/*
Theme Name: b-Clima
Author: Antonín Brejcha
Description: A short description of the theme.
Version: The version, written in X.X or X.X.X format.
Requires at least: The oldest main WordPress version supported, written in X.X format. 
Tested up to: The last main WordPress version the theme has been tested up to, i.e. 6.4. Write only the number.
Requires PHP: The oldest PHP version supported, in X.X format, only the number.
License: The license of the theme.
License URI: The URL of the theme license.
Text Domain: The string used for textdomain for translation. The theme slug.
*/
:root {
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/*button hover effects*/
.wp-block-button .wp-block-button__link {
  transition: all 0.3s ease;
  border: 2px solid var(--wp--preset--color--primary-950);
}
.wp-block-button .wp-block-button__link:hover {
  box-shadow: var(--wp--preset--shadow--soft-hover);
}
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
  background-color: color-mix(
    in srgb,
    var(--wp--preset--color--primary-950),
    black 20%
  );
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background-color: var(--wp--preset--color--primary-950);
  color: var(--wp--preset--color--white);
}

.site-header .wp-block-navigation-item__content {
  color: var(--wp--preset--color--primary-950) !important;
}

/*.site-header .wp-block-navigation-item__content,
.site-header .wp-block-site-title a {
  display: inline-block;
  position: relative;
  text-decoration: none !important;
  overflow: hidden;
  padding-bottom: 4px;
}

.site-header .wp-block-navigation-item__content::after,
.site-header .wp-block-site-title a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  opacity: 1;
  transform: translate3d(-100%, 0, 0);
  transition: transform 300ms ease-in-out;
}
.site-header .wp-block-navigation-item__content:hover::after,
.site-header .wp-block-navigation-item__content:focus::after,
.site-header .wp-block-site-title a:hover::after,
.site-header .wp-block-site-title a:focus::after {
  transform: translate3d(0, 0, 0);
}
.site-header .current-menu-item > .wp-block-navigation-item__content::after {
  transform: translate3d(0, 0, 0);
}*/

/* Restored original sliding underline look */
.site-header .wp-block-navigation-item__content,
.site-header .wp-block-site-title a {
  display: inline-block;
  position: relative;
  text-decoration: none !important;
  padding-bottom: 4px;
}

.site-header .wp-block-navigation-item__content::after,
.site-header .wp-block-site-title a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  /* Original sliding start state */
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms ease-in-out;
}

/* Hover and Active Scroll state */
.site-header .wp-block-navigation-item__content:hover::after,
.site-header
  .wp-block-navigation-item.current-scroll-item
  > .wp-block-navigation-item__content::after,
.site-header .wp-block-site-title a:hover::after {
  transform: scaleX(1);
}
.wp-block-navigation__submenu-container,
.wp-block-navigation__submenu-container > .wp-block-navigation-item {
  border-radius: 8px;
}
.wp-block-navigation__submenu-container {
  border: 1px solid var(--wp--preset--color--accent-300) !important;
}
.wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__submenu-container {
  border: none !important;
}
.site-header .wp-block-navigation__submenu-container .wp-block-navigation-item {
  width: fit-content !important;
}
.site-header
  .wp-block-navigation__submenu-container
  .wp-block-navigation-item__content {
  padding-left: 0 !important;
  padding-top: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 2px !important;
}
.site-header .wp-block-navigation__submenu-container .wp-block-navigation-item {
  padding: 0.5rem 1rem;
}
/* 1. Remove the default WordPress "current-menu-item" underline for anchor links */
.site-header
  .wp-block-navigation-item.current-menu-item
  > .wp-block-navigation-item__content::after {
  transform: scaleX(0);
}

/* 2. ONLY show the underline when JS says we are at that scroll position */
.site-header
  .wp-block-navigation-item.current-scroll-item
  > .wp-block-navigation-item__content::after,
.site-header
  .wp-block-navigation-item:hover
  > .wp-block-navigation-item__content::after {
  transform: scaleX(1);
}

/* 3. EXCEPT for the Privacy Policy page itself (actual separate pages) */
/* This ensures that when you ARE on the Privacy page, that specific link stays underlined */
.site-header
  .wp-block-navigation-item.current-menu-item:not([class*="anchor"])
  > .wp-block-navigation-item__content::after {
  transform: scaleX(1);
}
/* Ensure the first link is never 'grayed out' by WP default styles when on the home page */
.home
  .wp-block-navigation-item.current-menu-item:first-child
  > .wp-block-navigation-item__content::after {
  transform: scaleX(1);
}
/* 1. Global Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/*2. Variable Definitions (The Foundation) */
:root {
  --admin-bar: 0px;
  --header-height: 78px; /* Adjust this to your actual desktop header height*/
}

/* Update Admin Bar height based on WP defaults */
body.admin-bar {
  --admin-bar: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar {
    --admin-bar: 46px;
  }
}

/* 3. Sticky Header Logic */
header.wp-block-template-part {
  position: sticky;
  top: var(--admin-bar);
  z-index: 1000;
  background-color: var(--wp--preset--color--white);
}

/* 4. Responsive Header Height Adjustments */
/* If your header gets shorter/taller on mobile, we adjust --header-height here */
@media screen and (max-width: 768px) {
  :root {
    --header-height: 70px;
  } /* iPad height adjustment*/
}
@media screen and (max-width: 425px) {
  :root {
    --header-height: 42px;
  } /* Phone height adjustment*/
}

/* 5. The Scroll Margins (Unified) */
/* We use calc(Header + Admin Bar + Extra Buffer) */

#uvod,
#o-nas,
#sluzby,
#reference,
#kontakt {
  scroll-margin-top: calc(var(--header-height) + var(--admin-bar));
}

#projekce,
#realizace {
  scroll-margin-top: calc(var(--header-height) + var(--admin-bar) + 96px);
}

#servis {
  scroll-margin-top: calc(var(--header-height) + var(--admin-bar) + 80px);
}
.radius-8 {
  border-radius: 8px;
  overflow: hidden;
}

.avatar {
  aspect-ratio: 1/1;
  width: 128px;
  color: var(--wp--preset--color--primary-950);
}

.hover-effect-border {
  transition: all 0.3s ease-in-out;
  border: 2px solid transparent;
}
.hover-effect-border:hover {
  border: 2px solid var(--wp--preset--color--primary-950);
  box-shadow: var(--wp--preset--shadow--soft-hover);
}

.wp-block-image img[src$=".svg"] {
  width: 100%;
  height: auto;
}

.separator-accent {
  color: var(--wp--preset--color--accent-100) !important;
}

.cards-container > div {
  flex: 1 1 calc(33.33% - var(--wp--preset--spacing--40));
  min-width: 300px;
  max-width: calc((100% - 2 * var(--wp--preset--spacing--40)) / 3);
}
@media (max-width: 672px) {
  .cards-container > div {
    max-width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }
}

/* --- Desktop (1024px and WIDER) --- */
@media (min-width: 960px) {
  .service-container .wp-block-column {
    position: relative;
    min-width: 1px;
  }

  .service-container .wp-block-column .wp-block-image,
  .service-container .wp-block-column .wp-block-image figure,
  .service-container .wp-block-column .wp-block-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* --- Mobile/Tablet (1023px and SMALLER) --- */
@media (max-width: 960px) {
  .service-container {
    display: flex !important;
    flex-direction: column !important; /* Forces the stack */
  }

  /* Handle the swap version separately but within the same breakpoint */
  .service-container-swap {
    flex-direction: column-reverse !important;
  }

  .service-container .wp-block-column {
    width: 100% !important;
    flex-basis: 100% !important;
    margin-left: 0 !important;
  }

  /* Reset the image back to normal flow so it doesn't disappear */
  .service-container .wp-block-column .wp-block-image,
  .service-container .wp-block-column .wp-block-image figure,
  .service-container .wp-block-column .wp-block-image img {
    position: relative !important;
    height: auto !important;
    width: 100% !important;
    display: block !important;
  }
}

/* Animation Base State */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

/* Animation Active State */
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   EDITOR FIX: Keep blocks visible in FSE
   ========================================== */
.editor-styles-wrapper .reveal,
.wp-admin .reveal {
  opacity: 1 !important;
  transform: none !important;
}

.site-logo img[src$=".svg"] {
  width: 225px; /* Adjust to your desired size */
  height: auto;
}

/* 1. Force the first section to be visible immediately */
section:first-of-type .reveal,
section:first-of-type > div .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* 2. Force the section matching the URL anchor (#contact, etc.) to be visible */
section:target .reveal,
div:target .reveal,
section:target .reveal.active {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

.wp-block-navigation__submenu-container,
.wp-block-navigation-submenu {
  min-width: 0 !important;
}

/* CookieYes banner adjustments */
/* ==========================================================================
   1. Texty banneru: Nadpis (Montserrat) a Běžný text (Inter)
   ========================================================================== */
/* Nadpis banneru */
.cky-consent-container .cky-title {
  font-family:
    var(--wp--preset--font-family--montserrat), sans-serif !important;
  color: var(--wp--preset--color--primary-950) !important;
}

/* Běžný text (popis a detaily) */
.cky-consent-container .cky-notice-des,
.cky-consent-container .cky-notice-des * {
  font-family: var(--wp--preset--font-family--inter), sans-serif !important;
  color: var(--wp--preset--color--text) !important;
}

/* ==========================================================================
   2. Společné styly pro tlačítka (bez zásahu do velikosti a mezer)
   ========================================================================== */
.cky-consent-bar .cky-btn {
  border-radius: 8px !important;
  font-family:
    var(--wp--preset--font-family--montserrat), sans-serif !important;
  font-weight: 700 !important;
  transition: all 0.3s ease !important;
  box-shadow: var(--wp--preset--shadow--soft) !important;
}
.cky-consent-bar .cky-btn:hover {
  box-shadow: var(--wp--preset--shadow--soft-hover) !important;
  opacity: 1 !important;
  filter: none !important;
}
/* ==========================================================================
   3. "Accept All" tlačítko - Primární vzhled
   ========================================================================== */
.cky-consent-bar .cky-btn-accept {
  background-color: var(--wp--preset--color--primary-950) !important;
  color: var(--wp--preset--color--white) !important;
  border: 2px solid var(--wp--preset--color--primary-950) !important;
}

/* Hover efekt pro primární tlačítko (ztmaveno na 35 % černé) */
.cky-consent-bar .cky-btn-accept:hover {
  background-color: color-mix(
    in srgb,
    var(--wp--preset--color--primary-950),
    black 20%
  ) !important;
}

/* ==========================================================================
   4. "Reject All" a "Customize" tlačítka - Outline vzhled
   ========================================================================== */
.cky-consent-bar .cky-btn-reject,
.cky-consent-bar .cky-btn-customize {
  background-color: transparent !important;
  color: var(--wp--preset--color--primary-950) !important;
  border: 2px solid var(--wp--preset--color--primary-950) !important;
}

/* Hover efekt pro outline tlačítka */
.cky-consent-bar .cky-btn-reject:hover,
.cky-consent-bar .cky-btn-customize:hover {
  background-color: var(--wp--preset--color--primary-950) !important;
  color: var(--wp--preset--color--white) !important;
}
/* ==========================================================================
   5. Modální okno "Přizpůsobit" (Preference Center)
   ========================================================================== */

/* Nadpisy v modalu (Hlavní nadpis a názvy kategorií cookies) */
.cky-preference-center .cky-preference-title,
.cky-preference-center .cky-accordion-header-title,
.cky-preference-center .cky-always-active,
.cky-preference-center .cky-accordion-btn {
  font-family:
    var(--wp--preset--font-family--montserrat), sans-serif !important;
  color: var(--wp--preset--color--primary-950) !important;
}

/* Běžný text v modalu (Popisky kategorií a úvodní text) */
.cky-preference-center .cky-preference-content-wrapper,
.cky-preference-center .cky-preference-content-wrapper *,
.cky-preference-center .cky-accordion-body,
.cky-preference-center .cky-accordion-body * {
  font-family: var(--wp--preset--font-family--inter), sans-serif !important;
  color: var(--wp--preset--color--text) !important;
}

/* ==========================================================================
   6. Tlačítka uvnitř modálního okna
   ========================================================================== */

/* Společné styly pro všechna tlačítka v modalu */
.cky-preference-center .cky-btn {
  border-radius: 8px !important;
  font-family:
    var(--wp--preset--font-family--montserrat), sans-serif !important;
  font-weight: 700 !important;
  transition: all 0.3s ease !important;
  box-shadow: var(--wp--preset--shadow--soft) !important;
}

.cky-preference-center .cky-btn:hover {
  box-shadow: var(--wp--preset--shadow--soft-hover) !important;
  opacity: 1 !important;
  filter: none !important;
}

/* Tlačítko "Uložit předvolby" (Save Preferences) a "Přijmout vše" - Primární vzhled */
.cky-preference-center .cky-btn-accept {
  background-color: var(--wp--preset--color--primary-950) !important;
  color: var(--wp--preset--color--white) !important;
  border: 2px solid var(--wp--preset--color--primary-950) !important;
}

.cky-preference-center .cky-btn-accept:hover {
  background-color: color-mix(
    in srgb,
    var(--wp--preset--color--primary-950),
    black 20%
  ) !important;
}

/* Tlačítko "Odmítnout vše" v modalu - Outline vzhled */
.cky-preference-center .cky-btn-preferences,
.cky-preference-center .cky-btn-reject {
  background-color: transparent !important;
  color: var(--wp--preset--color--primary-950) !important;
  border: 2px solid var(--wp--preset--color--primary-950) !important;
}

.cky-preference-center .cky-btn-preferences:hover,
.cky-preference-center .cky-btn-reject:hover {
  background-color: var(--wp--preset--color--primary-950) !important;
  color: var(--wp--preset--color--white) !important;
}

/* ==========================================================================
   7. Přepínače (Toggles) pro zapnutí/vypnutí kategorií
   ========================================================================== */
.cky-preference-center
  .cky-switch
  input[type="checkbox"]:checked
  + .cky-slider {
  background-color: var(--wp--preset--color--primary-950) !important;
}
/* ==========================================================================
   7. Přepínače (Toggles) pro zapnutí/vypnutí kategorií
   ========================================================================== */

/* Vypnutý stav (původní šedá nahrazena za accent-300) */
.cky-preference-center input[type="checkbox"],
.cky-preference-center .cky-switch input[type="checkbox"] + .cky-slider {
  background-color: var(--wp--preset--color--accent-300) !important;
  border-color: var(--wp--preset--color--accent-300) !important;
}

/* Zapnutý stav (přepisuje vnucenou inline modrou na primary-950) */
.cky-preference-center input[type="checkbox"]:checked,
.cky-preference-center
  .cky-switch
  input[type="checkbox"]:checked
  + .cky-slider {
  background-color: var(--wp--preset--color--primary-950) !important;
  border-color: var(--wp--preset--color--primary-950) !important;
}

/* ==========================================================================
   8. Odkazy ("Zobrazit více" / "Zobrazit méně")
   ========================================================================== */

/* Základní stav odkazu (přebití inline modré barvy) */
.cky-preference-center .cky-show-desc-btn {
  color: var(--wp--preset--color--primary-950) !important;
  text-decoration: underline !important;
}
/* ==========================================================================
   9. Odstranění modrého focus/dýchajícího efektu u všech tlačítek
   ========================================================================== */
.cky-consent-bar .cky-btn:focus,
.cky-consent-bar .cky-btn:active,
.cky-preference-center .cky-btn:focus,
.cky-preference-center .cky-btn:active {
  outline: none !important; /* Zruší vnější modrý rámeček */
  animation: none !important; /* Vypne případnou pulzující animaci */
  /* Znovu vnutíme tvůj jemný stín, aby ho CookieYes při kliknutí nepřepsal modrým glow efektem */
  box-shadow: var(--wp--preset--shadow--soft) !important;
}
