:root {
  --bg: #f5f7fb;
  --bg-elev: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0b3d91;
  --brand-2: #123e7a;
  --accent: #c8102e;
  --accent-soft: #ffe4e8;
  --chip: #2563eb;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --font: "IBM Plex Sans Arabic", "Noto Naskh Arabic", Tahoma, sans-serif;
  --header-h: 64px;
  --topbar-h: 40px;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --bg-elev: #111827;
  --ink: #e5eefc;
  --muted: #94a3b8;
  --line: #243244;
  --brand: #7db0ff;
  --brand-2: #93c5fd;
  --accent: #fb7185;
  --accent-soft: #3f1d24;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.container { width: min(1200px, calc(100% - 2rem)); margin: 0 auto; }

/* Top bar */
.topbar {
  background: #0b1f3a;
  color: #dbe7f8;
  font-size: 0.86rem;
  min-height: var(--topbar-h);
}
.topbar-inner,
.header-inner,
.breaking-inner,
.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: inherit;
}
.topbar-actions { display: flex; align-items: center; gap: 0.85rem; }
.topbar a { color: #dbe7f8; text-decoration: none; }
.lang-switch a {
  margin-inline-start: 0.55rem;
  font-weight: 600;
  opacity: 0.8;
}
.lang-switch a.active { opacity: 1; color: #fff; border-bottom: 2px solid var(--accent); }
.social-mini { display: flex; gap: 0.45rem; }
.social-mini a,
.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 0;
  background: rgba(255,255,255,0.08);
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
.site-header .icon-btn {
  background: #eef2ff;
  color: var(--brand);
}
html[data-theme="dark"] .site-header .icon-btn {
  background: #1e293b;
  color: var(--brand);
}

/* Header + nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
html[data-theme="dark"] .site-header { background: rgba(17,24,39,0.96); }
.header-inner { min-height: var(--header-h); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--brand);
}
.brand-logo { max-height: 46px; width: auto; max-width: min(240px, 50vw); object-fit: contain; }
.brand-mark {
  background: linear-gradient(135deg, #0b3d91, #c8102e);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  font-size: 1.05rem;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.35rem; letter-spacing: 0.04em; }
.brand-text small { color: var(--muted); font-size: 0.75rem; }
.header-tools { display: flex; gap: 0.45rem; }

.main-nav {
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
}
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.25rem;
}
.main-nav a {
  display: block;
  padding: 0.75rem 0.85rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--brand);
  border-bottom-color: var(--accent);
}

/* Breaking ticker */
.breaking-bar {
  background: var(--accent);
  color: #fff;
}
.breaking-inner { min-height: 42px; gap: 0.75rem; }
.breaking-label {
  flex: 0 0 auto;
  background: rgba(0,0,0,0.18);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
  white-space: nowrap;
}
.breaking-track { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.breaking-marquee {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: ticker 38s linear infinite;
}
.breaking-marquee a {
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
html[dir="rtl"] .breaking-marquee { animation-name: ticker-rtl; }
@keyframes ticker-rtl {
  from { transform: translateX(0); }
  to { transform: translateX(50%); }
}

.site-main { padding: 1.4rem 0 3.5rem; }

/* Hero bento */
.hero-bento {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
  min-height: 420px;
}
.hero-feature,
.hero-card,
.recent-media,
.most-thumb,
.video-main,
.video-thumb {
  background-color: #1e293b;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
}
.card-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  display: block;
}
.hero-feature-overlay,
.hero-card-overlay,
.recent-media .cat-chip,
.recent-media .img-source-bar,
.hero-feature .img-source-bar,
.hero-card .img-source-bar,
.video-caption,
.play-btn,
.video-thumb > i {
  position: relative;
  z-index: 2;
}
.hero-feature::after,
.hero-card::after,
.recent-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(8, 15, 30, 0.15) 20%, rgba(8, 15, 30, 0.82) 100%);
  pointer-events: none;
}
.hero-feature.no-image,
.hero-card.no-image,
.recent-media.no-image,
.most-thumb.no-image,
.video-main.no-image,
.video-thumb.no-image {
  background-image:
    linear-gradient(135deg, rgba(11,61,145,0.92), rgba(200,16,46,0.75)),
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.15), transparent 45%);
}
.hero-feature.no-image::after,
.hero-card.no-image::after,
.recent-media.no-image::after {
  display: none;
}
.hero-feature {
  border-radius: var(--radius);
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--shadow);
  animation: rise 0.55s ease both;
}
.hero-feature-overlay,
.hero-card-overlay {
  width: 100%;
  padding: 1.25rem 1.35rem;
  background: transparent;
}
.hero-feature h2 {
  margin: 0.55rem 0 0.45rem;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.35;
}
.hero-feature p { margin: 0 0 0.7rem; color: rgba(255,255,255,0.88); }
.hero-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.9rem;
}
.hero-card {
  border-radius: 12px;
  min-height: 200px;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--shadow);
  animation: rise 0.6s ease both;
}
.hero-card:nth-child(2) { animation-delay: 0.05s; }
.hero-card:nth-child(3) { animation-delay: 0.1s; }
.hero-card:nth-child(4) { animation-delay: 0.15s; }
.hero-card h3 {
  margin: 0.4rem 0 0;
  font-size: 0.98rem;
  line-height: 1.4;
}

.cat-chip {
  display: inline-block;
  background: var(--chip);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  align-items: center;
  color: rgba(255,255,255,0.85);
  font-size: 0.78rem;
}
.recent-body .meta-row,
.article-page .meta-row { color: var(--muted); }

.section-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1rem;
}
.section-head h2 {
  margin: 0;
  font-size: 1.35rem;
  white-space: nowrap;
}
.section-head.compact { margin-bottom: 0.75rem; }
.section-line {
  height: 3px;
  flex: 1;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 99px;
}

/* Main + sidebar */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.recent-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: rise 0.55s ease both;
}
.recent-media {
  display: block;
  height: 160px;
  position: relative;
}
.recent-media .cat-chip {
  position: absolute;
  inset-inline-start: 0.7rem;
  top: 0.7rem;
  z-index: 4;
}
.recent-body { padding: 0.9rem 1rem 1.05rem; }
.recent-body h3 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
  line-height: 1.45;
}
.recent-body h3 a { text-decoration: none; }
.recent-body h3 a:hover { color: var(--brand); }
.recent-body p {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.side-widget {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.most-read {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}
.most-read li {
  display: grid;
  grid-template-columns: 28px 56px 1fr;
  gap: 0.65rem;
  align-items: center;
}
.rank {
  width: 26px; height: 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}
.most-thumb {
  width: 56px; height: 56px;
  border-radius: 10px;
  display: block;
}
.most-title {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.4;
}
.most-title:hover { color: var(--brand); }

.weather-now {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
}
.weather-temp { font-size: 2.4rem; font-weight: 800; color: var(--brand); line-height: 1; }
.weather-icon { font-size: 1.8rem; color: #f59e0b; }
.weather-days {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-top: 0.9rem;
}
.weather-days div {
  text-align: center;
  background: var(--bg);
  border-radius: 10px;
  padding: 0.45rem 0.2rem;
  font-size: 0.8rem;
}
.weather-days strong { display: block; margin-top: 0.15rem; }

.newsletter-widget {
  border: 2px solid var(--accent);
}
.newsletter-widget h2 { margin: 0 0 0.35rem; }
.newsletter-widget p { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.92rem; }
.newsletter-form { display: grid; gap: 0.55rem; }
.newsletter-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: var(--bg);
  color: var(--ink);
}
.newsletter-form button {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0.75rem;
  cursor: pointer;
}
.nl-ok { margin: 0; color: var(--brand); font-size: 0.86rem; }

.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.social-grid a {
  text-decoration: none;
  color: #fff;
  border-radius: 10px;
  padding: 0.8rem 0.6rem;
  font-weight: 700;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.sg.fb { background: #1877f2; }
.sg.x { background: #111827; }
.sg.yt { background: #dc2626; }
.sg.tg { background: #0ea5e9; }

/* Categories */
.category-grid-section,
.video-section { margin-bottom: 2rem; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
.category-tile {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  text-decoration: none;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.category-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}
.category-tile i {
  font-size: 1.55rem;
  color: var(--chip);
  margin-bottom: 0.45rem;
  display: block;
}
.category-tile strong { display: block; margin-bottom: 0.2rem; }
.category-tile span { color: var(--muted); font-size: 0.84rem; }

/* Video */
.video-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
}
.video-main {
  min-height: 320px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.play-btn {
  width: 64px; height: 64px;
  border-radius: 999px;
  background: rgba(200,16,46,0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.video-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 1rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.8));
}
.video-caption span { opacity: 0.85; font-size: 0.85rem; }
.video-list { display: grid; gap: 0.75rem; }
.video-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.75rem;
  text-decoration: none;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  align-items: center;
}
.video-thumb {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.video-row strong { display: block; font-size: 0.95rem; }
.video-row small { color: var(--muted); }

/* Footer */
.site-footer {
  background: #0b1f3a;
  color: #d7e3f5;
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 220px at 90% 120%, rgba(59,130,246,0.18), transparent 60%),
    radial-gradient(500px 200px at 10% 100%, rgba(200,16,46,0.12), transparent 55%);
  pointer-events: none;
}
.footer-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.5rem;
  padding: 2.5rem 0 1.8rem;
}
.footer-brand p { color: #9fb3d1; max-width: 28rem; }
.site-footer h3 {
  margin: 0 0 0.8rem;
  color: #fff;
  font-size: 1.05rem;
}
.footer-links { display: grid; gap: 0.45rem; }
.footer-links a {
  color: #9fb3d1;
  text-decoration: none;
}
.footer-links a:hover { color: #fff; }
.footer-social a { background: rgba(255,255,255,0.08); color: #fff; }
.footer-bottom {
  position: relative;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 0.9rem 0;
  font-size: 0.86rem;
  color: #8aa0c0;
}
.footer-logo .brand-text strong,
.footer-logo .brand { color: #fff; }

/* Article / legal / empty */
.empty-portal {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.article-page, .legal-page, .error-page, .article-shell {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.8rem;
  box-shadow: var(--shadow);
}
.breadcrumbs { margin: 0 0 1rem; color: var(--muted); font-size: 0.92rem; }
.breadcrumbs a { color: var(--brand); text-decoration: none; }
.breadcrumbs .sep { margin: 0 0.35rem; opacity: 0.6; }
.article-header h1 {
  margin: 0.2rem 0 0.7rem;
  font-size: clamp(1.55rem, 3.2vw, 2.25rem);
  line-height: 1.35;
  color: var(--ink);
}
.eyebrow { color: var(--accent); font-weight: 700; margin: 0; }
.article-byline, .article-source { color: var(--muted); margin: 0.25rem 0; }
.lang-alt a { color: var(--brand); font-weight: 700; }
.article-hero-media {
  margin: 1.1rem 0 1.3rem;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
}
.article-hero-media img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}
.img-source-bar {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 4;
  margin: 0;
  padding: 0.4rem 0.75rem;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
  pointer-events: none;
  border-inline-start: 4px solid var(--accent);
}
.hero-feature .img-source-bar,
.hero-card .img-source-bar,
.recent-media .img-source-bar {
  background: rgba(0, 0, 0, 0.72);
}
.hero-feature-overlay { padding-bottom: 2.4rem; }
.hero-card-overlay { padding-bottom: 2rem; }
.article-body p { font-size: 1.08rem; line-height: 1.95; margin: 0 0 1rem; }
.related-news { margin-top: 1.5rem; }
.related-news h2 { margin: 0 0 0.7rem; }
.news-list { display: grid; gap: 0.85rem; }
.news-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.9rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.news-item.compact { grid-template-columns: 1fr; }
.news-thumb img {
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
}
.news-body h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.news-body h3 a { text-decoration: none; }
.news-excerpt { margin: 0; color: var(--muted); }
.muted { color: var(--muted); }
.btn {
  display: inline-block;
  margin-top: 0.8rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  font-weight: 700;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
  .hero-bento { grid-template-columns: 1fr; min-height: 0; }
  .hero-feature { min-height: 320px; }
  .home-grid { grid-template-columns: 1fr; }
  .recent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .topbar-date { display: none; }
  .social-mini { display: none; }
  .main-nav {
    display: none;
    border-bottom: 1px solid var(--line);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .hero-side { grid-template-columns: 1fr; }
  .hero-card { min-height: 170px; }
  .recent-grid { grid-template-columns: 1fr; }
  .news-item { grid-template-columns: 1fr; }
  .news-thumb img { width: 100%; height: 180px; }
  .footer-grid { grid-template-columns: 1fr; }
  .breaking-label { font-size: 0.78rem; }
}
