/* ══════════════════════════════════════════════════════════════════
   هفته‌نامه — Public Weekly Magazine (archive + single issue)
   Palette: the site's real theme color, --novin-theme (#08b8c8 turquoise,
   defined in custom.css), for interactive/site-tie-in elements, plus
   per-issue AccentColor for the editorial masthead identity and a
   neutral charcoal "ink" for a real newsprint feel.
   ══════════════════════════════════════════════════════════════════ */

:root {
    --w-ink: #16181d;
    --w-ink-soft: #2b2f38;
    --w-muted: #667085;
    --w-paper: #fff;
    --w-paper-2: #faf9f6;
    --w-line: #e7e5df;
    --w-site: var(--novin-theme, #08b8c8);
    --w-site-dark: var(--novin-theme-dark, #067f8c);
    /* deep, desaturated version of the site's turquoise, used for the masthead/cover
       backgrounds so they read as "the site's brand", not an unrelated dark tone. */
    --w-brand-dark: #08b8c8;
    --w-brand-darker: #047f8a;
}

/* ── Shared masthead nameplate (list + detail) ───────────────────── */
.weekly-nameplate {
    background: linear-gradient(155deg, var(--w-brand-dark) 0%, var(--w-brand-darker) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.weekly-nameplate::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 30%, rgba(8,184,200,.22), transparent 55%),
                radial-gradient(circle at 85% 75%, rgba(8,184,200,.14), transparent 55%);
    pointer-events: none;
}

.weekly-nameplate-inner {
    position: relative;
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 24px 26px;
    text-align: center;
}

.weekly-nameplate-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 800;
    font-size: .8rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding-bottom: 10px;
}

.weekly-nameplate-eyebrow::before,
.weekly-nameplate-eyebrow::after {
    content: "";
    width: 28px;
    height: 1px;
    background: rgba(8,184,200,.6);
}

.weekly-nameplate h1 {
    color: #fff;
    font-size: clamp(2rem, 4.6vw, 3.2rem);
    font-weight: 950;
    margin: 4px 0 8px;
    letter-spacing: -.01em;
}

.weekly-nameplate p {
    color: rgba(255,255,255,.72);
    font-size: 1rem;
    font-weight: 650;
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.9;
}

.weekly-nameplate-rule {
    margin-top: 22px;
    border-top: 3px double rgba(255,255,255,.28);
}

/* ══════════════════════════ ARCHIVE / LIST ══════════════════════ */
.weekly-archive { padding: 0 0 76px; background: var(--w-paper-2); }
.weekly-ad-span { margin: 26px 0; }

/* Featured issue hero */
.weekly-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 0;
    background: var(--w-paper);
    border: 1px solid var(--w-line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(22,24,29,.09);
    margin: -34px 0 40px;
    position: relative;
    z-index: 2;
}

.weekly-featured-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #ece9e1;
    overflow: hidden;
}

.weekly-featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}

.weekly-featured:hover .weekly-featured-media img { transform: scale(1.04); }

.weekly-featured-ribbon {
    position: absolute;
    top: 18px;
    inset-inline-start: 18px;
    background: var(--fx-accent, var(--w-ink));
    color: #fff;
    font-weight: 900;
    font-size: .78rem;
    padding: 7px 14px;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
}

.weekly-featured-body {
    padding: 40px 40px 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}

.weekly-featured-tag {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 6px;
    color: var(--w-site-dark);
    font-weight: 900;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.weekly-featured-body h2 { font-size: clamp(1.5rem, 2.6vw, 2.15rem); line-height: 1.5; font-weight: 950; margin: 0; color: var(--w-ink); }
.weekly-featured-body h2 a { color: inherit; text-decoration: none; }
.weekly-featured-body p { color: var(--w-muted); font-size: 1.02rem; line-height: 2; font-weight: 550; margin: 0; }

.weekly-featured-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--w-muted); font-size: .85rem; font-weight: 700; }
.weekly-featured-meta span { display: inline-flex; align-items: center; gap: 6px; }

.weekly-featured-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin-top: 6px;
    background: var(--w-ink);
    color: #fff;
    font-weight: 850;
    padding: 12px 22px;
    border-radius: 9px;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease;
}

.weekly-featured-cta:hover { background: var(--w-site-dark); color: #fff; transform: translateY(-2px); }

/* Section heading for the grid of remaining issues */
.weekly-grid-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 6px 0 22px;
}

.weekly-grid-heading h3 { font-size: 1.2rem; font-weight: 900; color: var(--w-ink); margin: 0; white-space: nowrap; }
.weekly-grid-heading::after { content: ""; flex: 1; height: 1px; background: var(--w-line); }

/* Issue cards grid */
.weekly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}

.weekly-card {
    background: var(--w-paper);
    border: 1px solid var(--w-line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(22,24,29,.06);
    display: flex;
    flex-direction: column;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.weekly-card:hover { transform: translateY(-6px); box-shadow: 0 22px 46px rgba(22,24,29,.14); border-color: #d8d5cc; }

.weekly-card-cover { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #ece9e1; }
.weekly-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.weekly-card:hover .weekly-card-cover img { transform: scale(1.06); }

.weekly-card-cover span {
    position: absolute; inset-inline-end: 12px; top: 12px;
    background: rgba(22,24,29,.86); color: #fff; border-radius: 999px;
    padding: 5px 12px; font-size: .75rem; font-weight: 900; backdrop-filter: blur(4px);
}

.weekly-card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1 1 auto; }
.weekly-card-date { color: var(--w-site-dark); font-weight: 900; font-size: .78rem; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .03em; }

.weekly-card h2 { font-size: 1.12rem; line-height: 1.65; margin: 0 0 8px; font-weight: 900; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.weekly-card h2 a { color: var(--w-ink); text-decoration: none; }
.weekly-card h2 a:hover { color: var(--w-site-dark); }

.weekly-card p { color: var(--w-muted); line-height: 1.9; font-size: .9rem; font-weight: 550; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.weekly-card-lead { display: flex; align-items: center; gap: 8px; color: var(--w-ink-soft); border-top: 1px dashed var(--w-line); padding: 10px 0 0; margin-top: auto; font-size: .82rem; font-weight: 700; }
.weekly-card-lead i { color: var(--w-site-dark); }
.weekly-card-lead span { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.weekly-read { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 12px; color: var(--w-site-dark); font-weight: 850; text-decoration: none; font-size: .86rem; }
.weekly-read::after { content: "\2190"; }
.weekly-read:hover { color: var(--w-ink); }

.weekly-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 44px; }
.weekly-pagination a { min-width: 40px; height: 40px; padding: 0 8px; display: grid; place-items: center; border-radius: 8px; background: var(--w-paper); color: var(--w-ink); border: 1px solid var(--w-line); font-weight: 800; text-decoration: none; transition: all .18s ease; }
.weekly-pagination a:hover { border-color: var(--w-site); color: var(--w-site-dark); }
.weekly-pagination a.active { background: var(--w-ink); color: #fff; border-color: var(--w-ink); }

.weekly-empty { background: var(--w-paper); padding: 60px 30px; border-radius: 12px; text-align: center; color: var(--w-muted); border: 1px dashed var(--w-line); font-weight: 650; }

/* ══════════════════════════ SINGLE ISSUE ══════════════════════ */
.weekly-issue { background: var(--w-paper); color: var(--w-ink); }

.weekly-cover {
    background: linear-gradient(155deg, var(--w-brand-dark) 0%, var(--w-brand-darker) 100%);
    color: #fff;
    padding: 0 0 0;
    position: relative;
    overflow: hidden;
}

.weekly-cover::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(circle at 10% 20%, rgba(255,255,255,.06), transparent 55%);
    pointer-events: none;
}

.weekly-cover .container-fluid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 480px);
    gap: 40px;
    align-items: center;
    padding: 46px 30px 44px;
}

.weekly-cover-text { display: grid; align-content: center; gap: 16px; }

.weekly-kicker {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 8px;
    /* solid fill (not colored text on a dark background) so this stays legible
       no matter which accent color an issue picks */
   /* background: var(--fx-accent, var(--w-site));*/
    color: #fff;
    font-weight: 900;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 6px 14px;
    border-radius: 999px;
}

.weekly-cover h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.8rem); line-height: 1.25; margin: 0; font-weight: 950; letter-spacing: -.01em; }
.weekly-cover-text > p { color: rgba(255,255,255,.72); font-size: 1.08rem; line-height: 2; max-width: 640px; font-weight: 550; margin: 0; }

.weekly-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.weekly-meta span { padding: 7px 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; font-weight: 750; font-size: .82rem; color: rgba(255,255,255,.85); }

.weekly-cover-image { margin: 0; position: relative; border-radius: 12px; overflow: hidden; box-shadow: 0 30px 70px rgba(0,0,0,.4); aspect-ratio: 4 / 3; background: #2a2d34; }
.weekly-cover-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.weekly-cover-image figcaption { position: absolute; inset-inline: 0; bottom: 0; color: #fff; padding: 14px 16px 12px; font-size: .8rem; line-height: 1.8; background: linear-gradient(to top, rgba(0,0,0,.78), transparent); }

/* Sticky TOC */
.weekly-toc-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.weekly-toc-inline a { white-space: nowrap; color: rgba(255,255,255,.85); text-decoration: none; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.22); font-weight: 750; font-size: .8rem; transition: all .18s ease; }
.weekly-toc-inline a:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.4); color: #fff; }

.weekly-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.weekly-share-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08);
    color: #fff; font-size: .8rem; font-weight: 750;
    text-decoration: none; cursor: pointer; transition: all .18s ease;
}
.weekly-share-btn:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.45); color: #fff; }
.weekly-share-btn.is-copied { background: var(--w-site-dark); border-color: var(--w-site-dark); }
.weekly-share-btn.is-copied::after { content: " \2713"; }

.weekly-body { padding: 36px 0 76px; }
.weekly-body .container-fluid { padding-left: 30px; padding-right: 30px; }
.weekly-ad-block { margin: 0 0 26px; }
.weekly-inline-ad { grid-column: 1 / -1; padding: 20px; border-top: 1px solid var(--w-line); border-bottom: 1px solid var(--w-line); background: var(--w-paper-2); }

.weekly-editorial, .weekly-linked-posts, .weekly-more { padding: 30px 0 8px; margin-bottom: 30px; border-top: 1px solid var(--w-line); }
.weekly-section-mark { display: inline-flex; align-items: center; gap: 8px; color: var(--w-site-dark); font-weight: 900; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.weekly-section-mark::before { content: ""; width: 18px; height: 2px; background: var(--w-site-dark); border-radius: 2px; }
.weekly-editorial h2, .weekly-linked-posts h2, .weekly-more h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.5; font-weight: 950; margin: 0 0 20px; color: var(--w-ink); }

.weekly-editorial .weekly-rich { column-count: 2; column-gap: 34px; column-rule: 1px solid var(--w-line); }
.weekly-editorial .weekly-rich p:first-of-type::first-letter {
    float: inline-start; font-size: 3.6rem; line-height: .82; font-weight: 950; color: var(--fx-accent, var(--w-site-dark));
    padding: 4px 6px 0 0; margin-inline-end: 2px;
}

.weekly-rich { line-height: 2.05; color: var(--w-ink-soft); font-size: 1rem; }
.weekly-rich p { margin-bottom: 1rem; }
.weekly-rich iframe, .weekly-rich video, .weekly-rich audio { max-width: 100%; border: 0; border-radius: 10px; }
.weekly-rich iframe, .weekly-rich video { width: 100%; aspect-ratio: 16 / 9; height: auto; }
.weekly-rich audio { width: 100%; }

/* Masonry grid of section cards.
   grid-auto-flow stays the default "row" (not "dense") so sections always
   appear in the exact order set in admin - closing the rare leftover gap
   isn't worth silently reordering the editorial sequence. */
.weekly-masonry {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.weekly-section-card {
    grid-column: span 6;
    background: var(--w-paper);
    border: 1px solid var(--w-line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(22,24,29,.05);
    display: grid;
    grid-template-rows: auto 1fr;
    transition: transform .2s ease, box-shadow .2s ease;
}

.weekly-section-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(22,24,29,.1); }

/* is-feature / is-highlighted / is-brief use flexbox (not grid-template-columns) so a
   section with no image doesn't get its content squeezed into the empty image track. */
.weekly-section-card.is-feature,
.weekly-section-card.is-highlighted { grid-column: span 12; display: flex; align-items: stretch; }
.weekly-section-card.is-article { grid-column: span 7; }
.weekly-section-card.is-brief { grid-column: span 4; display: flex; flex-direction: column; align-items: stretch; min-height: 168px; }
.weekly-section-card.is-visual { grid-column: span 6; }

.weekly-section-card.is-feature figure,
.weekly-section-card.is-highlighted figure { flex: 0 0 45%; }
.weekly-section-card.is-feature .weekly-section-content,
.weekly-section-card.is-highlighted .weekly-section-content { flex: 1 1 auto; min-width: 0; }
.weekly-section-card.is-brief figure { flex: 0 0 auto; }
.weekly-section-card.is-brief .weekly-section-content { flex: 1 1 auto; min-width: 0; }

.weekly-section-card figure { margin: 0; height: 100%; background: #ece9e1; overflow: hidden; position: relative; }
.weekly-section-card img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; display: block; transition: transform .35s ease; }
.weekly-section-card:hover img { transform: scale(1.045); }
.weekly-section-card.is-brief figure { height: auto; aspect-ratio: 16/10; }
.weekly-section-card.is-brief img { min-height: 0; height: 100%; aspect-ratio: auto; }
.weekly-section-card figcaption { position: absolute; inset-inline: 0; bottom: 0; padding: 8px 12px; color: #fff; font-size: .76rem; line-height: 1.7; background: linear-gradient(to top, rgba(0,0,0,.7), transparent); }

.weekly-section-content { padding: 22px; display: flex; flex-direction: column; width: 100%; min-width: 0; }
.weekly-section-content > span {
    align-self: flex-start;
    color: var(--fx-accent, var(--w-site-dark));
    background: color-mix(in srgb, var(--fx-accent, var(--w-site-dark)) 10%, transparent);
    font-weight: 900; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
    padding: 4px 10px; border-radius: 999px; margin-bottom: 10px;
}
.weekly-section-content h2 { font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.55; margin: 0 0 10px; font-weight: 900; color: var(--w-ink); }
.is-feature .weekly-section-content h2, .is-highlighted .weekly-section-content h2 { font-size: clamp(1.6rem, 3.2vw, 2.5rem); line-height: 1.35; }
.is-brief .weekly-section-content { padding: 15px; }
.is-brief .weekly-section-content h2 { font-size: .98rem; line-height: 1.65; margin-bottom: 6px; }
.is-brief .weekly-rich { display: none; }
.is-brief .summary { font-size: .84rem; line-height: 1.8; margin: 0; }

.section-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.section-facts b { background: var(--w-paper-2); color: var(--w-ink-soft); border: 1px solid var(--w-line); border-radius: 999px; padding: 4px 10px; font-size: .74rem; font-weight: 700; }

.summary { color: var(--w-muted); line-height: 1.95; font-weight: 550; }
.section-link { display: inline-flex; align-items: center; gap: 6px; color: var(--w-site-dark); font-weight: 850; text-decoration: none; margin-top: 14px; }
.section-link:hover { color: var(--w-ink); }

/* Linked posts / more issues */
.linked-grid, .more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.linked-post, .more-grid a {
    color: var(--w-ink); text-decoration: none; border: 1px solid var(--w-line); border-radius: 12px;
    overflow: hidden; background: var(--w-paper); box-shadow: 0 8px 20px rgba(22,24,29,.05);
    transition: transform .2s ease, box-shadow .2s ease;
}
.linked-post:hover, .more-grid a:hover { transform: translateY(-5px); box-shadow: 0 18px 38px rgba(22,24,29,.12); }
.linked-post img, .more-grid img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.linked-post.is-highlighted { border-color: var(--fx-accent, var(--w-site)); }
.linked-post span, .more-grid span { display: inline-flex; color: var(--w-site-dark); font-weight: 900; padding: 14px 14px 0; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; }
.linked-post strong, .more-grid strong { display: block; padding: 6px 14px 14px; line-height: 1.75; font-size: 1rem; font-weight: 800; }
.linked-post small { display: block; padding: 0 14px 14px; color: var(--w-muted); }

@media (max-width: 992px) {
  .weekly-featured { grid-template-columns: 1fr; margin-top: -20px; }
  .weekly-featured-media { aspect-ratio: 16/9; }
  .weekly-featured-body { padding: 26px 24px 28px; }
  .weekly-cover .container-fluid { grid-template-columns: 1fr; padding: 34px 20px; }
  .weekly-cover-image { max-width: 380px; width: 100%; aspect-ratio: 4/3; margin: 0 auto; }
  .weekly-section-card,
  .weekly-section-card.is-feature,
  .weekly-section-card.is-highlighted,
  .weekly-section-card.is-article,
  .weekly-section-card.is-visual,
  .weekly-section-card.is-brief { grid-column: span 12; display: block; }
  .weekly-section-card img,
  .weekly-section-card.is-brief img { min-height: 0; aspect-ratio: 16/9; }
  .linked-grid, .more-grid { grid-template-columns: 1fr 1fr; }
  .weekly-editorial .weekly-rich { column-count: 1; }
}

@media (max-width: 640px) {
  .weekly-nameplate-inner { padding: 22px 16px 20px; }
  .weekly-archive { padding-bottom: 50px; }
  .weekly-featured { border-radius: 10px; }
  .weekly-featured-body { padding: 20px 18px 22px; gap: 10px; }
  .weekly-grid { grid-template-columns: 1fr; gap: 18px; }
  .weekly-cover .container-fluid { padding: 26px 14px; gap: 22px; }
  .weekly-cover h1 { font-size: 1.7rem; line-height: 1.5; }
  .weekly-cover-text > p { font-size: .94rem; }
  .weekly-body { padding: 24px 0 50px; }
  .weekly-body .container-fluid { padding-left: 14px; padding-right: 14px; }
  .weekly-section-content { padding: 16px; }
  .linked-grid, .more-grid { grid-template-columns: 1fr; }
  .weekly-inline-ad { padding: 14px; }
}

/* ══════════════════════════ PRINT / "Save as PDF" ══════════════════════ */
@media print {
  body:has(.weekly-issue) header.header,
  body:has(.weekly-issue) footer.footer,
  body:has(.weekly-issue) .progress-wrap,
  .weekly-toc-inline,
  .weekly-share,
  .weekly-ad-block,
  .weekly-inline-ad,
  .weekly-pagination {
    display: none !important;
  }

  .weekly-cover {
    background: #fff !important;
    color: var(--w-ink) !important;
    border-bottom: 3px double var(--w-ink);
  }
  .weekly-cover::before { display: none; }
  .weekly-kicker { background: none !important; color: var(--w-ink) !important; border: 1px solid var(--w-line); }
  .weekly-cover h1 { color: var(--w-ink) !important; }
  .weekly-cover-text > p { color: var(--w-ink-soft) !important; }
  .weekly-meta span { color: var(--w-ink-soft) !important; border-color: var(--w-line); }
  .weekly-cover-image { box-shadow: none; border: 1px solid var(--w-line); }

  .weekly-masonry { display: block; }
  .weekly-section-card,
  .weekly-section-card.is-feature,
  .weekly-section-card.is-highlighted,
  .weekly-section-card.is-article,
  .weekly-section-card.is-visual,
  .weekly-section-card.is-brief {
    display: block; grid-column: unset; break-inside: avoid; page-break-inside: avoid;
    margin-bottom: 16px; box-shadow: none; border: 1px solid var(--w-line);
  }
  .weekly-section-card img { min-height: 0; max-height: 320px; }
  .weekly-editorial .weekly-rich { column-count: 1; }
}
