/* =============================================
   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;
}
