/* ==========================================================================
   QATAR SUPERCARS — design system
   Direction (ui-ux-pro-max): bold editorial / brutalist poster.
   Qatar maroon brand, near-black base, signal red only for primary actions.
   0px corners, thick rules, poster-scale condensed type, serrated-edge motif.
   Logical properties throughout so Arabic (RTL) mirrors cleanly.
   ========================================================================== */

:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --surface: #161616;
  --surface-2: #1e1e1e;
  --line: #2a2a2a;
  --text: #f4f1ea;          /* bone white: 17.8:1 on --bg */
  --muted: #a8a29e;         /* 8.1:1 on --bg */
  --maroon: #8a1538;        /* Qatar maroon: white on it = 9.3:1 */
  --maroon-deep: #5e0e26;
  --maroon-ink: #ff9fb8;    /* maroon-family text on dark: 9:1 */
  --red: #e4002b;           /* signal red, CTAs only: white on it = 4.8:1 */
  --red-hover: #ff1a45;
  --gold: #c9a227;
  --ok: #3ccf91;
  --warn: #ffb020;

  --font-display: "Barlow Condensed", "Cairo", "Arial Narrow", sans-serif;
  --font-body: "Barlow", "Cairo", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1440px;
  --rule: 3px solid var(--text);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --dur: 180ms;

  --z-header: 40;
  --z-tabbar: 40;
  --z-overlay: 100;
  --tabbar-h: 64px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
@media (min-width: 900px) { body { padding-bottom: 0; } }
html[dir="rtl"] body { font-family: "Cairo", var(--font-body); font-size: 16px; }

img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
p a, .prose a, .link { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--maroon); }
p a:hover, .prose a:hover, .link:hover { text-decoration-color: var(--red); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--maroon); color: #fff; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 999; background: var(--red); color: #fff; padding: 10px 16px; font-weight: 700; }
.skip:focus { top: 8px; }

.i { width: 22px; height: 22px; flex: none; }
.i-sm { width: 16px; height: 16px; flex: none; }
.i-lg { width: 28px; height: 28px; flex: none; }
html[dir="rtl"] .flip { transform: scaleX(-1); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Type ---------------------------------------------------------- */

.display, h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: .92;
  letter-spacing: -.01em;
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
}
.display { font-style: italic; font-weight: 900; }
html[dir="rtl"] .display, html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 {
  font-style: normal; text-transform: none; letter-spacing: 0; line-height: 1.2; font-weight: 900;
}
/* Arabic glyphs are wider and taller than condensed Latin: scale them down. */
html[dir="rtl"] .d-xxl { font-size: clamp(2.6rem, 7.5vw, 6.5rem); }
html[dir="rtl"] .d-xl  { font-size: clamp(2.2rem, 5.5vw, 4.5rem); }
html[dir="rtl"] .d-l   { font-size: clamp(1.9rem, 4.5vw, 3.4rem); }
/* Outline text breaks on Arabic (overlapping contours), so use a solid accent colour instead. */
html[dir="rtl"] .stroke { -webkit-text-stroke: 0; color: var(--maroon-ink); }
.d-xxl { font-size: clamp(3.2rem, 11vw, 9.5rem); }
.d-xl  { font-size: clamp(2.6rem, 8vw, 6.5rem); }
.d-l   { font-size: clamp(2.2rem, 6.5vw, 5rem); }
.d-m   { font-size: clamp(1.7rem, 4vw, 2.8rem); }
.d-s   { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }

.kicker, .mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}
html[dir="rtl"] .kicker { font-family: "Cairo", sans-serif; letter-spacing: 0; font-size: 13px; font-weight: 700; }
.muted { color: var(--muted); }
.accent { color: var(--maroon-ink); }
.lead { font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.5; max-width: 60ch; }
.prose { max-width: 70ch; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 2.2em 0 .5em; }
.prose h3 { font-size: 1.35rem; margin: 1.8em 0 .4em; }
.prose p, .prose li { color: #d8d3cb; }
.prose li + li { margin-top: .35em; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Motifs ---------------------------------------------------------- */

/* The serrated edge (9 points), Qatar's most recognisable shape, used as a frame. */
.serrated {
  --teeth: 9;
  position: relative;
}
.serrated::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: clamp(28px, 4vw, 56px);
  background: var(--maroon);
  clip-path: polygon(0 0, 55% 0, 100% 5.55%, 55% 11.1%, 100% 16.65%, 55% 22.2%, 100% 27.75%, 55% 33.3%, 100% 38.85%, 55% 44.4%,
    100% 50%, 55% 55.55%, 100% 61.1%, 55% 66.65%, 100% 72.2%, 55% 77.75%, 100% 83.3%, 55% 88.85%, 100% 94.4%, 55% 100%, 0 100%);
  z-index: 2;
}
html[dir="rtl"] .serrated::before { transform: scaleX(-1); }

.zigzag {
  height: 14px;
  background:
    linear-gradient(135deg, var(--maroon) 25%, transparent 25%) -7px 0 / 14px 14px,
    linear-gradient(225deg, var(--maroon) 25%, transparent 25%) -7px 0 / 14px 14px;
}

/* Sadu-weave lattice texture */
.sadu {
  background-color: var(--maroon);
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.07) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.18) 0 2px, transparent 2px 18px);
}

.rule { border: 0; border-top: var(--rule); margin: 0; }

/* ---------- Buttons & chips --------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 2px solid var(--text); background: transparent; color: var(--text);
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase;
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out), transform 90ms;
  touch-action: manipulation; white-space: nowrap;
}
html[dir="rtl"] .btn { font-family: "Cairo", sans-serif; letter-spacing: 0; font-weight: 800; font-size: 1rem; }
.btn:hover { background: var(--text); color: var(--bg); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hover); border-color: var(--red-hover); color: #fff; }
.btn-maroon { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.btn-maroon:hover { background: #a3193f; border-color: #a3193f; color: #fff; }
.btn-light { background: var(--text); color: var(--bg); }
.btn-light:hover { background: #fff; }
.btn-ghost { border-color: var(--line); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .5; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; font: 700 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
  background: var(--text); color: var(--bg);
}
html[dir="rtl"] .tag { font-family: "Cairo", sans-serif; letter-spacing: 0; font-size: 12px; }
.tag-red { background: var(--red); color: #fff; }
.tag-maroon { background: var(--maroon); color: #fff; }
.tag-line { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text); }
.tag-ad { background: var(--gold); color: #111; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--line); font-weight: 600; font-size: .95rem; white-space: nowrap;
  transition: border-color var(--dur), background var(--dur);
}
.chip:hover { border-color: var(--text); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Header ---------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: rgba(10,10,10,.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.wordmark { display: flex; align-items: stretch; gap: 0; line-height: 1; flex: none; }
.wordmark .wm-q {
  background: var(--maroon); color: #fff; padding: 7px 10px 5px;
  font: italic 900 1.05rem/1 var(--font-display); letter-spacing: .04em;
  clip-path: polygon(0 0, 100% 0, 88% 25%, 100% 50%, 88% 75%, 100% 100%, 0 100%);
  padding-inline-end: 16px;
}
.wordmark .wm-s { font: italic 900 1.5rem/1 var(--font-display); letter-spacing: -.01em; padding: 4px 8px 0; text-transform: uppercase; }
html[dir="rtl"] .wordmark .wm-q { font: 900 1rem/1.2 "Cairo", sans-serif; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12% 75%, 0 50%, 12% 25%); padding-inline: 16px 10px; }
html[dir="rtl"] .wordmark .wm-s { font: 900 1.3rem/1.2 "Cairo", sans-serif; }

.main-nav { display: none; gap: 4px; margin-inline-start: 12px; }
.main-nav a {
  display: flex; align-items: center; height: 64px; padding: 0 14px;
  font: 800 1rem/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  border-bottom: 3px solid transparent; transition: color var(--dur);
}
html[dir="rtl"] .main-nav a { font: 700 1rem/1 "Cairo", sans-serif; letter-spacing: 0; }
.main-nav a:hover { color: var(--text); }
.main-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--red); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.lang-switch { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; font-weight: 800; border: 1.5px solid var(--line); }
.lang-switch:hover { border-color: var(--text); }
.avatar-btn { display: inline-flex; width: 44px; height: 44px; border: 2px solid var(--line); overflow: hidden; align-items: center; justify-content: center; background: var(--surface); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.header-post { display: none; }
@media (min-width: 900px) {
  .main-nav { display: flex; }
  .header-post { display: inline-flex; }
}

/* ---------- Mobile tab bar ------------------------------------------------------- */

.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: var(--z-tabbar);
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #050505; border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
html[dir="rtl"] .tabbar a { text-transform: none; letter-spacing: 0; font-size: 12px; }
.tabbar a[aria-current="page"] { color: var(--text); }
.tabbar a[aria-current="page"] .i { color: var(--red); }
.tabbar .tab-post { position: relative; }
.tabbar .tab-post .i { color: #fff !important; }
.tabbar .tab-post span.plus { display: flex; align-items: center; justify-content: center; width: 52px; height: 40px; background: var(--red); color: #fff; }
@media (min-width: 900px) { .tabbar { display: none; } }

/* ---------- Flash ------------------------------------------------------------------ */

.flash { border-inline-start: 6px solid var(--ok); background: var(--surface); padding: 14px 18px; margin: 16px 0; font-weight: 600; display: flex; gap: 12px; align-items: flex-start; }
.flash.is-error { border-color: var(--red); }
.flash .i { color: var(--ok); }
.flash.is-error .i { color: var(--red); }

/* ---------- Hero ----------------------------------------------------------------------- */

.hero { position: relative; min-height: min(calc(100svh - 64px), 900px); display: flex; align-items: flex-end; overflow: hidden; background: var(--bg-2); isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,10,10,.15) 0%, rgba(10,10,10,0) 30%, rgba(10,10,10,.55) 58%, rgba(10,10,10,.85) 85%, var(--bg) 100%); }
.hero-body { width: 100%; padding-block: 96px clamp(56px, 14svh, 150px); padding-inline-start: calc(var(--gutter) + clamp(28px, 4vw, 56px) + 12px); padding-inline-end: var(--gutter); max-width: var(--max); margin-inline: auto; }
.hero-title { text-shadow: 0 4px 40px rgba(0,0,0,.5); overflow-wrap: anywhere; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 18px; font-weight: 600; }
.hero-meta .sep { width: 6px; height: 6px; background: var(--red); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

/* Typographic hero when there are no posts yet */
.hero-type { min-height: auto; padding-block: clamp(40px, 7vw, 96px) clamp(32px, 5vw, 64px); background: var(--bg); }
.hero-type .hero-body { padding-block: 0; }
.hero-type::after { display: none; }
.hero-type .stroke { -webkit-text-stroke: 2px var(--text); color: transparent; }

/* ---------- Sections ---------------------------------------------------------------------- */

.section { padding-block: clamp(48px, 8vw, 110px); }
.section-tight { padding-block: clamp(32px, 5vw, 64px); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: clamp(20px, 3vw, 36px); border-bottom: var(--rule); padding-bottom: 14px; }
.section-head .idx { font: italic 900 clamp(1rem, 2vw, 1.2rem) var(--font-display); color: var(--red); display: block; margin-bottom: 6px; }
.section-head a.more { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; white-space: nowrap; min-height: 44px; }
.section-head a.more:hover { color: var(--red); }

/* ---------- Post cards & grids ---------------------------------------------------------- */

.grid { display: grid; gap: 4px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 6px; } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.grid .is-big { grid-column: span 2; grid-row: span 2; }

.card { position: relative; display: block; background: var(--surface); overflow: hidden; aspect-ratio: 4 / 5; isolation: isolate; }
.card img, .card video { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
.card:hover img { transform: scale(1.04); }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.85)); z-index: 0; pointer-events: none; }
.card-body { position: absolute; inset-inline: 0; bottom: 0; padding: 12px; z-index: 1; }
.card-make { font: 600 11px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: #e7e2da; }
html[dir="rtl"] .card-make { font-family: "Cairo"; letter-spacing: 0; font-size: 12px; }
.card-title { font: italic 900 clamp(1.15rem, 2.4vw, 1.6rem)/.95 var(--font-display); text-transform: uppercase; margin-top: 3px; overflow-wrap: anywhere; }
html[dir="rtl"] .card-title { font: 900 1.1rem/1.25 "Cairo", sans-serif; }
.is-big .card-title { font-size: clamp(1.8rem, 5vw, 3.6rem); }
.card-by { font-size: 13px; color: #d9d4cc; margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-badges { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; gap: 6px; z-index: 1; }
.card-count { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 1; color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }

.card-ad { display: flex; flex-direction: column; justify-content: flex-end; background: var(--surface-2); }
.card-ad::after { background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.9)); }

/* Horizontal rails (featured strip, reels, events) */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(72%, 1fr); gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: thin; scrollbar-color: var(--maroon) transparent; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 700px) { .rail { grid-auto-columns: minmax(40%, 1fr); } }
@media (min-width: 1100px) { .rail { grid-auto-columns: calc((100% - 16px) / 3); } }
.rail-reels { grid-auto-columns: 46%; }
@media (min-width: 700px) { .rail-reels { grid-auto-columns: 26%; } }
@media (min-width: 1100px) { .rail-reels { grid-auto-columns: calc((100% - 40px) / 6); } }
.card-reel { aspect-ratio: 9 / 16; }
.card-reel .play { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 1; color: #fff; }

.featured-band { background: var(--bg-2); border-block: 1px solid var(--line); }
.featured-band .section-head { border-bottom-color: var(--gold); }
.featured-band .section-head .idx { color: var(--gold); }

/* ---------- CTA band --------------------------------------------------------------------- */

.cta-band { position: relative; overflow: hidden; color: #fff; }
.cta-band .wrap { position: relative; padding-block: clamp(56px, 10vw, 140px); display: grid; gap: 28px; }
@media (min-width: 900px) { .cta-band .wrap { grid-template-columns: 1.4fr 1fr; align-items: end; } }
.cta-band p { font-size: 1.15rem; max-width: 46ch; color: #f6e9ed; margin: 0 0 22px; }

/* ---------- Marques index ------------------------------------------------------------------ */

.marques { list-style: none; margin: 0; padding: 0; border-top: var(--rule); }
.marques li { border-bottom: 1px solid var(--line); }
.marques a { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 4px; transition: background var(--dur), color var(--dur), padding var(--dur); }
.marques a:hover { background: var(--maroon); color: #fff; padding-inline: 16px; }
.marques .name { font: italic 900 clamp(2rem, 7vw, 5rem)/.9 var(--font-display); text-transform: uppercase; letter-spacing: -.01em; }
html[dir="rtl"] .marques .name { font: 900 clamp(1.8rem, 6vw, 4rem)/1.2 "Cairo"; }
.marques .meta { font: 500 12px var(--font-mono); letter-spacing: .1em; color: var(--muted); text-align: end; white-space: nowrap; }
.marques a:hover .meta { color: #fff; }

/* ---------- FAQ accordion (homepage, AIO/GEO-friendly: fully visible to crawlers) -------------- */

.faq { border-top: var(--rule); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 2px; font: 800 1.15rem/1.3 var(--font-display); text-transform: uppercase; letter-spacing: .01em;
}
html[dir="rtl"] .faq-item summary { font: 800 1.1rem/1.4 "Cairo", sans-serif; text-transform: none; letter-spacing: 0; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chev { flex: none; transition: transform var(--dur) var(--ease-out); color: var(--muted); }
.faq-item[open] summary .chev { transform: rotate(180deg); color: var(--text); }
.faq-item summary:hover { color: var(--maroon-ink); }
.faq-item p { margin: 0 0 20px; max-width: 70ch; color: #d8d3cb; }

/* ---------- Spec sheet --------------------------------------------------------------------- */

.specs { display: grid; grid-template-columns: repeat(2, 1fr); border-top: var(--rule); }
@media (min-width: 700px) { .specs { grid-template-columns: repeat(4, 1fr); } }
.spec { padding: 18px 12px 18px 0; border-bottom: 1px solid var(--line); }
html[dir="rtl"] .spec { padding: 18px 0 18px 12px; }
.spec dt { font: 500 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
html[dir="rtl"] .spec dt { font-family: "Cairo"; letter-spacing: 0; font-size: 12px; }
.spec dd { margin: 6px 0 0; font: italic 900 clamp(1.8rem, 4vw, 3rem)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.spec dd small { font: 700 .9rem var(--font-body); color: var(--muted); font-style: normal; margin-inline-start: 4px; }
.spec-wide { grid-column: 1 / -1; }
.spec-wide dd { font: 600 1.1rem/1.4 var(--font-body); }

/* ---------- Post page ----------------------------------------------------------------------- */

.post-layout { display: grid; gap: 28px; }
@media (min-width: 1000px) { .post-layout { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 48px; align-items: start; } }
.gallery { display: grid; gap: 4px; }
.gallery figure { margin: 0; background: #000; }
.gallery img { width: 100%; max-height: 88vh; object-fit: contain; }
.post-aside { position: sticky; top: 84px; display: grid; gap: 22px; }
.byline { display: flex; align-items: center; gap: 12px; }
.avatar { width: 48px; height: 48px; object-fit: cover; background: var(--surface-2); flex: none; border: 2px solid var(--text); display: inline-flex; align-items: center; justify-content: center; font: 900 1.2rem var(--font-display); }
.avatar-xl { width: clamp(96px, 18vw, 160px); height: clamp(96px, 18vw, 160px); border-width: 4px; font-size: 3rem; }
.facts { display: grid; gap: 0; border-top: 2px solid var(--text); margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; text-align: end; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.caption { font-size: 1.08rem; white-space: normal; overflow-wrap: anywhere; }
.caption a { color: var(--maroon-ink); font-weight: 600; }

.player { position: relative; background: #000; aspect-ratio: 9/16; max-height: 86vh; margin-inline: auto; }
.player video { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Reels (full-screen vertical feed) ------------------------------------------------- */

body.is-reels { padding-bottom: 0; background: #000; }
body.is-reels .site-footer { display: none; }
.reels { height: calc(100dvh - 64px - var(--tabbar-h) - env(safe-area-inset-bottom)); overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.reels::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .reels { height: calc(100dvh - 64px); } }
.reel { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; justify-content: center; background: #000; }
.reel video { height: 100%; width: 100%; max-width: calc((100dvh - 64px) * 9 / 16); object-fit: cover; background: #000; }
.reel-ui { position: absolute; inset: 0; max-width: calc((100dvh - 64px) * 9 / 16); margin-inline: auto; pointer-events: none; display: flex; align-items: flex-end; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.75)); }
.reel-info { padding: 18px; padding-inline-end: 76px; pointer-events: auto; }
.reel-info .card-title { font-size: clamp(1.6rem, 6vw, 2.4rem); }
.reel-actions { position: absolute; inset-inline-end: 10px; bottom: 24px; display: grid; gap: 14px; pointer-events: auto; }
.reel-actions button, .reel-actions a { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); border: 1.5px solid rgba(255,255,255,.35); color: #fff; }
.reel-actions button:hover, .reel-actions a:hover { background: var(--red); border-color: var(--red); }
.reel-tap { position: absolute; inset: 0; pointer-events: auto; background: transparent; border: 0; }
.reel-ad { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 24px; }
.reel-ad img { max-height: 55%; width: auto; }

/* ---------- Profile ----------------------------------------------------------------------- */

.profile-cover { position: relative; height: clamp(160px, 28vw, 360px); background: var(--maroon); overflow: hidden; }
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-cover.sadu::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(10,10,10,.6)); }
.profile-head { display: grid; gap: 18px; margin-top: calc(clamp(96px, 18vw, 160px) / -2); position: relative; z-index: 1; }
@media (min-width: 800px) { .profile-head { grid-template-columns: auto 1fr auto; align-items: end; } }
.profile-stats { display: flex; gap: 26px; }
.profile-stats b { display: block; font: italic 900 2rem/1 var(--font-display); }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-block: 28px 18px; overflow-x: auto; }
.tabs a { padding: 14px 18px; min-height: 48px; font: 800 1rem var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
html[dir="rtl"] .tabs a { font-family: "Cairo"; letter-spacing: 0; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--red); }

.garage { display: grid; gap: 6px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .garage { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .garage { grid-template-columns: repeat(3, 1fr); } }
.garage-card { display: grid; background: var(--surface); border: 1px solid var(--line); transition: border-color var(--dur); }
.garage-card:hover { border-color: var(--text); }
.garage-card .ph { aspect-ratio: 16/10; background: var(--surface-2) center/cover; display: flex; align-items: center; justify-content: center; color: var(--line); overflow: hidden; }
.garage-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.garage-card .bd { padding: 14px 16px 18px; }

/* ---------- Events --------------------------------------------------------------------------- */

.event-card { display: grid; grid-template-columns: 88px 1fr; gap: 0; background: var(--surface); border: 1px solid var(--line); min-height: 120px; transition: border-color var(--dur); }
.event-card:hover { border-color: var(--text); }
.event-date { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--maroon); color: #fff; text-align: center; padding: 10px; }
.event-date b { font: italic 900 2.6rem/.9 var(--font-display); }
.event-date span { font: 600 12px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
html[dir="rtl"] .event-date span { font-family: "Cairo"; letter-spacing: 0; }
.event-card .bd { padding: 16px 18px; display: grid; gap: 6px; align-content: center; }
.event-card h3 { font-size: clamp(1.3rem, 3vw, 1.7rem); }

/* ---------- Instagram strip ------------------------------------------------------------------ */

.ig-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
@media (min-width: 900px) { .ig-grid { grid-template-columns: repeat(8, 1fr); } }
.ig-grid a { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface); }
.ig-grid img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--dur); }
.ig-grid a:hover img { opacity: .7; }

/* ---------- Ads ------------------------------------------------------------------------------ */

.ad-banner { display: grid; grid-template-columns: 1fr; position: relative; background: var(--surface); border: 1px solid var(--line); }
.ad-banner img { width: 100%; aspect-ratio: 970 / 250; object-fit: cover; }
.ad-label { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 2; }

/* ---------- Forms ------------------------------------------------------------------------------ */

.form { display: grid; gap: 22px; }
.form-section { border-top: var(--rule); padding-top: 18px; display: grid; gap: 18px; }
.form-section > legend, .form-section > h2 { font-size: clamp(1.5rem, 3vw, 2rem); padding: 0; margin-bottom: 4px; }
/* Keep legends inside the section instead of straddling its top rule. */
.form-section > legend { float: inline-start; width: 100%; }
.form-section > legend + * { clear: both; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 700; font-size: .98rem; }
.field .req { color: var(--maroon-ink); }
.hint { color: var(--muted); font-size: .9rem; }
.error { color: #ff7a8f; font-weight: 600; font-size: .92rem; }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 12px 14px;
  background: var(--bg-2); border: 2px solid var(--line); border-radius: 0; color: var(--text);
  font-size: 16px; transition: border-color var(--dur);
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.select { background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-inline-end: 40px; }
html[dir="rtl"] .select { background-position: 16px 50%, 22px 50%; }
.input:hover, .select:hover, .textarea:hover { border-color: #444; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--text); outline: none; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--red); }
.row-2 { display: grid; gap: 18px; }
@media (min-width: 700px) { .row-2 { grid-template-columns: 1fr 1fr; } .row-3 { grid-template-columns: 1fr 1fr 1fr; } }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 10px 0; line-height: 1.45; }
.check input { width: 22px; height: 22px; accent-color: var(--red); flex: none; margin-top: 1px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--text); }
.seg label { position: relative; display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 56px; font: 800 1.05rem var(--font-display); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; text-align: center; padding: 6px 10px; }
html[dir="rtl"] .seg label { font-family: "Cairo"; letter-spacing: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--text); color: var(--bg); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: -6px; }
.error-summary { border: 3px solid var(--red); padding: 16px 18px; background: rgba(228,0,43,.08); }
.error-summary h2 { font-size: 1.4rem; margin-bottom: 6px; }
.error-summary ul { margin: 0; padding-inline-start: 18px; }
.auth-card { max-width: 520px; margin-inline: auto; padding-block: clamp(32px, 6vw, 80px); }
.progress { height: 6px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--red); transition: width 200ms linear; }

/* Dropzone + blur editor */
.dropzone { position: relative; display: grid; place-items: center; gap: 10px; min-height: 220px; padding: 28px; text-align: center; border: 3px dashed #3a3a3a; background: var(--bg-2); cursor: pointer; transition: border-color var(--dur), background var(--dur); }
.dropzone:hover, .dropzone.is-over { border-color: var(--red); background: #160b0e; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.editors { display: grid; gap: 18px; }
.editor { border: 1px solid var(--line); background: var(--bg-2); }
.editor-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.editor-bar .spacer { flex: 1; }
.editor-stage { position: relative; user-select: none; -webkit-user-select: none; touch-action: none; cursor: crosshair; line-height: 0; }
.editor-stage img { width: 100%; height: auto; pointer-events: none; }
.bbox { position: absolute; border: 2px solid var(--warn); background: rgba(255,176,32,.12); touch-action: none; cursor: move; }
.bbox.src-user, .bbox.src-admin { border-color: #3ea6ff; background: rgba(62,166,255,.12); }
.editor.is-preview .bbox { border-color: transparent; background: transparent; backdrop-filter: blur(14px) saturate(.6); -webkit-backdrop-filter: blur(14px) saturate(.6); }
.editor.is-preview .bbox > * { display: none; }
.bbox-del { position: absolute; top: -14px; inset-inline-end: -14px; width: 28px; height: 28px; background: var(--red); color: #fff; border: 0; display: flex; align-items: center; justify-content: center; line-height: 1; }
.bbox-resize { position: absolute; width: 22px; height: 22px; inset-inline-end: -11px; bottom: -11px; background: #fff; border: 2px solid #000; cursor: nwse-resize; }
html[dir="rtl"] .bbox-resize { cursor: nesw-resize; }
.legend-dot { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-inline-end: 4px; }

/* ---------- Footer ------------------------------------------------------------------------------ */

.site-footer { border-top: 1px solid var(--line); margin-top: clamp(48px, 8vw, 100px); }
.site-footer .zigzag { margin-top: -1px; }
.footer-grid { display: grid; gap: 32px; padding-block: 48px 32px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer-grid h4 { font: 700 12px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
html[dir="rtl"] .footer-grid h4 { font-family: "Cairo"; letter-spacing: 0; font-size: 13px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer-grid li a { display: inline-flex; min-height: 36px; align-items: center; }
.footer-grid li a:hover { color: var(--red); }
.footer-legal { border-top: 1px solid var(--line); padding-block: 20px 28px; font-size: 13px; color: var(--muted); display: grid; gap: 8px; }

.announce { background: var(--maroon); color: #fff; font-weight: 700; font-size: .95rem; text-align: center; padding: 9px 0; }
.announce a { display: inline-flex; gap: 6px; align-items: center; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Likes ---------------------------------------------------------------------------- */

.like-btn[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.like-btn[aria-pressed="true"] svg { fill: currentColor; }
.like-btn.is-pop svg { animation: pop 300ms var(--ease-out); }
@keyframes pop { 50% { transform: scale(1.35); } }
.like-reel { flex-direction: column; gap: 2px; font-size: 12px; font-weight: 700; }
.reel-actions .like-reel { height: auto; min-height: 52px; padding: 6px 0; }
.card-likes { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: auto; font-weight: 700; }
.card-likes svg { fill: currentColor; color: var(--red); }

/* ---------- Reactions & comments ------------------------------------------------------------- */

.engage { display: grid; gap: 22px; border-top: 2px solid var(--text); padding-top: 18px; }
.reactions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.reaction { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; padding: 8px 4px; background: var(--bg-2); border: 1.5px solid var(--line); color: var(--text); transition: border-color var(--dur), background var(--dur); touch-action: manipulation; }
.reaction:hover { border-color: var(--text); }
.reaction[aria-pressed="true"] { border-color: var(--red); background: rgba(228,0,43,.12); }
.reaction .emoji { font-size: 1.35rem; line-height: 1; }
.reaction .r-label { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.reaction b { font-size: 13px; min-height: 1em; }
.reaction.is-pop .emoji { animation: pop 300ms var(--ease-out); }
.comments { display: grid; gap: 14px; }
.comments-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comment { display: grid; grid-template-columns: 36px 1fr; gap: 10px; }
.comment-avatar { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); font-weight: 900; overflow: hidden; }
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: .9rem; }
.comment-body p { margin: 4px 0 0; overflow-wrap: anywhere; }
.comment-actions { display: flex; gap: 14px; align-items: center; margin-top: 4px; font-size: .85rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; min-height: 24px; }
.linkish:hover { color: var(--text); }
.comment-report summary { list-style: none; }
.comment-report summary::-webkit-details-marker { display: none; }
.inline-report { display: flex; gap: 6px; margin-top: 6px; }
.inline-report .select { min-height: 40px; padding-block: 4px; width: auto; font-size: 14px; }
.comment-form { display: grid; gap: 8px; }
.comment-form .textarea { min-height: 72px; }
.comment-form-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.reel-actions a.like-reel { display: flex; flex-direction: column; gap: 2px; font-size: 12px; font-weight: 700; height: auto; min-height: 52px; padding: 6px 0; }

/* ---------- Misc -------------------------------------------------------------------------------- */

.empty { border: 2px dashed var(--line); padding: clamp(32px, 6vw, 64px); text-align: center; display: grid; gap: 14px; justify-items: center; }
.empty .display { color: var(--muted); }
.load-more { display: flex; justify-content: center; margin-top: 28px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.status::before { content: ""; width: 9px; height: 9px; background: var(--muted); }
.status-approved::before { background: var(--ok); }
.status-pending::before, .status-draft::before { background: var(--warn); }
.status-rejected::before, .status-hidden::before { background: var(--red); }
.table-list { width: 100%; border-collapse: collapse; }
.table-list th, .table-list td { text-align: start; padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-list th { font: 600 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
details.report summary { cursor: pointer; display: inline-flex; gap: 8px; align-items: center; color: var(--muted); min-height: 44px; font-weight: 600; }
details.report summary:hover { color: var(--text); }
details.report[open] summary { color: var(--text); }
.notice-banner { background: var(--warn); color: #111; padding: 12px 0; font-weight: 700; }
.notice-banner a { text-decoration: underline; }
.install-hint { position: fixed; inset-inline: 12px; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); z-index: var(--z-overlay); background: var(--text); color: var(--bg); padding: 14px 16px; display: flex; gap: 12px; align-items: center; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.install-hint[hidden] { display: none; }
@media (min-width: 900px) { .install-hint { inset-inline: auto 24px; bottom: 24px; max-width: 380px; } }

/* Fade-in is an enhancement only: content is visible unless JS has opted in (html.js-anim). */
html.js-anim .reveal { transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
html.js-anim .reveal:not(.is-in) { opacity: 0; transform: translateY(18px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  html.js-anim .reveal:not(.is-in) { opacity: 1; transform: none; }
  .card:hover img { transform: none; }
}
