/* =============================================================================
   Mohammed Reviews · shared.css
   Rules used by more than one page. Page-only rules live in home.css, review.css, admin.css.

   1  Tokens          6  Buttons          11 Cards            16 Toasts
   2  Reset           7  Forms            12 Upcoming strip   17 Dialogs + lightbox
   3  Typography      8  Chips            13 Skeletons        18 Utilities
   4  Layout          9  Segmented        14 States           19 Motion
   5  Icons           10 Score badge      15 Header + footer
   Direction: logical properties everywhere. Physical left/right only for safe-area insets.
   ============================================================================= */

@property --ring-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }


/* ---------- 1 · Tokens ---------- */

:root {
  color-scheme: dark;

  /* palette (named in the design plan) */
  --black: #090B10;    /* Suit Black: page base */
  --yellow: #FCE249;   /* Cheveron Yellow: score + brand highlight */
  --cyan: #36ECFA;     /* Electric Cyan: interactive */
  --bone: #F5F7FB;     /* text */
  --ember: #FF6450;    /* low tier, errors */
  --signal: #46F08F;   /* high tier, success */

  /* surfaces + text roles */
  --bg: var(--black);
  --raised: #11141B;
  --card: #181C25;
  --line: #262B37;
  --line-strong: #3A4151;
  --text: var(--bone);
  --muted: #CBD2DE;
  --faint: #98A2B3;
  --cyan-ink: #032B30;   /* dark cyan for text on cyan fills */

  /* score tiers: fill + a dark shade of the same hue for text on the fill */
  --tier-low: var(--ember);   --tier-low-ink: #2B0602;
  --tier-mid: var(--yellow);  --tier-mid-ink: #2E2400;
  --tier-high: var(--signal); --tier-high-ink: #052E16;

  /* shape */
  --cover-ratio: 16 / 9;    /* one variable for every cover; change to 2 / 3 for portrait art */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;

  /* layout */
  --gutter: clamp(16px, 4.5vw, 32px);
  --maxw: 1320px;
  --header-h: 60px;
  --tap: 44px;

  /* type */
  --font-display: "Space Grotesk", "Noto Kufi Arabic", "Inter", system-ui, sans-serif;
  --font-text: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: .75rem;
  --fs-sm: .9375rem;
  --fs-base: 1rem;
  --fs-md: 1.1875rem;
  --fs-lg: 1.375rem;
  --fs-xl: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  --fs-2xl: clamp(2.25rem, 1.5rem + 3vw, 3.25rem);
  --fs-hero: clamp(2.25rem, 1rem + 4.6vw, 4.25rem);
  --lh-body: 1.65;
  --display-scale: .78;

  /* motion */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-stamp: cubic-bezier(.34, 1.56, .64, 1);
  --dur-1: 140ms;
  --dur-2: 260ms;
  --dur-3: 520ms;

  --shadow-lift: 0 30px 60px -24px rgb(0 0 0 / .85);
  --glow-cyan: 0 0 0 1px rgb(54 236 250 / .55), 0 18px 48px -18px rgb(54 236 250 / .45);
  --glow-yellow: 0 0 0 1px rgb(252 226 73 / .55), 0 18px 48px -18px rgb(252 226 73 / .35);
}

/* Arabic: Kufi display runs larger and needs air; body wants a taller line. */
html[lang="ar"] {
  --display-scale: .9;
  --lh-body: 1.85;
  --fs-base: 1.0625rem;
}


/* ---------- 2 · Reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--line-strong) var(--bg);
  scrollbar-width: thin;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
html.is-locked { overflow: hidden; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 560px at 88% -8%, rgb(54 236 250 / .20), transparent 62%),
    radial-gradient(900px 500px at -4% -6%, rgb(99 112 255 / .20), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* Hide the page until language + direction are applied (no LTR flash for Arabic). A CSS-only
   timeout reveals it anyway if JavaScript fails. */
html:not(.rn-ready) body { visibility: hidden; animation: rn-reveal 0s 2.5s forwards; }

main { flex: 1; padding-bottom: clamp(40px, 8vw, 88px); }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--yellow); color: var(--black); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 2px solid var(--bg); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #4B546A; }


/* ---------- 3 · Typography ---------- */

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.015em;
  text-transform: none;
  text-wrap: balance;
}
html[lang="ar"] :is(h1, h2, h3, h4) { line-height: 1.3; letter-spacing: 0; }

.h-hero { font-size: calc(var(--fs-hero) * var(--display-scale)); line-height: 1.02; }
.h-1 { font-size: calc(var(--fs-2xl) * var(--display-scale)); }
.h-2 { font-size: calc(var(--fs-xl) * var(--display-scale)); }
.h-3 { font-size: calc(var(--fs-lg) * var(--display-scale) * 1.15); }
.muted { color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; }


/* ---------- 4 · Layout ---------- */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.section { padding-block: clamp(28px, 6vw, 56px); }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-block-end: clamp(16px, 3vw, 28px);
}
.section__title {
  display: flex;
  align-items: center;
  gap: .45em;
  font-size: calc(var(--fs-xl) * var(--display-scale));
}
.section__title::before { content: ""; flex: none; width: .24em; height: .86em; background: var(--yellow); box-shadow: .24em 0 0 -0.0em rgb(54 236 250 / 0); border-radius: 2px; }
.section__count { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }

.grid-cards { display: grid; gap: clamp(16px, 2.6vw, 28px); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px)  { .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1440px) { .grid-cards:not(.grid-cards--related) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }


/* ---------- 5 · Icons ---------- */

.icon {
  flex: none;
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--back { transform: scaleX(-1); }
[dir="rtl"] .icon--fwd { transform: scaleX(-1); }
[dir="rtl"] .icon--back { transform: none; }


/* ---------- 6 · Buttons ---------- */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-bd: var(--line-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: var(--tap);
  padding: 0 18px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-1), border-color var(--dur-1), color var(--dur-1), transform var(--dur-1) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn--primary { --btn-bg: var(--cyan); --btn-fg: var(--cyan-ink); --btn-bd: var(--cyan); font-weight: 700; box-shadow: 0 8px 24px -10px rgb(54 236 250 / .7); }
.btn--accent { --btn-bg: var(--yellow); --btn-fg: var(--tier-mid-ink); --btn-bd: var(--yellow); font-weight: 700; }
.btn--secondary { --btn-bg: var(--card); --btn-bd: var(--line-strong); }
.btn--ghost { --btn-bd: transparent; }
.btn--danger { --btn-bg: var(--ember); --btn-fg: var(--tier-low-ink); --btn-bd: var(--ember); }
.btn--danger-ghost { --btn-bd: transparent; --btn-fg: var(--ember); }
.btn--icon { width: var(--tap); padding: 0; }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: .875rem; }
.btn--sm.btn--icon { width: 36px; }
@media (pointer: coarse) {
  .btn--sm { min-height: var(--tap); }
  .btn--sm.btn--icon { width: var(--tap); }
}
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: #7BF4FC; border-color: #7BF4FC; box-shadow: 0 10px 30px -8px rgb(54 236 250 / .85); }
  .btn--accent:hover { background: #FFEE7A; border-color: #FFEE7A; }
  .btn--secondary:hover, .btn--ghost:hover { background: #222836; border-color: var(--cyan); }
  .btn--danger:hover { background: #F77A68; border-color: #F77A68; }
  .btn--danger-ghost:hover { background: rgb(242 85 63 / .12); }
}
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--btn-fg);
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}


/* ---------- 7 · Forms ---------- */

.field { display: grid; gap: 6px; min-width: 0; }
.label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.input, .textarea, .select {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  line-height: 1.4;
  transition: border-color var(--dur-1), background-color var(--dur-1);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--faint); opacity: 1; }
input[type="date"].input { color-scheme: dark; cursor: pointer; }
input[type="date"].input::-webkit-calendar-picker-indicator { opacity: 1; cursor: pointer; width: 22px; height: 22px; }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 0; border-color: var(--cyan); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--ember); }
.select {
  appearance: none;
  padding-inline-end: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B4B2A9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 18px;
  background-position: right 12px center;
}
[dir="rtl"] .select { background-position: left 12px center; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field__hint { font-size: var(--fs-xs); color: var(--muted); }
.field__error { font-size: var(--fs-sm); color: var(--ember); }
.counter { font-size: var(--fs-xs); color: var(--faint); font-variant-numeric: tabular-nums; }
.counter.is-over { color: var(--ember); }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--cyan); }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; } /* honeypot */


/* ---------- 8 · Chips + pills ---------- */

.chip {
  --band: var(--cyan);
  --band-ink: var(--cyan-ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 2px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.chip--tag { color: var(--cyan); background: rgb(54 236 250 / .14); border-color: rgb(54 236 250 / .45); }
.chip--muted { color: var(--muted); background: var(--raised); border-color: var(--line-strong); }
.chip--plain { color: var(--text); background: rgb(9 11 16 / .6); border-color: var(--line-strong); }
.chip--tier { color: var(--band); background: color-mix(in srgb, var(--band) 12%, transparent); border-color: color-mix(in srgb, var(--band) 42%, transparent); }
.chip--tier[data-band="low"]  { --band: var(--tier-low);  --band-ink: var(--tier-low-ink); }
.chip--tier[data-band="mid"]  { --band: var(--tier-mid);  --band-ink: var(--tier-mid-ink); }
.chip--tier[data-band="high"], .chip--tier[data-band="top"] { --band: var(--tier-high); --band-ink: var(--tier-high-ink); }
.chip--lang { min-height: 22px; padding: 0 6px; color: var(--faint); border-color: var(--line); background: transparent; font-size: var(--fs-xs); }
.chip--lang.is-filled { color: var(--text); background: var(--raised); border-color: var(--line-strong); }

.chip--button { min-height: 36px; padding-inline: 14px; cursor: pointer; transition: background-color var(--dur-1), color var(--dur-1), border-color var(--dur-1); }
.chip--button::before { content: ""; position: absolute; inset: -4px -2px; } /* grows the hit area to 44px */
.chip--button[aria-pressed="true"] { background: var(--band); color: var(--band-ink); border-color: var(--band); }
@media (hover: hover) and (pointer: fine) {
  .chip--button:hover:not([aria-pressed="true"]) { background: color-mix(in srgb, var(--band) 22%, transparent); }
}
.chip__x { position: relative; display: grid; place-items: center; width: 20px; height: 20px; margin-inline-end: -6px; padding: 0; background: transparent; border: 0; color: inherit; border-radius: 2px; }
.chip__x .icon { width: 14px; height: 14px; }
@media (pointer: coarse) { .chip__x::before { content: ""; position: absolute; inset: -12px; } } /* invisible 44px hit area without growing the visible chip */

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.pill--published { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 45%, transparent); }
.pill--draft { color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 45%, transparent); }


/* ---------- 9 · Segmented toggle ---------- */

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}
.seg__btn {
  min-width: 44px;
  min-height: 40px;
  padding: 0 12px;
  background: transparent;
  border: 0;
  border-radius: 3px;
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 700;
  transition: background-color var(--dur-1), color var(--dur-1);
}
.seg__btn[aria-pressed="true"] { background: var(--cyan); color: var(--cyan-ink); }
.seg__btn[disabled] { opacity: .4; cursor: not-allowed; }
.seg--sm .seg__btn { min-height: 32px; min-width: 36px; padding: 0 10px; }
@media (pointer: coarse) { .seg__btn, .seg--sm .seg__btn { min-height: var(--tap); } }
@media (hover: hover) and (pointer: fine) {
  .seg__btn:hover:not([aria-pressed="true"]):not([disabled]) { color: var(--text); background: var(--card); }
}


/* ---------- 10 · Score badge (the one round thing) ---------- */

.badge {
  --b-size: 56px;
  --b-num: 26px;
  --b-verdict: 11px;
  --b-fill: var(--tier-mid);
  --b-ink: var(--tier-mid-ink);
  position: relative;
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--b-size);
  height: var(--b-size);
  border-radius: 50%;
  background: var(--b-fill);
  color: var(--b-ink);
  font-family: var(--font-display);
  text-align: center;
  transition: transform var(--dur-2) var(--ease-stamp);
}
.badge--xs { --b-size: 28px; --b-num: 14px; }
/* Sizes are tuned so the longest verdict ("Masterpiece") fits inside the circle at the verdict's row. */
.badge--sm { --b-size: 68px;  --b-num: 24px; --b-verdict: 9px; }
.badge--md { --b-size: 72px;  --b-num: 27px; --b-verdict: 9.5px; }
.badge--lg { --b-size: 88px;  --b-num: 32px; --b-verdict: 11px; }
.badge--xl { --b-size: 120px; --b-num: 52px; --b-verdict: 14px; }

.badge--low  { --b-fill: var(--tier-low);  --b-ink: var(--tier-low-ink); }
.badge--mid  { --b-fill: var(--tier-mid);  --b-ink: var(--tier-mid-ink); }
.badge--high, .badge--top { --b-fill: var(--tier-high); --b-ink: var(--tier-high-ink); }
.badge--none { --b-fill: var(--line); --b-ink: var(--muted); }

.badge__num { font-size: var(--b-num); font-weight: 700; line-height: .82; letter-spacing: -.01em; }
.badge__verdict {
  margin-top: 2px;
  max-width: 100%;
  font-size: var(--b-verdict);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}
html[lang="ar"] .badge__verdict { line-height: 1.25; }

/* Masterpiece: a slow yellow/cyan ring is the single special treatment. */
.badge--masterpiece::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(from var(--ring-angle), var(--yellow), var(--cyan), var(--yellow) 50%, var(--cyan), var(--yellow));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: ring-spin 9s linear infinite;
  pointer-events: none;
}


/* ---------- 11 · Cards ---------- */

.card {
  --t-size: calc(1.75rem * var(--display-scale));
  --t-lh: 1.15;
  --t-h: calc(var(--t-size) * var(--t-lh));
  --v-size: 1rem;
  --v-lh: 1.5;
  --v-h: calc(var(--v-size) * var(--v-lh) * 2);
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
html[lang="ar"] .card { --t-lh: 1.45; --v-lh: 1.65; }

.card__link { display: flex; flex-direction: column; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.card__frame { position: relative; }
.card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--cover-ratio);
  background: var(--raised);
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.card__media img, .card__thumb img, .upcoming__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card__media img.is-tile, .card__thumb img.is-tile, .upcoming__media img.is-tile { filter: none; }

.card__badge { position: absolute; z-index: 2; inset-inline-end: 14px; bottom: -30px; }

.card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, #1D222D 0%, var(--card) 100%);
  border: 1px solid var(--line-strong);
  border-top: 0;
  border-radius: 0 0 var(--r-md) var(--r-md);
  transition: border-color var(--dur-2);
}
.card__title {
  padding-inline-end: 80px; /* clear of the badge that overhangs the media edge */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: var(--t-size);
  font-weight: 700;
  line-height: var(--t-lh);
  letter-spacing: .01em;
}
.card__verdict {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: var(--v-h);
  color: #E4E8F0;
  font-size: var(--v-size);
  line-height: var(--v-lh);
}
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: auto; padding-top: 8px; min-height: 28px; }
.meta { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .875rem; line-height: 1.2; }
.meta .icon { width: 14px; height: 14px; }

/* related: same anatomy, smaller */
.card--related { --t-size: calc(1.25rem * var(--display-scale)); --v-size: .875rem; }

/* hero: full-bleed cover, text on a legibility gradient, badge straddles the top corner */
.card--hero { --t-size: calc(var(--fs-hero) * var(--display-scale) * .8); --t-lh: 1.05; }
html[lang="ar"] .card--hero { --t-lh: 1.2; }
.card--hero .card__media { aspect-ratio: 9 / 10; border-radius: var(--r-lg); border: 1px solid var(--line); }
@media (min-width: 768px)  { .card--hero .card__media { aspect-ratio: 2 / 1; } }
@media (min-width: 1200px) { .card--hero .card__media { aspect-ratio: 8 / 3; } }
.card__scrim { position: absolute; inset: 0; background: linear-gradient(to top, rgb(9 11 16 / .95) 0%, rgb(9 11 16 / .62) 38%, rgb(9 11 16 / 0) 72%); }
.card__content {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: clamp(16px, 3vw, 40px);
}
.card--hero .card__content { padding: clamp(16px, 2.5vw, 32px); gap: 10px; }
.card--hero .card__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.card--hero .card__title { max-width: min(100%, 24ch); padding: 0; overflow: visible; white-space: normal; text-wrap: balance; }
.card--hero .card__verdict { display: block; min-height: 0; max-width: 54ch; color: var(--text); font-size: clamp(.95rem, .88rem + .45vw, 1.125rem); line-height: 1.45; -webkit-line-clamp: unset; overflow: visible; }
.card--hero .card__meta { margin-top: 0; padding-top: 0; min-height: 0; }
.card--hero .card__meta .meta { color: var(--muted); }
.card--hero .card__badge { top: -36px; bottom: auto; inset-inline-end: clamp(16px, 3vw, 32px); }

/* admin: compact row, actions are slotted in by admin.js */
.card--admin {
  --t-size: 1.25rem;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.card__thumb { position: relative; flex: none; width: 96px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--raised); border-radius: var(--r-sm); }
.card--admin .card__main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.card--admin .card__title { padding: 0; }
.card__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card__stats { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.card__side { flex: none; display: flex; align-items: center; gap: 4px; }

/* Hover is polish only, never required: fine pointers only, nothing hidden until hover. */
@media (hover: hover) and (pointer: fine) {
  .card--grid, .card--related { transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
  .card--grid:hover, .card--related:hover { z-index: 5; transform: translateY(-6px); box-shadow: var(--shadow-lift); }
  .card--grid:hover .card__body, .card--related:hover .card__body { border-color: var(--cyan); }
  .card--grid:hover .card__media, .card--related:hover .card__media { box-shadow: 0 0 0 1px var(--cyan); }
  .card--grid:hover .badge, .card--related:hover .badge, .card--hero:hover .badge { transform: scale(1.14); }
  .card--hero .card__media { transition: transform var(--dur-2) var(--ease-out); transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
}
.card__link:focus-visible { outline-offset: 4px; border-radius: var(--r-md); }
.card--admin:hover { border-color: var(--line-strong); }


/* ---------- 12 · Upcoming strip (shared: Home and the admin homepage preview) ---------- */

.strip {
  display: flex;
  gap: 16px;
  margin-inline: calc(var(--gutter) * -1);
  padding: 4px var(--gutter);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.strip::-webkit-scrollbar { display: none; }

.upcoming {
  flex: 0 0 min(52vw, 220px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  cursor: default;
  transition: border-color var(--dur-2), transform var(--dur-2) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .upcoming:hover { border-color: var(--yellow); transform: translateY(-4px); } }
.upcoming__media { position: relative; aspect-ratio: 2 / 3; background: var(--raised); }   /* full portrait cover, never cropped */
.upcoming__media img:not(.is-tile) { filter: none; }
.upcoming__label {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: rgb(9 11 16 / .82);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.upcoming__label::before { content: ""; width: 7px; height: 7px; background: var(--yellow); }
.upcoming__date { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 4px; color: var(--yellow); font-size: var(--fs-sm); font-weight: 700; }
.upcoming__date .icon { width: 16px; height: 16px; }
.upcoming__when { flex-basis: 100%; padding-inline-start: 24px; color: var(--muted); font-weight: 500; }
.upcoming__body { display: grid; gap: 4px; padding: 12px 14px 14px; }
.upcoming__name { font-family: var(--font-display); font-size: calc(1.375rem * var(--display-scale)); font-weight: 700; line-height: 1.15; }
.upcoming__note { color: #E4E8F0; font-size: var(--fs-sm); line-height: 1.5; }


/* ---------- 13 · Skeletons (dimensions come from the real card classes) ---------- */

.skeleton {
  background: linear-gradient(100deg, var(--card) 30%, #1C212B 50%, var(--card) 70%);
  background-size: 300% 100%;
  border-radius: var(--r-sm);
  animation: shimmer 1.5s linear infinite;
}
.card__media.skeleton { border-radius: var(--r-md) var(--r-md) 0 0; }
.card--hero.is-skeleton .card__media { border-radius: var(--r-lg); }
.skeleton--title { height: var(--t-h, 1.7rem); width: 68%; }
.skeleton--line { height: calc(var(--v-size, .9375rem) * var(--v-lh, 1.45)); width: 100%; }
.skeleton--short { width: 55%; }
.skeleton--meta { height: 20px; width: 40%; margin-top: auto; }
.skeleton--row { height: 72px; border-radius: var(--r-md); }
.skeleton--stat { height: 104px; border-radius: var(--r-md); }
.skeleton--banner { aspect-ratio: 16 / 9; border-radius: var(--r-md); }
.skeleton-text, .comment-skel { display: grid; gap: 10px; }
.comment-skel { padding-block: 14px; }
.is-skeleton .card__link { pointer-events: none; }


/* ---------- 14 · Empty + error states ---------- */

.state { display: grid; justify-items: center; gap: 12px; padding: clamp(40px, 9vw, 80px) 20px; text-align: center; }
.state__icon { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--raised); color: var(--muted); }
.state__icon .icon { width: 28px; height: 28px; }
.state--error .state__icon { color: var(--ember); border-color: color-mix(in srgb, var(--ember) 45%, transparent); }
.state__title { font-family: var(--font-display); font-size: calc(var(--fs-lg) * var(--display-scale) * 1.2); font-weight: 700; line-height: 1.15; }
html[lang="ar"] .state__title { line-height: 1.4; }
.state__text { max-width: 44ch; color: var(--muted); }
.state .btn { margin-top: 8px; }


/* ---------- 15 · Header + footer ---------- */

.skip-link {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 300;
  padding: 10px 16px;
  background: var(--yellow);
  color: var(--black);
  border-radius: var(--r-sm);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-220%);
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: calc(var(--header-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: rgb(9 11 16 / .9);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
          backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2);
}
.site-header.is-scrolled { border-bottom-color: var(--line-strong); }
.site-header::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--yellow), var(--cyan) 60%, transparent); opacity: .85; pointer-events: none; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--header-h);
  max-width: none;   /* full-bleed: brand pinned to the far start, search + language to the far end */
  padding-left: max(clamp(16px, 2.5vw, 40px), env(safe-area-inset-left));
  padding-right: max(clamp(16px, 2.5vw, 40px), env(safe-area-inset-right)); }
.site-header__actions { display: flex; align-items: center; gap: 6px; }

.brand { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; }
.brand__name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; line-height: 1; letter-spacing: -.01em; }

.site-footer { margin-top: auto; padding-block: clamp(32px, 6vw, 56px) calc(32px + env(safe-area-inset-bottom)); background: var(--raised); border-top: 1px solid var(--line); }
.site-footer__inner { display: grid; gap: 24px; }
.site-footer__tagline { margin-top: 4px; max-width: 40ch; color: var(--muted); font-size: var(--fs-sm); }
.site-footer__side { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.site-footer__lang { display: inline-flex; align-items: center; gap: 12px; }
.site-footer__lang-label { color: var(--muted); font-size: var(--fs-sm); }
.site-footer__legal { padding-top: 20px; border-top: 1px solid var(--line); color: var(--faint); font-size: var(--fs-xs); }
@media (min-width: 768px) {
  .site-footer__inner { grid-template-columns: 1fr auto; align-items: start; }
  .site-footer__legal { grid-column: 1 / -1; }
}


/* ---------- 16 · Toasts ---------- */

.toasts {
  position: fixed;
  inset-inline: 0;
  bottom: calc(var(--toast-offset, 0px) + max(16px, env(safe-area-inset-bottom)));
  z-index: 200;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-inline: 16px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(440px, 100%);
  padding: 10px 8px 10px 14px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-inline-start: 4px solid var(--cyan);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lift);
  animation: toast-in var(--dur-2) var(--ease-out);
}
[dir="rtl"] .toast { padding: 10px 14px 10px 8px; }
.toast--success { border-inline-start-color: var(--signal); }
.toast--error { border-inline-start-color: var(--ember); }
.toast__icon { display: grid; color: var(--cyan); }
.toast--success .toast__icon { color: var(--signal); }
.toast--error .toast__icon { color: var(--ember); }
.toast__msg { flex: 1; font-size: var(--fs-sm); line-height: 1.45; }
.toast__close { display: grid; place-items: center; width: var(--tap); height: var(--tap); margin-block: -4px; background: transparent; border: 0; color: var(--muted); }
.toast.is-leaving { animation: toast-out var(--dur-1) ease-in forwards; }


/* ---------- 17 · Dialogs + lightbox (native <dialog>) ---------- */

.dialog {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  color: var(--text);
}
.dialog::backdrop { background: rgb(0 0 0 / .74); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog[open] { display: grid; place-items: center; padding: 16px; }
.dialog__panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--dlg-w, 520px);
  max-height: calc(100dvh - 32px);
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lift);
  animation: dialog-in var(--dur-2) var(--ease-out);
}
.dialog--sm { --dlg-w: 420px; }
.dialog--lg { --dlg-w: 1040px; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 8px 4px 20px; }
[dir="rtl"] .dialog__head { padding: 12px 20px 4px 8px; }
.dialog__title { font-size: calc(var(--fs-lg) * var(--display-scale) * 1.25); }
.dialog__body { padding: 8px 20px 20px; overflow: auto; overscroll-behavior: contain; }
.dialog__text { color: var(--muted); }
.dialog__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

/* bottom sheet on phones, centered card from tablet up */
.dialog--sheet[open] { place-items: end center; padding: 0; }
.dialog--sheet .dialog__panel { --dlg-w: 640px; max-height: 88dvh; border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; animation: sheet-in var(--dur-3) var(--ease-out); }
@media (min-width: 768px) {
  .dialog--sheet[open] { place-items: center; padding: 16px; }
  .dialog--sheet .dialog__panel { border-bottom: 1px solid var(--line-strong); border-radius: var(--r-md); animation: dialog-in var(--dur-2) var(--ease-out); }
}
.dialog--full[open] { padding: 0; }
.dialog--full .dialog__panel { --dlg-w: none; height: 100dvh; max-height: none; border: 0; border-radius: 0; }

.lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  background: rgb(5 6 10 / .97);
  border: 0;
  color: var(--text);
}
.lightbox[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.lightbox::backdrop { background: #05060A; }
.lightbox__stage { display: grid; place-items: center; min-height: 0; padding: calc(64px + env(safe-area-inset-top)) 12px 8px; touch-action: pan-y; }
.lightbox__img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lightbox__close { position: absolute; inset-block-start: max(8px, env(safe-area-inset-top)); inset-inline-end: 8px; --btn-bg: rgb(9 11 16 / .7); }
.lightbox__nav { position: absolute; inset-block-start: 50%; translate: 0 -50%; --btn-bg: rgb(9 11 16 / .7); }
.lightbox__nav--prev { inset-inline-start: 8px; }
.lightbox__nav--next { inset-inline-end: 8px; }
.lightbox.is-single .lightbox__nav { display: none; }
.lightbox__foot { display: grid; gap: 2px; justify-items: center; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); text-align: center; }
.lightbox__caption { max-width: 70ch; color: var(--text); font-size: var(--fs-sm); }
.lightbox__count { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }


/* ---------- 18 · Utilities ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.stack { display: grid; gap: var(--gap, 16px); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 8px); }
.scroll-x { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.load-more { display: flex; justify-content: center; margin-top: clamp(20px, 3vw, 32px); }
.load-more .btn { max-width: 320px; }


/* ---------- 19 · Motion ---------- */

@keyframes rn-reveal { to { visibility: visible; } }
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ring-spin { to { --ring-angle: 360deg; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes sheet-in { from { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .skeleton { animation: none; background: var(--card); }
  .badge--masterpiece::before { animation: none; } /* ring stays, static */
  .card--grid:hover, .card--related:hover { transform: none; }
  .card--hero .card__media { transform: none !important; }
}


/* ---------- small screens: hero badge stays inside the card, header fits on one line ---------- */
@media (max-width: 767px) {
  .card--hero .card__badge { top: 12px; inset-inline-end: 12px; }   /* was poking up under the sticky header */
  .card--hero .card__verdict { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
  .brand { gap: 8px; }
  .brand__name { font-size: 1.0625rem; white-space: nowrap; }
  .site-header__inner { gap: 8px; }
  .site-header__actions { gap: 4px; }
  .site-header .seg__btn { min-width: 40px; padding-inline: 10px; }
}
.brand { min-width: 0; }
.brand__name { overflow: hidden; text-overflow: ellipsis; }   /* never push the toggle off-screen */
.site-header__actions { flex: none; }
@media (max-width: 380px) {
  .brand__mark { width: 24px; height: 24px; }
  .brand__name { font-size: .9375rem; }
  .site-header .seg__btn { min-width: 36px; padding-inline: 8px; }
}


/* ---------- site notice (dismissible) ---------- */
.site-notice { background: rgb(252 226 73 / .08); border-bottom: 1px solid rgb(252 226 73 / .28); }
.site-notice__inner { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.site-notice__icon { flex: none; display: inline-flex; color: var(--yellow); }
.site-notice__icon .icon { width: 20px; height: 20px; }
.site-notice__text { flex: 1; min-width: 0; margin: 0; color: var(--text); font-size: var(--fs-sm); line-height: 1.45; }
.site-notice__close { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; margin-inline-end: -8px; background: transparent; border: 0; border-radius: var(--r-sm, 6px); color: var(--muted); cursor: pointer; }
.site-notice__close .icon { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .site-notice__close:hover { color: var(--text); background: rgb(255 255 255 / .06); } }
.site-notice__close:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
