/* =========================================================================
   Al-Madar European — v2 design system
   Identity: EU blue (#003399) + star gold (#FFCC00), ring-of-stars motif,
   Naskh headlines for a newspaper voice, IBM Plex Sans Arabic for reading.
   Red is reserved for breaking / live only.
   ========================================================================= */

:root, [data-theme='light'] {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.83rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.02rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.4rem, 1.2rem + 1vw, 1.9rem);
  --text-2xl: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);
  --text-3xl: clamp(2.1rem, 1.3rem + 3vw, 3.6rem);
  --text-hero: clamp(2.5rem, 1rem + 5vw, 5.5rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem; --space-24: 6rem; --space-32: 8rem;

  /* Surfaces — cool paper */
  --color-bg: #F3F5FA;
  --color-surface: #FFFFFF;
  --color-surface-2: #F8F9FC;
  --color-surface-offset: #E8EDF7;
  --color-border: #DAE0EC;
  --color-divider: #E5E9F2;

  /* Ink */
  --color-text: #0E1830;
  --color-text-muted: #4B5670;
  --color-text-faint: #7F89A1;
  --color-text-inverse: #FFFFFF;

  /* EU blue */
  --color-primary: #003399;
  --color-primary-2: #1D4FC2;
  --color-primary-hover: #002277;
  --color-navy-surface: #003399;
  --color-navy-surface-2: #0B3FAE;
  --color-deep: #001A4D;
  --color-deepest: #000F2E;

  /* Star gold */
  --color-accent: #FFCC00;
  --color-accent-hover: #F0BC00;
  --color-accent-ink: #7A5B00;
  --color-accent-light: #FFF5CC;

  /* Semantic */
  --color-live: #C8102E;
  --color-live-hover: #A50D26;
  --color-success: #2F6B3F;

  /* Radius & shadow */
  --radius-sm: 0.25rem; --radius-md: 0.5rem; --radius-lg: 0.75rem; --radius-xl: 1.1rem; --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0, 26, 77, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 26, 77, 0.10);
  --shadow-lg: 0 20px 48px rgba(0, 26, 77, 0.18);

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 720px;
  --content-default: 1080px;
  --content-wide: 1320px;

  --font-display: 'Noto Naskh Arabic', 'Amiri', Georgia, serif;
  --font-body: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
}

[data-theme='dark'] {
  --color-bg: #0A0F21;
  --color-surface: #111833;
  --color-surface-2: #151D3C;
  --color-surface-offset: #1B2549;
  --color-border: #26315B;
  --color-divider: #1F2A50;
  --color-text: #E9EDF8;
  --color-text-muted: #A8B1CD;
  --color-text-faint: #717C9C;
  --color-text-inverse: #FFFFFF;
  --color-primary: #8EAEFF;
  --color-primary-2: #B3C8FF;
  --color-primary-hover: #C9D8FF;
  --color-navy-surface: #0A2470;
  --color-navy-surface-2: #0F2E86;
  --color-deep: #061338;
  --color-deepest: #030A22;
  --color-accent: #FFCC00;
  --color-accent-hover: #FFD933;
  --color-accent-ink: #FFD84D;
  --color-accent-light: #332A0A;
  --color-live: #FF5A6E;
  --color-live-hover: #FF8190;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.40);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
}

html { direction: rtl; }
body { font-family: var(--font-body); background: var(--color-bg); color: var(--color-text); overflow-x: hidden; }

.container { max-width: var(--content-wide); margin-inline: auto; padding-inline: var(--space-6); }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-primary); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; }

.icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full); color: inherit; flex-shrink: 0;
}
.icon-btn:hover { background: rgba(127, 137, 161, 0.14); }

/* ----- Identity marks ----- */
.eu-star { width: 18px; height: 18px; fill: var(--color-accent); flex-shrink: 0; }
.eu-star--sm { width: 12px; height: 12px; }
.star-ring { fill: var(--color-accent); pointer-events: none; }

/* ===== TOP UTILITY BAR ===== */
.topbar { background: var(--color-deep); color: rgba(255, 255, 255, 0.72); font-size: var(--text-xs); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-2); }
.topbar-date { white-space: nowrap; }
.topbar-eu { display: flex; align-items: center; gap: var(--space-2); color: #fff; letter-spacing: 0.02em; }
.topbar-social, .drawer-social, .footer-social { display: flex; gap: var(--space-2); }
.topbar-social a {
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.85);
}
.topbar-social a:hover { background: var(--color-accent); color: var(--color-deep); }

/* ===== MASTHEAD ===== */
.masthead {
  background: var(--color-surface);
  position: relative;
}
.masthead::after {
  content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 3px;
  background: linear-gradient(to left, var(--color-accent) 0 120px, transparent 120px);
}
.masthead-inner {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: var(--space-4);
  padding-block: var(--space-5);
}
.masthead-burger, .masthead-search-btn { display: none; color: var(--color-primary); }

.brand { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.brand-mark { color: var(--color-primary); display: block; width: 60px; height: 60px; flex-shrink: 0; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-logo img, .brand-logo .custom-logo { max-height: 84px; width: auto; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.logo-title {
  font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 700; line-height: 1.05;
  color: var(--color-primary); letter-spacing: -0.01em;
}
[data-theme='dark'] .logo-title { color: #fff; }
.masthead-kicker { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); margin-top: var(--space-1); }

.masthead-aside { display: flex; align-items: center; gap: var(--space-3); }
.masthead-ring { width: 58px; height: 58px; }
.masthead-meta { display: flex; flex-direction: column; gap: 2px; }
.masthead-city { font-family: var(--font-display); font-weight: 700; color: var(--color-primary); font-size: var(--text-base); }
[data-theme='dark'] .masthead-city { color: #fff; }
.masthead-sub { font-size: var(--text-xs); color: var(--color-text-muted); }
.masthead-sub strong { color: var(--color-text); font-weight: 600; }

/* ===== MAIN NAV ===== */
.mainnav {
  background: var(--color-navy-surface); color: #fff;
  position: sticky; top: 0; z-index: 60;
  transition: box-shadow var(--transition-interactive);
}
.admin-bar .mainnav { top: 32px; }
.mainnav--scrolled { box-shadow: 0 6px 18px rgba(0, 15, 46, 0.28); }
.mainnav-inner { display: flex; align-items: stretch; gap: 0; min-height: 50px; }
.mainnav-home {
  display: flex; align-items: center; padding-inline: var(--space-4);
  background: rgba(0, 0, 0, 0.16); color: var(--color-accent);
}
.mainnav-home:hover { color: #fff; background: rgba(0, 0, 0, 0.26); }
.mainnav-scroll { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mainnav-scroll::-webkit-scrollbar { display: none; }
.mainnav .mainnav-list { display: flex; list-style: none; height: 100%; }
.mainnav-list .sub-menu { display: none; }
.mainnav .mainnav-list > .menu-item > a {
  display: flex; align-items: center; height: 100%; white-space: nowrap;
  font-size: var(--text-sm); font-weight: 600; color: rgba(255, 255, 255, 0.9);
  padding-inline: 0.8rem; position: relative;
}
.mainnav .mainnav-list > .menu-item > a::after {
  content: ''; position: absolute; inset-inline: 0.8rem; bottom: 0; height: 3px;
  background: var(--color-accent); border-radius: 3px 3px 0 0;
  transform: scaleX(0); transition: transform var(--transition-interactive);
}
.mainnav .mainnav-list > .menu-item > a:hover, .mainnav .mainnav-list > .menu-item > a.active { color: #fff; background: rgba(255, 255, 255, 0.06); }
.mainnav .mainnav-list > .menu-item > a:hover::after, .mainnav .mainnav-list > .menu-item > a.active::after { transform: scaleX(1); }
.mainnav-tools { display: flex; align-items: center; gap: var(--space-1); padding-inline-start: var(--space-2); color: rgba(255, 255, 255, 0.9); }
.mainnav-tools .icon-btn:hover { background: rgba(255, 255, 255, 0.12); }

.search-panel { background: var(--color-surface); border-bottom: 1px solid var(--color-border); color: var(--color-text); }
.search-panel-form { display: flex; gap: var(--space-3); padding-block: var(--space-4); }
.search-panel-form input {
  flex: 1; font-size: var(--text-lg); padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-2);
}
.search-panel-form input:focus { outline: 2px solid var(--color-primary); outline-offset: 0; }

/* ===== TICKER ===== */
.ticker { background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.ticker-inner { display: flex; align-items: center; gap: var(--space-3); padding-block: var(--space-2); }
.ticker-label {
  display: inline-flex; align-items: center; gap: var(--space-2); flex-shrink: 0;
  background: var(--color-live); color: #fff; font-size: var(--text-xs); font-weight: 700;
  padding: 0.3rem var(--space-3); border-radius: var(--radius-sm);
}
.ticker-dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }

.ticker-viewport {
  flex: 1; min-width: 0; overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 24px, #000 calc(100% - 48px), transparent 100%);
          mask-image: linear-gradient(to left, transparent 0, #000 24px, #000 calc(100% - 48px), transparent 100%);
}
/* RTL headlines enter from the left so the start of each sentence arrives first. */
.ticker-track { display: flex; width: max-content; will-change: transform; }
.ticker-track.is-running { animation: ticker-rtl var(--ticker-duration, 60s) linear infinite; }
.ticker-track.is-paused, .ticker:hover .ticker-track, .ticker-track:focus-within { animation-play-state: paused; }
@keyframes ticker-rtl { from { transform: translateX(0); } to { transform: translateX(50%); } }
.ticker-group { display: flex; flex-shrink: 0; }
.ticker-item {
  display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap;
  font-size: var(--text-sm); font-weight: 500; padding-inline-end: var(--space-8); position: relative;
}
.ticker-item::after {
  content: ''; position: absolute; inset-inline-end: calc(var(--space-4) - 3px); top: 50%;
  width: 6px; height: 6px; margin-top: -3px; border-radius: 1px; transform: rotate(45deg); background: var(--color-accent);
}
.ticker-item time { font-size: var(--text-xs); font-weight: 700; color: var(--color-live); font-variant-numeric: tabular-nums; }
.ticker-item a:hover { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.ticker-pause {
  width: 28px; height: 28px; border-radius: var(--radius-full); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border); color: var(--color-text-muted);
}
.ticker-pause:hover { color: var(--color-primary); border-color: var(--color-primary); }
.ticker-pause .i-play { display: none; }
.ticker-pause[aria-pressed='true'] .i-play { display: block; }
.ticker-pause[aria-pressed='true'] .i-pause { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ticker-track.is-running { animation: none; }
  .ticker-viewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .ticker-pause { display: none; }
}

/* ===== TAGS / LABELS ===== */
.tag-pill {
  display: inline-block; font-size: var(--text-xs); font-weight: 700;
  padding: 0.25rem var(--space-3); border-radius: var(--radius-sm);
  background: var(--color-accent); color: var(--color-deep); margin-bottom: var(--space-3);
}
.tag-pill:hover { background: #fff; color: var(--color-deep); }
.tag-text { font-size: var(--text-xs); font-weight: 700; color: var(--color-primary); }
[data-theme='dark'] .tag-text { color: var(--color-accent); }
.byline { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); font-size: var(--text-xs); color: rgba(255, 255, 255, 0.72); }

/* ===== HERO ===== */
.hero { padding-block: var(--space-8) var(--space-10); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-8); align-items: stretch; }

.lead-story {
  position: relative; border-radius: var(--radius-xl); overflow: hidden;
  aspect-ratio: 16 / 9; box-shadow: var(--shadow-md); background: var(--color-deep);
}
.lead-story-media, .lead-story-media img { display: block; width: 100%; height: 100%; }
.lead-story img { object-fit: cover; transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1); }
.lead-story:hover img { transform: scale(1.03); }
.lead-story::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 15, 46, 0.94) 0%, rgba(0, 15, 46, 0.55) 42%, rgba(0, 15, 46, 0) 72%);
}
.lead-story-content { position: absolute; inset-inline: 0; bottom: 0; padding: var(--space-8); z-index: 2; }
.lead-story-content h1 { font-size: var(--text-2xl); line-height: 1.3; color: #fff; margin-bottom: var(--space-3); max-width: 28ch; }
.lead-story-content h1 a:hover { color: var(--color-accent); }
.lead-story-content p { color: rgba(255, 255, 255, 0.82); font-size: var(--text-base); max-width: 62ch; margin-bottom: var(--space-3); }

.sub-leads { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); margin-top: var(--space-6); }
.sub-lead { display: flex; flex-direction: column; gap: var(--space-2); }
.sub-lead-img { display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--space-1); }
.sub-lead-img img, .card-img img, .feature-main-img img, .column-top-img img, .side-story-img img, .stacked-story-img img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
.sub-lead:hover img, .card:hover img, .feature-main:hover img, .column-top:hover img, .side-story:hover img, .stacked-story:hover img { transform: scale(1.04); }
.sub-lead h3 { font-size: var(--text-base); line-height: 1.45; }
.sub-lead time, .feature-main-body time { font-size: var(--text-xs); color: var(--color-text-faint); }

/* Live feed (آخر الأخبار) */
.live-feed {
  background: var(--color-surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border); border-top: 4px solid var(--color-primary);
  display: flex; flex-direction: column; min-height: 0;
}
.live-feed-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--color-divider);
}
.live-feed-head h2 { font-size: var(--text-lg); color: var(--color-primary); display: flex; align-items: center; gap: var(--space-2); }
[data-theme='dark'] .live-feed-head h2 { color: #fff; }
.live-feed-head .ticker-dot { color: var(--color-live); }
.live-feed-head a { font-size: var(--text-xs); font-weight: 700; color: var(--color-text-muted); }
.live-feed-list { list-style: none; padding: var(--space-2) var(--space-5) var(--space-4); overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; }
.live-feed-list li { position: relative; padding-block: var(--space-3); padding-inline-start: var(--space-5); border-bottom: 1px dashed var(--color-divider); }
.live-feed-list li:last-child { border-bottom: none; }
.live-feed-list li::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 1.15rem; width: 8px; height: 8px;
  border-radius: 50%; background: var(--color-surface); border: 2px solid var(--color-primary);
}
.live-feed-list li:first-child::before { background: var(--color-live); border-color: var(--color-live); }
.live-feed-list li::after {
  content: ''; position: absolute; inset-inline-start: 3px; top: 1.8rem; bottom: -0.6rem; width: 2px; background: var(--color-divider);
}
.live-feed-list li:last-child::after { display: none; }
.live-feed-meta { display: flex; gap: var(--space-2); align-items: baseline; font-size: var(--text-xs); margin-bottom: 2px; }
.live-feed-meta time { color: var(--color-live); font-weight: 700; }
.live-feed-meta a { color: var(--color-text-faint); font-weight: 600; }
.live-feed-title { display: block; font-size: var(--text-sm); font-weight: 600; line-height: 1.55; }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4);
  margin-bottom: var(--space-6); padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border); position: relative;
}
.section-header::after {
  content: ''; position: absolute; inset-inline-start: 0; bottom: -2px; width: 96px; height: 3px;
  background: var(--color-primary); border-radius: 3px;
}
.section-header h2 {
  font-size: var(--text-xl); line-height: 1.2; color: var(--color-primary);
  display: flex; align-items: center; gap: var(--space-3);
}
[data-theme='dark'] .section-header h2 { color: #fff; }
.section-header a { font-size: var(--text-xs); font-weight: 700; color: var(--color-text-muted); white-space: nowrap; }
.section-header a:hover { color: var(--color-primary); }
.section-header--inverse { border-bottom-color: rgba(255, 255, 255, 0.18); }
.section-header--inverse::after { background: var(--color-accent); }
.section-header--inverse h2 { color: #fff; }
.section-header--inverse a { color: rgba(255, 255, 255, 0.75); }
.section-header--inverse a:hover { color: var(--color-accent); }

.section { padding-block: var(--space-12); }
.section-alt { background: var(--color-surface); }

/* ===== CARDS ===== */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8) var(--space-6); }
.card-grid--4 { grid-template-columns: repeat(4, 1fr); }
.card { display: flex; flex-direction: column; }
.card-img { display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface-offset); }
.card-body { padding-top: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.card-body h3 { font-size: var(--text-lg); line-height: 1.45; }
.card-body p { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.7; }
.card-meta { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-faint); margin-top: auto; padding-top: var(--space-1); }

/* Feature block */
.feature-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--space-8); }
.feature-main-img { display: block; aspect-ratio: 16 / 9; border-radius: var(--radius-xl); overflow: hidden; }
.feature-main-body { padding-top: var(--space-4); }
.feature-main-body h3 { font-size: var(--text-xl); line-height: 1.35; margin-bottom: var(--space-3); }
.feature-main-body p { color: var(--color-text-muted); margin-bottom: var(--space-3); }
.feature-list { display: flex; flex-direction: column; gap: var(--space-4); }

.side-list { display: flex; flex-direction: column; gap: var(--space-4); }
.side-story { display: flex; gap: var(--space-4); padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-divider); }
.side-story:last-child { border-bottom: none; padding-bottom: 0; }
.side-story-img { width: 128px; aspect-ratio: 4 / 3; flex-shrink: 0; border-radius: var(--radius-md); overflow: hidden; }
.side-story-body { min-width: 0; }
.side-story-body h3 { font-size: var(--text-base); line-height: 1.5; margin-block: 2px var(--space-1); }
.side-story-body time { font-size: var(--text-xs); color: var(--color-text-faint); }

/* Two-column category block */
.columns-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-10); }
.column-top-img { display: block; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--space-3); }
.column-top h3 { font-size: var(--text-lg); line-height: 1.45; margin-bottom: var(--space-2); }
.column-top p { font-size: var(--text-sm); color: var(--color-text-muted); }
.headline-list { list-style: none; margin-top: var(--space-4); }
.headline-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4);
  padding-block: var(--space-3); border-top: 1px solid var(--color-divider);
}
.headline-list a { font-weight: 600; line-height: 1.55; }
.headline-list time { font-size: var(--text-xs); color: var(--color-text-faint); white-space: nowrap; }

/* ===== VIDEO BAND ===== */
.video-band {
  position: relative; overflow: hidden; color: #fff; padding-block: var(--space-12) var(--space-16);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(29, 79, 194, 0.55), transparent 60%),
    linear-gradient(160deg, var(--color-deep) 0%, #002a80 60%, var(--color-deep) 100%);
}
.video-band-ring { position: absolute; width: 520px; height: 520px; inset-inline-end: -160px; top: -140px; opacity: 0.1; }
.video-band .container { position: relative; }
.video-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--space-8); }
.video-thumb { position: relative; display: block; overflow: hidden; border-radius: var(--radius-lg); background: #000; aspect-ratio: 16 / 9; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1), opacity 300ms; }
.video-main, .video-item { display: block; color: #fff; }
.video-main:hover, .video-item:hover { color: #fff; }
.video-main:hover img, .video-item:hover img { transform: scale(1.04); opacity: 0.85; }
.video-main { position: relative; border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-lg); }
.video-main .video-thumb { border-radius: var(--radius-xl); }
.video-main .video-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 10, 35, 0.92) 0%, rgba(0, 10, 35, 0.2) 55%, transparent 80%);
}
.video-main-body { position: absolute; inset-inline: 0; bottom: 0; padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); z-index: 2; }
.video-kicker { align-self: flex-start; font-size: var(--text-xs); font-weight: 700; background: var(--color-accent); color: var(--color-deep); padding: 0.2rem var(--space-3); border-radius: var(--radius-sm); }
.video-main .video-title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); line-height: 1.35; }
.video-time { font-size: var(--text-xs); color: rgba(255, 255, 255, 0.65); }

.play-btn {
  position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; z-index: 3;
  border-radius: 50%; background: rgba(255, 204, 0, 0.96); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 6px rgba(255, 204, 0, 0.22); transition: transform var(--transition-interactive);
}
.play-btn svg { width: 45%; height: 45%; fill: var(--color-deep); transform: translateX(8%); }
.play-btn--lg { width: 78px; height: 78px; margin: -39px 0 0 -39px; box-shadow: 0 0 0 10px rgba(255, 204, 0, 0.2); }
.video-main:hover .play-btn, .video-item:hover .play-btn { transform: scale(1.1); }

.video-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-4); }
.video-item { display: grid; grid-template-columns: 160px 1fr; gap: var(--space-4); align-items: center; padding-bottom: var(--space-4); border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.video-list li:last-child .video-item { border-bottom: none; padding-bottom: 0; }
.video-item-body { display: flex; flex-direction: column; gap: var(--space-1); }
.video-item .video-title { font-weight: 600; font-size: var(--text-sm); line-height: 1.55; }

/* Lightbox */
.video-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.video-modal[hidden] { display: none; }
.video-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 8, 28, 0.88); backdrop-filter: blur(4px); }
.video-modal-dialog { position: relative; width: min(1000px, 100%); }
.video-modal-frame { aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.video-modal-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-modal-title { color: #fff; margin-top: var(--space-3); font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); }
.video-modal-close { position: absolute; top: -46px; inset-inline-end: 0; width: 38px; height: 38px; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, 0.12); display: flex; align-items: center; justify-content: center; }
.video-modal-close:hover { background: var(--color-accent); color: var(--color-deep); }

/* ===== OPINION / WRITERS ===== */
.opinion-strip { background: var(--color-surface-2); padding-block: var(--space-12); border-block: 1px solid var(--color-border); }
.opinion-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.opinion-card {
  position: relative; background: var(--color-surface); border: 1px solid var(--color-border); border-top: 3px solid var(--color-accent);
  border-radius: var(--radius-lg); padding: var(--space-6) var(--space-5); display: flex; flex-direction: column; gap: var(--space-3);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}
.opinion-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.opinion-author { display: flex; align-items: center; gap: var(--space-3); }
.opinion-avatar { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex-shrink: 0; box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-accent); }
.opinion-avatar img { width: 100%; height: 100%; object-fit: cover; }
.opinion-card .byname { font-weight: 700; font-size: var(--text-sm); color: var(--color-primary); }
[data-theme='dark'] .opinion-card .byname { color: var(--color-accent); }
.opinion-quote { position: absolute; top: var(--space-5); inset-inline-end: var(--space-5); width: 28px; height: 28px; fill: var(--color-surface-offset); }
.opinion-card h3 { font-size: var(--text-lg); line-height: 1.45; }
.opinion-card p { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.7; }

/* ===== TWO COLUMN: MAIN + SIDEBAR ===== */
.two-col { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); gap: var(--space-10); }
.stacked-story { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-5); padding-block: var(--space-5); border-bottom: 1px solid var(--color-divider); }
.stacked-story:first-of-type { padding-top: 0; }
.stacked-story-img { display: block; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16 / 10; }
.stacked-story h3 { font-size: var(--text-lg); margin-block: var(--space-2); line-height: 1.45; }
.stacked-story p { font-size: var(--text-sm); color: var(--color-text-muted); }

.sidebar-widget {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-5); margin-bottom: var(--space-6);
}
.section-alt .sidebar-widget { background: var(--color-surface-2); }
.sidebar-widget h4 {
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; color: var(--color-primary);
  margin-bottom: var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid var(--color-divider);
}
[data-theme='dark'] .sidebar-widget h4 { color: #fff; }
.ranked-item { display: flex; gap: var(--space-3); padding-block: var(--space-3); border-bottom: 1px solid var(--color-divider); }
.ranked-item:last-child { border-bottom: none; }
.rank-num { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; line-height: 1; color: var(--color-accent-ink); flex-shrink: 0; width: 34px; }
.ranked-item h5 { font-size: var(--text-sm); font-weight: 600; line-height: 1.55; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag-chip { font-size: var(--text-xs); padding: var(--space-2) var(--space-3); background: var(--color-surface-offset); border-radius: var(--radius-full); color: var(--color-text-muted); font-weight: 600; }
.tag-chip:hover { background: var(--color-primary); color: #fff; }
.top-tags { padding-top: var(--space-4); }

/* ===== NEWSLETTER ===== */
.section-newsletter { padding-block: var(--space-12); }
.newsletter-cta {
  background: linear-gradient(135deg, var(--color-deep), var(--color-navy-surface));
  border-radius: var(--radius-xl); padding: var(--space-12) var(--space-8); text-align: center;
  color: #fff; position: relative; overflow: hidden; isolation: isolate;
}
.newsletter-ring { position: absolute; width: 360px; height: 360px; inset-inline-start: -90px; top: 50%; margin-top: -180px; opacity: 0.18; z-index: -1; }
.newsletter-cta h2 { font-size: var(--text-xl); margin-bottom: var(--space-3); }
.newsletter-cta p { color: rgba(255, 255, 255, 0.78); margin-bottom: var(--space-6); font-size: var(--text-sm); }
.newsletter-form { display: flex; gap: var(--space-3); max-width: 460px; margin-inline: auto; }
.newsletter-form input {
  flex: 1; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.1); color: #fff; font-size: var(--text-sm);
}
.newsletter-form input::placeholder { color: rgba(255, 255, 255, 0.6); }
.btn-gold {
  background: var(--color-accent); color: var(--color-deep); font-weight: 700; padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md); font-size: var(--text-sm); white-space: nowrap;
}
.btn-gold:hover { background: var(--color-accent-hover); color: var(--color-deep); }

/* ===== FOOTER ===== */
.footer { background: var(--color-deepest); color: rgba(255, 255, 255, 0.7); padding-block: var(--space-16) var(--space-8); border-top: 4px solid var(--color-accent); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-8); margin-bottom: var(--space-10); }
.footer .logo-wrap { display: flex; align-items: center; gap: var(--space-3); }
.footer-brand .logo-title { color: #fff; font-size: var(--text-xl); }
.footer-brand p { font-size: var(--text-sm); color: rgba(255, 255, 255, 0.55); margin-top: var(--space-3); line-height: 1.8; }
.footer h5 { color: #fff; font-size: var(--text-sm); font-weight: 700; margin-bottom: var(--space-4); }
.footer ul { display: flex; flex-direction: column; gap: var(--space-2); list-style: none; }
.footer a { font-size: var(--text-sm); color: rgba(255, 255, 255, 0.6); }
.footer a:hover { color: var(--color-accent); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-3);
  padding-top: var(--space-6); border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: var(--text-xs); color: rgba(255, 255, 255, 0.45);
}
.footer-social a { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, 0.08); }

/* ===== MOBILE DRAWER ===== */
.drawer { position: fixed; inset: 0; z-index: 150; }
.drawer[hidden] { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 10, 35, 0.6); opacity: 0; transition: opacity 220ms; }
.drawer-panel {
  position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(340px, 88vw);
  background: var(--color-surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1); overflow-y: auto;
}
.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer.is-open .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-5); background: var(--color-navy-surface); color: #fff; }
.drawer-head .logo-title { color: #fff; font-size: var(--text-xl); }
.drawer-search { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--color-divider); }
.drawer-search input { width: 100%; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-2); }
.drawer-nav .mainnav-list { flex-direction: column; list-style: none; }
.drawer-nav .menu-item a { display: block; padding: var(--space-3) var(--space-5); font-weight: 600; border-bottom: 1px solid var(--color-divider); }
.drawer-nav .menu-item a.active { color: var(--color-primary); box-shadow: inset -4px 0 0 var(--color-accent); }
.drawer-nav .sub-menu { list-style: none; background: var(--color-surface-2); }
.drawer-nav .sub-menu a { padding-inline-start: var(--space-8); font-weight: 500; font-size: var(--text-sm); }
.drawer-social { padding: var(--space-5); margin-top: auto; }
.drawer-social a { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--color-surface-offset); color: var(--color-primary); }
body.drawer-lock { overflow: hidden; }

/* ===== THEME TOGGLE ===== */
.theme-toggle { color: rgba(255, 255, 255, 0.9); }

/* ===== RESPONSIVE ===== */
@media (min-width: 1025px) {
  /* Feed column follows the height of the lead column, and scrolls inside. */
  .live-feed { contain: size; }
}
@media (max-width: 1180px) {
  .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .opinion-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .live-feed-list { max-height: 520px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid, .video-grid { grid-template-columns: minmax(0, 1fr); }
  .columns-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-12); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .masthead-aside { display: none; }
}
@media (max-width: 760px) {
  .container { padding-inline: var(--space-4); }
  .topbar-eu { display: none; }
  .masthead-inner { grid-template-columns: auto 1fr auto; padding-block: var(--space-3); gap: var(--space-2); }
  .masthead-burger, .masthead-search-btn { display: inline-flex; }
  .brand { justify-content: center; gap: var(--space-2); }
  .brand-mark { width: 40px; height: 40px; }
  .brand-logo img, .brand-logo .custom-logo { max-height: 52px; }
  .logo-title { font-size: 1.9rem; }
  .masthead-kicker { font-size: 0.7rem; }
  .mainnav-home { display: none; }
  .mainnav-tools [data-search-toggle] { display: none; }
  .mainnav-inner { min-height: 46px; }
  .section { padding-block: var(--space-10); }
  .section-header h2 { font-size: var(--text-lg); }

  .lead-story { aspect-ratio: 4 / 5; border-radius: var(--radius-lg); }
  .lead-story-content { padding: var(--space-5); }
  .lead-story-content h1 { font-size: var(--text-xl); }
  .lead-story-content p { display: none; }
  .sub-leads { grid-template-columns: 1fr; gap: 0; }
  .sub-lead { display: grid; grid-template-columns: 112px 1fr; grid-template-rows: auto auto 1fr; column-gap: var(--space-3); padding-block: var(--space-4); border-bottom: 1px solid var(--color-divider); }
  .sub-lead-img { grid-row: 1 / 4; margin: 0; aspect-ratio: 4 / 3; }
  .sub-lead h3 { font-size: var(--text-sm); }

  .card-grid, .card-grid--4 { grid-template-columns: 1fr; }
  .opinion-grid { grid-template-columns: 1fr; }
  .stacked-story { grid-template-columns: 116px minmax(0, 1fr); gap: var(--space-3); }
  .stacked-story p { display: none; }
  .stacked-story h3 { font-size: var(--text-base); }
  .side-story-img { width: 104px; }
  .video-item { grid-template-columns: 124px 1fr; }
  .video-main .video-title { font-size: var(--text-lg); }
  .play-btn--lg { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
  .footer-grid { grid-template-columns: 1fr; }
  .newsletter-form { flex-direction: column; }
  .newsletter-cta { padding: var(--space-8) var(--space-5); }
  .ticker-pause { display: none; }
}
@media (max-width: 782px) { .admin-bar .mainnav { top: 46px; } }
@media (max-width: 600px) { .admin-bar .mainnav { top: 0; } }
.columns-grid--single { grid-template-columns: 1fr; }

/* Sticky marker is for archives only, never on the homepage. */
.home .tag-pill::after { content: none !important; }

/* ===== Generic widgets (classic + block) inside sidebars ===== */
.sidebar-widget h2, .sidebar-widget .wp-block-heading, .sidebar-widget .widget-title {
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; color: var(--color-primary);
  margin-bottom: var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid var(--color-divider);
}
[data-theme='dark'] .sidebar-widget h2, [data-theme='dark'] .sidebar-widget .wp-block-heading { color: #fff; }
.sidebar-widget ul, .sidebar-widget ol { list-style: none; padding: 0; margin: 0; }
.sidebar-widget li { padding-block: var(--space-2); border-bottom: 1px solid var(--color-divider); font-size: var(--text-sm); line-height: 1.55; }
.sidebar-widget li:last-child { border-bottom: none; }
.sidebar-widget li a { font-weight: 600; }
.sidebar-widget .wp-block-search__label { display: none; }
.sidebar-widget .wp-block-search__inside-wrapper { display: flex; gap: var(--space-2); }
.sidebar-widget .wp-block-search__input, .sidebar-widget input[type="search"] {
  flex: 1; min-width: 0; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-surface);
}
.sidebar-widget .wp-block-search__button, .sidebar-widget button[type="submit"] {
  background: var(--color-primary); color: #fff; border-radius: var(--radius-md); padding: var(--space-2) var(--space-4); font-weight: 700; font-size: var(--text-sm);
}
.sidebar-widget .no-comments, .sidebar-widget .wp-block-latest-comments__comment { font-size: var(--text-sm); color: var(--color-text-muted); }

@media (max-width: 760px) {
  .video-main .play-btn--lg { top: 38%; }
  .video-main-body { padding: var(--space-4); }
}

.header-ad { max-width: 728px; max-height: 90px; overflow: hidden; }
.header-ad img { max-height: 90px; width: auto; }

/* ===== LOGO (v2.1) ===== */
.brand-logo { display: block; line-height: 0; }
.brand-logo img, .brand-logo .custom-logo { height: 118px; width: auto; max-height: none; }
[data-theme='dark'] .brand-logo img { background: #fff; border-radius: var(--radius-lg); padding: 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .brand-logo img { background: #fff; border-radius: var(--radius-lg); padding: 6px; } }
.footer-logo { display: inline-block; background: #fff; border-radius: var(--radius-lg); padding: var(--space-2); line-height: 0; }
.footer-logo img { width: 120px; height: auto; }
@media (max-width: 760px) {
  .brand-logo img, .brand-logo .custom-logo { height: 64px; }
  [data-theme='dark'] .brand-logo img { padding: 3px; }
}

/* ===== "المزيد" button + panel ===== */
.mainnav-more {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; color: #fff;
  font-size: var(--text-sm); font-weight: 700; padding-inline: var(--space-4);
  background: rgba(0, 0, 0, 0.16); border-inline-start: 1px solid rgba(255, 255, 255, 0.12);
}
.mainnav-more:hover, .mainnav-more[aria-expanded='true'] { background: var(--color-accent); color: var(--color-deep); }
.mainnav-more svg { transition: transform var(--transition-interactive); }
.mainnav-more[aria-expanded='true'] svg { transform: rotate(180deg); }
.more-panel { background: var(--color-surface); color: var(--color-text); border-bottom: 3px solid var(--color-accent); box-shadow: var(--shadow-md); }
.more-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--space-1) var(--space-6); padding-block: var(--space-5); }
.more-grid > li > a {
  display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 0;
  font-weight: 600; border-bottom: 1px solid var(--color-divider);
}
.more-grid > li > a::before { content: ''; width: 6px; height: 6px; transform: rotate(45deg); background: var(--color-accent); flex-shrink: 0; }
.more-grid > li > a:hover, .more-grid a.active { color: var(--color-primary); }
.more-grid ul { list-style: none; padding: var(--space-1) var(--space-4) 0 0; font-size: var(--text-sm); }
@media (max-width: 760px) { .mainnav-more { display: none; } .more-panel { display: none !important; } }
.masthead-aside { justify-self: end; }

/* ===== YouTube channel (v2.1) ===== */
.video-band-actions { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.yt-subscribe {
  display: inline-flex; align-items: center; gap: var(--space-2); background: #FF0000; color: #fff !important;
  font-weight: 700; font-size: var(--text-xs); padding: 0.45rem var(--space-4); border-radius: var(--radius-full);
}
.yt-subscribe:hover { background: #cc0000; }
.video-band--page { min-height: 60vh; }
.videos-page-title { font-size: var(--text-2xl); color: #fff; display: flex; align-items: center; gap: var(--space-3); }
.videos-page-intro { color: rgba(255,255,255,0.8); max-width: 70ch; margin-bottom: var(--space-8); }
.videos-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8) var(--space-6); }
.video-item--card { display: flex; flex-direction: column; gap: var(--space-3); border-bottom: none; padding-bottom: 0; }
.video-item--card .video-title { font-size: var(--text-base); }
.videos-empty { color: rgba(255,255,255,0.8); }
@media (max-width: 1024px) { .videos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .videos-grid { grid-template-columns: minmax(0, 1fr); } }

/* Hide widgets that render nothing (e.g. leftovers from a previous theme). */
.sidebar-widget:not(:has(a, img, iframe, form, p, li, video, canvas, svg, .ranked-item)) { display: none; }
