/* =============================================
   Yemen X | يمن إكس — Modern News Platform
   Inspired by the clarity & strength of top news brands
   ============================================= */

:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --bg-secondary: #eef3f9;
  --panel: #ffffff;
  --panel-strong: #fafbfc;
  --text: #122033;
  --text-secondary: #3d4d62;
  --muted: #708096;
  --border: #dbe4ef;
  --border-light: #eaf0f6;
  --panel-06: rgba(255,255,255,.94);
  --primary: #1565c0;
  --primary-dark: #0d47a1;
  --primary-light: #42a5f5;
  --primary-t88: rgba(21,101,192,.12);
  --primary-t94: rgba(21,101,192,.06);
  --primary-t95: rgba(21,101,192,.05);
  --primary-t90: rgba(21,101,192,.10);
  --secondary: #c62828;
  --secondary-t90: rgba(198,40,40,.10);
  --secondary-t82: rgba(198,40,40,.18);
  --primary-border: #bbdefb;
  --accent: #c62828;
  --accent-dark: #961c1c;
  --success: #0d9488;
  --warning: #e67e00;
  --error: #dc2626;
  --info: #1565c0;
  --breaking-red: #dc2626;
  --shadow-xs: 0 2px 8px rgba(27,57,90,.05);
  --shadow-sm: 0 5px 16px rgba(27,57,90,.07);
  --shadow: 0 10px 28px rgba(27,57,90,.09);
  --shadow-md: 0 20px 44px rgba(27,57,90,.13);
  --shadow-lg: 0 24px 48px rgba(18,21,26,.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;
  --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-arabic: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, monospace;
  --transition-fast: .15s ease;
  --transition: .22s ease;
  --transition-slow: .35s ease;
  --z-sticky: 80;
  --z-overlay: 90;
  --z-modal: 100;
  --content-width: 1260px;
  --content-narrow: 780px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0d13;
  --bg-secondary: #12161e;
  --panel: #151a24;
  --panel-strong: #1a1f2c;
  --text: #edf0f5;
  --text-secondary: #c4c9d4;
  --muted: #808894;
  --border: #252a35;
  --border-light: #1e2330;
  --primary: #42a5f5;
  --primary-dark: #1976d2;
  --primary-light: #90caf9;
  --primary-t88: rgba(66,165,245,.12);
  --primary-t94: rgba(66,165,245,.06);
  --primary-t95: rgba(66,165,245,.05);
  --primary-t90: rgba(66,165,245,.10);
  --secondary-t82: rgba(198,40,40,.18);
  --secondary-t90: rgba(198,40,40,.10);
  --primary-border: #1565c0;
  --panel-06: rgba(21,26,36,.94);
  --shadow-xs: 0 1px 2px rgba(0,0,0,.25);
  --shadow-sm: 0 4px 8px rgba(0,0,0,.3);
  --shadow: 0 8px 20px rgba(0,0,0,.35);
  --shadow-md: 0 16px 36px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 54px rgba(0,0,0,.5);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

body {
  margin: 0; min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-arabic);
  font-size: 16px; line-height: 1.7;
  overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 { margin: 0 0 .5rem; color: var(--text); font-weight: 800; line-height: 1.3; }
h1 { font-size: clamp(1.7rem,2.8vw,2.5rem); }
h2 { font-size: clamp(1.25rem,2vw,1.65rem); }
h3 { font-size: 1.1rem; }
h4 { font-size: .95rem; }
p { margin: 0 0 .75rem; }

a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-dark); }

img { display: block; max-width: 100%; height: auto; }
svg { display: inline-block; flex: 0 0 auto; vertical-align: middle; }
button,input,textarea,select { font: inherit; }

.container { width: min(100% - 1.5rem, var(--content-width)); margin-inline: auto; }
.container-lg { width: min(100% - 1.5rem, 1400px); }
.container-sm { width: min(100% - 1.5rem, var(--content-narrow)); }
main.container { min-height: 60vh; padding-block: 1rem 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.icon { width: 1.1em; height: 1.1em; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }

/* ===== TOP BAR ===== */
.top-bar {
  background: #eef6ff; color: var(--text-secondary);
  font-size: .76rem; padding: .3rem 0; border-bottom: 1px solid #dbeafe;
}
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.top-bar-right { display: flex; align-items: center; gap: 1rem; min-width: 0; overflow: hidden; }
.top-bar-left { display: flex; align-items: center; gap: .65rem; flex-shrink: 0; }
.top-bar-left a { color: var(--text-secondary); display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: var(--radius-full); transition: all var(--transition-fast); }
.top-bar-left a:hover { background: #fff; color: var(--primary); }
.top-bar-left .top-text-link { display: inline-flex; width: auto; padding-inline: .35rem; font-weight: 700; }
.top-bar-date { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; color: var(--muted); }
.top-bar-date svg { width: 14px; height: 14px; }
.live-status { display: inline-flex; align-items: center; gap: .4rem; color: #13735f; font-weight: 800; white-space: nowrap; }
.live-status i { width: 7px; height: 7px; border-radius: 50%; background: #16a085; box-shadow: 0 0 0 4px rgba(22,160,133,.12); }
.theme-toggle-mini { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #cbd9e8; border-radius: var(--radius-full); background: #fff; color: var(--text-secondary); cursor: pointer; transition: all var(--transition-fast); }
.theme-toggle-mini:hover { border-color: var(--primary); color: var(--primary); }
[data-theme="dark"] .top-bar { background: #101827; border-color: #243248; }
[data-theme="dark"] .theme-toggle-mini { background: #172033; border-color: #334155; }
@media (max-width: 760px) {
  .top-bar-date { font-size: .72rem; }
  .top-bar-left .top-text-link { display: none; }
  .live-status { font-size: .68rem; }
}

/* ===== SITE HEADER ===== */
.site-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: rgba(255,255,255,.96); backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 8px 24px rgba(35,62,91,.06);
}
[data-theme="dark"] .site-header { background: rgba(21,26,36,.96); }
.header-top {
  display: flex; align-items: center; gap: clamp(.8rem,2vw,2rem);
  padding-block: .72rem; min-height: 76px;
}
.logo { display: inline-flex; align-items: center; gap: .75rem; color: var(--text); font-weight: 900; white-space: nowrap; flex-shrink: 0; text-decoration: none; }
.logo-mark, .logo-text-mark {
  display: grid; place-items: center; width: 58px; height: 58px; flex-shrink: 0;
  border-radius: 15px; background: #0a0e1a; color: #fff;
  box-shadow: 0 8px 20px rgba(21,101,192,.18);
  border: 1px solid #cfe2f8;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.logo-mark img {
  width: 100%; height: 100%; object-fit: contain; border-radius: inherit;
}
.logo-text-mark { font-weight: 900; font-size: 1.25rem; font-family: var(--font-sans); background: linear-gradient(135deg, #ffffff, #90caf9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo:hover .logo-mark, .logo:hover .logo-text-mark { transform: scale(1.06); box-shadow: 0 4px 16px rgba(33,150,243,.4); }
.logo-title { display: flex; flex-direction: column; gap: .22rem; line-height: 1.15; }
.logo-title strong { font-family: var(--font-sans); font-size: 1.12rem; font-weight: 900; color: var(--text); letter-spacing: -.025em; }
.logo-title strong b { color: var(--secondary); font-size: 1.2em; }
.logo-title span { color: var(--muted); font-size: .69rem; font-weight: 700; letter-spacing: 0; }
[data-theme="dark"] .logo-title strong { color: #fff; }

.header-actions { display: flex; align-items: center; gap: .4rem; margin-inline-start: auto; flex-shrink: 0; }

.search-box {
  display: flex; align-items: center; flex: 1; max-width: 480px; height: 44px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--bg); transition: all var(--transition-fast);
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-t90); background: var(--panel); }
.search-box input { flex: 1; border: 0; outline: 0; background: transparent; padding: 0 .85rem; color: var(--text); font-size: .88rem; min-width: 0; }
.search-box button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex-shrink: 0; border-radius: var(--radius-full); }
.search-box button:hover { color: var(--primary); }
.theme-toggle, .menu-toggle { display: grid; place-items: center; width: 36px; height: 36px; border: 2px solid var(--border); border-radius: var(--radius-full); background: transparent; color: var(--text-secondary); cursor: pointer; flex-shrink: 0; transition: all var(--transition-fast); }
.theme-toggle:hover, .menu-toggle:hover { border-color: var(--primary); color: var(--primary); }
.search-toggle { display: none; place-items: center; width: 36px; height: 36px; border: 2px solid var(--border); border-radius: var(--radius-full); background: transparent; color: var(--text-secondary); cursor: pointer; }
.menu-toggle { display: none; }

/* ===== NAVIGATION BAR ===== */
.categories-bar { border-top: 1px solid var(--border-light); background: #fff; overflow-x: auto; scrollbar-width: none; }
[data-theme="dark"] .categories-bar { background: var(--panel-strong); }
.categories-bar::-webkit-scrollbar { display: none; }
.categories-bar .container { display: flex; gap: .2rem; align-items: stretch; min-height: 46px; }
.categories-bar a {
  display: inline-flex; align-items: center; gap: .3rem; padding: 0 .78rem; min-height: 46px;
  font-size: .82rem; font-weight: 800; white-space: nowrap;
  color: var(--text-secondary); border-bottom: 3px solid transparent;
  transition: all var(--transition-fast);
}
.categories-bar a:hover, .categories-bar a.active {
  color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-t95);
}

/* Mobile navigation overlay */
.nav-overlay { display: none; }
.mobile-nav-head { display: none; }
@media (max-width: 1060px) {
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .menu-toggle { display: grid; }
  .search-box { display: none; }
  .search-toggle { display: grid; }
  .search-box.is-open { display: flex; position: absolute; top: 100%; inset-inline: 0; max-width: none; border-radius: 0; border-inline: 0; height: 42px; z-index: 2; }
  .categories-bar {
    position: fixed; top: 0; right: 0; bottom: auto; left: auto;
    width: min(350px,90vw); height: 100vh; height: 100dvh; max-height: none;
    overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
    transform: translate3d(105%,0,0); visibility: hidden;
    transition: transform .32s cubic-bezier(.22,1,.36,1), visibility .32s;
    box-shadow: -18px 0 50px rgba(15,38,68,.2);
    z-index: 1001; padding: 0 0 max(1rem,env(safe-area-inset-bottom));
    background: var(--panel);
  }
  .categories-bar.is-open { max-height: none; transform: translateX(0); visibility: visible; }
  .mobile-nav-head {
    position: sticky; top: 0; z-index: 2; display: flex; align-items: center;
    justify-content: space-between; gap: .75rem; padding: max(.85rem,env(safe-area-inset-top)) 1rem .85rem;
    border-bottom: 1px solid var(--border-light); background: rgba(255,255,255,.97);
  }
  [data-theme="dark"] .mobile-nav-head { background: rgba(21,26,36,.98); }
  .mobile-nav-brand { display: flex; align-items: center; gap: .65rem; min-width: 0; }
  .mobile-nav-brand img { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 11px; object-fit: contain; background: #fff; border: 1px solid var(--border-light); }
  .mobile-nav-brand span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
  .mobile-nav-brand strong { color: var(--text); font-family: var(--font-sans); font-size: .9rem; }
  .mobile-nav-brand small { color: var(--muted); font-size: .7rem; }
  .mobile-nav-close { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); cursor: pointer; font-size: 1.45rem; line-height: 1; }
  .mobile-nav-close:hover { color: var(--primary); border-color: var(--primary); }
  .categories-bar .container { width: 100%; min-height: auto; flex-direction: column; align-items: stretch; padding: .7rem; gap: .3rem; }
  .categories-bar a { width: 100%; min-height: 48px; flex: 0 0 auto; border: 0; border-radius: 12px; padding-inline: 1rem; font-size: .9rem; }
  .categories-bar a:hover, .categories-bar a.active { border: 0; background: var(--primary-t90); }
  .nav-overlay.is-open { display: block; position: fixed; inset: 0; background: rgba(12,29,49,.48); backdrop-filter: blur(2px); z-index: 1000; }
}

/* ===== BREAKING NEWS ===== */
.breaking-news {
  display: flex; align-items: center; gap: .65rem;
  margin-bottom: 1.15rem; padding: .45rem;
  border: 1px solid #fecaca; border-radius: 14px;
  background: #fffafa; box-shadow: var(--shadow-xs); overflow: hidden;
}
.breaking-label {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .42rem .7rem; border-radius: 10px;
  color: #fff; background: var(--breaking-red);
  font-size: .75rem; font-weight: 900; white-space: nowrap; flex-shrink: 0;
}
.breaking-viewport { flex: 1; min-width: 0; overflow: hidden; mask-image: linear-gradient(90deg,transparent,#000 4%,#000 96%,transparent); }
.breaking-track { display: flex; align-items: center; gap: 2.5rem; width: max-content; will-change: transform; }
.breaking-track.is-moving { animation: ticker-rtl var(--ticker-duration,30s) linear infinite; }
[dir="ltr"] .breaking-track.is-moving { animation-name: ticker-ltr; }
.breaking-track.is-paused { animation-play-state: paused; }
.breaking-track a { position: relative; color: var(--text-secondary); font-weight: 800; white-space: nowrap; font-size: .84rem; }
.breaking-track a::after { content: ''; position: absolute; inset-inline-end: -1.35rem; top: 50%; width: 4px; height: 4px; border-radius: 50%; background: #f87171; }
.breaking-track a:hover { color: var(--breaking-red); }
.ticker-toggle { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border: 1px solid #fecaca; border-radius: 9px; background: #fff; color: var(--breaking-red); cursor: pointer; font-family: var(--font-sans); font-size: .72rem; font-weight: 900; }
.ticker-toggle:hover { background: #fee2e2; }
@keyframes ticker-rtl { to { transform: translate3d(var(--ticker-shift,50%),0,0); } }
@keyframes ticker-ltr { to { transform: translate3d(var(--ticker-shift,-50%),0,0); } }
[data-theme="dark"] .breaking-news { background: #21171b; border-color: #6e2930; }

/* ===== HERO SECTION ===== */
.news-hero { display: grid; grid-template-columns: 1.55fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.hero-slider {
  position: relative; min-height: clamp(320px, 42vw, 440px);
  overflow: hidden; border-radius: var(--radius-2xl);
  background: #1a1a1a; box-shadow: var(--shadow-md); isolation: isolate;
}
.hero-slide {
  position: absolute; inset: 0; display: grid; align-items: end;
  padding: clamp(1.2rem,2vw,2rem); color: #fff;
  opacity: 0; transition: opacity .6s ease; pointer-events: none;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-slide img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(0,0,0,.94) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,.05) 100%); }
.hero-kicker { display: inline-flex; align-items: center; width: fit-content; margin-bottom: .55rem; padding: .25rem .55rem; border-radius: var(--radius-full); color: #fff; background: var(--primary); font-size: .7rem; font-weight: 900; }
.hero-slide h1, .hero-slide h2 { max-width: 780px; margin-bottom: .5rem; color: #fff; font-size: clamp(1.3rem,2.5vw,1.95rem); text-wrap: balance; }
.hero-slide p { max-width: 640px; color: rgba(255,255,255,.8); font-size: .92rem; line-height: 1.6; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .6rem 1rem; color: rgba(255,255,255,.7); font-size: .8rem; }
.slider-controls { position: absolute; inset-inline-start: 1rem; bottom: 1rem; display: flex; gap: .4rem; z-index: 2; }
.slider-dot { width: 32px; height: 4px; border: 0; border-radius: var(--radius-full); background: rgba(255,255,255,.3); cursor: pointer; transition: all var(--transition-fast); }
.slider-dot.active, .slider-dot:hover { background: #fff; }

.hero-side { display: grid; gap: .85rem; grid-template-rows: 1fr 1fr auto; }
.hero-side-card {
  position: relative; min-height: 130px; overflow: hidden;
  border-radius: var(--radius-xl); background: #1a1a1a;
  box-shadow: var(--shadow-sm); isolation: isolate;
}
.hero-side-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: transform var(--transition-slow), opacity var(--transition); }
.hero-side-card:hover img { transform: scale(1.04); opacity: .95; }
.hero-side-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.9) 0%, transparent 55%); }
.hero-side-card div { position: absolute; inset-inline: 0; bottom: 0; padding: .85rem; color: #fff; z-index: 1; }
.hero-side-card h3 { margin: 0; color: #fff; font-size: .88rem; line-height: 1.35; }
.hero-side-card .hero-kicker { margin-bottom: .35rem; font-size: .65rem; padding: .15rem .45rem; }

/* ===== SECTIONS ===== */
.section-title {
  display: flex; align-items: center; gap: .65rem;
  margin-bottom: 1rem; font-size: 1.25rem; font-weight: 900;
}
.section-title::before { content: ''; width: 4px; height: 1.35em; border-radius: var(--radius-full); background: var(--primary); flex-shrink: 0; }
.section-title a { margin-inline-start: auto; font-size: .82rem; font-weight: 700; color: var(--muted); }
.section-title a:hover { color: var(--primary); }

.grid { display: grid; grid-template-columns: minmax(0,2.3fr) minmax(260px,.9fr); gap: clamp(.85rem,2vw,1.25rem); align-items: start; }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

.card {
  position: relative; display: flex; flex-direction: column; min-height: 100%;
  overflow: hidden; border: 1px solid var(--border-light); border-radius: 18px;
  background: var(--panel); box-shadow: var(--shadow-xs);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-4px); border-color: #cfe0f3; }

/* ===== ADMIN SETTINGS CONTROLS ===== */
.settings-card { padding: 1.5rem; margin-bottom: 1.5rem; overflow: visible; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.settings-heading h3 { margin: 0 0 .2rem; }
.settings-heading p { margin: 0; color: var(--muted); font-size: .84rem; }
.switch-control { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; white-space: nowrap; }
.switch-control input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; width: 46px; height: 26px; border-radius: 99px; background: #cbd5e1; transition: background var(--transition-fast); }
.switch-ui::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform var(--transition-fast); }
.switch-control input:checked + .switch-ui { background: var(--success); }
.switch-control input:checked + .switch-ui::after { transform: translateX(-20px); }
[dir="ltr"] .switch-control input:checked + .switch-ui::after { transform: translateX(20px); }
.switch-control input:focus-visible + .switch-ui { outline: 3px solid var(--primary-t88); outline-offset: 2px; }
.range-control { display: grid; grid-template-columns: auto minmax(160px,1fr) auto auto; align-items: center; gap: .7rem; color: var(--muted); font-size: .78rem; }
.range-control input { width: 100%; accent-color: var(--primary); }
.range-control output { min-width: 58px; color: var(--text); font-weight: 800; text-align: center; }
.logo-settings { overflow: visible; }
.logo-preview { display: grid; place-items: center; width: 94px; height: 94px; flex: 0 0 auto; padding: .45rem; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(135deg,#fff,#eef5fc); box-shadow: var(--shadow-sm); }
.logo-preview img { width: 100%; height: 100%; border-radius: 14px; object-fit: contain; }
.field-help { display: block; margin-top: .35rem; color: var(--muted); font-size: .75rem; }
.remove-logo { display: inline-flex; align-items: center; gap: .4rem; margin-top: .6rem; color: var(--muted); font-size: .8rem; }
.automation-status .admin-card { position: relative; }
.automation-status .admin-card h3 { margin-inline-start: 1.2rem; font-size: 1.05rem; color: var(--text); }
.status-dot { position: absolute; top: 1.28rem; inset-inline-start: 1rem; width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 4px rgba(148,163,184,.14); }
.status-dot.ok { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.14); }
.status-dot.warn { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.14); }
.status-dot.off { background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.12); }
.card > a { display: flex; flex: 1; flex-direction: column; color: inherit; }
.card-video-icon { position: absolute; inset-inline-start: .75rem; top: .75rem; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-full); background: rgba(0,0,0,.65); color: #fff; backdrop-filter: blur(4px); }
.card-breaking { position: absolute; inset-inline-end: .75rem; top: .75rem; z-index: 1; padding: .2rem .5rem; border-radius: var(--radius-full); background: var(--breaking-red); color: #fff; font-size: .68rem; font-weight: 900; }
.card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--bg-secondary); min-height: 140px; transition: transform var(--transition-slow); }
.card:hover img { transform: scale(1.03); }
.card-body { display: flex; flex: 1; flex-direction: column; padding: .85rem; }
.card-cat { margin-bottom: .45rem; padding: .2rem .55rem; border-radius: var(--radius-full); color: var(--primary); background: var(--primary-t88); font-size: .72rem; font-weight: 800; width: fit-content; }
.card-title { display: -webkit-box; margin-bottom: .45rem; color: var(--text); font-size: .98rem; line-height: 1.42; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.card-excerpt { display: -webkit-box; color: var(--text-secondary); font-size: .85rem; line-height: 1.55; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-meta { display: flex; flex-wrap: wrap; gap: .5rem .75rem; color: var(--muted); font-size: .78rem; margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--border-light); }

/* Card sizes */
.card-lg .card-title { font-size: 1.1rem; }
.card-lg img { aspect-ratio: 16/9; }
.card-horizontal { flex-direction: row; }
.card-horizontal img { width: 140px; aspect-ratio: auto; min-height: 100px; flex-shrink: 0; }
.card-horizontal .card-body { padding: .7rem .85rem; }

/* ===== SIDEBAR ===== */
.sidebar-box {
  padding: .9rem; margin-bottom: .9rem;
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--panel); box-shadow: var(--shadow-xs);
}
.sidebar-box h3 {
  display: flex; align-items: center; gap: .45rem;
  margin-bottom: .7rem; padding-bottom: .55rem;
  border-bottom: 2px solid var(--border-light); font-size: .9rem; font-weight: 800;
}
.sidebar-item { display: flex; gap: .65rem; align-items: center; padding: .55rem .4rem; border-bottom: 1px solid var(--border-light); border-radius: var(--radius-md); color: var(--text); transition: background var(--transition-fast); }
.sidebar-item:last-child { border-bottom: 0; }
.sidebar-item:hover { background: var(--bg-secondary); color: var(--text); }
.sidebar-item img { width: 62px; height: 52px; border-radius: var(--radius-md); object-fit: cover; flex-shrink: 0; }
.sidebar-item div { min-width: 0; font-size: .84rem; }
.sidebar-item strong { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 700; }

.sidebar-rank { display: flex; align-items: center; gap: .6rem; padding: .55rem .4rem; border-bottom: 1px solid var(--border-light); }
.sidebar-rank:last-child { border-bottom: 0; }
.sidebar-rank-num { width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--bg-secondary); color: var(--muted); font-weight: 900; font-size: .82rem; flex-shrink: 0; }
.sidebar-rank:nth-child(1) .sidebar-rank-num { background: var(--primary); color: #fff; }
.sidebar-rank:nth-child(2) .sidebar-rank-num, .sidebar-rank:nth-child(3) .sidebar-rank-num { background: var(--accent); color: #fff; }
.sidebar-rank div { min-width: 0; font-size: .84rem; }
.sidebar-rank strong { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 700; color: var(--text); }
.sidebar-rank a { color: inherit; display: flex; gap: .6rem; align-items: center; width: 100%; }
.sidebar-rank a:hover strong { color: var(--primary); }

/* ===== AD SLOTS ===== */
.ad-slot {
  position: relative; display: block; margin: 1.5rem 0; padding: .85rem;
  border: 1px dashed var(--primary-border); border-radius: var(--radius-xl);
  background: var(--primary-t95); overflow: hidden; text-align: center;
  min-height: 90px; contain: layout;
}
.ad-slot .ad-slot-label { display: block; margin: 0 0 .5rem; color: var(--muted); font-family: var(--font-sans); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ad-slot .ad-slot-inner { min-height: 90px; display: grid; place-items: center; }
.ad-slot .ad-slot-inner ins.adsbygoogle { display: block; width: 100%; max-width: 100%; }
.ad-slot[data-ad-key="home_between_cards"], .ad-slot.grid-span { grid-column: 1 / -1; }
.ad-slot:empty, .ad-slot[style*="display:none"] { display: none; }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; width: fit-content; padding: .3rem .65rem; border-radius: var(--radius-full); font-size: .75rem; font-weight: 800; white-space: nowrap; }
.badge-primary { color: #fff; background: var(--primary); }
.badge-success { color: #064e3b; background: #d1fae5; }
.badge-warning { color: #78350f; background: #fef3c7; }
.badge-danger { color: #7f1d1d; background: #fee2e2; }
.badge-info { color: #1e3a5f; background: #dbeafe; }

/* ===== BREADCRUMBS ===== */
.breadcrumb { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; color: var(--muted); font-size: .84rem; margin-bottom: 1.15rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

/* ===== ARTICLE ===== */
.article-body {
  padding: clamp(1.15rem,2vw,2rem); border: 1px solid var(--border);
  border-radius: var(--radius-2xl); background: var(--panel); box-shadow: var(--shadow-sm);
}
.article-title { font-size: clamp(1.6rem,3vw,2.3rem) !important; text-wrap: balance; line-height: 1.25 !important; margin-bottom: .85rem !important; }
.article-excerpt { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.7; margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border-light); }
.article-meta { display: flex; flex-wrap: wrap; gap: .6rem 1.1rem; color: var(--muted); font-size: .84rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-light); margin-bottom: 1.25rem; }
.article-featured-image { margin: 1.25rem 0; text-align: center; }
.article-featured-image img { display:block; width: 100%; height:auto; max-height:none; object-fit:contain; border-radius: var(--radius-xl); background:var(--bg-secondary); }
.article-featured-image figcaption { margin-top: .6rem; color: var(--muted); font-size: .85rem; }
.article-content { color: var(--text); font-size: clamp(.95rem,1vw,1.08rem); line-height: 1.95; }
.article-content > * + * { margin-top: .9rem; }
.article-content h2 { margin-top: 1.5rem; padding-bottom: .35rem; border-bottom: 2px solid var(--border-light); }
.article-content h3 { margin-top: 1.25rem; }
.article-content p { margin-bottom: .9rem; }
.article-content a { border-bottom: 1.5px solid var(--primary-t88); font-weight: 700; }
.article-content a:hover { border-bottom-color: var(--primary); }
.article-content blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; border-inline-start: 4px solid var(--primary); border-radius: var(--radius-lg); background: var(--bg-secondary); color: var(--text-secondary); font-style: italic; }
.article-content pre, pre { overflow: auto; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #0f172a; color: #e2e8f0; font-size: .88rem; }
.article-content pre code { background: transparent; color: inherit; padding: 0; }
code { padding: .12rem .4rem; border-radius: var(--radius-sm); background: var(--bg-secondary); color: var(--primary); font-family: var(--font-mono); font-size: .9em; }
.code-shell { margin: 1.35rem 0; overflow: hidden; border: 1px solid #1e293b; border-radius: var(--radius-lg); background: #0f172a; box-shadow: var(--shadow-sm); direction: ltr; }
.code-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .65rem; border-bottom: 1px solid rgba(148,163,184,.18); background: #111827; color: #cbd5e1; direction: rtl; min-height: 38px; }
.code-language { font-family: var(--font-sans); font-size: .72rem; font-weight: 800; white-space: nowrap; flex-shrink: 0; }
.code-copy { min-height: 30px; padding: .25rem .6rem; border: 1px solid rgba(148,163,184,.28); border-radius: var(--radius-sm); background: rgba(255,255,255,.06); color: #f8fafc; cursor: pointer; font-size: .75rem; font-weight: 800; white-space: nowrap; flex-shrink: 0; transition: background .2s, border-color .2s; }
.code-copy:hover { background: var(--primary); border-color: var(--primary); }
.code-copy.copied { background: #16a34a; border-color: #16a34a; }
.code-shell pre { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.code-shell code { white-space: pre; color: #e2e8f0; }
.table-scroll { width: 100%; overflow-x: auto; margin: 1rem 0; border-radius: var(--radius-lg); -webkit-overflow-scrolling: touch; }
.table-scroll::-webkit-scrollbar { height: 4px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; min-width: 480px; }
.article-content th,.article-content td { padding: .65rem .75rem; border: 1px solid var(--border); text-align: right; font-size: .88rem; }
.article-content th { background: var(--bg-secondary); font-weight: 800; white-space: nowrap; }
.article-content ul,.article-content ol { padding-inline-start: 1.5rem; }
.article-content li { margin-bottom: .5rem; }
.article-content iframe { max-width: 100%; }
.article-content video { max-width: 100%; }
.article-content img { max-width: 100%; height: auto; }

/* Tags */
.tag { display: inline-flex; padding: .4rem .85rem; background: var(--bg-secondary); border-radius: var(--radius-full); color: var(--primary); font-size: .84rem; font-weight: 700; transition: all var(--transition-fast); }
.tag:hover { background: var(--primary); color: #fff; }

/* Video embed */
.video-embed { position: relative; margin: 1.5rem 0; border-radius: var(--radius-xl); overflow: hidden; background: #000; }
.video-embed::before { content: ''; display: block; padding-top: 56.25%; }
.video-embed iframe { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed .video-preview { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; }
.video-embed .video-preview img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.video-embed .video-preview:hover img { opacity: .95; }
.video-embed .video-play-btn { position: absolute; display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--radius-full); background: rgba(204,30,30,.9); color: #fff; pointer-events: none; box-shadow: 0 4px 20px rgba(0,0,0,.35); }

/* Source box */
.source-box { margin: 1.5rem 0; padding: 1rem 1.15rem; background: var(--bg-secondary); border-radius: var(--radius-lg); font-size: .88rem; }
.source-box a { font-weight: 700; }

/* Share bar */
.share-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1.5rem 0; }
.share-bar .btn { font-size: .84rem; }

/* Prev/Next navigation */
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.75rem 0; }
.article-nav a { display: block; padding: 1.15rem; background: var(--bg-secondary); border-radius: var(--radius-xl); color: var(--text); transition: all var(--transition-fast); }
.article-nav a:hover { background: var(--primary-t90); color: var(--primary); }
.article-nav .nav-label { color: var(--muted); font-size: .82rem; margin-bottom: .3rem; }
.article-nav .nav-title { font-weight: 800; color: var(--primary); }

/* ===== COMMENTS ===== */
.article-downloads,.comments-section { margin: 2rem 0; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--panel-strong); }
.article-primary-download{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:2.5rem 0;padding:1.25rem 1.4rem;border:1px solid var(--border);border-radius:var(--radius-xl);background:linear-gradient(135deg,var(--primary-t95),var(--panel));box-shadow:var(--shadow-sm)}
.article-primary-download>div{display:grid;gap:.25rem}.article-primary-download small{color:var(--muted)}.article-primary-download .btn{flex:none}
.section-heading { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: 1rem; }
.section-heading h2 { margin-bottom: .2rem; font-size: 1.2rem; }
.section-heading p { margin: 0; color: var(--muted); font-size: .9rem; }
.section-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-md); color: #fff; background: var(--primary); flex-shrink: 0; }
.download-list { display: grid; gap: .75rem; }
.download-card { display: grid; grid-template-columns: auto 1fr auto; gap: .85rem; align-items: center; padding: .85rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); color: var(--text); transition: all var(--transition-fast); }
.download-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-2px); color: var(--text); }
.download-ext { display: inline-grid; place-items: center; min-width: 50px; min-height: 44px; border-radius: var(--radius-md); background: var(--primary-t88); color: var(--primary); font-family: var(--font-sans); font-size: .72rem; font-weight: 900; }
.download-info { min-width: 0; }
.download-info strong { display: block; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.download-info small { color: var(--muted); }
.download-action { padding: .4rem .8rem; border-radius: var(--radius-md); background: var(--primary); color: #fff; font-weight: 800; font-size: .84rem; white-space: nowrap; }
.comment-list { display: grid; gap: 1rem; margin-bottom: 1.25rem; }
.comment-card { display: grid; grid-template-columns: 44px 1fr; gap: .8rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); }
.comment-card-reply { margin-top: .75rem; background: var(--panel-strong); }
.comment-avatar { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-full); background: var(--secondary-t82); color: var(--secondary); font-weight: 900; font-size: 1rem; }
.comment-avatar img,.comment-identity img{width:100%;height:100%;object-fit:cover;border-radius:inherit}.comment-identity{display:flex;align-items:center;gap:.7rem;padding:.75rem;background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius-lg)}.comment-identity img{width:42px;height:42px;border-radius:50%}.comment-identity div{display:grid;flex:1}.comment-identity small{color:var(--muted)}.google-comment-login{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;padding:.85rem;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--panel)}
.comment-content header { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .3rem; }
.comment-content time { color: var(--muted); font-size: .8rem; }
.comment-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .4rem; }
.comment-like,.comment-reply { border: 0; border-radius: var(--radius-md); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; padding: .3rem .7rem; font-size: .82rem; font-weight: 700; transition: all var(--transition-fast); }
.comment-like:hover,.comment-reply:hover { background: var(--primary); color: #fff; }
.comment-replies { margin-top: .8rem; }
.comment-form { display: grid; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-light); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.hp-field { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.reply-target { padding: .65rem .85rem; border-radius: var(--radius-md); background: var(--primary-t90); color: var(--text); font-size: .9rem; }
.reply-target button { margin-inline-start: .5rem; border: 0; background: transparent; color: var(--primary); cursor: pointer; font-weight: 900; }
.empty-state { padding: 1.5rem; border: 1px dashed var(--border); border-radius: var(--radius-lg); color: var(--muted); text-align: center; }

/* ===== FORMS & BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 38px; padding: .55rem .9rem;
  border: 2px solid transparent; border-radius: var(--radius-md);
  font-weight: 800; cursor: pointer; white-space: nowrap;
  transition: all var(--transition-fast); font-size: .9rem;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 4px 12px rgba(204,30,30,.25); }
.btn-primary:hover { color: #fff; background: var(--primary-dark); box-shadow: 0 6px 18px rgba(204,30,30,.35); }
.btn-secondary { color: var(--text); background: var(--panel); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-accent { color: #fff; background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-danger { color: #fff; background: var(--error); }
.btn-success { color: #fff; background: var(--success); }
.btn-sm { min-height: 32px; padding: .35rem .65rem; font-size: .8rem; }
.btn-lg { min-height: 46px; padding: .75rem 1.25rem; font-size: 1rem; }
.btn-block { width: 100%; }

.form-group { margin-bottom: .8rem; }
label { display: block; margin-bottom: .35rem; color: var(--text-secondary); font-size: .85rem; font-weight: 700; }
input[type="text"],input[type="email"],input[type="password"],input[type="number"],input[type="date"],input[type="time"],input[type="search"],input[type="url"],input[type="file"],textarea,select {
  width: 100%; min-height: 40px; padding: .55rem .8rem;
  border: 2px solid var(--border); border-radius: var(--radius-md);
  color: var(--text); background: var(--panel); outline: 0; font-size: .95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(204,30,30,.08); }

table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--panel); box-shadow: var(--shadow-xs); }
th, td { padding: .7rem .8rem; border-bottom: 1px solid var(--border-light); text-align: right; vertical-align: middle; }
th { color: var(--muted); background: var(--bg-secondary); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
tbody tr:hover { background: var(--bg-secondary); }
tbody tr:last-child td { border-bottom: 0; }

.pagination { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; justify-content: center; margin-top: 1.5rem; }
.pagination a,.pagination span { display: inline-grid; place-items: center; min-width: 36px; min-height: 36px; padding: .35rem .65rem; border: 2px solid var(--border); border-radius: var(--radius-md); color: var(--text-secondary); background: var(--panel); font-weight: 800; transition: all var(--transition-fast); }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .pagination-current,.pagination span.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.pagination .pagination-dots { border: 0; background: transparent; min-width: auto; }

.alert {
  position: relative; display: flex; gap: .6rem; align-items: flex-start;
  padding: .75rem .9rem; margin-bottom: .85rem;
  border: 1px solid var(--border); border-inline-start-width: 4px;
  border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-xs);
  transition: opacity var(--transition), transform var(--transition);
}
.alert-success { border-inline-start-color: var(--success); }
.alert-error { border-inline-start-color: var(--error); }
.alert-warning { border-inline-start-color: var(--warning); }
.alert-info { border-inline-start-color: var(--info); }
.btn-close { margin-inline-start: auto; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1.2rem; opacity: .7; }
.btn-close:hover { opacity: 1; }

/* ===== FOOTER ===== */
.site-footer {
  position: relative; margin-top: 2rem; padding: 2rem 0 1rem;
  color: rgba(255,255,255,.8); background: #0b0e15;
  overflow: hidden; font-size: .9rem;
}
.site-footer::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 20% 20%, rgba(204,30,30,.08), transparent 55%); pointer-events: none; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3,1fr); gap: 1rem; position: relative; z-index: 1; }
.footer-brand { max-width: 340px; }
.footer-brand h4 { background: linear-gradient(135deg, var(--primary-light), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-size: 1.1rem; }
.site-footer h4 { color: #fff; font-size: .92rem; margin-bottom: .6rem; }
.site-footer p { color: rgba(255,255,255,.6); font-size: .84rem; }
.site-footer a { display: flex; gap: .35rem; align-items: center; width: fit-content; margin-bottom: .35rem; color: rgba(255,255,255,.65); font-size: .84rem; transition: color var(--transition-fast); }
.site-footer a:hover { color: var(--primary-light); }
.social-links { display: flex; gap: .45rem; margin-top: .6rem; }
.social-links a { display: inline-grid; place-items: center; width: 32px; height: 32px; margin: 0; border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-full); color: rgba(255,255,255,.65); background: rgba(255,255,255,.04); transition: all var(--transition-fast); }
.social-links a:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: translateY(-2px); }
.footer-subscribe { display: flex; gap: .4rem; margin-top: .5rem; }
.footer-subscribe input { min-width: 0; color: #fff; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); min-height: 34px; padding: .35rem .65rem; font-size: .84rem; }
.footer-subscribe input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(204,30,30,.15); }
.footer-bottom { display: flex; gap: .75rem; justify-content: space-between; align-items: center; margin-top: 1.25rem; padding-top: .9rem; border-top: 1px solid rgba(255,255,255,.06); color: rgba(255,255,255,.45); font-size: .78rem; position: relative; z-index: 1; }

/* ===== CATEGORY PANEL ===== */
.network-category-panel {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  margin: 0 0 1.5rem; padding: 1.25rem;
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--secondary-t90), var(--primary-t94)), var(--panel);
}
.network-category-panel h2 { margin-bottom: .2rem; font-size: 1.15rem; }
.network-category-panel p { margin: 0; color: var(--muted); }
.network-chips { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: flex-end; }
.network-chips span { padding: .35rem .7rem; border-radius: var(--radius-full); background: #0f172a; color: #e2e8f0; font-family: var(--font-sans); font-size: .76rem; font-weight: 800; }

/* ===== ADMIN ===== */
.editor-panel,.upload-panel,.admin-file-list { padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); margin: 1rem 0; }
.editor-toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .85rem; }
.editor-toolbar button { min-height: 34px; padding: .35rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-secondary); color: var(--text); cursor: pointer; font-size: .84rem; font-weight: 800; }
.editor-toolbar button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-t95); }
.upload-panel small { display: block; margin-top: .4rem; color: var(--muted); }
.admin-file-list h3 { font-size: 1rem; }
.admin-file-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem; border: 1px solid var(--border-light); border-radius: var(--radius-md); margin-top: .5rem; }
.admin-file-row span { min-width: 0; }
.admin-file-row small { display: block; color: var(--muted); font-size: .8rem; }

/* ===== VIDEO SECTION ===== */
.video-hero {
  position: relative; min-height: clamp(300px, 50vw, 500px);
  border-radius: var(--radius-2xl); overflow: hidden;
  background: #000; box-shadow: var(--shadow-md); margin-bottom: 1.5rem;
}
.video-hero-embed { position: absolute; inset: 0; }
.video-hero-embed iframe, .video-hero-embed video { width: 100%; height: 100%; border: 0; }
.video-hero-info {
  position: absolute; bottom: 0; inset-inline: 0;
  padding: clamp(1rem, 2vw, 2rem); z-index: 2;
  background: linear-gradient(0deg, rgba(0,0,0,.9) 0%, transparent 100%); color: #fff;
}
.video-hero-info h1 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); margin-bottom: .4rem; }
.video-hero-info p { font-size: .9rem; color: rgba(255,255,255,.8); max-width: 600px; }
.video-hero-meta { display: flex; flex-wrap: wrap; gap: .6rem 1rem; margin-top: .6rem; color: rgba(255,255,255,.65); font-size: .8rem; }
.video-hero-meta svg { width: 14px; height: 14px; }

.video-card {
  position: relative; display: flex; flex-direction: column;
  overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--panel); box-shadow: var(--shadow-xs);
  transition: transform var(--transition), box-shadow var(--transition);
}
.video-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.video-card > a { display: flex; flex-direction: column; color: inherit; }
.video-card-thumb {
  position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #000;
}
.video-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-slow); }
.video-card:hover .video-card-thumb img { transform: scale(1.04); }
.video-card-thumb .video-play-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.3); opacity: 0; transition: opacity var(--transition);
}
.video-card:hover .video-play-overlay { opacity: 1; }
.video-play-icon {
  width: 50px; height: 50px; border-radius: var(--radius-full);
  background: rgba(220,38,38,.9); color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.video-card-duration {
  position: absolute; bottom: .5rem; inset-inline-end: .5rem;
  padding: .15rem .4rem; border-radius: var(--radius-sm);
  background: rgba(0,0,0,.8); color: #fff; font-size: .72rem; font-weight: 700;
  font-family: var(--font-sans);
}
.video-card-badge {
  position: absolute; top: .5rem; inset-inline-start: .5rem;
  padding: .2rem .5rem; border-radius: var(--radius-full);
  background: var(--primary); color: #fff; font-size: .68rem; font-weight: 800; z-index: 1;
}
.video-card-body { padding: .75rem; }
.video-card-cat { margin-bottom: .35rem; color: var(--primary); font-size: .72rem; font-weight: 800; }
.video-card-title { display: -webkit-box; color: var(--text); font-size: .92rem; line-height: 1.4; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 700; }
.video-card-meta { display: flex; flex-wrap: wrap; gap: .4rem .7rem; color: var(--muted); font-size: .75rem; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--border-light); }
.video-card-meta svg { width: 13px; height: 13px; }

.video-section { margin-bottom: 2rem; }
.video-section-title {
  display: flex; align-items: center; gap: .65rem;
  margin-bottom: 1rem; font-size: 1.2rem; font-weight: 900;
}
.video-section-title::before { content: ''; width: 4px; height: 1.35em; border-radius: var(--radius-full); background: var(--breaking-red); flex-shrink: 0; }

.video-sidebar-box {
  padding: .85rem; margin-bottom: .85rem;
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--panel); box-shadow: var(--shadow-xs);
}
.video-sidebar-item {
  display: flex; gap: .6rem; align-items: center; padding: .5rem .3rem;
  border-bottom: 1px solid var(--border-light); color: var(--text);
  transition: background var(--transition-fast);
}
.video-sidebar-item:last-child { border-bottom: 0; }
.video-sidebar-item:hover { background: var(--bg-secondary); color: var(--text); }
.video-sidebar-item img { width: 80px; height: 52px; border-radius: var(--radius-md); object-fit: cover; flex-shrink: 0; }
.video-sidebar-item div { min-width: 0; font-size: .82rem; }
.video-sidebar-item strong { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 700; }

@media (max-width: 1060px) {
  .video-hero { min-height: 260px; }
}
@media (max-width: 760px) {
  .video-card-thumb { aspect-ratio: 16/10; }
}

/* ===== MEDIA LIBRARY ===== */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.media-item {
  position: relative; aspect-ratio: 1; overflow: hidden;
  border: 2px solid var(--border); border-radius: var(--radius-lg);
  cursor: pointer; transition: border-color var(--transition-fast);
}
.media-item:hover { border-color: var(--primary); }
.media-item img { width: 100%; height: 100%; object-fit: cover; }
.media-item.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-t88); }
.media-item-info {
  position: absolute; bottom: 0; inset-inline: 0; padding: .35rem .5rem;
  background: linear-gradient(0deg, rgba(0,0,0,.8), transparent);
  color: #fff; font-size: .7rem;
}

/* ===== ARTICLE CONTENT IMAGES ===== */
.article-content img {
  max-width: 100%; height: auto; border-radius: var(--radius-lg);
  margin: 1rem auto; display: block;
}
.article-content figure {
  margin: 1.5rem 0; text-align: center;
}
.article-content figure img { max-width: 100%; height: auto; border-radius: var(--radius-lg); }
.article-content figcaption {
  margin-top: .5rem; color: var(--muted); font-size: .85rem; font-style: italic;
}
.article-content .image-source {
  display: inline-block; margin-top: .3rem; color: var(--muted);
  font-size: .78rem; opacity: .7;
}

/* ===== SHARE BAR TELEGRAM ===== */
.share-bar .btn-telegram { background: #0088cc; color: #fff; border: 0; }

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.hidden { display: none !important; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 2.5rem; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ===== SKELETON LOADING ===== */
.skeleton { background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-light) 50%, var(--bg-secondary) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-md); }
.skeleton-text { height: 1em; margin-bottom: .5rem; }
.skeleton-title { height: 1.4em; width: 70%; margin-bottom: .6rem; }
.skeleton-image { aspect-ratio: 16/10; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 1060px) {
  .header-top { gap: .6rem; }
  .search-box { display: none; }
  .search-toggle { display: grid; }
  .menu-toggle { display: grid; }
  .news-hero, .grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 760px) {
  .container { width: min(100% - .85rem, 1280px); }
  main.container { padding-top: .75rem; }
  .header-top { min-height: 66px; padding-block: .55rem; }
  .logo-title span { display: block; font-size: .6rem; }
  .logo-mark, .logo-text-mark { width: 48px; height: 48px; border-radius: 13px; }
  .logo-title strong { font-size: .94rem; }
  .breaking-news { border-radius: 12px; }
  .breaking-label { padding-inline: .55rem; }
  .hero-side { grid-template-columns: 1fr; }
  .hero-slider { min-height: 260px; }
  .cards { grid-template-columns: 1fr; }
  .card-horizontal { flex-direction: column; }
  .card-horizontal img { width: 100%; aspect-ratio: 16/10; }
  .article-body { border-radius: var(--radius-lg); padding: 1rem; overflow: hidden; }
  .article-primary-download{align-items:stretch;flex-direction:column}.article-primary-download .btn{justify-content:center}
  .form-grid { grid-template-columns: 1fr; }
  .download-card { grid-template-columns: auto 1fr; }
  .download-action { grid-column: 1 / -1; text-align: center; }
  .comment-card { grid-template-columns: 1fr; }
  .article-nav { grid-template-columns: 1fr; }
  .network-category-panel { align-items: flex-start; flex-direction: column; padding: 1rem; }
  .network-category-panel h2 { font-size: 1.05rem; }
  .network-chips { justify-content: flex-start; }
  .code-shell { margin: 1rem -1rem; border-radius: 0; border-left: 0; border-right: 0; }
  .code-toolbar { padding: .45rem .6rem; }
  .code-language { font-size: .7rem; }
  .code-copy { font-size: .72rem; padding: .2rem .5rem; min-height: 28px; }
  .article-content pre, pre { font-size: .82rem; padding: .75rem; }
  .article-content table { min-width: 380px; }
  .article-content th,.article-content td { padding: .55rem .6rem; font-size: .82rem; }
  .share-bar .btn { font-size: .78rem; padding: .4rem .65rem; }
  .share-bar { gap: .35rem; }
  .article-content iframe { width: 100%; }
  .download-card { padding: .75rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: .5rem; text-align: center; }
}
@media (max-width: 480px) {
  .header-top { gap: .4rem; }
  .logo { gap: .5rem; }
  .logo-mark, .logo-text-mark { width: 42px; height: 42px; border-radius: 11px; }
  .logo-title strong { font-size: .82rem; }
  .logo-title span { max-width: 132px; overflow: hidden; text-overflow: ellipsis; }
  .theme-toggle { display: none; }
  .settings-heading { align-items: flex-start; flex-direction: column; }
  .range-control { grid-template-columns: auto 1fr auto; }
  .range-control output { grid-column: 2; grid-row: 2; justify-self: center; }
  .hero-slider { min-height: 220px; }
  .hero-slide { padding: 1rem; }
  .hero-slide h1, .hero-slide h2 { font-size: 1.15rem; }
  .hero-slide p { display: none; }
  .card-title { font-size: .92rem; }
  .article-title { font-size: 1.35rem !important; }
  .article-content { font-size: .93rem; }
  .article-body { padding: .75rem; }
  .code-shell { margin: .85rem -0.75rem; }
  .code-toolbar { padding: .4rem .55rem; gap: .35rem; }
  .code-copy { font-size: .7rem; padding: .18rem .45rem; }
  .article-content pre, pre { font-size: .78rem; padding: .65rem; }
  .table-scroll { margin: .75rem -0.75rem; width: calc(100% + 1.5rem); }
  .article-content th,.article-content td { padding: .45rem .5rem; font-size: .78rem; }
  .share-bar { gap: .3rem; }
  .share-bar .btn { font-size: .75rem; padding: .35rem .55rem; }
  .download-card { padding: .65rem; gap: .65rem; }
  .download-ext { font-size: .75rem; }
  .network-category-panel { padding: .85rem; }
  .network-chips span { font-size: .7rem; padding: .3rem .6rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .sidebar-item img { width: 50px; height: 44px; }
}
@media (max-width: 380px) {
  .hero-slider { min-height: 190px; }
  .card img { min-height: 110px; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::selection { background: rgba(21,101,192,.18); color: var(--text); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 1ms !important; }
  .breaking-track.is-moving { animation: none !important; transform: none !important; }
}
@media print {
  .site-header, .site-footer, aside, .ad-slot, .breaking-news { display: none !important; }
  body { background: #fff; color: #000; }
  main.container { width: 100%; }
}

/* ===== LTR SUPPORT (English) ===== */
html[dir="ltr"] {
  direction: ltr;
  text-align: left;
}
html[dir="ltr"] body {
  font-family: var(--font-sans);
}
html[dir="ltr"] .logo-title span {
  direction: ltr;
  unicode-bidi: embed;
}
html[dir="ltr"] .breadcrumb {
  direction: ltr;
}
html[dir="ltr"] .article-content {
  direction: ltr;
  text-align: left;
}
html[dir="ltr"] .article-content a {
  border-bottom-color: var(--primary-t88);
}
html[dir="ltr"] .code-shell {
  direction: ltr;
}
html[dir="ltr"] .code-toolbar {
  direction: rtl;
}
html[dir="ltr"] .comment-form {
  direction: ltr;
}
html[dir="ltr"] .share-bar {
  direction: ltr;
}
html[dir="ltr"] .form-grid {
  direction: ltr;
}
html[dir="ltr"] .download-card {
  direction: ltr;
}
html[dir="ltr"] .article-nav {
  direction: ltr;
}
html[dir="ltr"] .hero-meta {
  direction: ltr;
}
html[dir="ltr"] .card-meta {
  direction: ltr;
}
html[dir="ltr"] .video-card-meta {
  direction: ltr;
}
html[dir="ltr"] .top-bar-date {
  direction: ltr;
}
html[dir="ltr"] .pagination {
  direction: ltr;
}


/* ===== 2026 NEWSROOM UI LAYER =====
   Editorial visual language: bold masthead, red breaking accents, calm navy surfaces. */
:root {
  --news-red: #c8102e;
  --news-red-dark: #970b22;
  --news-navy: #081a33;
  --news-ink: #111827;
  --news-surface: #ffffff;
  --news-line: #e5eaf1;
  --content-width: 1320px;
  --shadow-editorial: 0 10px 30px rgba(8, 26, 51, .08);
}

body { background: linear-gradient(180deg, #f7f9fc 0%, var(--bg) 28rem); }
.site-header { box-shadow: 0 8px 28px rgba(8, 26, 51, .08); }
.top-bar { background: var(--news-navy); color: rgba(255,255,255,.82); border-bottom: 0; }
.top-bar-left a, .top-bar-date { color: rgba(255,255,255,.78); }
.top-bar-left a:hover { background: rgba(255,255,255,.12); color: #fff; }
.live-status { color: #86efac; }
.live-status i { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.18); }
.theme-toggle-mini { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }

.logo-mark, .logo-text-mark { border-radius: 10px; background: var(--news-navy); border-color: rgba(255,255,255,.08); }
.logo-title strong b { color: var(--news-red); }
.categories-bar { border-top: 0; background: var(--news-navy); }
[data-theme="dark"] .categories-bar { background: #061225; }
.categories-bar a { color: rgba(255,255,255,.86); border-bottom-color: transparent; }
.categories-bar a:hover, .categories-bar a.active { color: #fff; background: rgba(200,16,46,.28); border-bottom-color: var(--news-red); }

.breaking-news { border: 0; border-radius: 0 0 12px 12px; background: var(--news-red); color: #fff; box-shadow: 0 8px 18px rgba(200,16,46,.12); }
.breaking-label { color: #fff; background: rgba(0,0,0,.16); border-radius: 8px; }
.breaking-track a { color: #fff; }
.ticker-toggle { color: #fff; border-color: rgba(255,255,255,.38); background: rgba(0,0,0,.12); }

.news-hero { gap: 1rem; margin-top: 1.2rem; }
.hero-slider { border-radius: 14px; box-shadow: var(--shadow-editorial); border: 1px solid var(--news-line); }
.hero-slide::after { background: linear-gradient(0deg, rgba(3,12,27,.92) 0%, rgba(3,12,27,.34) 52%, rgba(3,12,27,0) 100%); }
.hero-slide > div { padding: clamp(1.1rem, 3vw, 2rem); }
.hero-kicker, .card-cat { color: var(--news-red); font-weight: 900; letter-spacing: .01em; }
.hero-slide .hero-kicker { color: #fecdd3; }
.hero-slide h1, .hero-slide h2 { text-wrap: balance; }
.hero-side-card { border-radius: 12px; border: 1px solid var(--news-line); box-shadow: var(--shadow-editorial); }
.hero-side-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(8,26,51,.14); }

.section-title { display: flex; align-items: center; gap: .55rem; padding-bottom: .65rem; margin-bottom: 1rem; border-bottom: 3px solid var(--news-navy); }
.section-title::after { content: ''; display: block; width: 3.25rem; height: 3px; margin-inline-start: auto; background: var(--news-red); }
.cards { gap: 1rem; }
.card { border: 1px solid var(--news-line); border-radius: 12px; box-shadow: 0 5px 18px rgba(8,26,51,.045); overflow: clip; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(8,26,51,.12); border-color: rgba(200,16,46,.28); }
.card > a { display: flex; flex-direction: column; height: 100%; }
.card img { aspect-ratio: 16/9; object-fit: cover; background: #e8edf4; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 1rem; }
.card-title { text-wrap: balance; }
.card-excerpt { color: var(--text-secondary); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--border-light); }
.sidebar-box { border: 1px solid var(--news-line); box-shadow: var(--shadow-editorial); border-radius: 12px; }
.sidebar-box h3 { border-bottom-color: var(--news-red); }
.sidebar-rank-num { background: var(--news-navy); }
.btn-primary, .btn-accent { background: var(--news-red); border-color: var(--news-red); }
.btn-primary:hover, .btn-accent:hover { background: var(--news-red-dark); border-color: var(--news-red-dark); }

.ad-slot { min-height: 0; margin-block: 1rem; border: 1px dashed color-mix(in srgb, var(--border) 75%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--panel) 82%, transparent); overflow: hidden; }
.ad-slot-label { display: block; padding: .2rem .55rem; color: var(--muted); font-size: .66rem; text-align: center; }
.ad-slot-inner { min-height: 90px; display: grid; place-items: center; overflow: hidden; }
.ad-slot:has(ins.adsbygoogle) { border-style: solid; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--news-red) 60%, #fff); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media (max-width: 760px) {
  .container { width: min(100% - 1rem, var(--content-width)); }
  main.container { padding-top: .65rem; }
  .breaking-news { margin-inline: -.5rem; border-radius: 0; }
  .news-hero { margin-top: .75rem; }
  .hero-slide > div { padding: 1rem; }
  .hero-slide h1, .hero-slide h2 { font-size: clamp(1.15rem, 5vw, 1.55rem); }
  .section-title { font-size: 1.15rem; }
  .ad-slot-inner { min-height: 72px; }
}
@media (min-width: 1061px) {
  .site-header { position: sticky; top: 0; }
}
@media (prefers-reduced-data: reduce) {
  .hero-slide:not(.active) img, .hero-side-card img { content-visibility: auto; }
}
[data-theme="dark"] body { background: linear-gradient(180deg, #0b1220 0%, var(--bg) 28rem); }
[data-theme="dark"] .card, [data-theme="dark"] .hero-side-card, [data-theme="dark"] .sidebar-box { border-color: #263247; }
[data-theme="dark"] .section-title { border-bottom-color: #dbe4ef; }
[data-theme="dark"] .card-excerpt { color: var(--text-secondary); }


/* =========================================================
   Yemen X 8.0 — Editorial UI / UX / Accessibility Layer
   ========================================================= */
:root{
  --news-red:#c8102e;--news-red-dark:#9f0c24;--news-navy:#071a33;--news-line:#d9e3ef;
  --surface-glass:rgba(255,255,255,.78);--focus-ring:rgba(200,16,46,.32);
}
html{scroll-padding-top:7rem;text-rendering:optimizeLegibility}
body{background:
  radial-gradient(circle at 100% 0%,rgba(21,101,192,.06),transparent 28rem),
  linear-gradient(180deg,#f7f9fc 0%,var(--bg) 34rem);}
[data-theme="dark"] body{background:radial-gradient(circle at 100% 0%,rgba(66,165,245,.08),transparent 28rem),linear-gradient(180deg,#0b1220 0%,var(--bg) 34rem)}
.skip-link{position:fixed;inset-inline-start:1rem;top:-5rem;z-index:10000;padding:.65rem 1rem;border-radius:12px;background:var(--news-navy);color:#fff;font-weight:800;box-shadow:var(--shadow-md);transition:top .2s ease}
.skip-link:focus{top:1rem;color:#fff}
.reading-progress{position:fixed;top:0;inset-inline:0;height:3px;z-index:10001;background:transparent;pointer-events:none}
.reading-progress span{display:block;width:0;height:100%;background:linear-gradient(90deg,var(--news-red),var(--primary));box-shadow:0 0 12px rgba(200,16,46,.35);transition:width .08s linear}
.site-header{backdrop-filter:saturate(140%) blur(12px);background:var(--surface-glass)}
.header-top{min-height:74px}
.logo{transition:transform .2s ease,filter .2s ease}.logo:hover{transform:translateY(-1px);filter:brightness(1.02)}
.logo-title strong{letter-spacing:-.02em}.logo-title span{font-size:.7rem;opacity:.8}
.search-box{box-shadow:0 8px 24px rgba(8,26,51,.06)}
.search-box:focus-within{box-shadow:0 0 0 4px var(--focus-ring),0 10px 28px rgba(8,26,51,.08)}
.categories-bar{position:relative}.categories-bar::after{content:"";position:absolute;bottom:0;inset-inline:0;height:1px;background:linear-gradient(90deg,transparent,var(--news-red),transparent);opacity:.45}
.categories-bar .container{scrollbar-width:thin}
.breaking-news{position:relative;isolation:isolate}
.news-hero{align-items:stretch}
.hero-slider{box-shadow:0 18px 50px rgba(8,26,51,.14)}
.hero-slide::after{background:linear-gradient(0deg,rgba(3,12,27,.96) 0%,rgba(3,12,27,.48) 46%,rgba(3,12,27,.06) 100%)}
.hero-slide > div{max-width:900px}.hero-slide h1,.hero-slide h2{font-weight:900;letter-spacing:-.02em}
.hero-side-card{min-height:145px}.hero-side-card::after{background:linear-gradient(0deg,rgba(3,12,27,.94),rgba(3,12,27,.08) 75%)}
.section-title{position:relative;overflow:hidden}.section-title::before{height:1.5em}.section-title::after{width:4.5rem;height:3px;background:var(--news-red)}
.card{isolation:isolate;transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease}.card::after{content:"";position:absolute;inset:auto 0 0;height:3px;background:linear-gradient(90deg,var(--news-red),var(--primary));transform:scaleX(0);transform-origin:center;transition:transform .25s ease}.card:hover::after{transform:scaleX(1)}
.card-title{font-weight:900;letter-spacing:-.01em}.card-cat{border:1px solid color-mix(in srgb,var(--news-red) 20%,transparent);background:color-mix(in srgb,var(--news-red) 8%,transparent)}
.sidebar-box{background:color-mix(in srgb,var(--panel) 94%,transparent);backdrop-filter:blur(8px)}
.article-body{box-shadow:0 12px 42px rgba(8,26,51,.055);border:1px solid var(--news-line);border-radius:18px;padding:clamp(1rem,2.5vw,2rem);background:var(--panel)}
.article-title{letter-spacing:-.035em;font-weight:900}.article-excerpt{font-size:1.06rem}.article-content{font-size:clamp(1rem,1.1vw,1.12rem);line-height:2.05}.article-content p{max-width:74ch}.article-content h2,.article-content h3{scroll-margin-top:7rem}
.article-content img{border-radius:14px;box-shadow:0 10px 28px rgba(8,26,51,.08)}
.article-content a{color:var(--news-red);border-bottom-color:color-mix(in srgb,var(--news-red) 25%,transparent)}
.article-featured-image img{box-shadow:0 16px 42px rgba(8,26,51,.12)}
.article-tools{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap;margin:1rem 0 1.35rem;padding:.7rem;border:1px solid var(--border);border-radius:14px;background:var(--bg-secondary)}
.article-tools-main{display:flex;gap:.45rem;flex-wrap:wrap}.article-save-status{color:var(--muted);font-size:.78rem;font-weight:700}
[data-bookmark-article].is-saved{background:var(--news-red);color:#fff;border-color:var(--news-red)}
.breadcrumb{display:flex;align-items:center;flex-wrap:wrap;gap:.45rem;margin:.4rem 0 1rem;padding:.65rem .8rem;border:1px solid var(--border-light);border-radius:12px;background:var(--panel);font-size:.8rem;box-shadow:var(--shadow-xs)}
.breadcrumb a{font-weight:800}
.back-to-top{position:fixed;inset-inline-end:1rem;bottom:1rem;z-index:90;width:46px;height:46px;border:1px solid var(--border);border-radius:50%;background:var(--panel);color:var(--text);box-shadow:var(--shadow-md);font-size:1.25rem;font-weight:900;cursor:pointer;transition:transform .2s ease,opacity .2s ease}.back-to-top:hover{transform:translateY(-3px);color:var(--news-red)}
.pwa-install{position:fixed;inset-inline:1rem;bottom:1rem;z-index:95;display:flex;align-items:center;gap:.8rem;padding:.8rem 1rem;border:1px solid var(--border);border-radius:16px;background:color-mix(in srgb,var(--panel) 94%,transparent);backdrop-filter:blur(16px);box-shadow:var(--shadow-lg)}
.pwa-install>div{display:grid;gap:.15rem;min-width:0;flex:1}.pwa-install strong{font-size:.9rem}.pwa-install small{color:var(--muted);font-size:.72rem}.pwa-install-close{border:0;background:transparent;color:var(--muted);font-size:1.25rem;cursor:pointer}
.site-footer{margin-top:2rem}.footer-subscribe{align-items:stretch}.footer-subscribe .btn{min-height:34px}
@media (min-width:1061px){.site-header{position:sticky;top:0;z-index:var(--z-sticky)}.categories-bar .container{overflow:auto hidden}.categories-bar a{white-space:nowrap}}
@media (max-width:1060px){.article-body{box-shadow:none}.article-tools{position:sticky;top:.35rem;z-index:20;backdrop-filter:blur(12px);background:color-mix(in srgb,var(--panel) 88%,transparent)}}
@media (max-width:760px){html{scroll-padding-top:5rem}.container{width:min(100% - 1rem,var(--content-width))}.header-top{min-height:66px}.logo-title strong{font-size:.9rem}.logo-title span{display:none}.search-box{display:none}.news-hero{grid-template-columns:1fr}.hero-side{grid-template-columns:1fr 1fr;grid-template-rows:auto}.hero-side .sidebar-box{grid-column:1/-1}.article-body{padding:.9rem;border-radius:14px}.article-tools{margin-inline:-.2rem}.article-tools-main{width:100%}.article-tools-main .btn{flex:1;justify-content:center}.pwa-install{inset-inline:.65rem;bottom:.65rem}.back-to-top{bottom:5rem;width:42px;height:42px}.cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}.card-body{padding:.75rem}.card-title{font-size:.9rem}.card-excerpt{display:none}}
@media (max-width:480px){.cards{grid-template-columns:1fr}.hero-side{grid-template-columns:1fr}.article-title{font-size:1.55rem!important}.article-content{font-size:1rem;line-height:2}.breaking-label{padding:.38rem .55rem}}
@media print{.site-header,.breaking-news,.site-footer,.ad-slot,.article-tools,.back-to-top,.pwa-install,.comments-section{display:none!important}.article-body{border:0;box-shadow:none;padding:0}.article-content{font-size:11pt;line-height:1.8}.article-featured-image img{box-shadow:none}.container{width:100%}}

/* =========================================================
   Yemen X News — Al Jazeera Style Editorial Architecture
   ========================================================= */
.theme-toggle, .theme-toggle-mini { display: inline-flex !important; }

/* Breaking News Ticker */
.breaking-label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #fff;
  font-weight: 800;
  font-size: .82rem;
  padding: .35rem .85rem;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(220,38,38,.35);
  animation: pulse-live 2.2s infinite;
}
@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.55); }
  50% { box-shadow: 0 0 0 7px rgba(220,38,38,0); }
}

/* Al Jazeera Newsroom Hero Layout */
.news-hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.hero-slider {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(8,26,51,.15);
  position: relative;
  background: #061121;
}
.hero-slide {
  position: relative;
  display: block;
  text-decoration: none;
  color: #fff !important;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.hero-slide:hover img {
  transform: scale(1.03);
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(3,10,22,.95) 0%, rgba(3,10,22,.5) 45%, rgba(3,10,22,.08) 100%);
}
.hero-slide > div {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: clamp(1rem, 2.5vw, 2rem);
  z-index: 2;
}
.hero-kicker {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  padding: .2rem .65rem;
  border-radius: var(--radius-sm);
  margin-bottom: .65rem;
  text-transform: uppercase;
}
.hero-slide h1, .hero-slide h2 {
  color: #ffffff !important;
  font-size: clamp(1.25rem, 2.2vw, 1.85rem);
  font-weight: 900;
  line-height: 1.35;
  margin: 0 0 .5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,.4);
}
.hero-slide p {
  color: #e2e8f0;
  font-size: .95rem;
  line-height: 1.6;
  margin: 0 0 .75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-meta {
  display: flex;
  gap: 1rem;
  color: #cbd5e1;
  font-size: .8rem;
}

/* Side Featured News (Stacked) */
.hero-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.hero-side-card {
  position: relative;
  display: block;
  text-decoration: none;
  border-radius: 14px;
  overflow: hidden;
  height: 140px;
  box-shadow: 0 8px 24px rgba(8,26,51,.1);
}
.hero-side-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.hero-side-card:hover img {
  transform: scale(1.04);
}
.hero-side-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(3,10,22,.92) 0%, rgba(3,10,22,.3) 70%, transparent 100%);
}
.hero-side-card > div {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: .85rem;
  z-index: 2;
}
.hero-side-card h3 {
  color: #ffffff !important;
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Category Sections — Al Jazeera Bar */
.news-section-wrap {
  margin-bottom: 2.5rem;
}
.news-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border);
  padding-bottom: .6rem;
  margin-bottom: 1.25rem;
}
.news-section-title {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  position: relative;
}
.news-section-title::after {
  content: "";
  position: absolute;
  bottom: -0.65rem;
  right: 0;
  width: 100%;
  height: 3px;
  background: var(--news-red);
  border-radius: 2px;
}
.news-section-more {
  font-size: .84rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: color .2s;
}
.news-section-more:hover {
  color: var(--news-red);
}

/* Most Read Ranking (Al Jazeera Numbering) */
.sidebar-rank {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border-light);
  transition: transform .2s ease;
}
.sidebar-rank:last-child {
  border-bottom: none;
}
.sidebar-rank:hover {
  transform: translateX(-4px);
}
.sidebar-rank-num {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
  color: var(--news-red);
  font-family: var(--font-sans);
  min-width: 32px;
  text-align: center;
}

/* Social Share Bar */
.social-share-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .85rem 0;
  margin: 1.25rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.social-share-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border-radius: var(--radius-md);
  color: #fff !important;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none !important;
  border: 0;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease;
}
.social-share-btn:hover {
  opacity: .92;
  transform: translateY(-2px);
}
.share-wa { background: #25d366; }
.share-tg { background: #0088cc; }
.share-tw { background: #0f1419; }
.share-fb { background: #1877f2; }
.share-copy { background: #475569; }

/* Sticky Mobile Bottom Navigation & Mobile Anchor Ad */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  z-index: 95;
  box-shadow: 0 -3px 12px rgba(0,0,0,.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-anchor-ad-container {
  position: fixed;
  bottom: 58px;
  left: 0;
  right: 0;
  z-index: 89;
  background: var(--panel);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  min-height: 52px;
}
.mobile-anchor-close {
  position: absolute;
  top: -24px;
  right: 12px;
  background: #1e293b;
  color: #fff;
  border: 1px solid #334155;
  border-radius: 6px 6px 0 0;
  font-size: 14px;
  font-weight: 800;
  padding: 2px 10px;
  cursor: pointer;
  line-height: 1.2;
}
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
  body {
    padding-bottom: 64px !important;
  }
}
@media (min-width: 769px) {
  .mobile-anchor-ad-container { display: none !important; }
}
.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .68rem;
  font-weight: 600;
  gap: 2px;
  transition: color .2s ease;
}
.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover {
  color: var(--primary);
}
.mobile-bottom-nav .icon {
  width: 20px;
  height: 20px;
}

/* In-Article Ad Container */
.in-article-ad-wrap {
  margin: 1.5rem 0;
  text-align: center;
  clear: both;
}

/* Prevent a failed enhancement script from hiding the newsroom */
.hero-slide.active { opacity:1 !important; visibility:visible !important; }
.hero-slide:not(.active) { visibility:hidden; }

/* Video platform */
.yx-player { position:relative; width:100%; aspect-ratio:16/9; min-height:220px; overflow:hidden; border-radius:18px; background:#05070b; box-shadow:0 18px 45px rgba(8,26,51,.18); }
.yx-player > video, .yx-player > iframe { position:absolute; inset:0; width:100%; height:100%; border:0; display:block; }
.yx-player video { background:#000; object-fit:contain; }
.yx-player-poster { position:absolute; inset:0; display:grid; place-items:center; cursor:pointer; background:#05070b; color:#fff; }
.yx-player-poster img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.86; }
.yx-player-poster::after { content:''; position:absolute; inset:0; background:linear-gradient(180deg,rgba(0,0,0,.05),rgba(0,0,0,.62)); }
.yx-player-play { position:relative; z-index:2; width:76px; height:76px; display:grid; place-items:center; border-radius:50%; background:#c8102e; color:#fff; box-shadow:0 12px 34px rgba(0,0,0,.35); transition:transform .2s ease, background .2s ease; }
.yx-player-poster:hover .yx-player-play { transform:scale(1.08); background:#a70d26; }
.yx-player-play svg { width:30px; height:30px; margin-inline-start:4px; }
.yx-player-loading { position:absolute; inset:0; display:grid; place-items:center; background:rgba(5,7,11,.72); color:#fff; z-index:4; }
.yx-player-error { position:absolute; inset:0; display:grid; place-items:center; padding:1.5rem; text-align:center; color:#fff; background:#111827; z-index:5; }
.yx-player-caption { position:absolute; inset-inline-start:.75rem; inset-inline-end:.75rem; bottom:.75rem; z-index:3; color:#fff; font-size:.76rem; font-weight:700; text-shadow:0 2px 8px #000; pointer-events:none; }
.video-hero-link { position:absolute; inset:0; display:block; z-index:2; }
.video-hero-play { position:absolute; inset:0; display:grid; place-items:center; }
.video-hero-play span { width:78px;height:78px;border-radius:50%;display:grid;place-items:center;background:#c8102e;color:#fff;box-shadow:0 14px 36px rgba(0,0,0,.38); }
.video-hero-play svg { width:32px;height:32px;margin-inline-start:4px; }
.video-hero:hover .video-hero-play span { transform:scale(1.06); }
.video-hero-info { pointer-events:none; }
.video-card { contain:layout paint; }
.video-card-thumb img { aspect-ratio:16/9; }

@media (max-width:760px){
  .yx-player { border-radius:12px; min-height:200px; }
  .yx-player-play { width:64px;height:64px; }
  .video-hero { border-radius:14px; }
  .video-hero-play span { width:64px;height:64px; }
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; transition-duration:.01ms !important; }
}



/* =========================================================
   Yemen X V12 — BRAND / THEME / STABILITY HARDENING
   ========================================================= */
html { overflow-x:hidden; overscroll-behavior-x:none; -webkit-text-size-adjust:100%; }
body { min-width:0; }
/* Stable editorial UI: no layout-jumping animations or hover transforms. */
*,*::before,*::after { animation:none !important; transition:none !important; scroll-behavior:auto !important; }
.card:hover,.hero-side-card:hover,.back-to-top:hover,.logo:hover,.video-hero:hover .video-hero-play span,.card:hover img,.hero-side-card:hover img,.logo:hover .logo-mark,.logo:hover .logo-text-mark { transform:none !important; }
.breaking-track { animation:none !important; transform:none !important; }
/* Theme is user/system controlled, not forced by device or old V11 CSS. */
:root { color-scheme:light; }
html[data-theme="dark"] { color-scheme:dark; }
html[data-theme="dark"] body { background:var(--bg) !important; color:var(--text) !important; }
html[data-theme="dark"] .site-header { background:rgba(21,26,36,.96) !important; border-color:var(--border-light); color:var(--text); }
html[data-theme="dark"] .top-bar { background:#101827 !important; border-color:#243248; color:var(--text-secondary); }
html[data-theme="dark"] .categories-bar { background:var(--panel-strong) !important; color:var(--text); }
html[data-theme="dark"] .card,html[data-theme="dark"] .sidebar-box,html[data-theme="dark"] .article-body { background:var(--panel) !important; color:var(--text); border-color:var(--border); }
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] h4,html[data-theme="dark"] h5,html[data-theme="dark"] h6 { color:var(--text); }
html[data-theme="dark"] .logo-title strong { color:#fff; }
html[data-theme="dark"] .logo-mark { background:#05070b; border-color:#2f4563; }
html[data-theme="dark"] .logo-img-light { display:none !important; }
html[data-theme="dark"] .logo-img-dark { display:block !important; }
html:not([data-theme="dark"]) .logo-img-dark { display:none !important; }
html:not([data-theme="dark"]) .logo-img-light { display:block !important; }
.logo-img-custom { display:block !important; }
.logo-img-custom ~ .logo-img-dark,.logo-img-custom ~ .logo-img-light { display:none !important; }
.logo-img { width:100%; height:100%; object-fit:contain; border-radius:inherit; }
.logo-mark { overflow:hidden; }
.theme-toggle { display:grid !important; place-items:center; width:36px; height:36px; border:2px solid var(--border); border-radius:999px; background:transparent; color:var(--text-secondary); cursor:pointer; flex-shrink:0; }
.theme-toggle .theme-icon-moon { display:none; }
.theme-toggle .theme-icon-sun { display:block; }
html[data-theme="dark"] .theme-toggle .theme-icon-sun { display:none; }
html[data-theme="dark"] .theme-toggle .theme-icon-moon { display:block; }
/* Static mobile navigation: open/close is discrete, never sliding. */
@media (max-width:1060px){
  .categories-bar { transform:none !important; transition:none !important; }
  .categories-bar:not(.is-open) { display:none !important; visibility:hidden !important; }
  .categories-bar.is-open { display:block !important; visibility:visible !important; }
  .nav-overlay { backdrop-filter:none !important; -webkit-backdrop-filter:none !important; }
}
@media (max-width:760px){
  .container,.main.container { width:calc(100% - 1rem); }
  .logo-mark { width:52px; height:52px; border-radius:14px; }
  .header-top { min-height:68px; padding-block:.5rem; }
}
/* Keep content visible even if a non-critical enhancement fails. */
.hero-slide.active { opacity:1 !important; visibility:visible !important; }
.hero-slide:not(.active) { visibility:hidden; }
.yx-safe-fallback { min-height:55vh; display:grid; place-content:center; gap:.6rem; text-align:center; padding:2rem 1rem; background:var(--panel); border:1px solid var(--border); border-radius:20px; box-shadow:var(--shadow); margin:1rem 0; }
@media (prefers-reduced-motion:reduce){ *,*::before,*::after { animation:none !important; transition:none !important; } }

/* ===== V13 COMPACT SMART SIDE MENU ===== */
@media (max-width:1060px){
  .categories-bar{
    width:min(300px,82vw) !important;
    max-width:300px !important;
    border:1px solid var(--border-light);
    border-radius:0 18px 18px 0;
    box-shadow:0 14px 42px rgba(15,38,68,.18) !important;
    padding-bottom:max(.7rem,env(safe-area-inset-bottom)) !important;
    background:var(--panel) !important;
  }
  [dir="rtl"] .categories-bar{right:0;left:auto;border-radius:18px 0 0 18px;}
  [dir="ltr"] .categories-bar{left:0;right:auto;border-radius:0 18px 18px 0;}
  .mobile-nav-head{
    min-height:64px;
    padding:max(.65rem,env(safe-area-inset-top)) .75rem .65rem !important;
    gap:.55rem;
    background:var(--panel) !important;
  }
  .mobile-nav-brand{gap:.5rem !important;}
  .mobile-nav-brand img{width:36px !important;height:36px !important;border-radius:10px !important;}
  .mobile-nav-brand strong{font-size:.82rem !important;}
  .mobile-nav-brand small{font-size:.64rem !important;}
  .mobile-nav-close{
    width:34px !important;height:34px !important;border-radius:10px !important;
    font-size:1.2rem !important;
  }
  .categories-bar .container{
    padding:.55rem !important;
    gap:.22rem !important;
  }
  .categories-bar a{
    min-height:42px !important;
    padding:.45rem .72rem !important;
    border-radius:10px !important;
    font-size:.82rem !important;
    font-weight:800 !important;
    gap:.45rem !important;
    border:1px solid transparent !important;
  }
  .categories-bar a:hover,.categories-bar a.active{
    background:color-mix(in srgb,var(--primary) 9%,var(--panel)) !important;
    border-color:color-mix(in srgb,var(--primary) 16%,transparent) !important;
    color:var(--primary) !important;
  }
  .categories-bar a svg{width:16px;height:16px;opacity:.85;}
  .nav-overlay.is-open{background:rgba(9,20,34,.32) !important;}
  html[data-theme="dark"] .nav-overlay.is-open{background:rgba(0,0,0,.52) !important;}
}
@media (max-width:420px){
  .categories-bar{width:min(286px,84vw) !important;}
}
@media (min-width:1061px){
  .categories-bar{max-width:none;}
}

/* Compact controls: consistent, stable and touch-friendly. */
@media (max-width:1060px){
  .menu-toggle,.search-toggle,.theme-toggle{width:34px !important;height:34px !important;}
}

/* ===== V14 HOTFIX — MOBILE MENU VISIBILITY + PWA PROMPT CONTROL ===== */
@media (max-width:1060px){
  /* Explicit theme-safe surface colors prevent white-on-white menus. */
  html:not([data-theme="dark"]) .categories-bar,
  html:not([data-theme="dark"]) .mobile-nav-head { background:#ffffff !important; color:#122033 !important; }
  html:not([data-theme="dark"]) .categories-bar a { color:#122033 !important; background:#ffffff !important; }
  html:not([data-theme="dark"]) .categories-bar a:hover,
  html:not([data-theme="dark"]) .categories-bar a.active { color:#1565c0 !important; background:#eef5fd !important; }

  html[data-theme="dark"] .categories-bar,
  html[data-theme="dark"] .mobile-nav-head { background:#151a24 !important; color:#edf0f5 !important; border-color:#252a35 !important; }
  html[data-theme="dark"] .categories-bar a { color:#edf0f5 !important; background:#151a24 !important; }
  html[data-theme="dark"] .categories-bar a:hover,
  html[data-theme="dark"] .categories-bar a.active { color:#90caf9 !important; background:#1d2a3d !important; }
  html[data-theme="dark"] .mobile-nav-brand strong { color:#ffffff !important; }
  html[data-theme="dark"] .mobile-nav-brand small { color:#aeb8c7 !important; }
  html[data-theme="dark"] .mobile-nav-close { background:#1a1f2c !important; color:#edf0f5 !important; border-color:#303847 !important; }

  .categories-bar .container { background:transparent !important; }
  .categories-bar a { text-shadow:none !important; -webkit-text-fill-color:currentColor; }
}

/* PWA install prompt: intentionally occasional, never permanently intrusive. */
.pwa-install[hidden] { display:none !important; }
.pwa-install { max-width:760px; margin-inline:auto; }
@media (max-width:760px){
  .pwa-install { bottom:max(.65rem,env(safe-area-inset-bottom)); }
}

/* V14: no layout/zoom surprises on mobile browsers. */
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body { touch-action:pan-y; }
input,textarea,select { font-size:16px; }

/* ============================================================
   CATEGORY BLOCKS — Al Jazeera Style Homepage Sections
   ============================================================ */
.category-block {
  margin: 2rem 0;
}

.category-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--primary);
  padding-bottom: .5rem;
  margin-bottom: 1.25rem;
}

.category-block-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.category-block-title .cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
  flex-shrink: 0;
}

.category-block-more {
  font-size: .82rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  border: 1.5px solid var(--primary-border);
  border-radius: 20px;
  padding: .22rem .85rem;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.category-block-more:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

/* 4-column grid on desktop, 2 on tablet, 1 on mobile */
.category-block-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

@media (max-width: 1024px) {
  .category-block-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .category-block-grid {
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
  }
  .category-block-title { font-size: 1.05rem; }
}

@media (max-width: 380px) {
  .category-block-grid { grid-template-columns: 1fr; }
}

/* Card inside a category block */
.category-block-grid .card {
  background: var(--panel);
  border-radius: 10px;
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
  text-decoration: none;
  color: inherit;
}
.category-block-grid .card:hover {
  box-shadow: 0 6px 22px rgba(21,101,192,.13);
  transform: translateY(-3px);
  text-decoration: none;
}

.category-block-grid .card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: var(--bg-secondary);
}

.category-block-grid .card-body {
  padding: .75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.category-block-grid .card-cat {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--primary);
}

.category-block-grid .card-title {
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-block-grid .card-excerpt {
  font-size: .78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.category-block-grid .card-meta {
  font-size: .7rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: .35rem;
  border-top: 1px solid var(--border-light);
}

/* Empty state for category blocks */
.category-block-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: .9rem;
}

