/* ============================================================
   خبرنگار — Design System
   A newsroom-inspired editorial system: warm newsprint neutrals,
   a disciplined masthead red used sparingly, and Vazirmatn's full
   weight range doing the work of hierarchy instead of decoration.
   ============================================================ */

@font-face {
    font-family: 'Vazirmatn Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/vazirmatn-arabic.woff2') format('woff2-variations'),
         url('../fonts/vazirmatn-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
                   U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Vazirmatn Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/vazirmatn-latin.woff2') format('woff2-variations'),
         url('../fonts/vazirmatn-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                   U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
    /* ---- Color: newsprint neutrals + a masthead red used sparingly ---- */
    --color-primary: #c31b3a;
    --color-primary-dark: #9c1530;
    --color-secondary: #142136;
    --color-bg: #f5f3ee;
    --color-surface: #ffffff;
    --color-text: #18171c;
    --color-text-muted: #6b6558;
    --color-border: #e6e1d6;
    --color-link: #16335c;
    --color-breaking: #c31b3a;
    --color-success: #1a7f37;
    --color-warning: #a5760a;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(24, 23, 20, 0.06);
    --shadow-md: 0 6px 20px rgba(24, 23, 20, 0.10);
    --shadow-lg: 0 16px 40px rgba(24, 23, 20, 0.16);

    --font-body: 'Vazirmatn Variable', 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
    --font-heading: 'Vazirmatn Variable', 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;

    --container-width: 1180px;
    --header-height: 72px;
}

html[data-theme="dark"] {
    --color-primary: #ff5470;
    --color-primary-dark: #e8405d;
    --color-secondary: #eceaf2;
    --color-bg: #121218;
    --color-surface: #1a1a22;
    --color-text: #ecebf1;
    --color-text-muted: #9c9aab;
    --color-border: #2c2c37;
    --color-link: #7fb0e8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    direction: rtl;
    line-height: 1.9;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background .2s ease, color .2s ease;
}

img { max-width: 100%; display: block; }

a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 16px;
}

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--color-text); line-height: 1.4; margin: 0 0 12px; font-weight: 800; }
h1 { font-size: 30px; font-weight: 850; letter-spacing: -.01em; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 40px 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}
.section-title h2 { margin: 0; position: relative; padding-inline-start: 13px; border-inline-start: 4px solid var(--color-primary); }
.section-title a { font-size: 13px; color: var(--color-text-muted); font-weight: 600; }
.section-title a:hover { color: var(--color-primary); }

/* ---------------- Header ---------------- */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    border-top: 3px solid var(--color-primary);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: 16px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 850;
    font-size: 23px;
    color: var(--color-text);
    flex-shrink: 0;
    letter-spacing: -.01em;
}
.logo .dot { color: var(--color-primary); font-size: 14px; }
.logo-image { height: 46px; width: auto; display: block; }
.mobile-nav-head .logo-image { height: 34px; }

.main-nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.main-nav a {
    position: relative;
    color: var(--color-text);
    padding: 10px 13px;
    font-size: 14.5px;
    font-weight: 650;
    white-space: nowrap;
}
.main-nav a::after {
    content: "";
    position: absolute;
    inset-inline-start: 13px;
    inset-inline-end: 13px;
    bottom: 4px;
    height: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transition: transform .15s ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--color-primary); text-decoration: none; }
.main-nav a:hover::after, .main-nav a.active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: border-color .15s ease, color .15s ease;
}
.icon-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.icon-btn svg { width: 18px; height: 18px; }
.hamburger svg { width: 20px; height: 20px; }
.theme-icon-dark { display: none; }
html[data-theme="dark"] .theme-icon-light { display: none; }
html[data-theme="dark"] .theme-icon-dark { display: block; }

.header-date { font-size: 12.5px; color: var(--color-text-muted); white-space: nowrap; }

.search-box { position: relative; }
.search-box input {
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: 13.5px;
    width: 200px;
    color: var(--color-text);
    font-family: inherit;
}
.search-box input:focus { outline: none; border-color: var(--color-primary); }
.search-suggestions {
    position: absolute;
    top: 110%;
    inset-inline-end: 0;
    width: 260px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 60;
}
.search-suggestions.open { display: block; }
.search-suggestions a { display: block; padding: 10px 14px; font-size: 13.5px; color: var(--color-text); border-bottom: 1px solid var(--color-border); }
.search-suggestions a:last-child { border-bottom: none; }
.search-suggestions a:hover { background: var(--color-bg); text-decoration: none; }

.hamburger { display: none; }

/* ---------------- Breaking news ---------------- */
.breaking-bar {
    background: var(--color-breaking);
    color: #fff;
    font-size: 14px;
}
.breaking-bar .container { display: flex; align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; }
.breaking-label {
    background: rgba(255,255,255,.16);
    padding: 4px 11px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}
.breaking-label .blink { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }
.breaking-items { display: flex; overflow: hidden; flex: 1; min-width: 0; -webkit-mask-image: linear-gradient(to left, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); mask-image: linear-gradient(to left, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); }
.breaking-items-track { display: flex; gap: 40px; flex-shrink: 0; padding-inline-end: 40px; animation: marquee 10s linear infinite; }
.breaking-bar:hover .breaking-items-track { animation-play-state: paused; }
/* Starts fully in view (translateX(0)) instead of off-screen, so the first
   breaking-news item is visible immediately on page load instead of only
   scrolling into view after several seconds. Sped up further (14s -> 7s) and
   the direction flipped to left-to-right (translateX now animates toward
   +100% instead of -100%), so items enter from the left and exit to the right. */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
    .breaking-items-track { animation: none; }
    .breaking-items { overflow-x: auto; }
}
.breaking-items a { color: #fff; white-space: nowrap; font-weight: 600; opacity: .95; }
.breaking-items a:hover { text-decoration: underline; }

/* ---------------- Hero ---------------- */
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; margin-top: 26px; }
.hero-main { position: relative; height: 430px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); background: var(--color-surface); }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s ease; }
.hero-slide.active { opacity: 1; visibility: visible; z-index: 1; }
.hero-slide a, .hero-slide img { display: block; width: 100%; height: 100%; }
.hero-slide a { position: relative; }
.hero-slide img { object-fit: cover; }
.hero-main .hero-overlay {
    position: absolute; inset: auto 0 0 0;
    background: linear-gradient(0deg, rgba(10,9,14,.88) 8%, rgba(10,9,14,0) 100%);
    padding: 70px 26px 22px;
}
.hero-main .cat-badge { background: var(--color-primary); color: #fff; font-size: 12px; padding: 4px 11px; border-radius: var(--radius-sm); font-weight: 700; }
.hero-main h1 { color: #fff; margin: 13px 0 8px; font-size: 27px; }
.hero-main p { color: #e4e2dd; font-size: 14px; margin: 0; }
.hero-main .meta { color: #c7c4bc; font-size: 12.5px; margin-top: 10px; }

.hero-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(20,18,15,.45); color: #fff; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .2s ease, background .15s ease;
    backdrop-filter: blur(2px);
}
.hero-slideshow:hover .hero-arrow, .hero-arrow:focus-visible { opacity: 1; }
.hero-arrow:hover { background: var(--color-primary); }
.hero-arrow svg { width: 20px; height: 20px; }
.hero-arrow-prev { right: 16px; }
.hero-arrow-next { left: 16px; }

.hero-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 7px; }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; border: none; background: rgba(255,255,255,.45); cursor: pointer; padding: 0; transition: background .2s ease, width .2s ease; }
.hero-dot.active { background: #fff; width: 22px; border-radius: 4px; }

@media (max-width: 640px) {
    .hero-arrow { display: none; }
}

.hero-side { display: flex; }
.hero-side-poster { position: relative; width: 100%; height: 430px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); background: var(--color-surface); }
.hero-side-poster > a, .hero-side-poster img { display: block; width: 100%; height: 100%; }
.hero-side-poster img { object-fit: cover; }
.hero-side-poster .hero-overlay {
    position: absolute; inset: auto 0 0 0;
    background: linear-gradient(0deg, rgba(10,9,14,.9) 12%, rgba(10,9,14,0) 100%);
    padding: 60px 20px 20px;
}
.hero-side-poster .cat-badge { background: var(--color-primary); color: #fff; font-size: 12px; padding: 4px 11px; border-radius: var(--radius-sm); font-weight: 700; }
.hero-side-poster h2 { color: #fff; margin: 12px 0 6px; font-size: 19px; line-height: 1.6; }
.hero-side-poster h2 a { color: inherit; }
.hero-side-poster .meta { color: #c7c4bc; font-size: 12px; margin-top: 8px; }

/* ---------------- News cards ---------------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    display: flex;
    flex-direction: column;
}
.news-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.news-card-thumb { position: relative; display: block; }
.news-card img { width: 100%; height: 170px; object-fit: cover; background: var(--color-border); }
.video-badge {
    position: absolute; inset: 0; margin: auto; width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(15, 15, 20, .55); border-radius: 50%; color: #fff;
    pointer-events: none;
}
.video-badge svg { width: 18px; height: 18px; fill: #fff; margin-inline-start: 2px; }
.video-badge-sm { width: 28px; height: 28px; }
.video-badge-sm svg { width: 13px; height: 13px; }
.news-card .body { padding: 15px; flex: 1; display: flex; flex-direction: column; }
.news-card .cat { font-size: 11.5px; color: var(--color-primary); font-weight: 700; margin-bottom: 7px; }
.news-card h3 { font-size: 15.5px; margin: 0 0 8px; flex: 1; font-weight: 750; }
.news-card h3 a { color: var(--color-text); }
.news-card .excerpt { font-size: 13px; color: var(--color-text-muted); margin: 0 0 10px; }
.news-card .meta { font-size: 12px; color: var(--color-text-muted); display: flex; justify-content: space-between; gap: 8px; }
/* خبر خالص متنی (بدون تصویر/ویدیو): بدون باکس تصویر/پلیس‌هولدر بالای کارت. */
.news-card--text-only .body { padding-top: 18px; }

.news-list-row { display: flex; gap: 16px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 14px; transition: border-color .15s ease; }
.news-list-row:hover { border-color: var(--color-primary); }
.news-list-row img { width: 200px; height: 130px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.news-list-row .body { flex: 1; }
.news-list-row h3 { margin: 0 0 8px; font-size: 17px; font-weight: 750; }
.news-list-row .excerpt { color: var(--color-text-muted); font-size: 14px; margin: 0 0 10px; }
.news-list-row .meta { font-size: 12.5px; color: var(--color-text-muted); display: flex; gap: 14px; flex-wrap: wrap; }
/* خبر خالص متنی (بدون تصویر/ویدیو): بدون باکس تصویر/پلیس‌هولدر کنار ردیف. */
.news-list-row--text-only { align-items: center; }

@media (max-width: 720px) {
    .news-list-row { flex-direction: column; }
    .news-list-row img { width: 100%; height: 180px; }
}

/* ---------------- Page layout: content + sidebar ---------------- */
.page-layout { display: grid; grid-template-columns: 2.3fr 1fr; gap: 28px; margin-top: 26px; align-items: start; }
.sidebar-widget { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 18px; margin-bottom: 18px; }
.sidebar-widget h3 { border-bottom: 1px solid var(--color-border); padding-bottom: 11px; margin-bottom: 13px; }
.widget-list-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--color-border); }
.widget-list-item:last-child { border-bottom: none; }
.widget-list-item .num { font-weight: 800; color: var(--color-primary); font-size: 18px; width: 22px; flex-shrink: 0; }
.widget-list-item h4 { font-size: 13.5px; margin: 0 0 4px; font-weight: 700; }
.widget-list-item .meta { font-size: 11.5px; color: var(--color-text-muted); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 5px 12px; font-size: 12.5px; color: var(--color-text); }
.tag-chip:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }

.newsletter-box { text-align: center; }
.newsletter-box form { display: flex; gap: 8px; margin-top: 10px; }
.newsletter-box input[type=email] { flex: 1; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-text); font-family: inherit; }
.newsletter-box input[type=email]:focus { outline: none; border-color: var(--color-primary); }

/* ---------------- Buttons / forms (shared, front + admin) ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color:#fff; text-decoration:none; }
.btn-outline { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration:none; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-danger { background: #fbe9ea; color: var(--color-breaking); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    background: var(--color-surface); color: var(--color-text); font-family: inherit; font-size: 14px;
    transition: border-color .15s ease;
}
.form-control:focus { outline: none; border-color: var(--color-primary); }
textarea.form-control { min-height: 120px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input { width: auto; }

.badge { display: inline-block; padding: 3px 10px; border-radius: var(--radius-sm); font-size: 11.5px; font-weight: 700; }
.badge-published { background: #e6f6ea; color: var(--color-success); }
.badge-draft { background: #eeece5; color: var(--color-text-muted); }
.badge-scheduled { background: #fbf1dc; color: var(--color-warning); }
.badge-archived { background: #f3e6e6; color: #8a4a4a; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: #e6f6ea; color: var(--color-success); border-color: #c7e9cf; }
.alert-error { background: #fbe9ea; color: var(--color-breaking); border-color: #f3c9cd; }

/* ---------------- Pagination ---------------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 30px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; border-radius: var(--radius-sm);
    border: 1px solid var(--color-border); font-size: 13.5px; color: var(--color-text);
}
.pagination a:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }
.pagination .active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ---------------- Article page ---------------- */
.breadcrumb { font-size: 13px; color: var(--color-text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--color-text-muted); }
.article-header .cat-badge { display: inline-block; background: var(--color-primary); color: #fff; font-size: 12px; padding: 4px 12px; border-radius: var(--radius-sm); font-weight: 700; margin-bottom: 13px; }
.article-header h1 { font-size: 29px; }
.article-summary { font-size: 17px; color: var(--color-text-muted); border-inline-start: 3px solid var(--color-primary); padding-inline-start: 15px; margin: 15px 0; }
.article-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--color-text-muted); padding: 15px 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); margin-bottom: 22px; }
.article-meta .author { display: flex; align-items: center; gap: 8px; color: var(--color-text); font-weight: 700; }
.author-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--color-border); object-fit: cover; }
.article-image { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 22px; }

/* ---------------- Custom video player ---------------- */
.video-player { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #000; margin-bottom: 22px; }
.video-player-el { width: 100%; display: block; max-height: 520px; background: #000; cursor: pointer; }
.video-controls {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    background: linear-gradient(0deg, rgba(0,0,0,.85), rgba(0,0,0,.55) 70%, transparent);
    position: absolute; bottom: 0; left: 0; right: 0;
    opacity: 1; transition: opacity .2s ease;
}
.video-player.playing .video-controls { opacity: 0; }
.video-player.playing:hover .video-controls, .video-player.playing:focus-within .video-controls { opacity: 1; }
.video-play-btn, .video-volume-btn, .video-fullscreen-btn {
    background: none; border: none; color: #fff; cursor: pointer;
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0;
}
.video-play-btn svg, .video-volume-btn svg, .video-fullscreen-btn svg { width: 20px; height: 20px; }
.video-player .icon-pause { display: none; }
.video-player.playing .icon-play { display: none; }
.video-player.playing .icon-pause { display: block; }
.video-player .icon-mute { display: none; }
.video-player.muted .icon-vol { display: none; }
.video-player.muted .icon-mute { display: block; }
.video-time { color: #fff; font-size: 12px; min-width: 38px; text-align: center; flex-shrink: 0; font-variant-numeric: tabular-nums; }
/* Sliders must stay left-to-right even though the page is RTL — otherwise
   the browser renders min on the right / max on the left and playback
   progress visually moves backwards as the video plays forward. */
.video-seek, .video-volume { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: rgba(255,255,255,.3); cursor: pointer; direction: ltr; }
.video-seek { flex: 1; }
.video-volume { width: 70px; }
.video-seek::-webkit-slider-thumb, .video-volume::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--color-primary); cursor: pointer; }
.video-seek::-moz-range-thumb, .video-volume::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--color-primary); border: none; cursor: pointer; }
/* Desktop: button + popover sit inline in the controls row exactly like
   before — these wrappers generate no box of their own. */
.video-volume-wrap, .video-volume-popover { display: contents; }
@media (max-width: 640px) {
    .video-controls { padding: 8px 10px; gap: 6px; }
    /* Mobile: too little horizontal room for an inline slider, so the volume
       button now opens a small vertical slider that floats above it — kept
       upright (not squeezed sideways) via a CSS rotation of the range input. */
    .video-volume-wrap { position: relative; display: inline-flex; }
    .video-volume-popover {
        display: block;
        position: absolute;
        bottom: 40px; left: 50%; transform: translateX(-50%);
        background: rgba(20,20,20,.92);
        border-radius: var(--radius-sm);
        padding: 12px 8px;
        opacity: 0; pointer-events: none;
        transition: opacity .15s ease;
        z-index: 2;
    }
    .video-player.volume-open .video-volume-popover { opacity: 1; pointer-events: auto; }
    .video-volume { width: 84px; transform: rotate(-90deg); transform-origin: center; display: block; }
}
.article-body { font-size: 17px; line-height: 2.05; }
.article-body p { margin: 0 0 21px; }
.article-body img { border-radius: var(--radius-md); margin: 18px 0; }
.article-body h2, .article-body h3 { margin-top: 34px; }
.article-body blockquote { border-inline-start: 4px solid var(--color-primary); background: var(--color-bg); padding: 15px 19px; margin: 22px 0; border-radius: var(--radius-sm); }
.article-body table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.article-body th, .article-body td { border: 1px solid var(--color-border); padding: 8px 10px; }

.share-bar { display: flex; gap: 8px; margin: 22px 0; flex-wrap: wrap; align-items: center; }
.share-icon-btn { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--color-bg); border: 1px solid var(--color-border); color: #fff; flex-shrink: 0; }
.share-icon-btn svg { width: 18px; height: 18px; }
.share-icon-btn.share-twitter { background: #000; border-color: #000; }
.share-icon-btn.share-telegram { background: #26A5E4; border-color: #26A5E4; }
.share-icon-btn.share-whatsapp { background: #25D366; border-color: #25D366; }
.share-icon-btn:hover { opacity: .85; }
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0; }

.article-follow-us { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 22px; }
.article-follow-us-label { font-size: 13.5px; color: var(--color-text-muted, #777); }
.article-follow-us .footer-social { margin-top: 0; }
.article-follow-us .footer-social-link { width: 38px; height: 38px; background: var(--color-bg); border: 1px solid var(--color-border); }
.article-follow-us .footer-social-link svg { width: 18px; height: 18px; color: var(--color-text); }
.article-follow-us .footer-social-link:hover { background: var(--color-primary); border-color: var(--color-primary); }
.article-follow-us .footer-social-link:hover svg { color: #fff; }
/* Brand colors for the built-in glyphs — set per network via the CSS
   custom property below, then applied once through the shared
   [class*="social-brand-"] rules. Makes each icon instantly recognizable
   instead of the flat neutral circle every network shared before. Only
   applied when there's no admin-uploaded image (see socialLinkIconMarkup),
   so a custom logo is never boxed in behind an unrelated brand color. */
.article-follow-us .footer-social-link.social-brand-twitter { --brand: #000; }
.article-follow-us .footer-social-link.social-brand-telegram { --brand: #26A5E4; }
.article-follow-us .footer-social-link.social-brand-whatsapp { --brand: #25D366; }
.article-follow-us .footer-social-link.social-brand-youtube { --brand: #FF0000; }
.article-follow-us .footer-social-link.social-brand-linkedin { --brand: #0A66C2; }
.article-follow-us .footer-social-link.social-brand-facebook { --brand: #1877F2; }
.article-follow-us .footer-social-link.social-brand-instagram { --brand: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.article-follow-us .footer-social-link.social-brand-aparat { --brand: #ED1C24; }
.article-follow-us .footer-social-link.social-brand-eitaa { --brand: #009FE0; }
.article-follow-us .footer-social-link.social-brand-rubika { --brand: #FF8A00; }
.article-follow-us .footer-social-link.social-brand-bale { --brand: #0D5EFF; }
.article-follow-us .footer-social-link.social-brand-soroush { --brand: #6C3FC5; }
.article-follow-us .footer-social-link[class*="social-brand-"] { background: var(--brand); border-color: transparent; }
.article-follow-us .footer-social-link[class*="social-brand-"] svg { color: #fff; }
.article-follow-us .footer-social-link[class*="social-brand-"]:hover { background: var(--brand); border-color: transparent; opacity: .85; }
/* An admin-uploaded icon is already a finished logo — drop the neutral
   circle background/border and the heavy inner padding used for the
   built-in glyphs, so the uploaded image itself is what's visible instead
   of being shrunk down inside an unrelated ring. */
.article-follow-us .footer-social-link.has-custom-icon { background: transparent; border-color: transparent; }
.article-follow-us .footer-social-link.has-custom-icon:hover { background: var(--color-bg-muted, rgba(0,0,0,.05)); border-color: transparent; opacity: 1; }

.progress-bar { position: fixed; top: 0; right: 0; left: 0; height: 3px; background: var(--color-primary); width: 0; z-index: 100; transition: width .1s linear; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--color-secondary); color: #cfd3dc; margin-top: 64px; padding: 44px 0 22px; }
html[data-theme="dark"] .site-footer { background: #0b0c10; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.footer-grid h4 { color: #fff; font-size: 15px; margin-bottom: 15px; }
.footer-grid a { color: #a9adba; font-size: 13.5px; display: block; margin-bottom: 9px; }
.footer-grid a:hover { color: #fff; text-decoration: none; }
.footer-bottom { text-align: center; padding-top: 26px; margin-top: 26px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12.5px; color: #8d92a1; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social-link { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; margin: 0; overflow: hidden; }
.footer-social-link svg { width: 17px; height: 17px; color: #cfd3dc; }
/* Admin-uploaded icon image: always contained (never stretched or cropped)
   inside the fixed circular badge, whatever the source image's own size or
   aspect ratio — keeps the footer/article icon row's height and spacing
   stable regardless of what the admin uploads. */
.footer-social-link img { width: 100%; height: 100%; object-fit: contain; padding: 6px; box-sizing: border-box; }
.footer-social-link:hover { background: var(--color-primary); }
.footer-social-link:hover svg { color: #fff; }
/* Same reasoning as the article-page version above: a custom uploaded logo
   needs far less inner padding than the built-in glyphs to stay legible at
   this size, and doesn't need a colored circle behind it either. */
.footer-social-link.has-custom-icon { background: transparent; }
.footer-social-link.has-custom-icon:hover { background: rgba(255,255,255,.12); }
.footer-social-link.has-custom-icon img { padding: 2px; }

/* ---------------- 404 / error pages ---------------- */
.error-page { text-align: center; padding: 90px 16px; }
.error-page .code { font-size: 100px; font-weight: 900; color: var(--color-primary); margin: 0; line-height: 1; }

/* Visually hidden but still in normal flow — safe for honeypot fields and
   screen-reader-only text, unlike the old off-canvas `left:-9999px` trick
   which can blow out the page's scrollable width. */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; }
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .page-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .main-nav, .search-box, .header-date { display: none; }
    .hamburger { display: flex; }
    .news-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    h1 { font-size: 23px; }
    .hero-main { height: 340px; }
    .hero-main .hero-overlay { padding: 50px 18px 18px; }
    .hero-main h1 { font-size: 21px; }
    .hero-main p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .hero-side-poster { height: 240px; }
    .hero-side-poster .hero-overlay { padding: 45px 16px 16px; }
    .hero-side-poster h2 { font-size: 17px; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* ---------------- Back to top ---------------- */
.back-to-top {
    position: fixed; bottom: 24px; left: 24px; z-index: 40;
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--color-primary); color: #fff; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0; transform: translateY(16px) scale(.85); pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, background .15s ease;
}
.back-to-top svg { width: 20px; height: 20px; }
.back-to-top.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.back-to-top:hover { background: var(--color-primary-dark); }
@media (max-width: 640px) {
    .back-to-top { bottom: 16px; left: 16px; width: 42px; height: 42px; }
}

/* Mobile drawer nav */
.mobile-nav {
    position: fixed; inset: 0; background: rgba(15,14,10,0); z-index: 90;
    visibility: hidden; pointer-events: none;
    transition: background .3s ease, visibility 0s linear .3s;
}
.mobile-nav.open {
    background: rgba(15,14,10,.5); visibility: visible; pointer-events: auto;
    transition: background .3s ease, visibility 0s linear 0s;
}
.mobile-nav-panel {
    position: absolute; top: 0; right: 0; width: 82%; max-width: 320px; height: 100%;
    background: var(--color-surface); padding: 10px 14px 20px; overflow-y: auto;
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.32,.72,0,1);
    box-shadow: var(--shadow-lg);
}
.mobile-nav.open .mobile-nav-panel { transform: translateX(0); }
.mobile-nav-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 4px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--color-border);
}
.mobile-nav-head .logo { font-size: 18px; }
.mobile-nav-head .logo .dot { display: inline-flex; }
.mobile-nav-head .logo .dot svg { width: 20px; height: 20px; }
.mobile-nav-panel a { display: flex; align-items: center; gap: 12px; padding: 13px 6px; color: var(--color-text); border-bottom: 1px solid var(--color-border); font-weight: 600; }
.mobile-nav-panel a svg { width: 19px; height: 19px; color: var(--color-text-muted); flex-shrink: 0; }
.mobile-nav-panel a:hover { color: var(--color-primary); text-decoration: none; }
.mobile-nav-panel a:hover svg { color: var(--color-primary); }

/* ---------------- Toasts (AJAX form feedback) ---------------- */
/* Shown after any AJAX form submit (admin CRUD, contact form, newsletter
   signup) instead of the old full-page-reload + flash-message pattern. */
.toast-stack {
    position: fixed;
    top: 16px;
    inset-inline-end: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, calc(100vw - 32px));
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-inline-start: 5px solid var(--color-text-muted);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.04);
    padding: 13px 15px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast .toast-icon { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; margin-top: 1px; }
.toast .toast-icon svg { width: 12px; height: 12px; }
.toast.toast-success { border-inline-start-color: #1a7f37; }
.toast.toast-success .toast-icon { background: #1a7f37; }
.toast.toast-error { border-inline-start-color: var(--color-primary); }
.toast.toast-error .toast-icon { background: var(--color-primary); }
@media (max-width: 560px) {
    .toast-stack { top: auto; bottom: 16px; inset-inline: 16px; max-width: none; }
}
