/* In-page section menu in the header, between the logo and the Kontakt button. */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* leave room for the fixed header when jumping to a section */
.fl-anchor {
  display: block;
  height: 0;
  scroll-margin-top: 140px;
}

#header-outer #top .fl-nav {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
}

#header-outer #top .fl-nav ul {
  display: flex !important;
  gap: clamp(18px, 2.4vw, 40px);
  margin: 0 !important;
  padding: 0;
  list-style: none;
}

#header-outer #top .fl-nav li {
  margin: 0 !important;
  padding: 0;
  list-style: none;
}

#header-outer #top .fl-nav a {
  position: relative;
  display: block;
  padding: 6px 0;
  color: #2d1854;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: color .25s ease;
}

#header-outer #top .fl-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: #7e22ce;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}

#header-outer #top .fl-nav a:hover,
#header-outer #top .fl-nav a[aria-current="true"] {
  color: #7e22ce;
}

#header-outer #top .fl-nav a:hover::after,
#header-outer #top .fl-nav a[aria-current="true"]::after {
  transform: scaleX(1);
}

#header-outer #top .fl-nav-toggle {
  display: none;
}

/* Below the theme's mobile breakpoint the three links sit in a slim bar right under the header
   (the logo, CS/EN and Kontakt leave no room in the header row itself). */
@media only screen and (max-width: 999px) {
  /* responsive.css hides every header <nav> here with `#header-outer #top nav { display: none !important }`
     (the theme expects its own off-canvas menu), so this needs the extra #top to win. */
  #header-outer #top .fl-nav {
    display: block !important;
    top: 100%;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    padding: 6px 12px 8px;
    background: rgba(248, 248, 248, .92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(45, 24, 84, .08);
  }

  #header-outer #top .fl-nav-toggle {
    display: none !important;
  }

  #header-outer #top .fl-nav {
    transition: transform .3s ease, opacity .3s ease;
  }

  /* the link bar hangs below the header, so push the page down by its height
     (otherwise it covers the top of the hero heading) */
  #header-space {
    margin-bottom: 46px;
  }

  /* the theme slides the header away while scrolling down; take the link bar with it */
  #header-outer.invisible #top .fl-nav {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -100%);
  }

  #header-outer #top .fl-nav ul {
    justify-content: center;
    gap: clamp(12px, 4vw, 40px);
  }

  #header-outer #top .fl-nav a {
    padding: 6px 0;
    font-size: 14px;
  }
}

/* four links (incl. Grafika) must fit on narrow phones */
@media (max-width: 420px) {
  #header-outer #top .fl-nav ul { gap: 3.2vw; }
  #header-outer #top .fl-nav a { font-size: 3.4vw; }
}

/* Full-width scroll-triggered video */
.fl-video-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

/* Mobile: natural 16:9, full width */
.fl-video {
  display: block;
  width: 100%;
  height: auto;
}

/* Desktop: 960×540 centered */
@media only screen and (min-width: 769px) {
  .fl-video-wrap {
    max-width: 960px;
    margin: 0 auto;
  }
  .fl-video {
    width: 960px;
    max-width: 100%;
    height: 540px;
    object-fit: cover;
  }
}

/* Custom controls overlay */
.fl-vc {
  position: absolute;
  bottom: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.fl-vc-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .5);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.fl-vc-btn:hover {
  background: rgba(0, 0, 0, .72);
}

/* Language toggle */
.fl-lang-item {
  display: flex !important;
  align-items: center !important;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
}

.fl-lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 10px;
  border: 1px solid rgba(45, 24, 84, .22);
  border-radius: 999px;
  background: transparent;
  color: #2d1854;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  cursor: pointer;
  transition: border-color .25s ease, background .25s ease;
  white-space: nowrap;
}

.fl-lang-toggle:hover {
  border-color: #7e22ce;
  background: rgba(126, 34, 206, .06);
}

.fl-lang-opt {
  transition: opacity .2s ease;
}

.fl-lang-sep {
  opacity: 0.3;
  font-weight: 400;
}

/* keep the toggle visible in the mobile header */
#menu-saas-pull-right .fl-lang-item {
  display: flex !important;
}

#menu-saas-pull-right .fl-lang-toggle {
  margin: 4px 0;
}

/* Services list ("Služby, které vaši značku posunou dál"): items with a short description line. */
#ajax-content-wrap .nectar-fancy-ul li.fl-svc .fl-svc-title {
  display: inline;
}
#ajax-content-wrap .nectar-fancy-ul li.fl-svc .fl-svc-desc {
  display: block;
  margin-top: .15em;
  font-size: .82em;
  line-height: 1.45;
  color: #2d1854;
  opacity: .62;
}

/* Contact heading "Značka, která roste v číslech": always one line. The column's right padding is
   dropped and the font shrinks with the column (container units) so the sentence fits. */
#ajax-content-wrap .wpb_column:has(h2[data-translate="footer_heading"]) > .vc_column-inner {
  padding-right: 0 !important;
  container-type: inline-size;
}
#ajax-content-wrap h2[data-translate="footer_heading"] {
  white-space: nowrap;
  font-size: min(4vw, 7.6cqi) !important;
  line-height: 1.15 !important;
}
@media only screen and (max-width: 690px) {
  /* phones: the theme uses a larger size than 4vw here; fill the column width instead */
  #ajax-content-wrap h2[data-translate="footer_heading"] {
    font-size: 7.6cqi !important;
  }
}

/* Background hexagon spark (js/hex-spark.js) */
.fl-hex-spark {
  position: fixed; top: 0; left: 0; /* size set in px by hex-spark.js (100vh ≠ innerHeight on phones) */
  pointer-events: none; z-index: 50;
}

/* Logo-mark drawing in "Proměníme návštěvníky…" (replaces the white circle; js/hex-spark.js) */
#pristup .fl-mark-host { position: relative; }
#pristup .fl-mark {
  position: absolute; z-index: 1; pointer-events: none;
  width: 12vw; right: calc(100% + 1.4vw); top: -1.6vw;
}
#pristup .fl-mark svg { display: block; width: 100%; height: auto; overflow: visible; }
#pristup .fl-mark-p { fill-opacity: 0; stroke-width: 1.4; stroke-opacity: 0; stroke-linejoin: round; }
#pristup .fl-mark.is-done .fl-mark-p { fill-opacity: 1; stroke-opacity: 0; }
#pristup .fl-mark-spark {
  position: absolute; left: 0; top: 0; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, #fff 0 1.6px, rgba(206,160,255,.9) 2.2px, rgba(126,34,206,.35) 35%, rgba(126,34,206,0) 70%);
}
#pristup .nectar-animated-shape { transition: opacity .5s ease; }
#pristup.fl-mark-on .nectar-animated-shape { opacity: 0; }
@media (max-width: 690px) {
  #pristup .fl-mark { width: 24vw; right: auto; left: 0; top: auto; bottom: calc(100% + 18px); }
}

/* Services list: check marks replaced by logo hexagons drawn by the spark (js/hex-spark.js) */
#ajax-content-wrap .fl-hex-list.fl-hex-on li > i { visibility: hidden !important; }
#ajax-content-wrap .fl-hex-list li .fl-chk {
  position: absolute; left: 1px; top: 0.3em; width: 1.05em; height: 1.05em;
  overflow: visible; pointer-events: none;
}
#ajax-content-wrap .fl-hex-list li .fl-chk path { fill-opacity: 0; stroke-opacity: 0; stroke-width: 2; stroke-linejoin: round; transition: fill-opacity .2s ease, stroke-opacity .25s ease; }
#ajax-content-wrap .fl-hex-list li .fl-chk.is-done path { fill-opacity: 1; stroke-opacity: 0 !important; }
.fl-spark-dot {
  position: absolute; left: 0; top: 0; z-index: 60; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border-radius: 50%; opacity: 0; pointer-events: none; transition: opacity .3s ease;
  background: radial-gradient(circle, #fff 0 1.6px, rgba(206,160,255,.9) 2.2px, rgba(126,34,206,.35) 35%, rgba(126,34,206,0) 70%);
}

/* "…fanoušky vaší značky": straight underline drawn by the spark replaces the theme scribble */
#ajax-content-wrap .fl-ul-host { position: relative; }
#ajax-content-wrap .fl-ul-host .nectar-scribble { display: none !important; }
#ajax-content-wrap .fl-ul {
  position: absolute; left: 3px; right: 3px; bottom: 0.02em; height: 0.075em; border-radius: 0.04em;
  background: linear-gradient(90deg, #3f2054, #7a4069);
  transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
}
#ajax-content-wrap .fl-ul.is-done { transform: scaleX(1); }

/* "Naše práce" / "Ukázky Reels": written by the spark in one laser stroke (js/hex-spark.js) */
#ajax-content-wrap h2.fl-write-on { clip-path: inset(-30% 100% -30% 0); }
#ajax-content-wrap h2.fl-write-on.is-written { clip-path: none; }
#ajax-content-wrap h2.fl-write-on.is-writing { text-shadow: 0 0 14px rgba(168, 85, 247, .45); }
#ajax-content-wrap h2.fl-write-on.is-written { transition: text-shadow .8s ease; text-shadow: none; }

/* "Grafika" section under Ukázky Reels: small photo of our designer + text, then a sample row (gallery.js) */
#ajax-content-wrap .fl-grafika-title { margin-top: clamp(48px, 6vw, 96px); }
#ajax-content-wrap .fl-designer {
  max-width: 640px; margin: clamp(18px, 2vw, 28px) auto clamp(28px, 3vw, 44px); text-align: center;
}
#ajax-content-wrap .fl-designer-photo {
  display: block; width: clamp(150px, 14vw, 210px); height: auto; aspect-ratio: 2 / 3; object-fit: cover;
  margin: 0 auto 18px; border-radius: 18px; box-shadow: 0 18px 40px -20px rgba(45, 24, 84, .45);
}
#ajax-content-wrap .fl-designer-text { margin: 0; padding: 0 16px; line-height: 1.6; }
#ajax-content-wrap .fl-designer-name {
  margin: 0 0 18px; padding: 0;
  font-size: clamp(12px, 1vw, 14px); font-weight: 300; line-height: 1.4;
  letter-spacing: .42em; text-transform: uppercase; color: #2d1854;
  padding-left: .42em; /* balance the trailing letter-spacing so it stays centred */
}
