/* ─────────────────────────────────────────────
   History — Timeline  |  style.css
   ───────────────────────────────────────────── */

/* ── Reset & base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #FFFFFF;
  color: #1F232B;
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Force all non-date text to #1F232B regardless of Tailwind color classes 
span:not(.timeline-year-label):not(.hero-side-label)
*/
h1,
h2,
h3,
h4,
p,
a.social-link,
a.media-link,
.hero-title p,
.today-inner p,
.today-inner h2,
.timeline-text p,
.timeline-text h2 {
  color: #1F232B;
}


/* ── Grain overlay ── */
.grain-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  background-repeat: repeat;
  opacity: 0.06;
}

/* ─────────────────────────────────────────────
   HERO
   ───────────────────────────────────────────── */
#hero {
  background-color: #FFFF;
  position: relative;
  overflow: hidden;
}

/* subtle radial warmth */
#hero::before {
  /* content: '';
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(196, 164, 98, 0.10) 0%, transparent 70%);
  pointer-events: none; */
}

/* gold divider */
.gold-divider {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #1F232B, transparent);
}

/* ── Hero portrait row ── */
.hero-portrait-row {
  display: flex;
  align-items: flex-end;
  /* bottom-align все */
  justify-content: center;
  gap: clamp(16px, 4vw, 48px);
  width: 100%;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 100px;
  flex: 1;
  padding-bottom: 8px;
  /* невеликий відступ від низу фото */
}

.hero-side--left {
  align-items: flex-start;
}

.hero-side--right {
  align-items: flex-start;
}

.hero-side-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9199A6;
  margin-bottom: 2px;
}

@media (max-width: 640px) {

  /* фото по центру, Мережі і СМІ під ним в один рядок */
  .hero-portrait-row {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .portrait-frame {
    width: clamp(160px, 60vw, 240px);
  }

  .hero-side {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 24px;
    width: 100%;
    padding-bottom: 0;
  }

  .hero-side--left,
  .hero-side--right {
    flex: 0 0 auto;
    align-items: flex-start;
  }
}

/* portrait */
.portrait-frame {
  position: relative;
  width: clamp(200px, 35vw, 340px);
  aspect-ratio: 3/4;
  overflow: hidden;
  border-radius: 20px;
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(10%) contrast(1.05);
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    filter 0.6s ease;
}

.portrait-frame:hover .portrait-img {
  transform: scale(1.06);
  filter: sepia(5%) contrast(1.08);
}

.portrait-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
      transparent 50%,
      rgba(26, 23, 20, 0.25) 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.portrait-frame:hover .portrait-overlay {
  opacity: 1;
}

/* social & media links */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #1F232B;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.25s ease;
}

.social-link:hover {
  color: #9199A6;
}

.media-link {
  display: inline-flex;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #1F232B;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.25s ease, gap 0.25s ease;
  gap: 4px;
}

.media-link:hover {
  color: #9199A6;
  gap: 8px;
}

/* scroll cue */
.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.4;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(31, 35, 43, 0.3), transparent);
  animation: scrollPulse 2.4s ease-in-out infinite;
}

@keyframes scrollPulse {

  0%,
  100% {
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
  }

  40% {
    opacity: 1;
    transform: scaleY(1);
    transform-origin: top;
  }

  80% {
    opacity: 0;
    transform: scaleY(1);
    transform-origin: bottom;
  }
}

/* ─────────────────────────────────────────────
   TIMELINE
   ───────────────────────────────────────────── */
#timeline {
  position: relative;
  background-color: #FFFF;
}

/* vertical track line — starts at first row, not section top */
.timeline-track {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 1.33px;
  height: 0;
  /* fade-in at top so it appears from the first dot, not from the edge */
  background: linear-gradient(to bottom, transparent 0%, #1F232B 3%, #1F232B 96%, transparent 100%);
  z-index: 0;
  border-radius: 55px;
}

/* each row */
.timeline-row {
  position: relative;
  padding: 60px 0 60px;
  z-index: 1;
}

@media (min-width: 768px) {
  .timeline-row {
    padding: 80px 0 80px;
  }
}

/* year label — sits above H2 inside the text column */
.timeline-year-label {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 500;
  color: rgba(31, 35, 43, 0.3);
  line-height: 1;
  margin-bottom: 16px;
}

/* dot ON THE LINE — top is set precisely by JS via --dot-top */
.timeline-row::before {
  content: '';
  position: absolute;
  left: 50%;
  top: var(--dot-top, 80px);
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1F232B;
  box-shadow: 0 0 0 3px rgba(31, 35, 43, 0.12);
  z-index: 3;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.timeline-row.is-visible::before {
  opacity: 1;
}

/* year label — plain block, no extra dot */
.timeline-year-label {
  display: block;
}

/* dot on the line at «Сьогодні» */
.today-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1F232B;
  box-shadow: 0 0 0 3px rgba(31, 35, 43, 0.12);
  margin: 0 auto 16px;
}

@media (max-width: 767px) {
  .today-dot {
    margin-left: 0px;
  }

  h2.font-heading.text-3xl.md\:text-5xl.font-light.leading-tight.mb-5.text-ink {
    text-align: left;
  }

  .today-inner.max-w-3xl.mx-auto.px-6.pt-20.pb-10.md\:pt-28.md\:pb-14.text-center {
    text-align: left;
  }

  .today-inner.max-w-3xl.mx-auto.px-6.pt-8.pb-10.md\:pt-12.md\:pb-14.text-center {
    text-align: left;
  }

}

/* ── Timeline image frames ── */
.tl-img-frame {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 4/3;
  box-shadow:
    0 4px 8px rgba(31, 35, 43, 0.06),
    0 24px 64px rgba(31, 35, 43, 0.12);
}

.tl-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(8%) contrast(1.04) saturate(0.95);
  /* scale is set/animated by GSAP — no CSS default here */
  transition: filter 0.6s ease;
  will-change: transform;
}

/* tl-img hover filter removed */

/* overlay that slides up on hover */
.tl-img-overlay {
  position: absolute;
  inset: 0;
  /* background: linear-gradient(to top,
      rgba(26, 23, 20, 0.65) 0%,
      rgba(26, 23, 20, 0.0) 55%); */
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.tl-img-frame:hover .tl-img-overlay {
  opacity: 1;
  transform: translateY(0);
}

.tl-img-year {
  font-size: 13px;
  letter-spacing: 0.18em;
  color: rgba(244, 239, 230, 0.85);
  font-weight: 300;
}

/* timeline text */
.timeline-text h2,
h2.font-heading.text-ink {
  position: relative;
  font-style: italic;
  font-size: 22px;
  font-weight: 600;
  display: inline-block;
}

/* .timeline-text h2::after {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: #1F232B;
  margin-top: 10px;
} */

.timeline-text.md\:text-right h2::after {
  margin-left: auto;
}


/* GSAP initial states — added by JS, but define here for safety */
.timeline-image-wrap,
.timeline-text {
  will-change: transform, opacity;
}

/* ─────────────────────────────────────────────
   TODAY — junction between timeline & gallery
   ───────────────────────────────────────────── */
#today {
  position: relative;
}

.today-video-outer {
  /* Full-width; horizontal padding creates the card look.
     GSAP animates padding → 0 to expand to full-width on desktop. */
  width: 100%;
  padding: 0 clamp(24px, 10vw, 220px);
  padding-bottom: 0;
  position: relative;
  z-index: 10;
  /* sits above the rising gallery dark bg */
  will-change: padding;
}

blockquote.pl-4.border-l-4.border-\[\#C2C2C2\].italic.text-muted.my-6.bg-\[\#F7F7F9\].p-4.rounded-r-lg {
  color: #2b2b2b;
  text-decoration: none;
  font-style: normal;
  background: #9199a61f;
  border-radius: 8px;
}

.today-video-wrap {
  position: relative;
  border-radius: 16px 16px 0 0;
  /* GSAP animates this to 0 on desktop scroll */
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0E0D0C;
  will-change: border-radius;
}

/* Mobile: no expansion, stays as card with full radius */
@media (max-width: 767px) {
  .today-video-outer {
    padding: 0 16px;
  }

  .today-video-wrap {
    border-radius: 12px;
  }
}

/* add color */
.text-[#C2C2C2] {
  color: #C2C2C2;
}

/* iframe fills container; pointer-events off so clicks go to our buttons */
.yt-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.02);
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
  /* keeps iframe from swallowing clicks */
}

/* buttons must be above iframe and clickable */
.video-controls {
  position: relative;
  z-index: 20;
}

.video-ctrl-btn {
  position: relative;
  z-index: 20;
  pointer-events: all;
}

/* custom controls */
div#galleryStage {
  margin-top: -6rem;
}

.flex.gap-3.mb-2 {
  position: relative;
  z-index: 2;
}

div#carouselDots {
  transform: translateY(-5rem);
}

.video-controls {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  z-index: 10;
}

@media (min-width: 768px) {
  .video-controls {
    bottom: 24px;
    left: 24px;
    right: 24px;
  }
}

.video-ctrl-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(20, 18, 16, 0.4);
  backdrop-filter: blur(8px);
  color: rgba(244, 239, 230, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

@media (min-width: 768px) {
  .video-ctrl-btn {
    width: 52px;
    height: 52px;
  }
}

.video-ctrl-btn:hover {
  background: rgba(196, 164, 98, 0.3);
  border-color: rgba(196, 164, 98, 0.6);
  color: #fff;
  transform: scale(1.05);
}

/* ─────────────────────────────────────────────
   GALLERY / CENTERED FOCUS CAROUSEL
   ───────────────────────────────────────────── */

/* Clip only vertically — cards can peek horizontally */
#gallery {
  overflow-x: clip;
}

/* Stage: tall enough for the active card */
.gallery-stage {
  position: relative;
  height: clamp(500px, 66vw, 700px);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: pan-y;
}

/* Each slide: absolutely centered */
.gallery-slide {
  position: absolute;
  transform-origin: center center;
  will-change: transform, opacity;
}

/* Portrait sizing */
.gallery-slide.is-portrait {
  width: clamp(240px, 30vw, 400px);
}

.gallery-slide.is-portrait .gallery-img-wrap {
  height: clamp(320px, 40vw, 530px);
}

/* Landscape sizing */
.gallery-slide.is-landscape {
  width: clamp(360px, 48vw, 620px);
}

.gallery-slide.is-landscape .gallery-img-wrap {
  height: clamp(220px, 27vw, 347px);
}

/* Non-active slides are clickable to navigate */
.gallery-slide:not(.is-active) {
  cursor: pointer;
}

/* Gallery stage — grab cursor for drag */
.gallery-stage {
  cursor: grab;
}

.gallery-stage:active {
  cursor: grabbing;
}

/* Image/video wrapper — adapts to any content aspect ratio */
.gallery-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.9) contrast(1.05);
  transition: filter 0.5s ease, transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: scale(1.04);
  -webkit-user-drag: none;
  pointer-events: none;
}

.gallery-slide.is-active .gallery-img {
  filter: brightness(1) contrast(1.05);
}

.gallery-slide.is-active:hover .gallery-img {
  transform: scale(1.08);
}

/* expand / play icon — bottom-right of active slide */
.gallery-expand {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1A1714;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.25s ease;
  pointer-events: none;
}

.gallery-slide.is-active .gallery-expand {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.gallery-slide.is-active:hover .gallery-expand {
  background: rgba(255, 255, 255, 1);
}

/* nav buttons */
.gallery-nav-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.gallery-nav-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* dots */
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, width 0.3s ease, border-radius 0.3s ease;
}

.carousel-dot.active {
  background: rgba(244, 239, 230, 0.9);
  width: 20px;
  border-radius: 3px;
}

/* ─────────────────────────────────────────────
   HERO initial animation states (set in JS but
   define transforms here to avoid FOUC)
   ───────────────────────────────────────────── */
.hero-photo,
.hero-links {
  opacity: 0;
  transform: translateY(20px);
}

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width: 767px) {

  /* ── Відео: розтягуємо на всю ширину (без бокових відступів) ── */
  .today-video-outer {
    padding: 0 !important;
  }

  .hero-title.text-center.mb-4.md\:mb-6.z-10 {
    text-align: left;
  }

  h2.subphoto.text-center {
    text-align: left;
    width: 100%;
    padding-top: 2rem;
    margin-bottom: -2rem;
  }

  .flex.items-center.justify-center.gap-6.mb-8.w-full.pt-4 {
    text-align: left;
    justify-content: left;
  }

  .today-video-wrap {
    border-radius: 0;
  }

  /* ── Ліва лінія таймлайну ── */
  .timeline-track {
    display: block;
    left: 28px;
    transform: none;
  }

  /* ── Крапки — на лівій лінії ── */
  .timeline-row::before {
    display: block;
    left: 28px;
    transform: translateX(-50%);
  }

  /* ── Відступ рядка ── */
  .timeline-row {
    padding: 12px 0;
  }

  /* ── Контент зсунутий вправо від лінії ── */
  .timeline-row .timeline-content {
    padding-left: 52px !important;
    padding-right: 16px !important;
  }

  /* Gallery stage */
  .gallery-stage {
    height: clamp(380px, 110vw, 520px);
  }

  /* Картки на мобільному — активна ~70% ширини, щоб сусідні пікали з боків */
  .gallery-slide.is-portrait {
    width: clamp(170px, 52vw, 220px);
  }

  .gallery-slide.is-portrait .gallery-img-wrap {
    height: clamp(225px, 69vw, 295px);
  }

  .gallery-slide.is-landscape {
    width: clamp(230px, 68vw, 290px);
  }

  .gallery-slide.is-landscape .gallery-img-wrap {
    height: clamp(145px, 40vw, 185px);
  }

  /* Стрілки та точки — нижче на мобільному */
  #carouselDots {
    margin-top: 24px;
  }
}

/* ─────────────────────────────────────────────
   UTILITY
   ───────────────────────────────────────────── */
/* ─────────────────────────────────────────────
   LIGHTBOX
   ───────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 9, 8, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.lightbox-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 8px;
  color: rgba(244, 239, 230, 0.8);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(196, 164, 98, 0.25);
  color: #C4A462;
}

.lightbox-body {
  width: 90vw;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-inner {
  width: 100%;
}

/* local video thumbnail in gallery — behaves like img */
.gallery-video-thumb {
  -webkit-user-drag: none;
  pointer-events: none;
}

/* video in lightbox */
.lightbox-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

/* video in lightbox */
.lightbox-iframe-wrap {
  position: relative;
  aspect-ratio: 16/9;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.lightbox-iframe-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* image in lightbox */
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  margin: auto;
  border-radius: 8px;
  object-fit: contain;
}

/* ─────────────────────────────────────────────
   UTILITY
   ───────────────────────────────────────────── */
::selection {
  background: rgba(196, 164, 98, 0.25);
  color: #1A1714;
}

a {
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ─────────────────────────────────────────────
   HERO — Motion JS initial states
   Elements start hidden; Motion JS reveals them on load.
   Only applies when JS is active (html.js class).
   ───────────────────────────────────────────── */
html.js .hero-photo {
  opacity: 0;
  transform: translateY(16px);
}