:root {
  --red: #c8102e;
  --red-dark: #9e0c24;
  --navy: #0f1d33;
  --navy-2: #182a47;
  --gold: #f5b700;
  --ink: #16181d;
  --muted: #5b6475;
  --line: #e3e6eb;
  --bg: #f5f6f8;
  --card: #fff;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --latin: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --arabic: 'Cairo', 'Segoe UI', Tahoma, 'Geeza Pro', sans-serif;
}
/* Arabic: Cairo for headlines and interface, Noto Naskh Arabic for reading text. */
[lang="ar"] {
  --serif: 'Cairo', 'Segoe UI', Tahoma, 'Geeza Pro', sans-serif;
  --sans: 'Cairo', 'Segoe UI', Tahoma, 'Geeza Pro', sans-serif;
  --body: 'Noto Naskh Arabic', 'Traditional Arabic', 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--sans); color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }
img { display: block; max-width: 100%; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* top bar */
.topbar { background: var(--navy); color: #c9d1de; font-size: 12.5px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 32px; }
.topbar-links a { margin-inline-start: 18px; color: #fff; }
.lang-switch { border: 1px solid rgba(255,255,255,.35); border-radius: 4px; padding: 1px 8px; }
.topbar-links a:hover { color: var(--gold); }

/* masthead */
.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand:hover { color: inherit; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-main { font: 700 32px/1 var(--serif); color: var(--navy); letter-spacing: .5px; }
.brand-main em { font-style: normal; color: var(--red); }
.brand-sub { font: 700 18px/1.4 var(--arabic); color: var(--muted); margin-top: 4px; }
[dir="rtl"] .brand-main { font: 800 40px/1.15 var(--arabic); letter-spacing: 0; }
[dir="rtl"] .brand-sub { font: 600 13px/1.4 var(--latin); letter-spacing: 2.5px; margin-top: 2px; }
.search { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg); }
.search input { border: 0; background: transparent; padding: 9px 16px; font: inherit; width: 230px; outline: none; }
.search button { border: 0; background: var(--red); color: #fff; padding: 0 16px; cursor: pointer; font: 600 14px var(--sans); }
.search button:hover { background: var(--red-dark); }

/* main nav */
.mainnav { background: var(--red); position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.mainnav-inner { display: flex; overflow-x: auto; scrollbar-width: none; }
.mainnav-inner::-webkit-scrollbar { display: none; }
.mainnav a { color: #fff; font: 600 14px var(--sans); padding: 13px 16px; white-space: nowrap; text-transform: uppercase; letter-spacing: .4px; }
.mainnav a:hover, .mainnav a.active { background: var(--red-dark); color: #fff; }
.mainnav a.active { box-shadow: inset 0 -3px 0 var(--gold); }

/* breaking ticker */
.ticker { background: #fff; border-bottom: 1px solid var(--line); }
.ticker-inner { display: flex; align-items: center; gap: 14px; height: 42px; overflow: hidden; }
.ticker-label { flex: none; background: var(--navy); color: var(--gold); font: 700 12px var(--sans); text-transform: uppercase; letter-spacing: 1px; padding: 5px 10px; border-radius: 3px; }
.ticker-track { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.ticker-items { display: flex; gap: 48px; width: max-content; animation: ticker 45s linear infinite; }
.ticker-items a { font-weight: 600; white-space: nowrap; }
.ticker-items a::before { content: '●'; color: var(--red); margin-inline-end: 10px; font-size: 10px; vertical-align: 2px; }
.ticker:hover .ticker-items { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
[dir="rtl"] .ticker-items { animation-name: ticker-rtl; }
@keyframes ticker-rtl { to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-items { animation: none; } }

/* layout */
.page { padding-top: 24px; padding-bottom: 40px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; }
.kicker { display: inline-block; font: 700 11.5px var(--sans); text-transform: uppercase; letter-spacing: .8px; color: var(--c, var(--red)); }
.meta { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.empty { background: #fff; padding: 24px; border-radius: 8px; color: var(--muted); }
.btn { display: inline-block; background: var(--red); color: #fff; padding: 10px 18px; border-radius: 6px; font-weight: 600; }
.btn:hover { background: var(--red-dark); color: #fff; }

/* lead story */
.lead { display: grid; grid-template-columns: 1.35fr 1fr; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(15,29,51,.08); }
.lead-img img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; aspect-ratio: 16/10; }
.lead-body { padding: 26px 26px 22px; display: flex; flex-direction: column; justify-content: center; }
.lead h1 { font: 700 30px/1.18 var(--serif); margin: 8px 0 12px; }
.lead-excerpt { color: #3a4150; margin: 0 0 8px; font-size: 16px; }

/* cards */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.top-stories { margin-top: 20px; }
.card { background: var(--card); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(15,29,51,.08); display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,29,51,.12); }
.card-img img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.card-body { padding: 12px 14px 14px; }
.card h3 { font: 700 16.5px/1.28 var(--serif); margin: 5px 0 0; }
.card-excerpt { color: #3a4150; font-size: 14px; margin: 6px 0 0; }

.section-block { margin-top: 34px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; font: 700 21px var(--serif); border-bottom: 2px solid var(--line); margin: 0 0 16px; padding-bottom: 8px; position: relative; }
.section-title::after { content: ''; position: absolute; inset-inline-start: 0; bottom: -2px; width: 72px; height: 3px; background: var(--c, var(--red)); }
.section-more { font: 600 13px var(--sans); color: var(--muted); }

/* sidebar */
.sidebar { display: flex; flex-direction: column; gap: 22px; }
.side-box { background: var(--card); border-radius: 8px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(15,29,51,.08); }
.side-title { font: 700 13px var(--sans); text-transform: uppercase; letter-spacing: 1px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 3px solid var(--red); }
.side-latest, .side-popular { list-style: none; margin: 0; padding: 0; }
.side-latest li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.side-latest li:last-child { border-bottom: 0; }
.side-latest time { display: block; color: var(--red); font-size: 11.5px; font-weight: 600; }
.side-latest a { font: 600 14.5px/1.35 var(--serif); }
.side-more { display: block; margin-top: 6px; font-weight: 600; font-size: 13px; color: var(--red); }
.side-popular li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.side-popular li:last-child { border-bottom: 0; }
.rank { font: 700 26px/1 var(--serif); color: var(--gold); min-width: 22px; }
.side-popular a { font: 600 14.5px/1.35 var(--serif); }

/* list pages */
.page-title { font: 700 30px var(--serif); margin: 0 0 20px; padding-inline-start: 14px; border-inline-start: 5px solid var(--c, var(--red)); }
.search-big { border-radius: 8px; margin-bottom: 20px; background: #fff; }
.search-big input { width: 100%; padding: 12px 16px; }
.list { display: flex; flex-direction: column; gap: 16px; }
.list-item { display: grid; grid-template-columns: 240px 1fr; gap: 18px; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(15,29,51,.08); }
.list-item > div { padding-block: 14px; padding-inline: 0 16px; }
.list-img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16/10; }
.list-item h2 { font: 700 20px/1.25 var(--serif); margin: 4px 0 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 24px; }
.pager a { background: #fff; padding: 8px 14px; border-radius: 6px; font-weight: 600; border: 1px solid var(--line); }

/* article page */
.story { background: #fff; border-radius: 10px; padding: 26px 32px 32px; box-shadow: 0 1px 3px rgba(15,29,51,.08); }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.story-title { font: 700 36px/1.15 var(--serif); margin: 8px 0 12px; }
.story-summary { font-size: 18.5px; color: #3a4150; margin: 0 0 16px; }
.story-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13.5px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.byline strong { color: var(--ink); }
.story-figure { margin: 22px 0; }
.story-figure img { width: 100%; border-radius: 6px; }
.story-figure figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; }
.story-body { font: 18px/1.72 var(--body, var(--serif)); margin-top: 22px; }
.story-body p { margin: 0 0 1.1em; }
.share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.share a { background: var(--bg); padding: 7px 14px; border-radius: 999px; }
.share a:hover { background: var(--red); color: #fff; }
.copy-link { background: var(--navy); color: #fff; border: 0; padding: 7px 14px; border-radius: 999px; font: inherit; cursor: pointer; }
.copy-link:hover { background: var(--red); }
.notfound { background: #fff; border-radius: 10px; padding: 32px; }

/* footer */
.footer { background: var(--navy); color: #c9d1de; margin-top: 20px; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; padding-top: 32px; padding-bottom: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; gap: 14px; max-width: 460px; }
.footer-brand strong { color: #fff; font: 700 18px var(--serif); }
.footer-alt { color: var(--gold); margin-inline-start: 6px; }
.footer-brand p { margin: 6px 0 0; font-size: 13.5px; }
.footer-links { display: grid; grid-template-columns: repeat(4, auto); gap: 8px 26px; font-size: 14px; }
.footer-links a:hover { color: var(--gold); }
.footer-copy { border-top: 1px solid var(--navy-2); padding-top: 14px; padding-bottom: 20px; font-size: 12.5px; }

/* responsive */
@media (max-width: 1060px) {
  .layout { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .masthead-inner { flex-direction: column; align-items: stretch; }
  .search input { width: 100%; }
  .search { width: 100%; }
  .brand-main { font-size: 25px; }
  .lead { grid-template-columns: 1fr; }
  .lead-img img { min-height: 0; }
  .lead h1 { font-size: 24px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .list-item { grid-template-columns: 1fr; }
  .list-item > div { padding: 0 16px 16px; }
  .story { padding: 20px 18px; }
  .story-title { font-size: 27px; }
  .story-body { font-size: 17px; }
  .footer-links { grid-template-columns: repeat(2, auto); }
  .topbar-inner span:first-child { font-size: 11.5px; }
}
@media (max-width: 480px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
}

/* ---- right-to-left (Arabic) adjustments ---- */
/* Letter-spacing and uppercase break Arabic letter joining. */
[dir="rtl"] .mainnav a, [dir="rtl"] .kicker, [dir="rtl"] .ticker-label, [dir="rtl"] .side-title { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .mainnav a { font-size: 15.5px; padding: 11px 16px; }
[dir="rtl"] .kicker { font-size: 13px; }
[dir="rtl"] .ticker-label { font-size: 13.5px; padding: 3px 12px; }
[dir="rtl"] .side-title { font-size: 16px; }
[dir="rtl"] .lead h1 { font-size: 29px; line-height: 1.4; }
[dir="rtl"] .card h3 { font-size: 16.5px; line-height: 1.5; }
[dir="rtl"] .list-item h2 { line-height: 1.45; }
[dir="rtl"] .story-title { line-height: 1.4; }
[dir="rtl"] .story-body { font-size: 20px; line-height: 1.95; }
[dir="rtl"] .side-latest a, [dir="rtl"] .side-popular a { font-size: 14.5px; line-height: 1.6; }
[dir="rtl"] .card-excerpt, [dir="rtl"] .lead-excerpt, [dir="rtl"] .story-summary { line-height: 1.8; }
[dir="rtl"] .section-title { font-size: 22px; }
[dir="rtl"] .crumbs .sep { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .footer-brand strong { font-size: 20px; }
@media (max-width: 760px) {
  [dir="rtl"] .brand-main { font-size: 31px; }
  [dir="rtl"] .lead h1 { font-size: 23px; }
  [dir="rtl"] .story-title { font-size: 26px; }
  [dir="rtl"] .story-body { font-size: 18.5px; }
}
