/* =========================================================================
   DOKUMENTÁRNÍ FILMY TŘEBECHOVICE
   Layout: minimal sections on a 12-column grid. Beige for text sections,
   dark for the films and footer, one yellow accent. One typeface: DM Sans.
   ========================================================================= */
:root {
  --light: #E9E5DB;
  --dark: #151418;
  --accent: #FFD600;

  /* tints of the two base colours */
  --dark-muted: rgba(21, 20, 24, 0.66);
  --dark-line: rgba(21, 20, 24, 0.16);
  --dark-fill: rgba(21, 20, 24, 0.06);
  --light-muted: rgba(233, 229, 219, 0.68);
  --light-line: rgba(233, 229, 219, 0.16);
  --light-fill: rgba(233, 229, 219, 0.07);

  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --fs-h1: clamp(2.75rem, 7.4vw, 7.25rem);
  --fs-h2: clamp(2.25rem, 5vw, 4.25rem);
  --fs-h3: clamp(1.75rem, 3vw, 2.625rem);
  --fs-lead: clamp(1.25rem, 1.9vw, 1.5rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;
  --fs-label: 0.75rem;

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1320px;
  --gap: clamp(20px, 3vw, 40px);
  --section: clamp(72px, 10vw, 144px);
  --header-h: 64px;

  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  background: var(--light);
  color: var(--dark);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: var(--fs-body);
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 700; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--dark); }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.col-head { grid-column: 1 / span 5; min-width: 0; }
.col-body { grid-column: 6 / span 7; min-width: 0; }

.label {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}
.h2 {
  font-size: var(--fs-h2);
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.prose { display: grid; gap: 1.1em; max-width: 62ch; }
.prose .lead { font-size: var(--fs-lead); font-weight: 500; line-height: 1.4; letter-spacing: -0.01em; }
.prose a { text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }

.section { padding-block: var(--section); }
.section + .section:not(.section--dark) { border-top: 1px solid var(--dark-line); }
.section--dark { background: var(--dark); color: var(--light); }

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.35rem;
  font: 600 0.9375rem/1 var(--font);
  text-decoration: none;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn svg { width: 0.9em; height: 0.9em; flex: none; }
.btn:hover { background: var(--dark); color: var(--light); border-color: var(--dark); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--dark); }
.btn--accent:hover { background: var(--dark); border-color: var(--dark); color: var(--accent); }
.section--dark .btn:hover { background: var(--light); color: var(--dark); border-color: var(--light); }

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.15rem;
}
.link svg { width: 0.8em; height: 0.8em; transition: transform 0.2s; }
.link:hover svg { transform: translate(2px, -2px); }

/* ---------- header ---------- */
/* Registrovaná barva loga, aby šla v mobilním menu plynule časovat. */
@property --logo-base { syntax: "<color>"; inherits: true; initial-value: #151418; }
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: var(--light);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}
.logo {
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.logo__img { --logo-base: var(--dark); width: auto; height: 40px; flex: none; color: var(--logo-base); }
/* Tvary v logu jsou tmavé a jeden po druhém se plynule rozsvítí žlutě (každý na 0,8 s, celé kolo 2,4 s). */
.logo__shape { fill: var(--logo-base); animation: logo-shape 2.4s ease-in-out infinite; }
.logo__shape--2 { animation-delay: 0.8s; }
.logo__shape--3 { animation-delay: 1.6s; }
@keyframes logo-shape {
  0% { fill: var(--logo-base); }
  12%, 33% { fill: var(--accent); }
  48%, 100% { fill: var(--logo-base); }
}
@media (prefers-reduced-motion: reduce) {
  .logo__shape { animation: none; fill: var(--accent); }
}
.nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.25rem); }
.nav a:not(.btn) {
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  padding-block: 0.25rem;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 2px no-repeat;
  transition: background-size 0.2s;
}
.nav a:not(.btn):hover { background-size: 100% 2px; }
.nav .btn { padding: 0.6rem 1rem; }
.menu-toggle {
  display: none;
  font: 600 0.9375rem/1 var(--font);
  background: none;
  border: 1.5px solid var(--dark);
  border-radius: 999px;
  color: var(--dark);
  padding: 0.55rem 0.95rem;
  cursor: pointer;
}
@media (max-width: 860px) {
  .menu-toggle { display: inline-block; }
  /* Rozbalené menu přes celou obrazovku: tmavá plocha vyjede shora (::before lišty),
     položky se zarovnají doprava do spodní části obrazovky a postupně se objeví.
     Při zavírání se logo a tlačítko přepnou zpět na tmavé až ve chvíli, kdy plocha odjede. */
  .site-header::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    height: 100lvh;
    z-index: -1;
    background: var(--dark);
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
    pointer-events: none;
  }
  .site-header:has(.nav.is-open)::before { transform: none; }
  .nav {
    position: fixed;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem var(--gutter) calc(2rem + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    color: var(--light);
    text-align: right;
    visibility: hidden;
    transition: visibility 0s 0.5s;
  }
  .nav.is-open { visibility: visible; transition-delay: 0s; }
  .nav > :first-child { margin-top: auto; }
  .nav a:not(.btn) {
    padding-block: 0.9rem;
    font-size: clamp(1.75rem, 8vw, 2.25rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    border-bottom: 1px solid var(--light-line);
    background: none;
  }
  .nav .btn { margin-top: 1.75rem; align-self: flex-end; justify-content: center; }
  .nav .btn--accent:hover { background: var(--light); border-color: var(--light); color: var(--dark); }
  .nav > a { opacity: 0; transform: translateY(-0.75rem); transition: opacity 0.2s, transform 0.2s; }
  .nav.is-open > a { opacity: 1; transform: none; transition: opacity 0.4s, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .nav.is-open > a:nth-child(1) { transition-delay: 0.2s; }
  .nav.is-open > a:nth-child(2) { transition-delay: 0.26s; }
  .nav.is-open > a:nth-child(3) { transition-delay: 0.32s; }
  .nav.is-open > a:nth-child(4) { transition-delay: 0.38s; }
  .nav.is-open > a:nth-child(5) { transition-delay: 0.44s; }
  html:has(.nav.is-open) { overflow: hidden; }
  .logo__img { transition: --logo-base 0s 0.4s; }
  .menu-toggle { transition: color 0s 0.4s, border-color 0s 0.4s; }
  .site-header:has(.nav.is-open) .logo__img { --logo-base: var(--light); transition-delay: 0s; }
  .site-header:has(.nav.is-open) .menu-toggle { border-color: var(--light); color: var(--light); transition-delay: 0s; }
}

/* ---------- hero ---------- */
.hero { padding-block: clamp(56px, 9vw, 128px) var(--section); }
.hero__title {
  font-size: var(--fs-h1);
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.hero__title .line > span { display: block; }
.hero__grid { margin-top: clamp(40px, 6vw, 88px); align-items: end; }
.hero__intro { grid-column: 1 / span 6; display: grid; gap: 1.25rem; justify-items: start; min-width: 0; }
.hero__lead { font-size: var(--fs-lead); font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
.hero__text { color: var(--dark-muted); max-width: 46ch; font-size: 1.125rem; line-height: 1.55; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; }

.index { grid-column: 8 / span 5; min-width: 0; }
.index .label { color: var(--dark-muted); margin-bottom: 0.75rem; }
.index ol { border-top: 1px solid var(--dark); }
.index a {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--dark-line);
  text-decoration: none;
  transition: padding-left 0.25s;
}
.index a:hover { padding-left: 0.5rem; }
.index__year { font-size: var(--fs-small); color: var(--dark-muted); font-variant-numeric: tabular-nums; }
.index__title { font-weight: 600; letter-spacing: -0.01em; }
.index__arrow { width: 1rem; height: 1rem; transform: rotate(90deg); }

.tag {
  display: inline-block;
  background: var(--accent);
  color: var(--dark);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- photo placeholders ----------
   Replace the .ph__label span with <img src="…" alt="…">. */
.ph {
  position: relative;
  aspect-ratio: 3 / 2;
  max-width: 100%;
  overflow: hidden;
  background: var(--dark-fill);
  color: var(--dark-muted);
  display: grid;
  place-items: center;
}
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph__label {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 1rem;
  text-align: center;
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.35;
}
.ph__label svg { width: 28px; height: 28px; }
.ph:has(img) .ph__label { display: none; }
.ph--wide { aspect-ratio: 16 / 9; }
.ph--poster { aspect-ratio: 1 / 1.414; }
.section--dark .ph { background: var(--light-fill); color: var(--light-muted); }

/* ---------- jak to vše začalo ---------- */
.origin .prose { justify-items: start; }
.origin .btn { margin-top: 0.75rem; }

/* ---------- o nás ---------- */
/* Carousel s fotkami přes celou šířku stránky */
.gallery { margin-top: clamp(40px, 6vw, 72px); overflow-x: auto; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery.is-ready { overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.gallery.is-dragging { cursor: grabbing; }
.gallery:focus-visible { outline-offset: -3px; }
.gallery__track { display: flex; gap: clamp(10px, 1.2vw, 16px); width: max-content; padding-inline: var(--gutter); }
.gallery.is-ready .gallery__track { padding-inline: 0; will-change: transform; }
.gallery__slide { margin: 0; flex: none; height: clamp(220px, 32vw, 460px); aspect-ratio: 3 / 2; background: var(--dark-fill); }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.team {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: clamp(40px, 6vw, 72px);
}
.person { display: grid; gap: 1rem; align-content: start; border-top: 1px solid var(--dark); padding-top: 1.25rem; min-width: 0; }
.person__name { font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.1; letter-spacing: -0.025em; }
.person__role { color: var(--dark-muted); margin-top: -0.5rem; }
.person__bio { display: grid; gap: 1em; font-size: 1rem; line-height: 1.6; }
.person .link { justify-self: start; margin-top: 0.25rem; }

/* ---------- filmy ---------- */
.films__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 2rem; }
.films__head .btn { flex: none; }
.film {
  padding-top: clamp(40px, 5vw, 64px);
  margin-top: clamp(56px, 8vw, 112px);
  border-top: 1px solid var(--light-line);
}
/* Hlavička filmu je součástí mřížky: rok (řádek 1), název (řádek 2), text (řádek 3).
   Obrázky vpravo začínají na řádku 2, takže jejich horní hrana lícuje s názvem. */
.film__grid { row-gap: 0; align-items: start; }
.film__head { display: contents; }
.film__meta { grid-column: 1 / span 5; grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; color: var(--light-muted); }
.film__title { grid-column: 1 / span 5; grid-row: 2; font-size: var(--fs-h3); line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
.film__info { grid-column: 1 / span 5; grid-row: 3; margin-top: clamp(28px, 4vw, 48px); display: grid; gap: 2rem; align-content: start; min-width: 0; }
.film__media { grid-column: 7 / span 6; grid-row: 2 / span 2; display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.film__info .prose p { color: var(--light-muted); }
.film__info .prose .lead { color: var(--light); }

.facts { display: grid; border-top: 1px solid var(--light-line); }
.facts > div { display: grid; gap: 0.3rem; padding-block: 1rem; border-bottom: 1px solid var(--light-line); }
.facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { color: var(--accent); }
.facts dd { font-size: 1rem; line-height: 1.55; }

.posters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 420px; }
.posters--single { grid-template-columns: minmax(0, 1fr); max-width: 220px; }
.poster-link { display: block; transition: opacity 0.2s; }
.poster-link:hover { opacity: 0.85; }
.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* YouTube facade */
.video {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  overflow: hidden;
  background: var(--light-fill);
  color: var(--light);
  text-decoration: none;
  isolation: isolate;
}
.video__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.video:has(.video__thumb)::before { content: ""; position: absolute; inset: 0; background: rgba(21, 20, 24, 0.35); z-index: -1; }
.video__play {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: clamp(64px, 7vw, 88px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  transition: transform 0.25s;
}
.video__play svg { width: 30%; height: 30%; margin-left: 8%; fill: var(--dark); }
.video:hover .video__play { transform: scale(1.08); }
.video__label { position: absolute; left: 1rem; bottom: 0.9rem; font-size: var(--fs-small); font-weight: 600; }
.video--playing { background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- média ---------- */
.media__head { grid-column: 1 / span 3; }
.media__body { grid-column: 4 / -1; }
.media-item {
  display: grid;
  gap: 0.6rem;
  padding: clamp(24px, 3vw, 36px);
  background: var(--dark-fill);
  text-decoration: none;
  transition: background-color 0.2s;
}
.media-item:has(.media-item__thumb) { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); column-gap: clamp(20px, 2.5vw, 32px); }
.media-item:has(.media-item__thumb) > :not(.media-item__thumb) { grid-column: 2; }
/* Náhled se roztáhne od horní hrany data po spodní hranu odkazu „Poslechnout“. */
.media-item__thumb { grid-column: 1; grid-row: 1 / span 4; align-self: stretch; width: 100%; height: 0; min-height: 100%; object-fit: cover; background: var(--dark-fill); }
.media-item:hover { background: var(--accent); }
.media-item .label { color: var(--dark-muted); }
.media-item__title { font-size: var(--fs-h3); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
.media-item__text { font-size: 1.0625rem; }
.media-item .link { justify-self: start; margin-top: 0.75rem; border-bottom-color: var(--dark); }

/* ---------- footer ---------- */
.site-footer { padding-block: clamp(64px, 8vw, 112px) 2rem; }
.footer__name { font-size: var(--fs-h3); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
.footer__tagline { color: var(--light-muted); margin-top: 0.75rem; }
.socials { border-top: 1px solid var(--light-line); }
.socials a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem 1rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--light-line);
  text-decoration: none;
}
.socials b { font-size: clamp(1.25rem, 2vw, 1.625rem); font-weight: 600; letter-spacing: -0.02em; }
.socials span { grid-column: 1; color: var(--light-muted); font-size: var(--fs-small); overflow-wrap: anywhere; }
.socials svg { grid-column: 2; grid-row: 1 / span 2; width: 1.1rem; height: 1.1rem; transition: transform 0.2s, color 0.2s; }
.socials a:hover svg { transform: translate(3px, -3px); color: var(--accent); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: clamp(56px, 7vw, 96px);
  padding-top: 1.25rem;
  border-top: 1px solid var(--light-line);
  color: var(--light-muted);
  font-size: var(--fs-small);
}
.footer__bottom a { text-decoration: none; }
.footer__bottom a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .team { grid-template-columns: minmax(0, 1fr); }
  .person { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); column-gap: var(--gap); }
  .person > * { grid-column: 1; }
  .person__bio, .person .link { grid-column: 2; }
  .person__bio { grid-row: 1 / span 3; }
}
@media (max-width: 860px) {
  .col-head, .col-body, .hero__intro, .index, .film__meta, .film__title, .film__info, .film__media { grid-column: 1 / -1; }
  .film__meta, .film__title, .film__info, .film__media { grid-row: auto; }
  .index { margin-top: 1.5rem; }
  .film__media { margin-top: calc(var(--gap) + 0.5rem); }
  .person { grid-template-columns: minmax(0, 1fr); }
  .person__bio, .person .link { grid-column: 1; }
  .person__bio { grid-row: auto; }
}
@media (max-width: 560px) {
  .photos { grid-template-columns: minmax(0, 1fr); }
  .posters { max-width: none; }
  .hero__ctas .btn { flex: 1 1 auto; justify-content: center; }
  .media-item:has(.media-item__thumb) { grid-template-columns: minmax(0, 1fr); }
  .media-item:has(.media-item__thumb) > :not(.media-item__thumb) { grid-column: 1; }
  .media-item__thumb { grid-row: auto; height: auto; min-height: 0; aspect-ratio: 16 / 9; margin-bottom: 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
