/* ============ پشت پرده — theme (ported from newsestan) ============ */
:root{
  --brand:#d50000;
  --bg:#f4f5f7; --surface:#ffffff; --text:#16181d; --muted:#6b7280;
  --border:#e6e8eb; --black:#0d0f12; --shadow:0 2px 14px rgba(0,0,0,.06);
  --radius:14px; --maxw:1240px;
  --font:'Vazirmatn',system-ui,-apple-system,'Segoe UI',sans-serif;
}
html[data-theme="dark"], body.theme-dark{
  --bg:#0d0f12; --surface:#16181d; --text:#e9eaee; --muted:#9aa0aa;
  --border:#262a31; --shadow:0 2px 18px rgba(0,0,0,.5);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{background:var(--bg);color:var(--text);font-family:var(--font);line-height:1.7;font-size:16px;
  -webkit-font-smoothing:antialiased;transition:background .2s,color .2s}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
.container{max-width:var(--maxw);margin:0 auto;padding:0 16px}

/* ---- Breaking bar ---- */
.breaking-bar{display:flex;align-items:center;gap:12px;background:var(--black);color:#fff;
  padding:8px 16px;overflow:hidden;font-size:14px}
.breaking-label{background:var(--brand);color:#fff;font-weight:800;padding:3px 12px;border-radius:6px;flex:none;z-index:1}
.breaking-viewport{flex:1;overflow:hidden}
.breaking-track{display:flex;width:max-content;will-change:transform}
.breaking-group{display:flex;align-items:center;gap:14px;padding-inline-end:14px;flex:none;min-width:100%;white-space:nowrap;animation:ticker 45s linear infinite}
.breaking-bar:hover .breaking-group{animation-play-state:paused}
.breaking-track a:hover{color:#ffd2d2}
.breaking-track .sep{opacity:.4}
@keyframes ticker{from{transform:translateX(0)}to{transform:translateX(-100%)}}

/* ---- Header ---- */
.site-header{background:var(--surface);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:50;box-shadow:var(--shadow)}
.header-top{display:flex;align-items:center;gap:20px;padding:14px 16px}
.brand-group{display:flex;align-items:center;gap:10px;flex:none}
.logo{display:flex;align-items:center;gap:10px;font-weight:800;font-size:22px}
.logo-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:var(--brand);color:#fff;font-weight:900}
.logo .logo-text b{color:var(--brand)}
.logo-sub{font-size:12px;color:var(--muted);font-weight:500;margin-top:2px}
.search-box{flex:1;display:flex;max-width:520px;border:1px solid var(--border);border-radius:30px;overflow:hidden;background:var(--bg)}
.search-box input{flex:1;border:0;background:transparent;padding:10px 16px;color:var(--text);outline:none;font-family:inherit}
.search-box button{border:0;background:var(--brand);color:#fff;padding:0 18px;font-size:18px;cursor:pointer}
.header-actions{display:flex;align-items:center;gap:12px;margin-inline-start:auto}
.icon-btn{border:1px solid var(--border);background:var(--bg);color:var(--text);width:38px;height:38px;border-radius:10px;cursor:pointer;font-size:16px}

.main-nav{background:var(--surface);border-bottom:1px solid var(--border)}
.nav-inner{display:flex;align-items:center}
.nav-list{display:flex;gap:4px;list-style:none;margin:0;padding:0;flex-wrap:wrap}
.nav-list a{display:block;padding:12px 14px;font-weight:600;font-size:14px;border-bottom:3px solid transparent}
.nav-list a:hover,.nav-list a.active{color:var(--brand);border-color:var(--brand)}
.nav-toggle{display:none;border:0;background:none;color:var(--text);font-size:24px;cursor:pointer;padding:8px}
.nav-clock{margin-inline-start:auto;font-size:13px;font-weight:700;color:var(--muted);white-space:nowrap;padding:0 8px;font-variant-numeric:tabular-nums}
.nav-clock-m{display:none}
@media(max-width:640px){
  .nav-clock{display:none}
  .nav-clock-m{display:inline-block;order:99;margin-inline-start:auto;font-size:11.5px;font-weight:700;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
  .brand-group{flex-wrap:wrap}
}

.site-main{padding:24px 16px;min-height:50vh}

/* ---- Grids & cards ---- */
.section{margin-bottom:34px}
.section-head{display:flex;align-items:center;gap:10px;margin-bottom:16px}
.section-head h2{font-size:20px;margin:0;position:relative;padding-inline-start:14px}
.section-head h2::before{content:"";position:absolute;inset-inline-start:0;top:4px;bottom:4px;width:5px;border-radius:3px;background:var(--brand)}
.section-head .more{margin-inline-start:auto;font-size:13px;color:var(--muted)}
.section-head .more:hover{color:var(--brand)}

.grid{display:grid;gap:18px}
.grid-4{grid-template-columns:repeat(4,1fr)}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-2{grid-template-columns:repeat(2,1fr)}
.home-layout{display:grid;grid-template-columns:1fr 320px;gap:28px}

.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);transition:transform .15s,box-shadow .15s}
.card:hover{transform:translateY(-3px)}
.card .thumb{position:relative;aspect-ratio:16/9;background:#222;overflow:hidden;display:block}
.card .thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.card .cat-badge{position:absolute;top:10px;inset-inline-start:10px;background:var(--brand);color:#fff;font-size:11px;font-weight:700;padding:3px 10px;border-radius:20px}
.card .body{padding:14px}
.card h3{font-size:16px;margin:0 0 8px;line-height:1.5}
.card h3 a:hover{color:var(--brand)}
.card .meta{display:flex;gap:10px;font-size:12px;color:var(--muted)}
.card.sm h3{font-size:14px}

/* big hero */
.hero{display:grid;grid-template-columns:2fr 1fr;gap:18px;margin-bottom:30px;align-items:stretch}
.hero-main{position:relative;border-radius:var(--radius);overflow:hidden;height:300px;background:#111;display:block}
.hero-main img{width:100%;height:100%;object-fit:cover;position:absolute;inset:0;transition:transform .4s}
.hero-main:hover img{transform:scale(1.04)}
.hero-main .overlay{position:absolute;inset:0;background:linear-gradient(to top,rgba(0,0,0,.9),rgba(0,0,0,.15) 70%,transparent);display:flex;flex-direction:column;justify-content:flex-end;padding:24px;color:#fff}
.hero-main h2{font-size:26px;margin:10px 0 6px;color:#fff;line-height:1.5;text-shadow:0 2px 14px rgba(0,0,0,.85),0 1px 3px rgba(0,0,0,.9)}
.hero-main p{color:#e9e9e9;font-size:14px;margin:0;line-height:1.8;text-shadow:0 1px 8px rgba(0,0,0,.8)}
.hero-main .cat-badge{position:static;align-self:flex-start;color:#fff;font-size:12px;font-weight:700;padding:4px 12px;border-radius:20px}
.hero-side{display:flex;flex-direction:column;gap:14px}
.hero-card{position:relative;display:block;border-radius:var(--radius);overflow:hidden;background:#111;flex:1;min-height:90px}
.hero-card img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:transform .4s}
.hero-card:hover img{transform:scale(1.06)}
.hero-card .overlay{position:absolute;inset:0;background:linear-gradient(to top,rgba(0,0,0,.92),rgba(0,0,0,.1) 75%,transparent);display:flex;flex-direction:column;justify-content:flex-end;padding:13px;color:#fff}
.hero-card .cat-badge{position:static;align-self:flex-start;color:#fff;font-size:10px;font-weight:700;padding:3px 9px;border-radius:20px}
.hero-card h3{font-size:14px;margin:7px 0 0;line-height:1.6;color:#fff;text-shadow:0 2px 12px rgba(0,0,0,.85),0 1px 3px rgba(0,0,0,.9)}

/* list rows */
.news-list{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:4px 16px;box-shadow:var(--shadow)}
.news-row{display:flex;gap:16px;padding:14px 0;border-bottom:1px solid var(--border);align-items:flex-start}
.news-row:last-child{border-bottom:0}
.news-row .thumb{flex:none;width:140px;height:90px;border-radius:10px;overflow:hidden;background:var(--bg)}
.news-row .thumb img{width:100%;height:100%;object-fit:cover}
.news-row .row-body{flex:1;min-width:0}
.news-row h3{font-size:16px;margin:0 0 6px;line-height:1.6}
.news-row h3 a:hover{color:var(--brand)}
.news-row .row-sum{font-size:13px;color:var(--muted);margin:0 0 7px;line-height:1.8;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.news-row .meta{font-size:12px;color:var(--muted)}
.news-row .rcat{font-weight:700}
@media(max-width:640px){
  .news-row .thumb{width:104px;height:72px}
  .news-row .row-sum{display:none}
  .news-row h3{font-size:14px}
}

/* sidebar widgets */
.widget{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px;margin-bottom:20px;box-shadow:var(--shadow)}
.widget h3{font-size:16px;margin:0 0 12px;padding-bottom:8px;border-bottom:2px solid var(--brand);display:inline-block}
.rank-list{list-style:none;margin:0;padding:0;counter-reset:r}
.rank-list li{counter-increment:r;display:flex;gap:10px;padding:9px 0;border-bottom:1px dashed var(--border);font-size:14px;line-height:1.7}
.rank-list li:last-child{border-bottom:0}
.rank-list li::before{content:counter(r);font-weight:800;color:var(--brand);min-width:22px}
.rank-list a:hover{color:var(--brand)}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips a{background:var(--bg);border:1px solid var(--border);padding:5px 12px;border-radius:20px;font-size:13px}
.chips a:hover{background:var(--brand);color:#fff;border-color:var(--brand)}
.fx-list{display:grid;gap:8px}
.fx-row{display:flex;justify-content:space-between;font-size:14px;padding:6px 0;border-bottom:1px dashed var(--border)}
.fx-row:last-child{border-bottom:0}
.fx-row .up{color:#1aa251}.fx-row .down{color:#d12d2d}
.widget .more{display:inline-block;margin-top:10px;font-size:13px;color:var(--muted)}
.widget .more:hover{color:var(--brand)}

/* article */
.article{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:26px;box-shadow:var(--shadow);max-width:900px;margin:0 auto}
.article .breadcrumb{font-size:13px;color:var(--muted);margin-bottom:14px}
.article .breadcrumb a:hover{color:var(--brand)}
.article h1{font-size:30px;line-height:1.4;margin:6px 0 14px}
.article .lead{font-size:18px;color:var(--muted);border-inline-start:4px solid var(--brand);padding-inline-start:14px;margin:16px 0;line-height:1.9}
.article .hero-img{border-radius:var(--radius);overflow:hidden;margin:18px 0}
.article .content{font-size:17px;line-height:2}
.article .content p{margin:0 0 16px}
.article .content h2,.article .content h3{margin:24px 0 10px}
.article .content blockquote{border-inline-start:4px solid var(--brand);background:var(--bg);margin:16px 0;padding:12px 16px;border-radius:8px;color:var(--muted)}
.article .article-meta{display:flex;gap:16px;font-size:13px;color:var(--muted);flex-wrap:wrap;border-block:1px solid var(--border);padding:12px 0;margin:16px 0}
.badge-special{background:var(--brand);color:#fff;padding:3px 12px;border-radius:20px;font-size:12px;font-weight:700}

.video-embed{position:relative;aspect-ratio:16/9;border-radius:var(--radius);overflow:hidden;margin:16px 0}
.video-embed iframe{position:absolute;inset:0;width:100%;height:100%;border:0}

/* share bar */
.share-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:22px;padding-top:16px;border-top:1px solid var(--border)}
.share-row .share-label{font-size:13px;font-weight:800;color:var(--muted)}
.share-row .sh{display:inline-flex;align-items:center;gap:5px;height:36px;padding:0 14px;border-radius:10px;background:var(--bg);border:1px solid var(--border);color:var(--text);font-size:13px;font-weight:700;cursor:pointer}
.share-row .sh:hover{background:var(--brand);color:#fff;border-color:var(--brand)}
.share-row .sh-tg:hover{background:#0088cc;border-color:#0088cc}
.share-row .sh-wa:hover{background:#25d366;border-color:#25d366}

.page-head{margin-bottom:22px;border-bottom:1px solid var(--border);padding-bottom:14px}
.page-head h1{font-size:26px;margin:0}
.page-head .sub{color:var(--muted);font-size:14px;margin-top:6px}

/* video cards */
.video-card{display:block;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);transition:transform .15s}
.video-card:hover{transform:translateY(-3px)}
.video-card .thumb{position:relative;aspect-ratio:16/9;background:#111;overflow:hidden}
.video-card .thumb img{width:100%;height:100%;object-fit:cover}
.video-card .play{position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:34px;text-shadow:0 2px 10px rgba(0,0,0,.6)}
.video-card .dur{position:absolute;bottom:8px;inset-inline-end:8px;background:rgba(0,0,0,.75);color:#fff;font-size:11px;padding:2px 7px;border-radius:5px}
.video-card .body{padding:12px 14px}
.video-card h4{margin:0 0 6px;font-size:14px;line-height:1.6}
.video-card .meta{font-size:12px;color:var(--muted)}

/* forms */
.form{max-width:560px;display:grid;gap:14px}
.form label{font-weight:600;font-size:14px}
.form input,.form textarea,.form select{width:100%;padding:11px 14px;border:1px solid var(--border);border-radius:10px;background:var(--bg);color:var(--text);font-family:inherit;font-size:15px}
.form textarea{min-height:140px;resize:vertical}
.btn{display:inline-block;background:var(--brand);color:#fff;border:0;padding:12px 22px;border-radius:10px;font-weight:700;cursor:pointer;font-family:inherit;font-size:15px}
.btn:hover{filter:brightness(.94)}
.alert{padding:12px 16px;border-radius:10px;margin-bottom:16px}
.alert.success,.flash-success{background:#e6f6ec;color:#1a7a3e;border:1px solid #bfe6cd}
.flash-error{background:#fdeaea;color:#b42318;border:1px solid #f5c2c0;padding:12px 16px;border-radius:10px;margin-bottom:16px}

.empty{text-align:center;color:var(--muted);padding:50px 0}

/* newsletter */
.newsletter{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:26px;box-shadow:var(--shadow);text-align:center;margin-top:10px}
.newsletter h3{margin:0 0 8px;font-size:20px}
.newsletter p{color:var(--muted);margin:0 0 16px}
.newsletter form{display:flex;gap:8px;max-width:440px;margin:0 auto;flex-wrap:wrap}
.newsletter input{flex:1;min-width:200px;padding:11px 14px;border:1px solid var(--border);border-radius:10px;background:var(--bg);color:var(--text);font-family:inherit}

/* pagination */
.pagination{display:flex;gap:6px;justify-content:center;margin-top:26px;flex-wrap:wrap;list-style:none;padding:0}
.pagination a,.pagination span{display:grid;place-items:center;min-width:38px;height:38px;padding:0 10px;border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--text);font-size:14px}
.pagination .active span,.pagination a:hover{background:var(--brand);color:#fff;border-color:var(--brand)}

/* footer */
.site-footer{background:var(--surface);border-top:1px solid var(--border);margin-top:50px}
.footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:28px;padding:42px 16px 26px}
.footer-col h4{font-size:15px;margin:0 0 14px;color:var(--text);position:relative;padding-bottom:8px}
.footer-col h4::after{content:"";position:absolute;inset-inline-start:0;bottom:0;width:30px;height:2px;background:var(--brand)}
.footer-col ul{list-style:none;margin:0;padding:0}
.footer-col ul li{margin-bottom:9px}
.footer-col ul a{color:var(--muted);font-size:14px}
.footer-col ul a:hover{color:var(--brand)}
.footer-about .logo{font-size:20px;margin-bottom:12px}
.footer-about p{color:var(--muted);font-size:14px;line-height:1.9;margin:0 0 16px;max-width:340px}
.social{display:flex;gap:10px}
.social a{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:var(--bg);border:1px solid var(--border);font-size:16px;color:var(--text)}
.social a:hover{background:var(--brand);color:#fff;border-color:var(--brand)}
.footer-bottom{border-top:1px solid var(--border);padding:16px;text-align:center;color:var(--muted);font-size:13px}

/* responsive */
@media(max-width:980px){
  .home-layout{grid-template-columns:1fr}
  .hero{grid-template-columns:1fr}
  .grid-4{grid-template-columns:repeat(2,1fr)}
  .grid-3{grid-template-columns:repeat(2,1fr)}
  .footer-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:640px){
  .grid-4,.grid-3,.grid-2{grid-template-columns:1fr}
  .header-top{flex-wrap:wrap;gap:12px}
  .search-box{order:3;max-width:100%;flex-basis:100%}
  .header-actions{margin-inline-start:auto}
  .logo{font-size:19px}
  .nav-toggle{display:block}
  .main-nav{border-bottom:0}
  .nav-list{display:none;flex-direction:column;width:100%;border-top:1px solid var(--border)}
  .nav-list.open{display:flex;padding:4px 0 8px}
  .nav-list a{padding:11px 14px;border-bottom:1px solid var(--border);border-inline-start:3px solid transparent}
  .article h1{font-size:24px}
  .footer-grid{grid-template-columns:1fr 1fr;gap:18px 16px;padding:26px 16px 14px;text-align:right}
  .footer-about{grid-column:1 / -1;border-bottom:1px solid var(--border);padding-bottom:18px}
  .footer-about p{max-width:none}
  .social{justify-content:flex-start}
}

/* mobile: news cards become compact horizontal cards (image beside title) */
@media(max-width:640px){
  .grid-2,.grid-3,.grid-4{gap:12px}
  .grid-2 .card,.grid-3 .card,.grid-4 .card{display:flex;flex-direction:row;align-items:stretch}
  .grid-2 .card .thumb,.grid-3 .card .thumb,.grid-4 .card .thumb{flex:0 0 38%;max-height:none;aspect-ratio:4/3}
  .grid-2 .card .body,.grid-3 .card .body,.grid-4 .card .body{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;padding:11px 13px}
  .grid-2 .card h3,.grid-3 .card h3,.grid-4 .card h3{font-size:14.5px;margin-bottom:6px}
  .grid-2 .card .cat-badge,.grid-3 .card .cat-badge,.grid-4 .card .cat-badge{font-size:10px;padding:2px 8px}
  /* photoless card = title only (no flex/image) */
  .grid-2 .card.no-img,.grid-3 .card.no-img,.grid-4 .card.no-img{display:block}
}
/* photoless cards/rows: just the title, no image (all viewports) */
.card.no-img .body{padding:16px}
.card.no-img .cat-inline{display:inline-block;margin-bottom:8px}
.news-row.no-img .thumb{display:none}

/* mobile hero: image on top, title BELOW it (not overlaid) */
@media(max-width:640px){
  .hero{gap:14px}
  .hero-main,.hero-card{height:auto;min-height:0;flex:none;display:block;overflow:hidden;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius)}
  .hero-main img,.hero-card img{position:static;width:100%;height:auto;aspect-ratio:16/9;transform:none}
  .hero-main .overlay,.hero-card .overlay{position:static;inset:auto;background:none;padding:10px 13px 14px}
  .hero-main .cat-badge,.hero-card .cat-badge{position:absolute;top:10px;inset-inline-start:10px;align-self:auto;z-index:2}
  .hero-main h2{color:var(--text);font-size:19px;line-height:1.6;margin:8px 0 6px;text-shadow:none}
  .hero-main p{color:var(--muted);font-size:13px;text-shadow:none}
  .hero-card h3{color:var(--text);font-size:15px;margin:8px 0 2px;text-shadow:none}
}

/* mobile floating «آخرین اخبار» button + bottom sheet */
body.no-scroll{overflow:hidden}
.latest-fab{display:none}
.latest-sheet{display:none}
@media(max-width:640px){
  .latest-fab{display:inline-flex;align-items:center;gap:6px;position:fixed;bottom:16px;left:16px;right:auto;z-index:80;background:var(--brand);color:#fff;border:0;border-radius:30px;padding:12px 18px;font-weight:800;font-size:14px;box-shadow:0 6px 20px rgba(0,0,0,.35);cursor:pointer;font-family:inherit}
}
.latest-sheet.open{display:block;position:fixed;inset:0;z-index:90}
.latest-sheet .ls-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.5)}
.latest-sheet .ls-panel{position:absolute;left:0;right:0;bottom:0;max-height:80vh;background:var(--surface);border-radius:18px 18px 0 0;display:flex;flex-direction:column;box-shadow:0 -6px 30px rgba(0,0,0,.3);animation:lsUp .25s ease}
@keyframes lsUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
.latest-sheet .ls-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--border);font-weight:800;font-size:15px}
.latest-sheet .ls-close{border:0;background:var(--bg);width:32px;height:32px;border-radius:50%;font-size:16px;cursor:pointer;color:var(--text);line-height:1}
.latest-sheet .ls-list{overflow-y:auto;-webkit-overflow-scrolling:touch;padding:4px 16px 20px}
.latest-sheet .ls-item{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--border);align-items:flex-start;color:inherit}
.latest-sheet .ls-item:last-child{border-bottom:0}
.latest-sheet .ls-thumb{flex:none;width:72px;height:54px;border-radius:8px;overflow:hidden;background:var(--bg)}
.latest-sheet .ls-thumb img{width:100%;height:100%;object-fit:cover}
.latest-sheet .ls-body{flex:1;min-width:0}
.latest-sheet .ls-item h4{margin:0 0 5px;font-size:14px;line-height:1.6}
.latest-sheet .ls-item:hover h4{color:var(--brand)}
.latest-sheet .ls-meta{font-size:11.5px;color:var(--muted)}

/* mobile: simplified footer (only درباره/تماس) + hide print on share */
.footer-mobile-links{display:none}
@media(max-width:640px){
  .footer-grid > .footer-col:not(.footer-about){display:none}
  .footer-mobile-links{display:flex;gap:10px;padding:14px 16px 6px}
  .footer-mobile-links a{flex:1;text-align:center;background:var(--bg);border:1px solid var(--border);border-radius:10px;padding:11px;font-weight:700;font-size:14px;color:var(--text)}
  .footer-mobile-links a:hover{background:var(--brand);color:#fff;border-color:var(--brand)}
  .share-row .sh-print{display:none}
}

@media print{
  .breaking-bar,.site-header,.site-footer,.home-side,.share-row,.newsletter,.section-head .more{display:none!important}
  .article{border:0;box-shadow:none;max-width:none}
}
