/* ── HERO SLIDER ── */
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: var(--ink);
}
.slides { position: absolute; inset: 0; }
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s var(--ease);
}
.slide.active {
  opacity: 1;
  pointer-events: all;
}
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* gradient scrim — guarantees legibility on any backdrop image */
.slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(18, 10, 8, 0.88) 0%,
    rgba(18, 10, 8, 0.45) 45%,
    rgba(18, 10, 8, 0.10) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.slide-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 3.5rem;
  pointer-events: none;
  width: 100%;
  max-width: none;
  left: 0;
  transform: none;
  padding-left: max(var(--gutter), calc((100% - var(--max-width)) / 2 + var(--gutter)));
  padding-right: var(--gutter);
  z-index: 2;
}
.slide.active .slide-body > * { pointer-events: all; }
.slide-lang {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.slide-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.05;
  margin-bottom: 0.5rem;
}
.slide-dir {
  font-family: var(--font-prose);
  font-size: 0.9375rem;
  font-style: italic;
  color: rgba(255,255,255,0.6);
  margin-bottom: 1.25rem;
}
.hero-arr {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast);
}
.hero-arr:hover { background: rgba(255,255,255,0.25); }
.hero-arr svg {
  width: 14px; height: 14px;
  stroke: #fff; fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.arr-l { left: 1rem; }
.arr-r { right: 1rem; }
.hero-dots {
  position: absolute;
  bottom: 1.5rem;
  left: max(var(--gutter), calc((100% - var(--max-width)) / 2 + var(--gutter)));
  display: flex;
  gap: 7px;
  z-index: 10;
}
.dot { pointer-events: all; }
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  padding: 0;
}
.dot.active { background: #fff; transform: scale(1.3); }

/* ── HOME BODY ── */
.home-main { padding-top: 2rem; padding-bottom: 3rem; }

/* ── SECTION BACKGROUNDS — Option B ── */
/* Scroll sections extend full container width so the poster overflow
   stays inside the background box. Negative margins cancel the container
   gutter; matching padding restores the visual indent inside. */
.scroll-section {
  background: var(--bg2);
  border-radius: 8px;
  margin-left:  calc(-1 * var(--gutter));
  margin-right: calc(-1 * var(--gutter));
  padding: 1.25rem var(--gutter);
  margin-bottom: 0.75rem;
}

/* browse/features inside home-two-col — no poster overflow, no negative margin needed */
.browse-section   { background: var(--bg2); border-radius: 8px; padding: 1.25rem; }
.features-section { background: var(--bg2); border-radius: 8px; padding: 1.25rem; }

/* ── SCROLL ROW ── */
.poster-row-wrap {
  overflow: hidden;
  margin-right: calc(-1 * var(--gutter));
  position: relative;
}
/* fade + scroll-hint arrow on right edge */
.poster-row-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 72px;
  height: calc(100% - 0.75rem);
  background: linear-gradient(to left, var(--bg2) 18%, transparent 100%);
  pointer-events: none;
  z-index: 2;
  opacity: 1;
  transition: opacity 0.3s;
}
.poster-row-wrap::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='14' fill='none' stroke='%23E8E1D8' stroke-width='1.5'/%3E%3Cpath d='M14 10l6 6-6 6' fill='none' stroke='%23E8E1D8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-70%);
  pointer-events: none;
  z-index: 3;
  line-height: 0;
  opacity: 1;
  transition: opacity 0.3s;
}
/* dark mode: use off-white so it still reads against dark posters */
.dark .poster-row-wrap::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='14' fill='none' stroke='%23D4CFC9' stroke-width='1.5'/%3E%3Cpath d='M14 10l6 6-6 6' fill='none' stroke='%23D4CFC9' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* when row is fully scrolled: hide both the arrow and the fade */
.poster-row-wrap.at-end::before,
.poster-row-wrap.at-end::after {
  opacity: 0;
}
.poster-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  padding-right: var(--gutter);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.poster-row::-webkit-scrollbar { display: none; }
.poster-row .poster-card {
  flex-shrink: 0;
  width: 128px;
  scroll-snap-align: start;
}
.poster-row .poster-card-img img {
  width: 128px;
  height: 192px;
  aspect-ratio: unset;
}

/* view all card */
.poster-card-viewall {
  flex-shrink: 0;
  width: 128px;
  scroll-snap-align: start;
  display: flex;
  align-items: stretch;
  text-decoration: none;
}
.viewall-inner {
  width: 128px;
  height: 192px;
  border-radius: 3px;
  border: 1.5px solid var(--rule);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.poster-card-viewall:hover .viewall-inner {
  border-color: var(--accent);
  background: var(--bg2);
}
.viewall-arrow {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--duration-fast);
}
.poster-card-viewall:hover .viewall-arrow { border-color: var(--accent); }
.viewall-arrow svg {
  width: 12px; height: 12px;
  stroke: var(--muted); fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--duration-fast);
}
.poster-card-viewall:hover .viewall-arrow svg { stroke: var(--accent); }
.viewall-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  transition: color var(--duration-fast);
}
.poster-card-viewall:hover .viewall-label { color: var(--accent); }

/* hide text labels under posters in scroll rows — info shown in hover overlay */
.poster-row .poster-card-title { display: none; }
.poster-row .poster-card-meta  { display: none; }
.poster-row .poster-card-dir   { display: none; }

/* Fix 2 — button width in slider */
.slide-body .btn {
  align-self: flex-start;
  width: auto;
  display: inline-flex;
}

/* ── TWO COL ── */
.home-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-left:  calc(-1 * var(--gutter));
  margin-right: calc(-1 * var(--gutter));
  margin-bottom: 0.75rem;
}

/* ── LANG FILTER ── */
.lang-strip {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.lang-btn {
  font-family: var(--font-ui);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
  background: var(--bg2);
  color: var(--muted);
}
.lang-btn:hover { background: var(--bg3); color: var(--ink); }
.lang-btn.active { background: var(--ink2); color: var(--bg); }

/* ── BROWSE LIST ── */
.browse-list { display: flex; flex-direction: column; }
.browse-item {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 0.5px solid var(--rule);
  text-decoration: none;
}
.browse-item:first-child { padding-top: 0; }
.browse-poster img {
  width: 36px;
  height: 54px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}
.browse-title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  transition: color var(--duration-fast);
}
.browse-item:hover .browse-title { color: var(--accent); }
.browse-meta { font-size: 0.6563rem; color: var(--muted); margin-top: 1px; }

/* ── FEATURES LIST ── */
.features-list { display: flex; flex-direction: column; gap: 1.1rem; }
.feature-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  text-decoration: none;
}
.feature-img { flex-shrink: 0; }
.feature-body {
  flex: 1;
  min-width: 0;
}
.feature-img img {
  width: 88px;
  height: 55px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
  transition: transform var(--duration-mid) var(--ease);
}
.feature-item:hover .feature-img img { transform: scale(1.04); }
.feature-tag {
  font-size: 0.5938rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.25rem;
}
.feature-title {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  transition: color var(--duration-fast);
}
.feature-item:hover .feature-title { color: var(--accent); }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .hero { aspect-ratio: 16 / 9; }
  .slide-body { padding: 1.5rem var(--gutter); }
  .home-two-col { grid-template-columns: 1fr; gap: 0.75rem; }
  .home-main { padding-top: 2rem; padding-bottom: 3rem; }
}

/* ── LETTERBOXD SECTION ── */
.lb-section {
  background: #202830;
  border-radius: 8px;
  margin-left:  calc(-1 * var(--gutter));
  margin-right: calc(-1 * var(--gutter));
  padding: 1.25rem var(--gutter);
  margin-bottom: 0.75rem;
}

/* lb section internal colours */
.lb-section .lb-sub-label       { color: #8A9BAA; }
.lb-section .lb-divider         { background: #2D3540; }
.lb-section .lb-fav-placeholder { background: #2D3540; }
.lb-section .lb-diary-item      { border-bottom-color: #2D3540; }
.lb-section .lb-diary-title     { color: #F0EBE4; }
.lb-section .lb-diary-preview   { color: #E2DBD4; }
.lb-section .lb-diary-year,
.lb-section .lb-diary-date      { color: #8A9BAA; }
.lb-section .lb-diary-arrow     { color: #4A5A6A; }
.lb-section .lb-diary-item:hover .lb-diary-title { color: #D94035; }
.lb-section .lb-diary-item:hover .lb-diary-arrow { color: #D94035; }
.lb-section .sh-label           { color: var(--gold); }
.lb-section .sh-more            { color: #8A9BAA; }
.lb-section .sh-more:hover      { color: #D94035; }

/* lb-section is the same in dark mode — no override needed */
.dark .lb-section { background: #202830; }

.lb-layout {
  display: grid;
  grid-template-columns: auto 1px 1fr;
  gap: 0 2.5rem;
  align-items: start;
}
.lb-sub-label {
  font-family: var(--font-ui);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}
.lb-divider {
  background: var(--rule);
  width: 0.5px;
  align-self: stretch;
}

/* favourites */
.lb-fav-grid {
  display: grid;
  grid-template-columns: repeat(4, 82px);
  gap: 8px;
}
.lb-fav-card { display: block; text-decoration: none; }
.lb-fav-img {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  width: 82px;
  height: 123px;
}
.lb-fav-img img {
  width: 82px;
  height: 123px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s var(--ease);
}
.lb-fav-card:hover .lb-fav-img img { transform: scale(1.05); }
.lb-fav-placeholder { width: 82px; height: 123px; background: var(--bg3); border-radius: 3px; }
.lb-fav-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18,10,8,0.85);
  opacity: 0;
  transition: opacity 0.26s var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  gap: 4px;
}
.lb-fav-card:hover .lb-fav-overlay { opacity: 1; }
.lb-fav-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.lb-fav-year { font-size: 0.5625rem; color: rgba(255,255,255,0.5); }

/* diary */
.lb-diary-list { display: flex; flex-direction: column; }
.lb-diary-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.5rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 0.5px solid var(--rule);
  text-decoration: none;
}
.lb-diary-item:first-child { padding-top: 0; }
.lb-diary-item:last-child  { border-bottom: none; }
.lb-diary-top {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.lb-diary-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  transition: color 0.18s;
}
.lb-diary-item:hover .lb-diary-title { color: var(--accent); }
.lb-diary-year  { font-size: 0.6875rem; color: var(--muted); flex-shrink: 0; }
.lb-diary-date  { font-size: 0.6875rem; color: var(--muted); flex-shrink: 0; }
.lb-diary-preview {
  font-family: var(--font-prose);
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--muted);
  font-style: italic;
}
.lb-diary-arrow {
  font-size: 0.75rem;
  color: var(--rule);
  margin-top: 4px;
  transition: color 0.18s;
  flex-shrink: 0;
}
.lb-diary-item:hover .lb-diary-arrow { color: var(--accent); }

/* responsive */
@media (max-width: 768px) {
  .lb-layout {
    grid-template-columns: 1fr;
    gap: 2rem 0;
  }
  .lb-divider { display: none; }
  .lb-fav-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .lb-fav-img { width: 100%; height: auto; aspect-ratio: 2/3; }
  .lb-fav-img img { width: 100%; height: 100%; }
  .lb-fav-placeholder { width: 100%; height: auto; aspect-ratio: 2/3; }
}
