﻿/* ====== Alssaa News — Design Tokens ====== */
/* Fonts are self-hosted — see fonts.css, linked before this file in
   partials/alssaa-head.blade.php. (Replaced a render-blocking Google Fonts
   @import that pulled 6 families; only the 4 actually rendered — IBM Plex
   Sans Arabic, Tajawal, Inter, Cairo — are now shipped, arabic+latin subsets.) */

:root {
  /* Brand palette */
  --navy:        #222963;
  --navy-900:    #171c48;
  --navy-700:    #2e3885;
  --cyan:        #00A3C6;
  --green:       #00B87D;
  --orange:      #FD8A24;
  --orange-soft: #FFBC48;
  --yellow:      #FFC800;
  --red:         #c31933;
  --purple:      #7B5AA6;

  /* Header themes */
  --theme-v1:    #091767;   /* deep indigo navy     — root (/)   */

  /* Semantic */
  --primary:      var(--navy);
  --primary-ink:  #ffffff;
  --live:         #e11d48;
  --accent:       var(--orange);

  /* Card hover (unified across root-route cards) */
  --card-zoom:    1.04;                 /* image-zoom amount on hover */
  --card-zoom-t:  transform .4s ease;   /* image-zoom transition      */

  /* Row-thumbnail scale (desktop).
     Every "thumb + title + timestamp" row on the homepage takes its width
     from one of these two; the height follows from --ar-photo. Two steps,
     1.67x apart, so a size difference reads as rank rather than as drift —
     the pairs this replaced (78/96 and 150/168) were too close to tell apart.
     Companion knobs to --ar-photo and --r-photo in home.css. */
  --thumb-row:    112px;  /* rows in a narrow column — آخر الأخبار aside (16:9 → ~63px tall) */
  --thumb-row-lg: 160px;  /* rows in a wide column — category lead/list rows */
  /* Mobile collapses both of the above to ONE small-thumb width: every
     "thumb + headline" row (آخر الأخبار, category/lead list rows, data-
     journalism rows) reads at the same 137px (16:9 → ~77px). Single source of
     truth — change here, not in each component. The switcher rail borrows it
     too (card = thumb + 8px padding). Matched to BBC mobile sub-story thumbs. */
  --thumb-row-sm: 137px;

  /* Neutrals */
  --ink:         #111428;
  --ink-2:       #2a2e45;
  --muted:       #636C76;
  --muted-2:     #8a93a0;
  /* Card metadata + long subtext (homepage / أمنية list standard) */
  --meta:        #545658;
  --excerpt:     #202224;
  --line:        #E5E7ED;
  --line-2:      #B1BAC5;
  --surface:     #ffffff;
  --surface-2:   #faf9f5;   /* warm cream — light fill   */
  --surface-3:   #f3f1ec;   /* warm cream — section band */

  /* Type */
  --f-display: 'IBM Plex Sans Arabic', 'Tajawal', system-ui, sans-serif;
  --f-body:    'IBM Plex Sans Arabic', 'Tajawal', system-ui, sans-serif;
  --f-num:     'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;

  /* Radius / shadow */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --sh-1: 0 1px 2px rgba(17,20,40,.06), 0 1px 0 rgba(17,20,40,.03);
  --sh-2: 0 4px 18px rgba(17,20,40,.08);

  /* Density */
  --density: 1;
}

[data-density="compact"] { --density: .82; }
[data-density="comfy"]   { --density: 1.12; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { direction: rtl; overflow-x: hidden; }
body {
  font-family: var(--f-body);
  background: #fff;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "ss01";
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }
main,
section,
header,
footer,
.container {
  max-width: 100%;
}

/* Utility */
.container { max-width: 1320px; margin: 0 auto; padding: 0 28px; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  color: var(--primary); text-transform: none;
}
/* Card metadata: relative time / source · time (BBC treatment) */
.meta {
  font-size: 12px;
  color: var(--meta);
  font-weight: 400;
  letter-spacing: -0.12px;
  font-family: var(--f-body);
}
/* Long subtext / excerpt under a headline (matches homepage أمنية / تقارير) */
.excerpt,
.dek {
  font-size: 14.5px;
  color: var(--excerpt);
  line-height: 1.65;
  font-family: var(--f-body);
}
.kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--primary);
  padding: 4px 10px; border-radius: 999px;
  background: color-mix(in oklab, var(--primary) 10%, white);
}
.kicker.red    { color: white; background: var(--red); }
.kicker.orange { color: #2a1a00; background: var(--yellow); }
.kicker.live   {
  color: white; background: var(--live);
  padding-inline-start: 18px; position: relative;
}
.kicker.live::before {
  content: ""; position: absolute; inset-inline-start: 8px; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: white; transform: translateY(-50%);
  box-shadow: 0 0 0 0 rgba(255,255,255,.8);
  animation: livepulse 1.6s infinite;
}
@keyframes livepulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.8); }
  70%  { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.divider { height: 1px; background: var(--line); }
.rule-heavy { height: 3px; background: var(--primary); }

@media (max-width: 900px) {
  :root { --density: .92; }
  body { overflow-x: hidden; }
  .container { padding: 0 16px; }
  .section-head {
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
  }
  .section-head h2 { font-size: 20px; line-height: 1.35; }
  .section-head .more { font-size: 12.5px; }
  .card.big h3 { font-size: 22px; }
  .chip { max-width: 100%; }
  .ph-title { max-width: 100%; overflow-wrap: anywhere; }
}

/* Placeholder artwork — colorful editorial tiles */
.ph {
  position: relative;
  overflow: hidden;
  background: var(--surface-3);
  display: flex; align-items: flex-end;
  color: white;
  isolation: isolate;
}
.ph::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 90% 10%, rgba(255,255,255,.22), transparent 55%),
    radial-gradient(80% 60% at 10% 110%, rgba(0,0,0,.35), transparent 60%);
  z-index: 0;
}
.ph::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 24px 24px;
  z-index: 0;
  mix-blend-mode: overlay;
  opacity: .6;
}
.ph > .ph-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.ph > .ph-inner { position: relative; z-index: 1; padding: 18px 22px; width: 100%; }
.ph .ph-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  background: rgba(255,255,255,.16); backdrop-filter: blur(6px);
  padding: 4px 10px; border-radius: 4px; display: inline-block;
  margin-bottom: 10px;
}
.ph .ph-title {
  font-family: var(--f-display); font-weight: 700;
  font-size: 20px; line-height: 1.3;
  text-shadow: 0 2px 18px rgba(0,0,0,.25);
  max-width: 90%;
}

/* Color variants */
.ph.navy   { background: linear-gradient(135deg, #2b348a, #171c48); }
.ph.cyan   { background: linear-gradient(135deg, #0cc3eb, #007390); }
.ph.green  { background: linear-gradient(135deg, #14d48f, #046f4a); }
.ph.orange { background: linear-gradient(135deg, #ffa349, #c45d00); }
.ph.red    { background: linear-gradient(135deg, #ef6d65, #8f2a23); }
.ph.pink   { background: linear-gradient(135deg, #d477a4, #7a2e5a); }
.ph.purple { background: linear-gradient(135deg, #8d6fb8, #4a3275); }
.ph.yellow { background: linear-gradient(135deg, #ffd83d, #b08300); color: #2a1a00; }
.ph.yellow .ph-tag { background: rgba(0,0,0,.1); color: #2a1a00; }

/* Real image override — add data-img="URL" to any .ph */
.ph[data-img] { background-size: cover; background-position: center; }
.ph[data-img]::before {
  background:
    linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.2) 45%, rgba(0,0,0,0) 70%),
    radial-gradient(120% 80% at 90% 10%, rgba(255,255,255,.15), transparent 55%);
}
.ph[data-img]::after { display: none; }
.ph[data-img] .ph-tag { background: rgba(0,0,0,.45); color: white; }

/* Numbers/latin inside Arabic */
.num { font-family: var(--f-num); font-feature-settings: "tnum"; }

/* Focus */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

/* Scrollbar nicety */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c5ccd6; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ba3b0; }
