/* ==========================================================================
   sections.css — sekce sdílené více stránkami (HP, portfolio, case studies)
   Hero, pás log, CTA banner, FAQ + společné drobnosti (kolečka s ikonou,
   hover karet, překrývající se loga klientů).
   Závisí na tokens.css, base.css a components.css.

   Plynulé hodnoty: clamp(mobil, …, desktop) mezi šířkou 390 a 1496 px.
   Vzorec: mobil + (desktop − mobil) × (100vw − 390px) / 1106
   ========================================================================== */

/* --------------------------------------------------------------------------
   Společné
   -------------------------------------------------------------------------- */
.section-white {
  background-color: var(--white);
}

.section-title {
  color: var(--color-text);
}

/* Červený kruh s ikonou (služby, O mně, kontakt) */
.icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-primary);
  border-radius: 50%;
  background-color: var(--color-primary);
}

.icon-circle--sm {
  border: 0;
}

/* Společný hover karet (služby, kontakt, další projekty):
   zvednutí o 4 px, ztmavnutí rámečku, zvětšení ikony v kolečku.
   Karta potřebuje 1px rámeček (.card-lift ho barví). */
.card-lift {
  transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.card-lift:is(:hover, :focus-visible) {
  border-color: var(--grey-100);
  transform: translateY(-4px);
}

.icon-circle,
.project__icon {
  transition:
    transform var(--duration) var(--ease),
    background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.card-lift:is(:hover, :focus-visible) .icon-circle,
.project__link:is(:hover, :focus-visible) .project__icon {
  transform: scale(1.08);
}

/* Omezený pohyb: hover efekty bez posunu a zvětšení (přebarvení zůstává) */
@media (prefers-reduced-motion: reduce) {
  .card-lift:is(:hover, :focus-visible),
  .card-lift:is(:hover, :focus-visible) .icon-circle,
  .project__link:is(:hover, :focus-visible) .project__icon {
    transform: none;
  }
}

/* Překrývající se kolečka s logy klientů (Proof, CTA)
   Barvy kruhů jsou barvy značek klientů — nejsou součástí palety webu. */
.avatar-stack {
  display: flex;
  padding-left: 0;
}

.avatar-stack__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
}

.avatar-stack__item + .avatar-stack__item {
  margin-left: -13px; /* Figma: posun 27 px */
}

.avatar-stack--bordered .avatar-stack__item {
  border: 2px solid;
}

.avatar-stack--bordered .avatar-stack__item + .avatar-stack__item {
  margin-left: -12px; /* Figma: posun 28 px */
}

.avatar-stack__item--cz      { background-color: #6C150E; border-color: #6C150E; }
.avatar-stack__item--biogama { background-color: var(--white); }
.avatar-stack__item--blod    { background-color: #7A0025; }
.avatar-stack__item--drs     { background-color: #111A2D; border-color: #111A2D; }
.avatar-stack__item--velour  { background-color: #52392C; border-color: #52392C; }

.avatar-stack__item--biogama img {
  width: 41px;
  height: 41px;
  max-width: none;
}


/* ==========================================================================
   HERO
   ========================================================================== */

/* Navigace leží na HP uvnitř hero karty */
.site-header--overlay {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
}

@media (min-width: 768px) {
  .site-header--overlay {
    top: 0;
  }
}

.hero {
  padding: 8px 8px 65px;
}

.hero__card {
  position: relative;
  overflow: hidden;
  max-width: calc(var(--page-max) - 24px);
  /* min. výška podle Figmy; delší nadpis (case studies) kartu prodlouží */
  min-height: clamp(583px, calc(583px + 143 * (100vw - 390px) / 1106), 726px);
  margin-inline: auto;
  border-radius: var(--radius-card);
  background: linear-gradient(90deg, #F8F2DC 3.8%, #F9F2DF 48.4%, #F7EEDD 99.4%);
}

/* Mobil: obrázek 1025 px na střed, 39 px od horního okraje karty */
.hero__image {
  position: absolute;
  top: 39px;
  left: 50%;
  width: 1025px;
  max-width: none;
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
}

.hero__copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* spodní odsazení = pás louky pod tlačítky (Figma: 165 px mobil, 178 px desktop) */
  padding: 104px 20px clamp(165px, calc(165px + 13 * (100vw - 390px) / 1106), 178px);
  text-align: center;
}

.hero__title {
  max-width: 928px;
}

.hero__title,
.hero__lead,
.hero__actions {
  animation: hero-in var(--duration-slow) var(--ease) both;
}

.hero__lead    { animation-delay: 120ms; }
.hero__actions { animation-delay: 240ms; }

@keyframes hero-in {
  from {
    opacity: 0;
    translate: 0 var(--reveal-shift);
  }
}

.hero__lead {
  max-width: 492px;
  margin-top: clamp(18px, calc(18px + 5 * (100vw - 390px) / 1106), 23px);
  color: var(--color-text-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(50px, calc(50px + 23 * (100vw - 390px) / 1106), 73px);
}

@media (min-width: 768px) {
  .hero {
    padding: 12px 12px 0;
  }

  .hero__image {
    top: 0;
    width: max(100%, 1025px);
  }

  .hero__copy {
    padding-top: clamp(150px, calc(150px + 62 * (100vw - 768px) / 728), 212px);
  }
}


/* ==========================================================================
   LOGA KLIENTŮ — nekonečný pás (pauza při najetí myší)
   ========================================================================== */
.clients {
  overflow: hidden;
  padding-block: clamp(25px, calc(25px + 13 * (100vw - 390px) / 1106), 38px);
  /* jemné vyblednutí na okrajích (maska, ne animace) */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}

.clients__track {
  display: flex;
  width: max-content;
  animation: clients-marquee 60s linear infinite;
}

.clients:hover .clients__track {
  animation-play-state: paused;
}

.clients__list {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 40px;
  padding-right: 40px; /* stejná mezera i mezi sadami → plynulá smyčka */
}

/* Loga zůstávají obrázky; výchozí 60 % průhlednost, při najetí plná */
.clients__list img {
  max-width: none;
  opacity: 0.6;
  transition: opacity var(--duration) var(--ease);
}

.clients__list img:hover {
  opacity: 1;
}

/* Mobil: loga na 70 % (Figma 203:31), mezera 28 px */
@media (max-width: 767px) {
  .clients__list {
    zoom: 0.7; /* zmenší i mezeru: 40 × 0,7 = 28 px */
  }
}

@keyframes clients-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Omezený pohyb: jedna statická řada na střed, co se nevejde,
   zmizí ve vyblednutí okrajů. Nikdy víc řádků. Kopie se skryje. */
@media (prefers-reduced-motion: reduce) {
  .clients__track {
    width: auto;
    justify-content: center;
    animation: none;
  }

  .clients__list {
    padding-right: 0;
  }

  .clients__list[aria-hidden="true"] {
    display: none;
  }
}


/* ==========================================================================
   CTA BANNER
   ========================================================================== */
.cta {
  padding: 24px 8px;
}

.cta__card {
  position: relative;
  overflow: hidden;
  max-width: calc(var(--page-max) - 24px);
  height: 560px;
  margin-inline: auto;
  border-radius: var(--radius-card);
}

.cta__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ztmavení pod textem (Figma „Přechod“) */
.cta__card::before,
.cta__card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cta__card::before {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0));
}

.cta__card::after {
  background: linear-gradient(to bottom, rgba(27, 27, 27, 0.6), rgba(27, 27, 27, 0));
}

.cta__copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  padding: 40px 20px;
  color: var(--color-text-inverse);
}

.cta__trust {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cta__text {
  max-width: 528px;
}

@media (min-width: 768px) {
  .cta {
    padding: 0 12px;
  }

  .cta__card {
    height: 488px;
  }

  .cta__card::after {
    right: auto;
    width: 78%; /* 1150 z 1472 px */
    background: linear-gradient(to right, rgba(27, 27, 27, 0.6), rgba(27, 27, 27, 0));
  }

  .cta__copy {
    padding: 69px clamp(40px, calc(40px + 56 * (100vw - 768px) / 728), 96px);
  }
}


/* ==========================================================================
   FAQ — akordeon z nativních <details>
   ========================================================================== */
.faq {
  padding-block: clamp(48px, calc(48px + 24 * (100vw - 390px) / 1106), 72px);
}

.faq__inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.faq__intro {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.faq__list {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, calc(12px + 20 * (100vw - 390px) / 1106), 32px);
}

.faq-item {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background-color: var(--color-surface-soft);
}

.faq-item__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 21px;
  border-radius: var(--radius-card);
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
}

.faq-item__question::-webkit-details-marker {
  display: none;
}

/* Ikona ve Figmě míří nahoru (otevřeno) → zavřená otázka ji má otočenou dolů */
.faq-item__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  transform: rotate(180deg);
  transition: transform var(--duration-base) var(--ease);
}

.faq-item[open] .faq-item__icon {
  transform: rotate(0deg);
}

.faq-item__answer {
  padding: 0 21px 17px;
  color: var(--color-text-muted);
}

.faq-item[open] .faq-item__answer {
  animation: faq-answer-in var(--duration-base) var(--ease) both;
}

@keyframes faq-answer-in {
  from {
    opacity: 0;
    translate: 0 -8px;
  }
}

/* Plynulé rozbalení — jen v prohlížečích, které to umí (Chrome, Edge) */
@supports (interpolate-size: allow-keywords) {
  .faq-item {
    interpolate-size: allow-keywords;
  }

  .faq-item::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size var(--duration-base) var(--ease), content-visibility var(--duration-base) allow-discrete;
  }

  .faq-item[open]::details-content {
    block-size: auto;
  }
}

@media (min-width: 768px) {
  .faq-item__question {
    padding: 29px 25px;
  }

  .faq-item[open] .faq-item__question {
    padding-bottom: 20px; /* 4 px řádek + 16 px mezera */
  }

  .faq-item__answer {
    padding: 0 25px 25px;
  }
}

@media (max-width: 767px) {
  .faq-item[open] .faq-item__question {
    padding-bottom: 12px;
  }
}

@media (min-width: 1200px) {
  .faq__inner {
    display: grid;
    grid-template-columns: 532px 532px;
    justify-content: space-between;
    align-items: start;
    gap: 64px;
  }
}
