/* ==========================================================================
   Shaho Theme — Literary RTL Ghost theme
   Tuned for Persian/Kurdish writing. Paris Review meets Tehran quarterly.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
    /* Palette — warm paper + ink + deep crimson. Muted, editorial. */
    --bg:            #f6f3ed;
    --bg-elevated:   #fbf9f5;
    --surface:       #ffffff;
    --ink:           #1a1614;
    --ink-soft:      #3a332e;
    --muted:         #6b5e52;
    --muted-light:   #a09286;
    --accent:        #9b2335;
    --accent-soft:   #c43c4c;
    --accent-dark:   #751a28;
    --border:        #e6ddd1;
    --border-strong: #cfc3b2;
    --hover:         #efe8dd;
    --hero-bg:       #0f0d0c;

    /* Typography — two-font system
       • Vazirmatn: modern Persian sans — UI, body, headings (100–900 weights)
       • Noto Nastaliq Urdu: calligraphic script — drop cap + pull quotes
       • Gulzar: graceful Nastaliq cut — ornamental accents */
    --font-body:     'Vazirmatn', 'IRANSans', 'Tahoma', system-ui, sans-serif;
    --font-display:  'Vazirmatn', system-ui, sans-serif;
    --font-script:   'Gulzar', 'Noto Nastaliq Urdu', 'Vazirmatn', serif;
    --font-mono:     ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

    /* Type scale — musical, not arithmetic. Optimized for Persian reading. */
    --fs-xs:     0.75rem;    /* 12 */
    --fs-sm:     0.875rem;   /* 14 */
    --fs-base:   1.125rem;   /* 18 — body lifted 5% for Persian legibility */
    --fs-lg:     1.25rem;    /* 20 — lede + excerpts */
    --fs-xl:     1.5rem;     /* 24 */
    --fs-2xl:    1.875rem;   /* 30 — h3 */
    --fs-3xl:    2.375rem;   /* 38 — h2 */
    --fs-4xl:    3rem;       /* 48 — h1 */
    --fs-5xl:    4rem;       /* 64 — display */

    /* Line-height — Persian needs more air than Latin */
    --lh-display: 1.2;   /* tight headings */
    --lh-tight:   1.4;
    --lh-snug:    1.65;
    --lh-base:    1.95;
    --lh-read:    2.15;  /* long-form body */
    --lh-relaxed: 2.3;   /* generous */

    /* Spacing scale */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-7: 3rem;
    --sp-8: 4rem;
    --sp-9: 6rem;
    --sp-10: 8rem;

    /* Widths — reading column deliberately narrow for Persian legibility.
       Shorter lines = easier return-sweep of the eye; you don't lose the line. */
    --w-read:   36rem;    /* ~576px, ~50-55 Persian glyphs per line */
    --w-content: 52rem;   /* ~832px wider content */
    --w-wide:   68rem;    /* ~1088px grid/layout */

    /* Motion */
    --ease:       cubic-bezier(0.2, 0, 0.2, 1);
    --t-fast:     150ms;
    --t-base:     220ms;
    --t-slow:     400ms;

    /* Radii */
    --r-sm: 2px;
    --r-md: 4px;
    --r-lg: 8px;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(26, 22, 20, 0.04), 0 1px 3px rgba(26, 22, 20, 0.06);
    --shadow-md: 0 4px 16px rgba(26, 22, 20, 0.08);
    --shadow-lg: 0 12px 40px rgba(26, 22, 20, 0.12);
}

/* --------------------------------------------------------------------------
   2. Reset + base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
::selection { background: var(--accent); color: #fff; }

html {
    direction: rtl;
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: 400;
    line-height: var(--lh-base);
    color: var(--ink);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Enable kerning, ligatures, contextual alternates — gives Vazirmatn its best rendering */
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    font-variant-numeric: proportional-nums;
    /* Slight optical sizing for Persian */
    font-optical-sizing: auto;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.site-main { flex: 1; }

.container-read    { max-width: var(--w-read);    margin-inline: auto; padding-inline: var(--sp-5); }
.container-content { max-width: var(--w-content); margin-inline: auto; padding-inline: var(--sp-5); }
.container-wide    { max-width: var(--w-wide);    margin-inline: auto; padding-inline: var(--sp-5); }

/* --------------------------------------------------------------------------
   4. Header + Navigation
   -------------------------------------------------------------------------- */
.site-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: saturate(1.2) blur(8px);
    background: rgba(251, 249, 245, 0.92);
}

.site-header-inner {
    max-width: var(--w-wide);
    margin: 0 auto;
    padding: var(--sp-4) var(--sp-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-6);
}

.site-logo { display: flex; align-items: center; gap: var(--sp-2); }
.site-logo img { height: 34px; width: auto; }

.site-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    transition: color var(--t-fast) var(--ease);
}
.site-logo:hover .site-title { color: var(--accent); }

/* Navigation */
.site-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--sp-6);
    flex-wrap: wrap;
}

.site-nav a {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--muted);
    padding: var(--sp-2) 0;
    position: relative;
    transition: color var(--t-fast) var(--ease);
    white-space: nowrap;
}

.site-nav a::after {
    content: '';
    position: absolute;
    right: 0; left: 0; bottom: 2px;
    height: 1.5px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--t-base) var(--ease);
}

.site-nav a:hover,
.site-nav a.nav-current {
    color: var(--ink);
}
.site-nav a:hover::after,
.site-nav a.nav-current::after {
    transform: scaleX(1);
}

/* Hamburger button — hidden at desktop, 44×44 touch target on mobile */
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 12px 10px;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    background: transparent;
    border: 0;
    cursor: pointer;
    position: relative;
    z-index: 130;
    margin-inline-start: auto;
}
.nav-toggle-line {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--ink);
    transition: transform var(--t-base) var(--ease),
                opacity var(--t-fast) var(--ease);
    transform-origin: center;
    border-radius: 2px;
}
body.nav-open .nav-toggle-line:nth-child(1) { transform: translateY(8px) rotate(-45deg); }
body.nav-open .nav-toggle-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
body.nav-open .nav-toggle-line:nth-child(3) { transform: translateY(-8px) rotate(45deg); }

/* Scrim — semi-opaque background when nav is open (mobile) */
.nav-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(12, 10, 9, 0.4);
    backdrop-filter: blur(3px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-base) var(--ease);
}
body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }

/* --------------------------------------------------------------------------
   5. Homepage hero — cinematic GIF reel, hard cuts (no fade)
   -------------------------------------------------------------------------- */
.site-hero {
    background: var(--hero-bg);
    color: #fff;
    padding: var(--sp-9) var(--sp-5);
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 62vh;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

/* Dark overlay for title legibility + subtle vignette */
.site-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.72) 100%),
        rgba(0,0,0,0.35);
    z-index: 1;
    pointer-events: none;
}

/* Thin crimson horizon line at the bottom edge */
.site-hero::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(to right, transparent 0%, rgba(155,35,53,0.5) 50%, transparent 100%);
    z-index: 2;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    opacity: 0;
    /* 12 GIFs × 7 s = 84 s cycle, hard cuts via step-end (no crossfade) */
    animation: heroSlide 84s step-end infinite;
    filter: saturate(0.85) contrast(1.05);
}

/* 12 cinematic film loops — no pendulums, no static stills */
.hero-bg-1  { background-image: url('https://ashuob.com/content/images/wp-uploads/2017/02/band-of-outsiders-jean-luc-godard-cinematheia.gif'); animation-delay: 0s;   }
.hero-bg-2  { background-image: url('https://ashuob.com/content/images/wp-uploads/2017/02/MammaRomaFinale_zpse8e5ec4f.gif');                   animation-delay: -77s; }
.hero-bg-3  { background-image: url('https://ashuob.com/content/images/wp-uploads/2017/02/tumblr_nwa9v71fB81sf2a1uo2_500.gif');                animation-delay: -70s; }
.hero-bg-4  { background-image: url('https://ashuob.com/content/images/wp-uploads/2017/02/tumblr_mpbhvrB5Rl1s36zono1_500.gif');                animation-delay: -63s; }
.hero-bg-5  { background-image: url('https://ashuob.com/content/images/wp-uploads/2017/02/tumblr_noz0ejmzNE1qghl49o1_r1_540.gif');             animation-delay: -56s; }
.hero-bg-6  { background-image: url('https://ashuob.com/content/images/wp-uploads/2017/02/285ec07184c7b72def784fc2deacc87e.gif');              animation-delay: -49s; }
.hero-bg-7  { background-image: url('https://ashuob.com/content/images/wp-uploads/2017/02/carcrash.gif');                                      animation-delay: -42s; }
.hero-bg-8  { background-image: url('https://ashuob.com/content/images/wp-uploads/2017/02/tumblr_o445rv6rgQ1rdfgw4o1_500.gif');                animation-delay: -35s; }
.hero-bg-9  { background-image: url('https://ashuob.com/content/images/wp-uploads/2017/02/tumblr_nrdesdcsJa1rtmubxo1_500.gif');                animation-delay: -28s; }
.hero-bg-10 { background-image: url('https://ashuob.com/content/images/wp-uploads/2017/02/tumblr_njvm825snc1qzhvd4o1_400.gif');                animation-delay: -21s; }
.hero-bg-11 { background-image: url('https://ashuob.com/content/images/wp-uploads/2017/02/tumblr_mo0to7ivVo1rij4pzo1_500.gif');                animation-delay: -14s; }
.hero-bg-12 { background-image: url('https://ashuob.com/content/images/wp-uploads/2017/02/tumblr_oenllgBmXc1rsuztqo1_500.gif');                animation-delay: -7s;  }

/* Instant cut: each slot is 1/12 of the cycle = 8.333%.
   With step-end, opacity holds at 1 until 8.34% then snaps to 0 — no fade. */
@keyframes heroSlide {
    0%     { opacity: 1; }
    8.34%  { opacity: 0; }
}

.site-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 640px;
    margin: 0 auto;
}

.site-hero-eyebrow {
    display: inline-block;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    margin-bottom: var(--sp-4);
    padding: var(--sp-1) var(--sp-3);
    border: 1px solid rgba(255,255,255,0.2);
}

.site-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.035em;
    margin-bottom: var(--sp-4);
    color: #fff;
}

.site-hero-desc {
    font-size: 1.05rem;
    font-weight: 300;
    color: rgba(255,255,255,0.72);
    max-width: 460px;
    margin: 0 auto var(--sp-5);
    line-height: 1.8;
}

.site-hero-rule {
    width: 48px;
    height: 2px;
    background: var(--accent-soft);
    margin: var(--sp-5) auto 0;
    opacity: 0.9;
}

/* Scroll cue */
.site-hero-scroll {
    position: absolute;
    bottom: var(--sp-6);
    right: 50%;
    transform: translateX(50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    color: rgba(255,255,255,0.5);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    animation: scrollPulse 2.5s var(--ease) infinite;
}
.site-hero-scroll::after {
    content: '';
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.3);
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.45; transform: translate(50%, 0); }
    50%      { opacity: 0.8;  transform: translate(50%, 4px); }
}

/* --------------------------------------------------------------------------
   6. Post feed — editorial card grid
   -------------------------------------------------------------------------- */
.post-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-6);
    max-width: var(--w-wide);
    margin: 0 auto;
    padding: var(--sp-8) var(--sp-5);
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow var(--t-base) var(--ease),
                transform var(--t-base) var(--ease),
                border-color var(--t-base) var(--ease);
    position: relative;
}

.post-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--border-strong);
}

.post-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

/* Media area — 2:1 matches the cover photos Shaho designed in WordPress.
   `contain` shows the full designer composition, no cropping.
   Any off-ratio images get a dark cinematic letterbox. */
.post-card-media {
    position: relative;
    aspect-ratio: 2 / 1;
    background: #0f0d0c;
    overflow: hidden;
    flex-shrink: 0;
}

/* Diagonal hatch — only visible on no-image posts or in letterbox margins */
.post-card-media::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(-55deg, transparent 0 10px, rgba(255,255,255,0.02) 10px 11px),
        linear-gradient(135deg, #1a1513 0%, #241a15 100%);
    z-index: 0;
}

.post-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;         /* preserve designed cover in full */
    object-position: center;
    display: block;
    z-index: 1;
    transition: transform var(--t-slow) var(--ease);
}
.post-card:hover .post-card-image { transform: scale(1.03); }

.post-card-tag {
    position: absolute;
    bottom: var(--sp-3);
    right: var(--sp-3);
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #fff;
    background: var(--accent);
    padding: 0.32em 0.8em;
    z-index: 2;
    transition: background var(--t-fast) var(--ease);
}
.post-card:hover .post-card-tag { background: var(--accent-dark); }

/* Card body */
.post-card-body {
    padding: var(--sp-4) var(--sp-5) var(--sp-5);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    flex: 1;
}

.post-card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.55;
    color: var(--ink);
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--t-fast) var(--ease);
}
.post-card:hover .post-card-title { color: var(--accent); }

.post-card-excerpt {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.post-card-meta {
    font-size: 0.74rem;
    color: var(--muted-light);
    font-weight: 500;
    letter-spacing: 0.03em;
    margin-top: auto;
    padding-top: var(--sp-3);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.post-card-date { white-space: nowrap; }
.post-card-reading-time { color: var(--muted-light); }
.post-card-reading-time::before { content: '·'; margin-left: var(--sp-2); opacity: 0.4; }

/* Featured first post — full-width hero card on desktop */
.post-card:first-child {
    grid-column: 1 / -1;
    border-color: var(--border-strong);
    background: var(--bg-elevated);
}

.post-card:first-child .post-card-link {
    flex-direction: row;
    min-height: 340px;
}

.post-card:first-child .post-card-media {
    width: 54%;
    aspect-ratio: auto;
    min-height: 340px;
    flex-shrink: 0;
}

.post-card:first-child .post-card-body {
    padding: var(--sp-7) var(--sp-7);
    justify-content: center;
    gap: var(--sp-4);
}

.post-card:first-child .post-card-title {
    font-size: clamp(1.6rem, 2.3vw, 2rem);
    line-height: 1.35;
    -webkit-line-clamp: 4;
}

.post-card:first-child .post-card-excerpt {
    font-size: 1rem;
    line-height: 1.85;
    -webkit-line-clamp: 3;
}

.post-card:first-child .post-card-meta {
    padding-top: var(--sp-4);
    font-size: 0.8rem;
}

/* Featured badge */
.post-card:first-child::before {
    content: 'تازه‌ترین';
    position: absolute;
    top: var(--sp-4);
    right: var(--sp-4);
    background: var(--ink);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    padding: 0.3em 0.9em;
    z-index: 4;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   7. Pagination
   -------------------------------------------------------------------------- */
.pagination {
    max-width: var(--w-wide);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--sp-5);
    padding: var(--sp-8) var(--sp-5);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    color: var(--muted);
    padding: var(--sp-2) var(--sp-4);
    border: 1px solid var(--border);
    transition: all var(--t-fast) var(--ease);
    font-weight: 500;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
}

.pagination-link:hover {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.pagination-arrow {
    font-size: 1.25em;
    line-height: 1;
    opacity: 0.65;
    transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}

.pagination-link:hover .pagination-arrow {
    opacity: 1;
}

/* Hover: arrow drifts away from the label (toward its edge of the page) */
.pagination-newer:hover .pagination-arrow { transform: translateX(3px); }
.pagination-older:hover .pagination-arrow { transform: translateX(-3px); }

.pagination .page-number {
    color: var(--muted-light);
    letter-spacing: 0.05em;
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    padding: var(--sp-2) 0;
}

/* --------------------------------------------------------------------------
   8. Single post — the reading canvas
   -------------------------------------------------------------------------- */
.post-container {
    max-width: var(--w-read);
    margin: 0 auto;
    padding: var(--sp-9) var(--sp-5) var(--sp-8);
}

.full-post { position: relative; }

/* Reading progress bar */
.reading-progress {
    position: fixed;
    top: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    width: 0;
    z-index: 200;
    transition: width 60ms linear;
}

.post-header {
    text-align: center;
    margin-bottom: var(--sp-7);
    padding-bottom: var(--sp-6);
    border-bottom: 1px solid var(--border);
}

.post-header-eyebrow {
    display: inline-block;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--sp-4);
}

.post-title {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 4.5vw, 2.9rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
    margin-bottom: var(--sp-5);
    color: var(--ink);
}

.post-meta {
    font-size: 0.85rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
    letter-spacing: 0.02em;
}
.post-meta-sep { color: var(--muted-light); opacity: 0.6; }
.post-meta-tag {
    color: var(--accent);
    font-weight: 500;
    transition: opacity var(--t-fast);
}
.post-meta-tag:hover { opacity: 0.7; }

.post-excerpt {
    font-size: 1.08rem;
    color: var(--ink-soft);
    line-height: 1.9;
    margin-top: var(--sp-5);
    font-weight: 300;
    font-style: italic;
    max-width: 36rem;
    margin-inline: auto;
}

.post-feature-image {
    margin: 0 0 var(--sp-7);
    overflow: hidden;
    background: var(--ink);
}
.post-feature-image img {
    width: 100%;
    max-height: 540px;
    object-fit: cover;
    display: block;
}

/* Post content typography — tuned for deep Persian reading.
   Shorter line measure + generous leading + full-ink color so lines don't get lost. */
.post-content {
    font-size: var(--content-size, 1.2rem);  /* JS can override via localStorage */
    line-height: 2.3;                         /* generous — Persian needs air */
    color: var(--ink);                        /* pure ink, not softened */
    font-weight: 400;
    letter-spacing: 0;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1, 'tnum' 0;
    hanging-punctuation: first allow-end last;
}

/* The lede — first paragraph: larger, with a Nastaliq drop cap */
.post-content > p:first-of-type {
    font-size: calc(var(--content-size, 1.2rem) * 1.08);
    line-height: 2.2;
    color: var(--ink);
    margin-bottom: 1.9em;
    font-weight: 400;
}

.post-content > p:first-of-type::first-letter {
    float: right;
    font-family: var(--font-script);
    font-size: 5em;
    font-weight: 400;
    line-height: 0.92;
    margin-left: 0.14em;
    margin-top: 0.14em;
    margin-bottom: -0.05em;
    color: var(--accent);
    padding-left: 0.05em;
    /* Slight drop shadow for depth */
    text-shadow: 2px 2px 0 rgba(155, 35, 53, 0.06);
}

.post-content p {
    margin-bottom: 1.85em;
    position: relative;
    padding-right: var(--sp-4);
    margin-right: calc(-1 * var(--sp-4));
    transition: opacity 0.35s ease, color 0.35s ease;
    cursor: text;
}

/* Soft crimson "you're here" bar on the right edge (RTL start-side) */
.post-content p::before {
    content: '';
    position: absolute;
    top: 0.35em;
    bottom: 0.35em;
    right: 0;
    width: 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.post-content p:hover::before { opacity: 0.2; }
/* Click to pin a paragraph — helps when you come back after an interruption */
.post-content p.p-marked::before { opacity: 0.75; width: 3px; }
.post-content p.p-marked { background: linear-gradient(to left, rgba(155,35,53,0.02), transparent 40%); }

/* ── Focus mode ────────────────────────────────────────────────────────────
   Only the paragraph near the viewport center stays at 100% ink;
   everything else dims to 28%. Killer for avoiding line loss. */
.post-content.focus-mode p,
.post-content.focus-mode h2,
.post-content.focus-mode h3,
.post-content.focus-mode blockquote,
.post-content.focus-mode figure,
.post-content.focus-mode ul,
.post-content.focus-mode ol {
    opacity: 0.28;
    transition: opacity 0.45s ease;
}
.post-content.focus-mode .p-in-focus {
    opacity: 1 !important;
}
.post-content.focus-mode .p-in-focus::before { opacity: 0.5; width: 3px; }

/* Headings — hierarchy through weight + rhythm, not just size */

.post-content h2 {
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 3.2vw, 1.75rem);
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 2.4em 0 0.7em;
    position: relative;
    padding-top: 0.25em;
}
/* Small rule above h2 — like a chapter break */
.post-content h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 2.5rem;
    height: 2px;
    background: var(--accent);
    opacity: 0.7;
}

.post-content h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: -0.01em;
    margin: 2em 0 0.55em;
    color: var(--ink);
}

.post-content h4 {
    font-size: 1.08rem;
    font-weight: 700;
    margin: 1.6em 0 0.5em;
    color: var(--ink-soft);
    letter-spacing: 0.01em;
}

/* Links — refined underline (not border) with generous offset */
.post-content a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: rgba(155, 35, 53, 0.4);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.28em;
    transition: color var(--t-fast) var(--ease),
                text-decoration-color var(--t-fast) var(--ease);
}
.post-content a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
}

.post-content strong { font-weight: 700; color: var(--ink); }
.post-content em     { font-style: italic; color: var(--ink); }

/* Blockquote — a quiet sidebar, not a loud callout */
.post-content blockquote {
    margin: 2.2em 0;
    padding: 0.3em var(--sp-6) 0.3em 0;
    border-right: 2px solid var(--accent);
    font-size: 1.08rem;
    line-height: 2;
    color: var(--ink-soft);
    font-weight: 400;
    background: transparent;
    position: relative;
}
.post-content blockquote p { margin-bottom: 0.6em; }
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content blockquote em,
.post-content blockquote i {
    font-style: normal;
    color: var(--accent);
}

/* Pull quote — short blockquote gets huge Nastaliq display treatment.
   Opt-in by giving blockquote a `.pull-quote` class, or automatically via :only-child heuristic. */
.post-content blockquote.pull-quote,
.post-content blockquote:has(> p:only-child:not(:has(br))) {
    font-family: var(--font-script);
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.9;
    color: var(--accent-dark);
    text-align: center;
    border: 0;
    padding: var(--sp-6) var(--sp-5);
    margin: 2.5em -1.5rem;
    position: relative;
}
.post-content blockquote.pull-quote::before,
.post-content blockquote:has(> p:only-child:not(:has(br)))::before {
    content: '';
    display: block;
    width: 3rem;
    height: 1px;
    background: var(--accent);
    margin: 0 auto 1em;
    opacity: 0.5;
}
.post-content blockquote.pull-quote::after,
.post-content blockquote:has(> p:only-child:not(:has(br)))::after {
    content: '';
    display: block;
    width: 3rem;
    height: 1px;
    background: var(--accent);
    margin: 1em auto 0;
    opacity: 0.5;
}

/* Lists — Persian-appropriate bullets */
.post-content ul,
.post-content ol {
    padding-right: 1.5em;
    margin-bottom: 1.6em;
}
.post-content ul { list-style: none; }
.post-content ul li {
    margin-bottom: 0.55em;
    position: relative;
}
.post-content ul li::before {
    content: '❋';
    position: absolute;
    right: -1.3em;
    top: 0.15em;
    color: var(--accent);
    font-size: 0.75em;
    opacity: 0.7;
}
.post-content ol li { margin-bottom: 0.55em; }
.post-content ol li::marker {
    color: var(--accent);
    font-weight: 700;
}

.post-content img { margin: 2em 0; border-radius: 2px; }

.post-content figure { margin: 2.4em 0; }

.post-content figcaption {
    text-align: center;
    font-size: 0.88rem;
    color: var(--muted);
    margin-top: var(--sp-3);
    font-style: italic;
    line-height: 1.7;
    letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   Audio player — custom, crimson, RTL-tuned, accessible
   -------------------------------------------------------------------------- */
.post-content .post-audio {
    margin: 2.4em 0;
    padding: var(--sp-5) var(--sp-5) var(--sp-4);
    background: linear-gradient(180deg, #fdfbf6 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--border);
    border-radius: 4px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    /* Top accent stripe */
    background-image: linear-gradient(var(--accent), var(--accent));
    background-repeat: no-repeat;
    background-size: 2.5rem 2px;
    background-position: top right var(--sp-5);
    padding-top: calc(var(--sp-5) + 4px);
}

.post-content .post-audio .audio-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: var(--sp-4);
    line-height: 1;
}

/* Native audio is hidden once JS enhances — stays as fallback for no-JS users */
.post-content .post-audio.player-enhanced audio { display: none; }

/* Native fallback styling (no JS) */
.post-content .post-audio:not(.player-enhanced) audio {
    width: 100%;
    height: 44px;
    direction: ltr;
}

.audio-body {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

/* ── Play / pause button ──────────────────────────────────────────────────── */
.audio-play {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t-fast) var(--ease),
                transform var(--t-fast) var(--ease),
                box-shadow var(--t-base) var(--ease);
    box-shadow: 0 2px 10px rgba(155, 35, 53, 0.22);
    padding: 0;
}
.audio-play:hover {
    background: var(--accent-dark);
    transform: scale(1.04);
    box-shadow: 0 4px 14px rgba(155, 35, 53, 0.32);
}
.audio-play:active { transform: scale(0.96); }
.audio-play:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
.audio-play svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}
.audio-play .icon-play  { margin-right: 2px; }   /* optical centering of triangle */
.audio-play .icon-pause { display: none; }
.audio-play.is-playing  { background: var(--ink); box-shadow: 0 2px 10px rgba(26, 22, 20, 0.25); }
.audio-play.is-playing:hover { background: var(--accent-dark); }
.audio-play.is-playing .icon-play  { display: none; }
.audio-play.is-playing .icon-pause { display: block; margin: 0; }

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.audio-progress {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}
.audio-progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    cursor: pointer;
    transition: height var(--t-fast) var(--ease);
}
.audio-progress-bar:hover,
.audio-progress-bar:focus-visible { height: 6px; }
.audio-progress-bar:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(155, 35, 53, 0.18); }

.audio-progress-buffer,
.audio-progress-fill {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    border-radius: inherit;
    will-change: width;
}
.audio-progress-buffer {
    background: rgba(155, 35, 53, 0.15);
    width: 0%;
    z-index: 1;
    transition: width 120ms linear;
}
.audio-progress-fill {
    background: var(--accent);
    width: 0%;
    z-index: 2;
    transition: width 80ms linear;
}
.audio-progress-fill::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    transition: transform var(--t-fast) var(--ease);
    box-shadow: 0 0 0 4px rgba(155, 35, 53, 0.15);
}
.audio-progress-bar:hover .audio-progress-fill::after,
.audio-play.is-playing ~ .audio-progress .audio-progress-fill::after {
    transform: translateY(-50%) scale(1);
}

/* ── Time display ─────────────────────────────────────────────────────────── */
.audio-time {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    min-width: 5.5em;
    justify-content: flex-end;
}
.audio-current   { color: var(--ink); font-weight: 500; }
.audio-sep       { margin: 0 0.3em; opacity: 0.4; }
.audio-duration  { opacity: 0.75; }

/* ── Speed toggle ─────────────────────────────────────────────────────────── */
.audio-speed {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 0.32em 0.65em;
    border-radius: 3px;
    cursor: pointer;
    letter-spacing: 0.02em;
    min-width: 2.8em;
    text-align: center;
    transition: all var(--t-fast) var(--ease);
}
.audio-speed:hover {
    color: var(--ink);
    border-color: var(--border-strong);
    background: var(--bg);
}
.audio-speed:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Mobile adaptation ────────────────────────────────────────────────────── */
@media (max-width: 599px) {
    .post-content .post-audio {
        padding: var(--sp-4);
        padding-top: calc(var(--sp-4) + 4px);
        background-position: top right var(--sp-4);
    }
    .audio-body { gap: var(--sp-3); }
    .audio-play { width: 44px; height: 44px; }
    .audio-time { font-size: 0.72rem; min-width: 5em; }
    .audio-speed { font-size: 0.68rem; padding: 0.28em 0.5em; }
}

/* Code — kept for completeness */
.post-content pre,
.post-content code {
    font-family: var(--font-mono);
    font-size: 0.92em;
    direction: ltr;
    text-align: left;
}
.post-content code {
    background: var(--bg-elevated);
    padding: 0.15em 0.4em;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.post-content pre {
    background: var(--ink);
    color: #e8ddd0;
    padding: var(--sp-5);
    border-radius: var(--r-md);
    overflow-x: auto;
    margin: 2em 0;
    line-height: 1.7;
}
.post-content pre code { background: none; border: 0; padding: 0; color: inherit; }

/* ── Reading controls — sticky toolbar above long-form posts ──────────────── */
.reading-controls {
    position: sticky;
    top: 72px;                          /* below site header */
    z-index: 50;
    display: flex;
    gap: var(--sp-2);
    justify-content: flex-end;
    margin: var(--sp-5) 0 var(--sp-4);
    padding: var(--sp-2) 0;
    font-size: 0.82rem;
}

.reading-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.4em 0.8em;
    border: 1px solid var(--border);
    background: rgba(246, 243, 237, 0.92);
    backdrop-filter: blur(6px);
    color: var(--muted);
    cursor: pointer;
    border-radius: 3px;
    letter-spacing: 0.02em;
    font-weight: 500;
    transition: all var(--t-fast) var(--ease);
    font-variant-numeric: tabular-nums;
}
.reading-tool:hover {
    color: var(--ink);
    border-color: var(--border-strong);
    background: var(--bg-elevated);
}
.reading-tool.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.reading-tool.is-active:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.reading-tool-group {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
    background: rgba(246, 243, 237, 0.92);
    backdrop-filter: blur(6px);
}
.reading-tool-group .reading-tool {
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    padding: 0.4em 0.7em;
}
.reading-tool-group .reading-tool + .reading-tool { border-right: 1px solid var(--border); }
.reading-tool-group .reading-tool:hover { background: var(--bg-elevated); }

@media (max-width: 599px) {
    .reading-controls { top: 60px; font-size: 0.75rem; gap: var(--sp-1); }
    .reading-tool { padding: 0.35em 0.6em; }
}

/* Section break — three stars, centered */
.post-content hr {
    border: 0;
    height: 1px;
    background: transparent;
    margin: 2.5em auto;
    position: relative;
    text-align: center;
    color: var(--accent);
    font-size: 1rem;
    letter-spacing: 0.8em;
}
.post-content hr::after {
    content: '❋ ❋ ❋';
    letter-spacing: 0.5em;
    color: var(--accent);
    opacity: 0.55;
}

/* End-of-article mark — a small crimson diamond after the last paragraph */
.post-content > p:last-of-type::after {
    content: ' ❖';
    display: inline;
    color: var(--accent);
    font-size: 0.85em;
    margin-right: 0.35em;
    vertical-align: 0.05em;
}

/* --------------------------------------------------------------------------
   9. Post footer — tags, share, prev/next
   -------------------------------------------------------------------------- */
.post-footer {
    margin-top: var(--sp-8);
    padding-top: var(--sp-6);
    border-top: 1px solid var(--border);
}

.post-footer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-bottom: var(--sp-6);
}

.post-footer-tag {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 0.3em 0.9em;
    border-radius: 99px;
    transition: all var(--t-fast) var(--ease);
}
.post-footer-tag:hover {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

/* Prev/Next navigation */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-5);
    margin-top: var(--sp-7);
    padding-top: var(--sp-6);
    border-top: 1px solid var(--border);
}

.post-nav-item {
    display: block;
    padding: var(--sp-5);
    border: 1px solid var(--border);
    transition: all var(--t-base) var(--ease);
}
.post-nav-item:hover {
    border-color: var(--border-strong);
    background: var(--bg-elevated);
    transform: translateY(-2px);
}

.post-nav-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--sp-2);
    display: block;
}
.post-nav-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-nav-next { text-align: left; }

/* Back-link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 0.88rem;
    color: var(--muted);
    margin-top: var(--sp-7);
    transition: color var(--t-fast);
}
.back-link:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   10. Tag archive + static page
   -------------------------------------------------------------------------- */
.page-header {
    text-align: center;
    padding: var(--sp-8) var(--sp-5) var(--sp-6);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}
.page-header-eyebrow {
    display: inline-block;
    font-size: var(--fs-xs);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--sp-3);
    font-weight: 600;
}
.page-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.025em;
    color: var(--ink);
}
.page-description {
    color: var(--muted);
    font-size: 1rem;
    margin-top: var(--sp-3);
    max-width: 36rem;
    margin-inline: auto;
    line-height: 1.8;
}
.page-meta {
    color: var(--muted-light);
    font-size: 0.8rem;
    margin-top: var(--sp-3);
    letter-spacing: 0.05em;
}

/* Static page (about) */
.page-container-narrow {
    max-width: var(--w-read);
    margin: 0 auto;
    padding: var(--sp-9) var(--sp-5);
}

.page.full-post .post-header {
    text-align: right;
    border-bottom: 0;
    padding-bottom: var(--sp-4);
    margin-bottom: var(--sp-5);
}

.post-content .lead {
    font-size: 1.3rem;
    line-height: 1.9;
    color: var(--ink-soft);
    font-weight: 300;
    margin-bottom: 1.5em;
}

/* --------------------------------------------------------------------------
   11. Error page
   -------------------------------------------------------------------------- */
.error-page {
    text-align: center;
    padding: var(--sp-10) var(--sp-5);
    max-width: 32rem;
    margin: 0 auto;
}
.error-code {
    font-family: var(--font-display);
    font-size: 6rem;
    font-weight: 300;
    line-height: 1;
    color: var(--border-strong);
    margin-bottom: var(--sp-3);
}
.error-message {
    color: var(--muted);
    margin-bottom: var(--sp-6);
}
.error-link {
    display: inline-block;
    color: var(--accent);
    border-bottom: 1px solid currentColor;
    padding-bottom: 0.15em;
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--hero-bg);
    color: rgba(255,255,255,0.55);
    padding: var(--sp-8) var(--sp-5) var(--sp-6);
    margin-top: var(--sp-8);
}

.site-footer-inner {
    max-width: var(--w-wide);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--sp-7);
    padding-bottom: var(--sp-7);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.site-footer-brand {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    color: rgba(255,255,255,0.88);
    letter-spacing: -0.02em;
    margin-bottom: var(--sp-3);
    display: block;
}

.site-footer-tagline {
    color: rgba(255,255,255,0.5);
    font-size: 0.92rem;
    line-height: 1.8;
    max-width: 28rem;
}

.site-footer-col h4 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    margin-bottom: var(--sp-3);
}

.site-footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.site-footer-col a {
    color: rgba(255,255,255,0.55);
    font-size: 0.88rem;
    transition: color var(--t-fast) var(--ease);
}
.site-footer-col a:hover { color: rgba(255,255,255,0.9); }

.site-footer-bottom {
    max-width: var(--w-wide);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--sp-5);
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
    flex-wrap: wrap;
    gap: var(--sp-3);
}
.site-footer-bottom a { color: rgba(255,255,255,0.5); }
.site-footer-bottom a:hover { color: #fff; }

/* --------------------------------------------------------------------------
   13. Ghost Koenig editor cards
   -------------------------------------------------------------------------- */
.kg-card { margin: 2em 0; }
.kg-image-card img { border-radius: var(--r-md); width: 100%; }
.kg-image-card figcaption { text-align: center; color: var(--muted); }

.kg-gallery-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.kg-gallery-image img { width: 100%; height: 220px; object-fit: cover; border-radius: var(--r-sm); }

.kg-embed-card { display: flex; justify-content: center; }

.kg-bookmark-card {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: border-color var(--t-fast);
}
.kg-bookmark-card:hover { border-color: var(--border-strong); }
.kg-bookmark-container { display: flex; padding: var(--sp-4); gap: var(--sp-4); }
.kg-bookmark-title { font-weight: 700; font-size: 0.95rem; }
.kg-bookmark-description { font-size: 0.85rem; color: var(--muted); margin-top: var(--sp-1); }
.kg-bookmark-url { font-size: 0.78rem; color: var(--muted-light); margin-top: var(--sp-2); }

.kg-width-wide {
    max-width: none;
    margin-left: calc(-1 * (50vw - var(--w-read) / 2) + var(--sp-5));
    margin-right: calc(-1 * (50vw - var(--w-read) / 2) + var(--sp-5));
}
.kg-width-full {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
}
.kg-width-wide img,
.kg-width-full img { width: 100%; }

/* --------------------------------------------------------------------------
   14. Responsive breakpoints
   -------------------------------------------------------------------------- */

/* Tablet */
@media (max-width: 999px) {
    :root {
        --sp-9: 4rem;
        --sp-8: 3rem;
    }
    .post-feed {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--sp-5);
    }
    .post-card:first-child {
        grid-column: 1 / -1;
    }
    .post-card:first-child .post-card-link {
        min-height: 260px;
    }
    .post-card:first-child .post-card-media {
        min-height: 260px;
    }
    .post-card:first-child .post-card-body {
        padding: var(--sp-5);
    }
    .post-card:first-child .post-card-title {
        font-size: 1.45rem;
    }
    .site-footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile / small tablet — hamburger drawer breakpoint
   Anything below 768 px gets a drawer; horizontal nav above */
@media (max-width: 767px) {
    /* Hamburger visible, inline nav hidden by default */
    .nav-toggle { display: flex; }
    .nav-scrim  { display: block; top: 64px; }

    .site-header { z-index: 110; }
    .site-header-inner {
        padding: var(--sp-3) var(--sp-4);
        min-height: 64px;
    }
    .site-title { font-size: 1.25rem; }

    /* Nav becomes a slide-down drawer anchored to the header */
    .site-nav {
        position: fixed;
        top: 64px;
        right: 0;
        left: 0;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
        z-index: 110;
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition: transform var(--t-base) var(--ease),
                    opacity var(--t-base) var(--ease),
                    visibility 0s linear var(--t-base);
    }
    body.nav-open .site-nav {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
        transition: transform var(--t-base) var(--ease),
                    opacity var(--t-base) var(--ease),
                    visibility 0s linear 0s;
    }
    body.nav-open { overflow: hidden; }

    .site-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: var(--sp-2) 0;
    }
    .site-nav li { width: 100%; }
    .site-nav li + li { border-top: 1px solid var(--border); }
    .site-nav a {
        display: block;
        padding: var(--sp-4) var(--sp-5);
        font-size: 1.05rem;
        font-weight: 500;
        color: var(--ink-soft);
        text-align: right;
    }
    .site-nav a.nav-current {
        color: var(--accent);
        background: rgba(155, 35, 53, 0.04);
    }
    .site-nav a::after { display: none; }
    .site-nav a:active { background: var(--hover); }
}

/* True phone — 600 px and below */
@media (max-width: 599px) {
    :root {
        --fs-base: 1rem;
        --sp-9: 3rem;
        --sp-8: 2.5rem;
        --sp-7: 2rem;
    }

    .site-hero { min-height: 56vh; padding: var(--sp-8) var(--sp-4); }
    .site-hero-title { font-size: clamp(2.2rem, 11vw, 3rem); }
    .site-hero-desc  { font-size: 0.98rem; }
    .site-hero-eyebrow { font-size: 0.66rem; letter-spacing: 0.2em; }
    .site-hero-scroll { display: none; }

    .post-feed {
        grid-template-columns: 1fr;
        gap: var(--sp-4);
        padding: var(--sp-6) var(--sp-4);
    }

    /* Featured first post collapses to single column */
    .post-card:first-child::before { font-size: 0.6rem; padding: 0.25em 0.7em; top: var(--sp-3); right: var(--sp-3); }
    .post-card:first-child .post-card-link { flex-direction: column; min-height: auto; }
    .post-card:first-child .post-card-media { width: 100%; aspect-ratio: 2 / 1; min-height: auto; }
    .post-card:first-child .post-card-body { padding: var(--sp-4); gap: var(--sp-3); }
    .post-card:first-child .post-card-title { font-size: 1.2rem; line-height: 1.45; }
    .post-card:first-child .post-card-excerpt { font-size: 0.9rem; -webkit-line-clamp: 2; }

    .post-card-body { padding: var(--sp-3) var(--sp-4) var(--sp-4); gap: var(--sp-2); }
    .post-card-title { font-size: 1.05rem; line-height: 1.5; }
    .post-card-excerpt { font-size: 0.85rem; -webkit-line-clamp: 2; }
    .post-card-meta { font-size: 0.72rem; padding-top: var(--sp-2); }
    .post-card:hover { transform: none; box-shadow: var(--shadow-sm); }
    .post-card:hover .post-card-image { transform: none; }

    .post-container { padding: var(--sp-6) var(--sp-4) var(--sp-7); }
    .post-title { font-size: clamp(1.7rem, 7.5vw, 2.1rem); }
    .post-content { font-size: 1rem; line-height: 2.05; }
    .post-content > p:first-of-type { font-size: 1.08rem; }
    .post-content > p:first-of-type::first-letter { font-size: 3em; margin-left: 0.1em; }
    .post-content h2 { font-size: 1.35rem; }
    .post-content h3 { font-size: 1.15rem; }
    .post-content blockquote { padding: var(--sp-3) var(--sp-4); margin: 1.8em 0; font-size: 1rem; }
    .post-content blockquote::before { font-size: 2.2rem; top: 0.1em; right: 0.2em; }

    .post-nav { grid-template-columns: 1fr; gap: var(--sp-3); }
    .post-footer-tag { font-size: 0.76rem; padding: 0.25em 0.7em; }

    .page-header { padding: var(--sp-6) var(--sp-4) var(--sp-5); }
    .page-title  { font-size: clamp(1.5rem, 7vw, 2.1rem); }

    .site-footer { padding: var(--sp-7) var(--sp-4) var(--sp-5); margin-top: var(--sp-6); }
    .site-footer-inner { grid-template-columns: 1fr; gap: var(--sp-5); padding-bottom: var(--sp-5); }
    .site-footer-bottom { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }

    .pagination { padding: var(--sp-6) var(--sp-4); gap: var(--sp-3); flex-wrap: wrap; }
}

/* --------------------------------------------------------------------------
   15. Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .hero-bg { animation: none; opacity: 0; }
    .hero-bg-1 { opacity: 1; }
}

/* --------------------------------------------------------------------------
   16. Focus styles for keyboard users
   -------------------------------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--r-sm);
}

.post-card-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   17. Print
   -------------------------------------------------------------------------- */
@media print {
    .site-hero, .site-header, .site-footer, .pagination, .post-nav, .reading-progress { display: none; }
    .post-container { max-width: none; padding: 0; }
    .post-content { font-size: 11pt; line-height: 1.6; }
    .post-content a { color: inherit; border-bottom: 0; }
}
