/* =====================================================
   سوارنیوز — استایل بخش عمومی
   پالت: سبز شکارگاه #1F3D2B | برنجی زین #C29A4B | مرکب #171D18
          کاغذ #FBFAF6 | خاک میدان #8A6D3B | قرمز فوری #A32638
   ===================================================== */
:root {
  --green: #1F3D2B;
  --green-deep: #14291D;
  --brass: #C29A4B;
  --brass-soft: #E4D3AC;
  --ink: #171D18;
  --paper: #FBFAF6;
  --line: #E4E0D4;
  --red: #A32638;
  --radius: 10px;
  --shadow: 0 2px 14px rgba(23, 29, 24, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
body {
  font-family: Vazirmatn, Tahoma, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.85;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- سربرگ ---------- */
.site-header { background: var(--green); color: #F3EFE2; }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 16px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark { font-size: 2.2rem; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.logo-text { font-size: 1.55rem; font-weight: 800; letter-spacing: -.5px; }
.logo-text small { display: block; font-size: .72rem; font-weight: 400; color: var(--brass-soft); letter-spacing: 1px; }
.search-form { display: flex; background: var(--green-deep); border: 1px solid rgba(228,211,172,.35); border-radius: 999px; overflow: hidden; }
.search-form input { background: transparent; border: 0; color: #F3EFE2; padding: 9px 18px; width: 240px; font-family: inherit; }
.search-form input::placeholder { color: rgba(243,239,226,.55); }
.search-form button { background: var(--brass); border: 0; padding: 0 16px; cursor: pointer; font-size: 1rem; }

/* منوی سرویس‌ها — با خط برنجی زیر آیتم فعال، مثل نوار افسار */
.main-nav { background: var(--green-deep); border-top: 1px solid rgba(194,154,75,.35); }
.nav-inner { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-inner::-webkit-scrollbar { display: none; }
.nav-inner a {
  padding: 11px 15px; font-size: .92rem; color: #E8E4D5; white-space: nowrap;
  border-bottom: 3px solid transparent; transition: border-color .2s, color .2s;
}
.nav-inner a:hover, .nav-inner a:focus-visible { color: #fff; border-bottom-color: var(--cat, var(--brass)); outline: none; }
.nav-home { font-weight: 700; }

/* نوار خبر فوری — ریل میدان */
.breaking-bar { display: flex; align-items: stretch; background: #fff; border-bottom: 2px solid var(--red); color: var(--ink); }
.breaking-label {
  background: var(--red); color: #fff; font-weight: 800; font-size: .85rem;
  display: flex; align-items: center; padding: 8px 18px; flex-shrink: 0;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}
.breaking-track { overflow: hidden; flex: 1; display: flex; align-items: center; }
.breaking-items { display: flex; gap: 48px; padding-inline-start: 100%; animation: ticker 30s linear infinite; white-space: nowrap; }
.breaking-items a { font-size: .9rem; font-weight: 600; }
.breaking-items a::before { content: "◈ "; color: var(--red); }
.breaking-items a:hover { color: var(--red); }
@keyframes ticker { to { transform: translateX(100%); } } /* RTL: حرکت به راست→چپ */

/* ---------- تبلیغات ---------- */
.ad-slot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 14px auto; }
.ad-item { position: relative; max-width: 100%; }
.ad-item img { border-radius: var(--radius); max-height: 140px; width: auto; }
.ad-tag {
  position: absolute; top: 6px; inset-inline-start: 6px; background: rgba(23,29,24,.65);
  color: #fff; font-size: .62rem; padding: 1px 7px; border-radius: 4px;
}
.ad-inline { grid-column: 1 / -1; }

/* ---------- هیرو ---------- */
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin: 20px 0 30px; }
.hero-main a { position: relative; display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-height: 380px; background: var(--green-deep); }
.hero-main img { width: 100%; height: 100%; min-height: 380px; object-fit: cover; position: absolute; inset: 0; }
.hero-overlay {
  position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 380px; padding: 26px;
  background: linear-gradient(to top, rgba(15,25,18,.92) 0%, rgba(15,25,18,.35) 55%, transparent 100%);
  color: #fff;
}
.hero-overlay h1 { font-size: 1.7rem; line-height: 1.5; margin: 10px 0 6px; }
.hero-overlay p { color: #DCD7C8; font-size: .95rem; }
.hero-overlay time { color: var(--brass-soft); font-size: .8rem; margin-top: 8px; }
.hero-side { display: grid; gap: 14px; }
.hero-mini a { position: relative; display: block; border-radius: var(--radius); overflow: hidden; height: 100%; min-height: 84px; background: var(--green-deep); }
.hero-mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-mini h2 {
  position: relative; z-index: 1; font-size: .92rem; line-height: 1.6; color: #fff; padding: 14px;
  background: linear-gradient(to top, rgba(15,25,18,.9), rgba(15,25,18,.25));
  display: flex; align-items: flex-end; height: 100%;
}

/* ---------- چیدمان دو ستونه ---------- */
.layout-two-col { display: grid; grid-template-columns: 1fr 300px; gap: 28px; margin: 24px 0 48px; }
.col-main { min-width: 0; }

/* عنوان بخش‌ها — با ریل دوخط برنجی */
.section-title {
  display: flex; align-items: center; gap: 14px; margin: 34px 0 18px;
  font-size: 1.25rem; color: var(--green);
}
.section-title span { flex-shrink: 0; }
.section-title::after {
  content: ""; flex: 1; height: 5px;
  border-top: 1px solid var(--brass); border-bottom: 1px solid var(--brass);
}
.section-title .more { font-size: .82rem; font-weight: 400; color: var(--brass); flex-shrink: 0; }
.section-title .more:hover { text-decoration: underline; }

/* ---------- کارت خبر ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 16/10; background: var(--brass-soft); overflow: hidden; display: block; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 2.6rem; opacity: .5; }
.type-badge {
  position: absolute; bottom: 8px; inset-inline-start: 8px;
  background: rgba(20,41,29,.85); color: #fff; font-size: .7rem; padding: 3px 10px; border-radius: 999px;
}
.type-badge.inline { position: static; display: inline-block; background: var(--green); margin-bottom: 10px; }
.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: .98rem; line-height: 1.65; font-weight: 700; }
.card h3 a:hover { color: var(--green); }
.card-lead { font-size: .82rem; color: #5A5F58; }
.card-meta { margin-top: auto; display: flex; justify-content: space-between; font-size: .74rem; color: #8B8F87; }

/* نشان دسته — به سبک روبان رنگی سوارکاران */
.cat-chip {
  display: inline-block; font-size: .72rem; font-weight: 700; color: var(--cat, var(--green));
  border: 1px solid var(--cat, var(--green)); border-radius: 4px; padding: 1px 9px;
  background: color-mix(in srgb, var(--cat, var(--green)) 8%, transparent);
  width: fit-content;
}

/* ---------- سایدبار ---------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.widget-title { font-size: 1rem; color: var(--green); padding-bottom: 10px; margin-bottom: 12px; border-bottom: 2px solid var(--brass); }
.popular-list { list-style: none; }
.popular-list li { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.popular-list li:last-child { border: 0; }
.popular-list .rank {
  font-weight: 800; color: var(--brass); font-size: 1.2rem; min-width: 22px; text-align: center;
}
.popular-list a { font-size: .87rem; line-height: 1.7; }
.popular-list a:hover { color: var(--green); }

/* ---------- صفحه خبر ---------- */
.post { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.post-header.center { text-align: center; }
.post-subtitle { color: var(--brass); font-size: .9rem; font-weight: 600; margin: 8px 0 4px; }
.post h1 { font-size: 1.65rem; line-height: 1.6; color: var(--ink); margin: 8px 0; }
.post-lead { font-size: 1.02rem; color: #444A43; font-weight: 500; border-inline-start: 4px solid var(--brass); padding-inline-start: 14px; margin: 12px 0; }
.post-header.center .post-lead { border: 0; padding: 0; }
.post-meta { display: flex; flex-wrap: wrap; gap: 18px; font-size: .8rem; color: #8B8F87; margin: 12px 0; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.post-meta.center { justify-content: center; }
.post-cover { margin: 18px -28px; }
.post-cover img { width: 100%; }
.post-body { font-size: 1.02rem; }
.post-body p { margin: 14px 0; }
.post-body h2, .post-body h3 { color: var(--green); margin: 22px 0 10px; }
.post-body blockquote { border-inline-start: 4px solid var(--brass); background: #FAF6EC; padding: 12px 18px; margin: 16px 0; border-radius: 6px; }
.post-body img { border-radius: var(--radius); margin: 12px auto; }
.post-body iframe { width: 100%; aspect-ratio: 16/9; border-radius: var(--radius); }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.post-tags a { background: #F0EDE2; border-radius: 999px; padding: 4px 14px; font-size: .8rem; color: var(--green); }
.post-tags a:hover { background: var(--brass-soft); }

/* گزارش تصویری */
.photo-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 24px 0; }
.gallery-item { background: #F5F2E9; border-radius: var(--radius); overflow: hidden; }
.gallery-item img { width: 100%; aspect-ratio: 3/2; object-fit: cover; transition: transform .25s; }
.gallery-item a:hover img { transform: scale(1.03); }
.gallery-item figcaption { padding: 10px 14px; font-size: .82rem; color: #5A5F58; }
.gallery-item figcaption small { display: block; color: var(--brass); margin-top: 2px; }
.lightbox {
  position: fixed; inset: 0; background: rgba(10,15,11,.94); z-index: 99;
  display: flex; align-items: center; justify-content: center; padding: 30px;
}
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 6px; }
.lb-close { position: absolute; top: 18px; inset-inline-end: 22px; background: transparent; border: 0; color: #fff; font-size: 1.8rem; cursor: pointer; }

/* گزارش ویدئویی */
.video-frame { margin: 20px 0; }
.video-frame video, .video-frame iframe { width: 100%; aspect-ratio: 16/9; border-radius: var(--radius); background: #000; border: 0; }

/* دیدگاه‌ها */
.comments { margin-top: 30px; }
.comment { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px; background: #FCFBF7; }
.comment-head { display: flex; gap: 14px; align-items: baseline; font-size: .82rem; color: #8B8F87; margin-bottom: 6px; }
.comment-head b { color: var(--green); font-size: .92rem; }
.comment-form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.comment-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.comment-form input, .comment-form textarea {
  font-family: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: #fff;
}
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid var(--brass); border-color: transparent; }
.comment-form .hp { position: absolute; inset-inline-start: -9999px; } /* هانی‌پات */
.comment-form small { color: #8B8F87; }

/* ---------- دسته / آرشیو ---------- */
.cat-header {
  background: linear-gradient(135deg, var(--cat, var(--green)), color-mix(in srgb, var(--cat, var(--green)) 70%, black));
  color: #fff; border-radius: var(--radius); padding: 30px; margin: 22px 0;
}
.cat-header h1 { font-size: 1.6rem; }
.cat-header p { color: rgba(255,255,255,.85); margin-top: 6px; }
.cat-header .count { display: inline-block; margin-top: 12px; background: rgba(255,255,255,.18); border-radius: 999px; padding: 2px 14px; font-size: .8rem; }
.page-title { font-size: 1.5rem; color: var(--green); margin: 26px 0 20px; }
.band { margin-top: 10px; }

/* صفحه‌بندی */
.pagination { display: flex; gap: 8px; justify-content: center; margin: 30px 0; flex-wrap: wrap; }
.pagination a, .pagination .current {
  min-width: 38px; text-align: center; padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; font-size: .9rem;
}
.pagination .current { background: var(--green); color: #fff; border-color: var(--green); }
.pagination a:hover { border-color: var(--brass); }

/* ---------- عمومی ---------- */
.btn {
  display: inline-block; background: var(--green); color: #fff; border: 0;
  border-radius: 8px; padding: 10px 24px; font-family: inherit; font-size: .92rem;
  font-weight: 600; cursor: pointer; transition: background .2s;
  width: fit-content;
}
.btn:hover { background: var(--green-deep); }
.flash { border-radius: 8px; padding: 12px 18px; margin: 14px 0; font-size: .9rem; }
.flash.ok { background: #E8F3EA; color: #1F5B31; border: 1px solid #BBDCC3; }
.flash.err { background: #FBEBED; color: var(--red); border: 1px solid #EFC4CA; }
.empty { color: #8B8F87; padding: 30px; text-align: center; grid-column: 1 / -1; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.notfound { text-align: center; padding: 80px 20px; }
.nf-emoji { font-size: 4.5rem; margin-bottom: 14px; }
.notfound h1 { font-size: 1.4rem; color: var(--green); margin-bottom: 8px; }
.notfound p { color: #8B8F87; margin-bottom: 22px; }

/* ---------- پاصفحه ---------- */
.site-footer { background: var(--green-deep); color: #CFCBBB; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; padding: 38px 16px 28px; }
.site-footer h3 { color: var(--brass-soft); margin-bottom: 8px; }
.site-footer h4 { color: #F3EFE2; margin-bottom: 12px; font-size: .95rem; }
.site-footer ul { list-style: none; }
.site-footer li { margin: 7px 0; font-size: .87rem; }
.site-footer a:hover { color: var(--brass-soft); }
.footer-bar { border-top: 1px solid rgba(194,154,75,.3); padding: 14px 0; font-size: .78rem; text-align: center; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: repeat(2, 1fr); }
  .layout-two-col { grid-template-columns: 1fr; }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .cards-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .header-top { flex-direction: column; }
  .search-form input { width: 180px; }
  .cards-grid, .cards-3, .cards-4, .hero-side, .photo-gallery, .comment-form .row { grid-template-columns: 1fr; }
  .post { padding: 18px; }
  .post-cover { margin: 14px -18px; }
  .hero-overlay h1 { font-size: 1.25rem; }
  .footer-grid { grid-template-columns: 1fr; }
}
