/* Chooni.ir — base layer: reset, shared design-system components, and the site nav.
   Loaded on every page after tokens.css. Page-specific layout lives in its own file. */

*, *::before, *::after { box-sizing: border-box; }

/* An element's own `display` rule (`.chip`, `.f-opt`, ...) has equal specificity to the
   UA's `[hidden]{display:none}` and wins by cascade order — so anything hidden via the
   `hidden` attribute/property needs this to actually disappear. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-fa);
  overflow-x: hidden;               /* guard against any stray full-bleed child */
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--amber); }

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

/* Fluid page container: fluid gutters, capped width, centred. */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section { padding-top: var(--section-y); }

/* ---- Typography helpers ---- */
.display { font-family: var(--font-display); font-weight: 400; color: var(--ink); }
.latin { font-family: var(--font-latin); direction: ltr; unicode-bidi: isolate; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--dim); }
.eyebrow-amber { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--amber); }
.h2 { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1.1; color: var(--ink); margin: 0; font-weight: 400; }
.quote { font-weight: 500; color: var(--ink); text-wrap: pretty; }
.hairline { height: 1px; background: var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---- Chips / pills ---- */
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip-amber { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--amber-line); background: rgb(var(--amber-rgb) / 0.10); color: var(--amber); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip-active { display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--amber); background: var(--amber); color: var(--on-amber); font-size: 13px; font-weight: 700; white-space: nowrap; }
.lang-big { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 24px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink); font-size: 18px; font-weight: 600; }
.lang-big-on { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 24px; border-radius: 999px; border: 1px solid var(--amber); background: var(--amber); color: var(--on-amber); font-size: 18px; font-weight: 700; }
.kind { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 2px; background: var(--amber-wash); color: var(--amber); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; }
/* Platform "where to watch" marks: a neutral gray circle badge (same chrome for every
   service — no per-brand fill) holding just the service's own mark (see the #logo-*
   sprite). Icon-only by default (matches the reference badge row: circle, mark, no
   label); .platform-badge--sm shrinks it for the filter checklist, which still needs
   the text label next to it for scanability. */
/* Fixed warm off-white chrome regardless of theme — like the popcorn bucket art, these
   marks are drawn in their own brand color (incl. near-black) and only read on a light
   coin, so the badge can't track the dark-theme default or a black mark vanishes into it. */
.platform-badge { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: #F3EFE7; border: 1px solid rgba(14, 11, 8, 0.12); overflow: hidden; flex-shrink: 0; }
.platform-badge--sm { width: 22px; height: 22px; }
.platform-logo { width: 55%; height: 55%; flex-shrink: 0; }
/* A real platform icon (own dark background baked in, e.g. the HBO Max app icon) —
   overflow:hidden above crops its square corners into the circle. */
.platform-badge__img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Borderless variant for small/dense contexts (filter lists, inline detail rows) — the
   pale circle chrome above reads as a dull gray dot at ~22-36px with a wordmark shrunk
   inside it. This drops the circle entirely and lets the icon-only #logo-*-mark fill
   its own box directly, so the brand color itself is what shows (owner, 2026-09-04:
   "no border ... to be vivid"). */
.platform-mark { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0; }
.platform-mark .platform-logo { width: 100%; height: 100%; }
/* Real platform-icon images (owner-supplied, 2026-09-04 — the hand-drawn #logo-*-mark
   SVGs read as "terrible" next to an actual app icon). Rounded uniformly regardless of
   the source image's own corners: a flat-square export (no transparency) gets a soft
   squircle to match icons that already ship rounded, so the row reads as one system. */
.platform-mark__img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 22%; }
/* Publisher marks (Games): logo on a fixed warm-white tile in every theme — company logos are drawn
   for light grounds, same reasoning as .platform-badge. Rounded rectangle, not a circle: most
   publisher logos are wordmarks. No logo file → the name's initials on the same tile. */
.publisher-mark { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 28px; padding: 3px 5px; border-radius: 6px; background: #F3EFE7; border: 1px solid rgba(14, 11, 8, 0.12); flex-shrink: 0; overflow: hidden; }
.publisher-mark--lg { width: 72px; height: 44px; padding: 5px 8px; }
.publisher-mark__img { width: 100%; height: 100%; object-fit: contain; display: block; }
.publisher-mark__mono { color: #3A3128; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; line-height: 1; }
.flag-icon { width: 18px; height: 12px; border-radius: 2px; flex-shrink: 0; outline: 1px solid rgb(var(--ink-rgb) / 0.15); outline-offset: -1px; }
.score-inline { display: flex; align-items: center; gap: 8px; }
/* Fixed height, natural width — the fresh (upright) and rotten (tipped) bucket art have
   different aspect ratios, so a fixed width would skew one of them. */
.popcornmeter-icon { height: 28px; width: auto; flex-shrink: 0; display: block; }

/* Film-grain overlay (used inside relatively-positioned parents). */
.grain { position: absolute; inset: 0; pointer-events: none; opacity: 0.11; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  background-size: 240px 240px; }

/* Font Awesome Duotone icons (Rendering/Fa.cs, assets/icons/fa.svg). One em tall, centered in a box wide
   enough for the widest glyph; the second layer is the amber accent at partial strength. */
.fa { display: inline-block; width: 1.25em; height: 1em; flex-shrink: 0; overflow: visible; vertical-align: -0.125em;
  --fa-primary-color: currentColor; --fa-secondary-color: var(--amber); --fa-secondary-opacity: .55; }
.fa-xmark, .fa-check, .fa-chevron-down { --fa-secondary-color: currentColor; --fa-secondary-opacity: 1; }
.nav__search-icon .fa, .theme-toggle .fa { font-size: 18px; }
.kind .fa { font-size: 13px; }

/* Screen's RT score pair (Shared/_RtScores): Popcornmeter and Tomatometer, RT's own icons; "-" when RT
   shows no score yet. Card = stacked in the score column; hero = side by side, larger. */
.rt-scores { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.rt-score { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.rt-score__icon { width: 30px; height: 30px; flex-shrink: 0; display: block; }
.rt-score__value { font-family: var(--font-display); font-size: 32px; line-height: 1; color: var(--amber); }
.rt-score__value.is-empty { color: var(--dim); }
.rt-score__count { color: var(--dim); font-size: 12px; }
.rt-scores--hero { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.rt-scores--hero .rt-score__icon { width: 40px; height: 40px; }
.rt-scores--hero .rt-score__value { font-size: 40px; }
.rt-scores--hero .rt-score__count { font-size: 13px; color: var(--muted); }

/* Work covers (Shared/_Cover, covers.js): the cover fills its 2:3 frame; until it arrives the frame
   shimmers, then the cover fades in. A work with no cover keeps the plain frame. */
.cover-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-img.is-loading {
  background-color: var(--panel-2);
  background-image: linear-gradient(100deg, transparent 35%, var(--line-2) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: cover-shimmer 1.2s linear infinite;
}
.cover-img.is-loaded { animation: cover-in .45s ease-out; }
.cover-img.is-missing { visibility: hidden; }
@keyframes cover-shimmer { from { background-position: 125% 0; } to { background-position: -25% 0; } }
@keyframes cover-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cover-img.is-loading, .cover-img.is-loaded { animation: none; } }

/* ===================================================================
   SITE NAV — fluid, collapses to a menu button under 720px.
   =================================================================== */
.nav {
  position: absolute; inset-inline: 0; top: 0; z-index: 20;
}
/* Row 1: brand + the big, primary search field — the thing the eye lands on first. */
.nav__inner {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  display: flex; align-items: center;
  min-height: 68px; padding: 16px var(--pad-x) 12px; gap: clamp(16px, 3vw, 32px);
}
.nav__brand { font-family: var(--font-display); font-size: 34px; color: var(--amber); line-height: 1; flex-shrink: 0; }
.nav__brand a { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.nav__brand-logo { height: 38px; width: auto; aspect-ratio: 640 / 278; object-fit: contain; }
.nav__search {
  position: relative;
  display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 22px;
  border: 1px solid var(--line-2); border-radius: 26px; color: var(--muted);
  background: var(--panel); font-size: 15px; flex: 1 1 auto; max-width: 640px;
  transition: border-radius .15s ease;
}
.nav__search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav__search-icon { display: inline-flex; flex-shrink: 0; cursor: text; }
.nav__search.is-suggesting { border-end-start-radius: 0; border-end-end-radius: 0; }
.nav__toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 10px;
  background: transparent; color: var(--ink); cursor: pointer; flex-shrink: 0;
}

/* ---- Theme toggle (sun/moon) — one button, two icons swapped by [data-theme]. ---- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent; color: var(--ink); cursor: pointer; flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--amber-line); color: var(--amber); }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
/* ---- Design switch: two pills, this design ("دهه شصت") and the /alt one ("نسل زد"). ---- */
.ui-switch {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px; margin-inline-start: auto;
  border: 1px solid var(--line-2); border-radius: 999px; flex-shrink: 0; font-size: 13px; font-weight: 700;
}
.ui-switch__option { padding: 8px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; white-space: nowrap; line-height: 1; }
.ui-switch__option.is-active { background: var(--amber); color: var(--bg); }
a.ui-switch__option:hover { color: var(--amber); }
@media (max-width: 420px) { .ui-switch__option { padding: 7px 9px; font-size: 12px; } }
/* Row 2: the category strip — Section links live here now, always visible, own line. */
.nav__strip { border-top: 1px solid var(--line); }
.nav__strip-inner {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  display: flex; align-items: center; gap: clamp(20px, 3vw, 40px);
  padding: 12px var(--pad-x); overflow-x: auto; scrollbar-width: none;
}
.nav__strip-inner::-webkit-scrollbar { display: none; }
.nav-link { color: var(--muted); font-size: 15px; font-weight: 500; white-space: nowrap; }
.nav-link:hover { color: var(--amber); }
.nav-link.is-active { color: var(--amber); }

@media (max-width: 720px) {
  .nav__search span { display: none; }
  .nav__search { flex: 0 1 auto; width: 52px; padding: 0; justify-content: center; }
  /* The icon is a label for the field: tapping it focuses the field, which opens it out. */
  .nav__search:focus-within { flex: 1 1 auto; width: auto; padding: 0 16px; justify-content: flex-start; }
}

/* ===================================================================
   SEARCH TYPE-AHEAD — an accordion that unfolds from the bottom edge of the field it
   belongs to (nav and home). search.js fills .suggest__inner from /search/suggest and
   sets .is-suggesting on the form; the 0fr→1fr row animates the height.
   =================================================================== */
.suggest {
  position: absolute; inset-inline: -1px; top: calc(100% - 1px); z-index: 30;
  display: grid; grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows .22s ease, visibility 0s linear .22s;
  color: var(--ink); text-align: start; font-size: 15px;
}
.is-suggesting > .suggest {
  grid-template-rows: 1fr; visibility: visible;
  transition: grid-template-rows .22s ease, visibility 0s;
}
.suggest__inner {
  min-height: 0; overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line-2); border-top: 0;
  border-end-start-radius: 22px; border-end-end-radius: 22px;
  box-shadow: 0 22px 44px rgb(0 0 0 / 0.32);
}
.suggest__list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: min(62vh, 520px); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border-top: 1px solid var(--line);
}
.suggest__opt {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 14px; color: var(--ink);
}
.suggest__opt:hover, .suggest__opt.is-active { background: var(--amber-wash); color: var(--ink); }
.suggest__thumb { width: 36px; height: 54px; border-radius: 4px; object-fit: cover; background: var(--panel-2); }
.suggest__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.suggest__title { font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest__sub { display: flex; align-items: baseline; gap: 10px; min-width: 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; }
.suggest__sub .latin { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.suggest__score { font-family: var(--font-display); font-size: 20px; line-height: 1; color: var(--amber); }
.suggest__all {
  display: block; width: 100%; padding: 12px 18px;
  border: 0; border-top: 1px solid var(--line); background: transparent;
  color: var(--teal); font: inherit; font-size: 14px; text-align: start; cursor: pointer;
}
.suggest__all:hover { color: var(--amber); }
.suggest__empty { margin: 0; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .suggest, .is-suggesting > .suggest { transition: none; }
}

/* ===================================================================
   SITE FOOTER — shared across pages.
   =================================================================== */
.footer { padding-bottom: 56px; }
.footer__grid { display: grid; grid-template-columns: 5fr 2fr 2fr 3fr; gap: clamp(28px, 4vw, 32px); padding: 64px 0 48px; }
.footer__col { display: flex; flex-direction: column; gap: 12px; }
.footer__col a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.footer__col a:hover { color: var(--amber); }
.footer__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; color: var(--dim); font-size: 12px; }

@media (max-width: 820px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; } }

/* Anyone who prefers reduced motion: no live WebGL hero. */
@media (prefers-reduced-motion: reduce) {
  .home__scene { display: none !important; }
}
