/* ============================================================
   FANEILLE — Cozy Fanfic Archive Theme for Publii
   Palette: Grabient rust › amber › sage › teal
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Lora:ital,wght@0,400;0,500;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Tokens ─────────────────────────────────────── */
:root {
    /* gradient stops */
    --g-rust:   #a64900;
    --g-amber:  #df8c1e;
    --g-sand:   #d0a969;
    --g-sage:   #b9b188;
    --g-celadon:#9bb3a1;
    --g-sky:    #78afb1;
    --g-teal:   #3399b7;
    --g-deep:   #047299;

    --grad: linear-gradient(90deg,
        #a64900 0%, #c26100 8.333%, #d57800 16.667%,
        #df8c1e 25%, #dd9d45 33.333%, #d0a969 41.667%,
        #b9b188 50%, #9bb3a1 58.333%, #78afb1 66.667%,
        #55a6b8 75%, #3399b7 83.333%, #1787ac 91.667%,
        #047299 100%);
    --grad-r: linear-gradient(270deg,
        #a64900 0%, #c26100 8.333%, #d57800 16.667%,
        #df8c1e 25%, #dd9d45 33.333%, #d0a969 41.667%,
        #b9b188 50%, #9bb3a1 58.333%, #78afb1 66.667%,
        #55a6b8 75%, #3399b7 83.333%, #1787ac 91.667%,
        #047299 100%);

    /* surfaces */
    --bg:         #faf8f4;
    --bg-warm:    #f4f0e8;
    --bg-card:    #ffffff;
    --bg-sidebar: #f7f4ee;
    --border:     #e5dfd4;
    --border-med: #cdc4b4;

    /* text */
    --text:       #2a2118;
    --text-mid:   #5a4e3e;
    --text-muted: #9a8e7e;

    /* accents */
    --warm:       #c26100;
    --warm-light: #fff0e0;
    --cool:       #3399b7;
    --cool-light: #e0f4f9;

    /* type */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'Lora', Georgia, serif;
    --font-ui:      'DM Sans', system-ui, sans-serif;

    --radius:    8px;
    --radius-lg: 16px;
    --max-w:     1160px;
    --gap:       24px;
    --ease:      cubic-bezier(.4,0,.2,1);
}

/* ── Reset ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.76;
    -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ── Typography ──────────────────────────────────── */
h1,h2,h3,h4,h5,h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.65rem); }
h4 { font-size: 1.15rem; }
p  { margin-bottom: 1.3em; }
p:last-child { margin-bottom: 0; }

/* ── Layout ──────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2.5rem);
}

/* ── Gradient utilities ──────────────────────────── */
.grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.grad-bar {
    height: 3px;
    background: var(--grad);
    border-radius: 2px;
}
.grad-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--grad);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 200;
}

.header-gradient-line {
    height: 3px;
    background: var(--grad);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
    gap: 1.5rem;
}

/* Logo */
.site-logo { display: flex; flex-direction: column; gap: 1px; flex-shrink: 0; }

.site-logo__name {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-logo__sub {
    font-family: var(--font-ui);
    font-size: 0.58rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Nav */
.site-nav { display: flex; align-items: center; gap: 0.15rem; }
.site-nav a {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-mid);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius);
    transition: background 0.2s, color 0.2s;
}
.site-nav a:hover, .site-nav a.active {
    background: var(--bg-warm);
    color: var(--warm);
}

.header-search {
    position: relative;
    flex-shrink: 0;
}
.header-search input {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 0.38rem 1rem 0.38rem 2.2rem;
    color: var(--text);
    width: 180px;
    transition: width 0.3s var(--ease), border-color 0.2s;
    outline: none;
}
.header-search input:focus {
    width: 240px;
    border-color: var(--cool);
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search__icon {
    position: absolute;
    left: 0.7rem; top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none; border: none; cursor: pointer; padding: 6px;
}
.nav-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--text); border-radius: 2px;
    transition: transform .3s, opacity .3s;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ============================================================
   HERO / BANNER
   ============================================================ */
.hero {
    background: var(--bg-warm);
    border-bottom: 1px solid var(--border);
    padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad);
}

/* soft ink-wash blobs */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 70% at 90% 50%, rgba(209,160,105,0.13) 0%, transparent 65%),
        radial-gradient(ellipse 40% 60% at 5%  60%, rgba(51,153,183,0.09) 0%, transparent 60%);
    pointer-events: none;
}

.hero__inner { position: relative; z-index: 1; }

.hero__label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--warm);
    margin-bottom: 1.1rem;
}

.hero__title {
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 700;
    font-style: italic;
    max-width: 16ch;
    margin-bottom: 1rem;
}

.hero__desc {
    font-size: 1.05rem;
    color: var(--text-mid);
    max-width: 50ch;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero__stats {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.hero__stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.hero__stat-label {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ============================================================
   MAIN LAYOUT: content + sidebar
   ============================================================ */
.page-body {
    padding: 3rem 0 5rem;
}

.page-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.6rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.section-header__title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
}

.section-header__more {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cool);
    transition: opacity .2s;
}
.section-header__more:hover { opacity: 0.7; }

/* ============================================================
   STORY CARDS
   ============================================================ */
.stories-list { display: flex; flex-direction: column; gap: 1px; }
.stories-list--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
    flex-direction: unset;
}

.story-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.6rem 1.5rem;
    transition: border-color .22s, box-shadow .22s, transform .22s;
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
}

.story-card:hover {
    border-color: var(--border-med);
    box-shadow: 0 6px 28px rgba(166,73,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
    transform: translateY(-2px);
}

/* cover thumbnail */
.story-card__cover {
    flex-shrink: 0;
    width: 72px; height: 100px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-warm);
    position: relative;
}
.story-card__cover img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.story-card__cover-placeholder {
    width: 100%; height: 100%;
    background: var(--grad);
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.story-card__cover-placeholder svg { opacity: 0.7; }

.story-card__body { flex: 1; min-width: 0; }

.story-card__tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.tag {
    font-family: var(--font-ui);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.18rem 0.6rem;
    border-radius: 30px;
    background: var(--bg-warm);
    color: var(--text-mid);
    border: 1px solid var(--border);
    transition: background .2s, color .2s;
    cursor: pointer;
}
.tag:hover { background: var(--cool-light); color: var(--cool); border-color: rgba(51,153,183,0.25); }
.tag--fandom { background: var(--warm-light); color: var(--warm); border-color: rgba(194,97,0,0.2); }
.tag--fandom:hover { background: #ffe4c4; }
.tag--rating-g   { background: #e6f4e6; color: #2d7a2d; border-color: rgba(45,122,45,0.2); }
.tag--rating-t   { background: #fff8e0; color: #b07a00; border-color: rgba(176,122,0,0.2); }
.tag--rating-m   { background: #fdeee6; color: #c44a00; border-color: rgba(196,74,0,0.2); }
.tag--status-complete { background: var(--cool-light); color: var(--cool); border-color: rgba(51,153,183,0.25); }
.tag--status-wip      { background: #f0eeff; color: #6655cc; border-color: rgba(102,85,204,0.2); }

.story-card__title {
    font-family: var(--font-display);
    font-size: 1.18rem;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.3rem;
    transition: color .2s;
}
.story-card:hover .story-card__title { color: var(--warm); }

.story-card__author {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}
.story-card__author a { color: var(--cool); transition: opacity .2s; }
.story-card__author a:hover { opacity: 0.7; }

.story-card__summary {
    font-size: 0.88rem;
    color: var(--text-mid);
    line-height: 1.67;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.85rem;
}

.story-card__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.story-card__meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.story-card__meta-item svg { opacity: 0.6; }

/* compact list variant (sidebar, related) */
.story-card--compact {
    padding: 0.85rem 1rem;
    gap: 0.85rem;
    border-radius: var(--radius);
}
.story-card--compact .story-card__cover {
    width: 44px; height: 60px;
}
.story-card--compact .story-card__summary { display: none; }
.story-card--compact .story-card__meta    { display: none; }
.story-card--compact .story-card__title   { font-size: 0.95rem; }

/* ============================================================
   FEATURED STORY
   ============================================================ */
.featured-story {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 200px 1fr;
    margin-bottom: 2.5rem;
    transition: box-shadow .25s;
}
.featured-story:hover { box-shadow: 0 12px 40px rgba(166,73,0,0.10); }

.featured-story__cover {
    position: relative;
    background: var(--bg-warm);
}
.featured-story__cover img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.featured-story__cover-placeholder {
    width: 100%; height: 100%;
    min-height: 260px;
    background: var(--grad);
    opacity: 0.45;
}
.featured-story__badge {
    position: absolute;
    top: 0.9rem; left: 0.9rem;
    font-family: var(--font-ui);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: var(--warm);
    color: #fff;
    padding: 0.22rem 0.7rem;
    border-radius: 30px;
}

.featured-story__body {
    padding: 2rem 2.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-story__tags {
    display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem;
}

.featured-story__title {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.4rem;
    transition: color .2s;
}
.featured-story:hover .featured-story__title { color: var(--warm); }

.featured-story__author {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.9rem;
}
.featured-story__author a { color: var(--cool); }

.featured-story__summary {
    font-size: 0.92rem;
    color: var(--text-mid);
    line-height: 1.72;
    margin-bottom: 1.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-story__meta {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.featured-story__read-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.4rem;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--warm);
    transition: gap .2s;
}
.featured-story__read-btn::after { content: '→'; transition: transform .2s; }
.featured-story:hover .featured-story__read-btn::after { transform: translateX(4px); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar { display: flex; flex-direction: column; gap: 2rem; }

.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.sidebar-widget__header {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--bg-sidebar);
}

.sidebar-widget__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.sidebar-widget__body { padding: 1.1rem 1.2rem; }

/* author card */
.author-bio { text-align: center; }
.author-bio__avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    margin: 0 auto 0.8rem;
    overflow: hidden;
    background: var(--grad);
    border: 3px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--border);
}
.author-bio__avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-bio__name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.author-bio__desc {
    font-size: 0.82rem;
    color: var(--text-mid);
    line-height: 1.65;
    margin-bottom: 1rem;
}
.author-bio__links {
    display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap;
}
.author-bio__link {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.85rem;
    border-radius: 30px;
    border: 1px solid var(--border);
    color: var(--text-mid);
    transition: background .2s, color .2s;
}
.author-bio__link:hover { background: var(--warm-light); color: var(--warm); border-color: rgba(194,97,0,0.2); }

/* tag cloud */
.tag-cloud {
    display: flex; flex-wrap: wrap; gap: 0.45rem;
    padding: 0.6rem 0;
}

/* recent list in sidebar */
.sidebar-story-list { display: flex; flex-direction: column; gap: 0; }
.sidebar-story-item {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
}
.sidebar-story-item:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-story-item__num {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--border-med);
    line-height: 1;
    flex-shrink: 0;
    min-width: 1.6rem;
}
.sidebar-story-item__title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    transition: color .2s;
}
.sidebar-story-item:hover .sidebar-story-item__title { color: var(--warm); }
.sidebar-story-item__meta {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ============================================================
   SINGLE POST (READING VIEW)
   ============================================================ */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 3rem;
    align-items: start;
}

.post-header {
    padding: clamp(3rem, 7vw, 5.5rem) 0 2.5rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.post-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad);
}

.post-header__tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }

.post-header__title {
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    font-weight: 700;
    font-style: italic;
    max-width: 22ch;
    margin-bottom: 0.6rem;
}

.post-header__author {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.1rem;
}
.post-header__author a { color: var(--cool); font-weight: 500; }

.post-header__meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--text-muted);
    align-items: center;
}

.post-header__meta-item { display: flex; align-items: center; gap: 0.35rem; }

/* story info box */
.story-info-box {
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-left: 3px solid var(--warm);
    border-radius: var(--radius);
    padding: 1.1rem 1.4rem;
    margin: 2rem 0;
    font-size: 0.88rem;
}
.story-info-box__label {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--warm);
    margin-bottom: 0.5rem;
}
.story-info-box p { color: var(--text-mid); margin: 0; font-style: italic; }

/* post content */
.post-content {
    max-width: 68ch;
    padding: 2.5rem 0;
}
.post-content p, .post-content li {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.82;
    color: var(--text);
}
.post-content h2 {
    font-size: 1.6rem;
    margin: 2.5rem 0 0.8rem;
    color: var(--text);
}
.post-content h3 { font-size: 1.25rem; margin: 2rem 0 0.6rem; }
.post-content blockquote {
    margin: 2rem 0;
    padding: 1.1rem 1.6rem;
    border-left: 3px solid;
    border-image: var(--grad) 1;
    background: var(--bg-warm);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-mid);
}
.post-content a { color: var(--cool); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { opacity: 0.75; }
.post-content hr {
    margin: 2.5rem 0;
    border: none;
    height: 1px;
    background: var(--border);
    position: relative;
}
.post-content hr::after {
    content: '✦';
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg);
    padding: 0 0.6rem;
    color: var(--text-muted);
    font-size: 0.7rem;
}
.post-content ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1.3em; }
.post-content ol { list-style: decimal; padding-left: 1.5rem; margin-bottom: 1.3em; }

/* chapter nav */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.chapter-nav__btn {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text-mid);
    background: var(--bg-card);
    transition: background .2s, color .2s, border-color .2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.chapter-nav__btn:hover {
    background: var(--bg-warm);
    color: var(--warm);
    border-color: rgba(194,97,0,.25);
}
.chapter-nav__btn--primary {
    background: var(--warm);
    color: #fff;
    border-color: var(--warm);
}
.chapter-nav__btn--primary:hover { background: var(--g-rust); border-color: var(--g-rust); color: #fff; }

/* reading sidebar */
.reading-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.reading-settings {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
}
.reading-settings__title {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.9rem;
}
.reading-settings__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--text-mid);
}
.reading-settings__row:last-child { border-bottom: none; }

/* ============================================================
   AUTHOR PAGE
   ============================================================ */
.author-header {
    background: var(--bg-warm);
    border-bottom: 1px solid var(--border);
    padding: 3.5rem 0 3rem;
    position: relative;
    overflow: hidden;
}
.author-header::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: var(--grad);
}

.author-header__inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.author-header__avatar {
    width: 110px; height: 110px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--grad);
    border: 4px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--border);
    flex-shrink: 0;
}
.author-header__avatar img { width: 100%; height: 100%; object-fit: cover; }

.author-header__info { flex: 1; min-width: 220px; }
.author-header__name {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.author-header__handle {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
}
.author-header__bio {
    font-size: 0.95rem;
    color: var(--text-mid);
    max-width: 50ch;
    line-height: 1.7;
    margin-bottom: 1.1rem;
}
.author-header__stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.author-header__stat-num {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.author-header__stat-label {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ============================================================
   TAG / FANDOM PAGE
   ============================================================ */
.tag-header {
    background: var(--bg-warm);
    border-bottom: 1px solid var(--border);
    padding: 3rem 0 2.5rem;
    position: relative;
}
.tag-header::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: var(--grad);
}
.tag-header__label {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--warm);
    margin-bottom: 0.5rem;
}
.tag-header__name {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-style: italic;
    margin-bottom: 0.5rem;
}
.tag-header__count {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 2rem 0 0;
}
.pagination a, .pagination span {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-mid);
    transition: background .2s, color .2s, border-color .2s;
    min-width: 2.4rem;
    text-align: center;
}
.pagination a:hover { background: var(--bg-warm); color: var(--warm); border-color: rgba(194,97,0,.25); }
.pagination .active, .pagination .is-active {
    background: var(--warm);
    color: #fff;
    border-color: var(--warm);
}

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-header { padding: 3rem 0 2rem; }
.search-header__title { font-size: 1.8rem; margin-bottom: 1rem; }
.search-bar {
    display: flex;
    gap: 0;
    max-width: 560px;
}
.search-bar input {
    flex: 1;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    padding: 0.75rem 1.2rem;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    background: var(--bg-card);
    color: var(--text);
    outline: none;
    transition: border-color .2s;
}
.search-bar input:focus { border-color: var(--cool); }
.search-bar button {
    padding: 0.75rem 1.4rem;
    background: var(--warm);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s;
}
.search-bar button:hover { background: var(--g-rust); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer-grad { height: 3px; background: var(--grad); }

.footer-inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    padding: 3.5rem 0 2.5rem;
}

.footer-brand__name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    font-style: italic;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}
.footer-brand__desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 32ch;
    margin-bottom: 1.2rem;
}
.footer-social { display: flex; gap: 0.6rem; }
.footer-social a {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    border: 1px solid var(--border);
    color: var(--text-mid);
    transition: background .2s, color .2s;
}
.footer-social a:hover { background: var(--warm-light); color: var(--warm); border-color: rgba(194,97,0,.2); }

.footer-col__title {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--text-mid);
    transition: color .2s;
}
.footer-links a:hover { color: var(--warm); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 1.2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1040px) {
    .page-layout,
    .post-layout   { grid-template-columns: 1fr; }
    .sidebar       { display: grid; grid-template-columns: 1fr 1fr; }
    .reading-sidebar { display: none; }
    .footer-inner  { grid-template-columns: 1fr 2fr; }
}

@media (max-width: 768px) {
    .site-nav      { display: none; }
    .site-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        padding: 1rem;
        gap: 0.25rem;
        z-index: 200;
    }
    .nav-toggle    { display: flex; }
    .header-search { display: none; }
    .featured-story { grid-template-columns: 1fr; }
    .featured-story__cover { min-height: 200px; }
    .stories-list--grid { grid-template-columns: 1fr; }
    .footer-inner  { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .sidebar       { grid-template-columns: 1fr; }
    .hero__stats   { gap: 1.5rem; }
    .author-header__inner { flex-direction: column; text-align: center; }
    .author-header__stats { justify-content: center; }
}

@media (max-width: 480px) {
    .story-card { flex-direction: column; }
    .story-card__cover { width: 100%; height: 140px; border-radius: var(--radius) var(--radius) 0 0; }
    .chapter-nav { flex-direction: column; }
}

/* ============================================================
   SINGLE-AUTHOR ADDITIONS (samalla / faneille personal)
   ============================================================ */

/* ── Hero: author layout ── */
.hero__inner--author {
    display: flex;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3rem);
}

/* ── Author avatars ── */
.author-avatar {
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--grad);
    opacity: 0.7;
    border: 3px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--border);
}
.author-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    opacity: 1;
}
.author-avatar--placeholder { opacity: 0.6; }
.author-avatar--hero   { width: 96px;  height: 96px; }
.author-avatar--sidebar { width: 60px; height: 60px; margin: 0 auto 0.75rem; }
.author-avatar--about  { width: 110px; height: 110px; }

/* ── Author bio (sidebar) ── */
.author-bio { text-align: center; }
.author-bio__name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.author-bio__pronouns {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 0.55rem;
}
.author-bio__desc {
    font-size: 0.82rem;
    color: var(--text-mid);
    line-height: 1.65;
    margin-bottom: 0.7rem;
}
.author-bio__more {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--warm);
    margin-bottom: 0.9rem;
    transition: opacity .2s;
}
.author-bio__more:hover { opacity: 0.7; }
.author-bio__links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.author-bio__link {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.28rem 0.8rem;
    border-radius: 30px;
    border: 1px solid var(--border);
    color: var(--text-mid);
    background: var(--bg-warm);
    transition: background .2s, color .2s, border-color .2s;
}
.author-bio__link:hover {
    background: var(--warm-light);
    color: var(--warm);
    border-color: rgba(194,97,0,.2);
}

/* ── About page header ── */
.author-header__eyebrow {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--warm);
    margin-bottom: 0.6rem;
}
.author-header__stat-num {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    display: block;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}
.author-header__stat-label {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ── About page prose ── */
.about-prose {
    font-size: 1rem;
    color: var(--text-mid);
    line-height: 1.82;
    max-width: 62ch;
    margin-bottom: 2.5rem;
}
.about-prose p { margin-bottom: 1.2em; }
.about-prose p:last-child { margin-bottom: 0; }

/* ── Tropes grid ── */
.tropes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 2.5rem;
}
.trope-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid;
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1rem 1.2rem;
}
.trope-card--warm { border-left-color: var(--warm); }
.trope-card--cool { border-left-color: var(--cool); }
.trope-card--sand { border-left-color: #d0a969; }
.trope-card--sage { border-left-color: #9bb3a1; }

.trope-card__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.trope-card__desc {
    font-size: 0.83rem;
    color: var(--text-mid);
    line-height: 1.62;
    margin: 0;
}

/* ── Find me list ── */
.find-me-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.find-me-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    color: var(--text-mid);
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    transition: color .2s;
}
.find-me-link:last-child { border-bottom: none; }
.find-me-link:hover { color: var(--cool); }
.find-me-link svg { color: var(--warm); flex-shrink: 0; }

/* ── Stat rows ── */
.stat-rows { display: flex; flex-direction: column; gap: 0; }
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-ui);
    font-size: 0.8rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-row__label { color: var(--text-muted); }
.stat-row__value {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text);
}

/* ── Post: hide author line (single-author site) ── */
.post-header__author { display: none; }

/* ── Responsive tweaks ── */
@media (max-width: 640px) {
    .hero__inner--author { flex-direction: column; text-align: center; }
    .hero__stats { justify-content: center; }
    .tropes-grid { grid-template-columns: 1fr; }
    .author-header__inner { flex-direction: column; text-align: center; }
    .author-header__stats { justify-content: center; }
}

/* ============================================================
   PAGES (page.hbs / page-wide.hbs)
   ============================================================ */

/* page excerpt shown under the title */
.post-header__excerpt {
    font-size: 1.05rem;
    color: var(--text-mid);
    max-width: 56ch;
    margin-top: 0.75rem;
    line-height: 1.72;
    font-style: italic;
}

/* page content inherits post-content styles;
   wide variant stretches to full readable column */
.page-content {
    max-width: 72ch;
    padding: 2.5rem 0;
}

.page-content--wide {
    max-width: 80ch;
    margin: 0 auto;
}

/* ensure tables inside pages look decent */
.page-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 1.5em;
}
.page-content th,
.page-content td {
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    text-align: left;
}
.page-content th {
    background: var(--bg-warm);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-mid);
}

/* images inside page content */
.page-content img {
    border-radius: var(--radius);
    max-width: 100%;
    height: auto;
}

/* page-content figures with captions */
.page-content figure {
    margin: 1.8rem 0;
}
.page-content figcaption {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: center;
}

/* ============================================================
   DYNAMIC MENU (menu.hbs partial)
   ============================================================ */
.site-nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav li { position: relative; }

.site-nav a,
.site-nav .site-nav__separator {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-mid);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius);
    transition: background 0.2s, color 0.2s;
    display: block;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav a:hover,
.site-nav li.is-active > a {
    background: var(--bg-warm);
    color: var(--warm);
}

/* submenu */
.site-nav__submenu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    list-style: none;
    padding: 0.4rem 0;
    min-width: 180px;
    z-index: 300;
}

.site-nav li:hover > .site-nav__submenu,
.site-nav li:focus-within > .site-nav__submenu {
    display: block;
}

.site-nav__submenu a {
    border-radius: 0;
    padding: 0.4rem 1rem;
}

/* mobile: nav shown as column when .open */
@media (max-width: 768px) {
    .site-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem;
        gap: 0.2rem;
        z-index: 200;
    }
    .site-nav.open { display: flex; }
    .site-nav__submenu {
        position: static;
        box-shadow: none;
        border: none;
        background: var(--bg-warm);
        border-radius: var(--radius);
        margin-top: 2px;
    }
}

/* ── Reading progress bar ── */
.reading-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: var(--grad);
    z-index: 9999;
    transition: width .1s linear;
    pointer-events: none;
}

/* ── Nav toggle (mobile) ── */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ── Site nav (from menu.hbs) ── */
.site-nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    list-style: none;
    margin: 0; padding: 0;
}
.site-nav li { position: relative; }
.site-nav a, .site-nav .site-nav__sep {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-mid);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius);
    transition: background .2s, color .2s;
    display: block;
    text-decoration: none;
    white-space: nowrap;
}
.site-nav a:hover,
.site-nav li.is-active > a { background: var(--bg-warm); color: var(--warm); }
.site-nav__submenu {
    display: none;
    position: absolute;
    top: calc(100% + 4px); left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    list-style: none;
    padding: .4rem 0;
    min-width: 180px;
    z-index: 300;
}
.site-nav li:hover > .site-nav__submenu,
.site-nav li:focus-within > .site-nav__submenu { display: block; }
.site-nav__submenu a { border-radius: 0; padding: .4rem 1rem; }

/* ── Publii generated footer ── */
.footer { text-align: center !important; }
.footer__copyright { text-align: center !important; }

/* ── Footer ── */
.footer-inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    padding: 3rem 0 2rem;
}
.footer-brand__name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    font-style: italic;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: .4rem;
}
.footer-brand__desc { font-size: .85rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }
.footer-social { display: flex; gap: .6rem; flex-wrap: wrap; }
.footer-social a {
    font-family: var(--font-ui);
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: .3rem .8rem;
    border-radius: 30px;
    border: 1px solid var(--border);
    color: var(--text-mid);
    text-decoration: none;
    transition: background .2s, color .2s;
}
.footer-social a:hover { background: var(--warm-light); color: var(--warm); border-color: rgba(194,97,0,.2); }
.footer-col__title {
    font-family: var(--font-ui);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.footer-links { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a { font-family: var(--font-ui); font-size: .85rem; color: var(--text-mid); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--warm); }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-family: var(--font-ui);
    font-size: .72rem;
    color: var(--text-muted);
}
.footer-grad { height: 3px; background: var(--grad); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .site-nav { display: none; }
    .site-nav.open { display: flex; flex-direction: column; align-items: stretch; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-card); border-bottom: 1px solid var(--border); padding: .75rem; z-index: 200; }
    .nav-toggle { display: flex; }
    .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-bottom { flex-direction: column; text-align: center; }
}

/* ================================================================
   DUSKLINE — POST & PAGE CONTENT TYPOGRAPHY
   Comprehensive styling for all Publii block editor output
   ================================================================ */

/* ── Base content area ── */
.post-content,
.page-content {
    max-width: 68ch;
    padding: 2.5rem 0 3rem;
    overflow-wrap: break-word;
    word-break: break-word;
    color: var(--text);
}
.page-content--wide { max-width: 82ch; }
.post-content > *:first-child,
.page-content > *:first-child { margin-top: 0 !important; }

/* ── Paragraphs ── */
.post-content p,
.page-content p {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.84;
    color: var(--text);
    margin-bottom: 1.4em;
    hanging-punctuation: first last;
}
.post-content p:last-child,
.page-content p:last-child { margin-bottom: 0; }

/* ── Headings ── */
.post-content h1, .page-content h1,
.post-content h2, .page-content h2,
.post-content h3, .page-content h3,
.post-content h4, .page-content h4,
.post-content h5, .page-content h5,
.post-content h6, .page-content h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.22;
    color: var(--text);
    margin-top: 2.6em;
    margin-bottom: 0.65em;
}
.post-content h2, .page-content h2 { font-size: 1.65rem; font-style: italic; }
.post-content h3, .page-content h3 { font-size: 1.3rem; }
.post-content h4, .page-content h4 { font-size: 1.1rem; letter-spacing: 0.02em; }
.post-content h5, .page-content h5 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--font-ui); font-weight: 600; }
.post-content h6, .page-content h6 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; font-family: var(--font-ui); font-weight: 600; color: var(--text-muted); }

/* ── Links ── */
.post-content a,
.page-content a {
    color: var(--cool);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    text-decoration-skip-ink: auto;
    transition: color 0.2s, opacity 0.2s;
}
.post-content a:hover,
.page-content a:hover { opacity: 0.72; }

/* ── Lists ── */
.post-content ul,
.page-content ul {
    list-style: none;
    padding-left: 1.5rem;
    margin-bottom: 1.4em;
}
.post-content ul li,
.page-content ul li {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.76;
    color: var(--text);
    margin-bottom: 0.4em;
    position: relative;
}
.post-content ul li::before,
.page-content ul li::before {
    content: '✦';
    position: absolute;
    left: -1.4rem;
    color: var(--warm);
    font-size: 0.5rem;
    top: 0.6em;
}

.post-content ol,
.page-content ol {
    list-style: none;
    counter-reset: dusk-counter;
    padding-left: 2rem;
    margin-bottom: 1.4em;
}
.post-content ol li,
.page-content ol li {
    counter-increment: dusk-counter;
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.76;
    color: var(--text);
    margin-bottom: 0.4em;
    position: relative;
}
.post-content ol li::before,
.page-content ol li::before {
    content: counter(dusk-counter);
    position: absolute;
    left: -2rem;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--warm);
    width: 1.4rem;
    text-align: right;
}

/* nested lists */
.post-content li ul, .post-content li ol,
.page-content li ul, .page-content li ol {
    margin-top: 0.4em;
    margin-bottom: 0.4em;
}

/* ── Blockquote ── */
.post-content blockquote,
.page-content blockquote {
    margin: 2.5rem 0;
    padding: 1.4rem 1.8rem;
    border-left: 3px solid;
    border-image: var(--grad) 1;
    background: var(--bg-warm);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    font-style: italic;
    color: var(--text-mid);
    font-size: 1.08rem;
    line-height: 1.78;
    position: relative;
}
.post-content blockquote::before,
.page-content blockquote::before {
    content: '\201C';
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    font-family: var(--font-display);
    font-size: 4rem;
    line-height: 1;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.4;
    pointer-events: none;
}
.post-content blockquote p,
.page-content blockquote p { margin-bottom: 0.5em; font-size: 1.05rem; }
.post-content blockquote p:last-child,
.page-content blockquote p:last-child { margin-bottom: 0; }
.post-content blockquote cite,
.page-content blockquote cite {
    display: block;
    margin-top: 0.75rem;
    font-style: normal;
    font-size: 0.8rem;
    font-family: var(--font-ui);
    color: var(--text-muted);
    letter-spacing: 0.06em;
}
.post-content blockquote cite::before,
.page-content blockquote cite::before { content: '— '; }

/* ── Pull quote (Publii block) ── */
.post-content .pullquote,
.page-content .pullquote {
    text-align: center;
    margin: 3rem auto;
    max-width: 58ch;
    padding: 2rem 1.5rem;
    border-top: 2px solid;
    border-bottom: 2px solid;
    border-image: var(--grad) 1;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-style: italic;
    line-height: 1.42;
    color: var(--text);
}

/* ── HR / scene break ── */
.post-content hr,
.page-content hr {
    margin: 3rem 0;
    border: none;
    height: 1px;
    background: var(--border);
    position: relative;
}
.post-content hr::after,
.page-content hr::after {
    content: '✦';
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg);
    padding: 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    letter-spacing: 0.4em;
}

/* ── Code ── */
.post-content code,
.page-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.88em;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.12em 0.45em;
    color: var(--warm);
    white-space: nowrap;
}
.post-content pre,
.page-content pre {
    margin: 2rem 0;
    padding: 1.4rem 1.6rem;
    background: var(--text);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    line-height: 1.65;
}
.post-content pre code,
.page-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    color: var(--bg-warm);
    white-space: pre;
}

/* ── Images ── */
.post-content img,
.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    display: block;
    margin: 2rem auto;
}
.post-content figure,
.page-content figure { margin: 2.5rem 0; }
.post-content figcaption,
.page-content figcaption {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.6rem;
    line-height: 1.55;
    font-style: italic;
}

/* ── Tables ── */
.post-content table,
.page-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 2rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.post-content thead,
.page-content thead {
    background: var(--bg-warm);
    border-bottom: 2px solid var(--border-med);
}
.post-content th,
.page-content th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-mid);
}
.post-content td,
.page-content td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--text);
    vertical-align: top;
}
.post-content tr:last-child td,
.page-content tr:last-child td { border-bottom: none; }
.post-content tbody tr:hover,
.page-content tbody tr:hover { background: var(--bg-warm); }

/* ── Strong & em ── */
.post-content strong, .page-content strong { font-weight: 700; color: var(--text); }
.post-content em, .page-content em { font-style: italic; color: var(--text-mid); }
.post-content mark, .page-content mark {
    background: var(--warm-light);
    color: var(--warm);
    border-radius: 2px;
    padding: 0 0.2em;
}

/* ── Footnotes ── */
.post-content .footnotes,
.page-content .footnotes {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.65;
}
.post-content .footnotes ol,
.page-content .footnotes ol { padding-left: 1.5rem; }
.post-content .footnotes li,
.page-content .footnotes li { font-size: 0.82rem; color: var(--text-muted); }

/* ── Publii gallery block ── */
.post-content .gallery,
.page-content .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 2rem 0;
}
.post-content .gallery__item img,
.page-content .gallery__item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    margin: 0;
    border-radius: var(--radius);
    transition: transform 0.25s, opacity 0.25s;
}
.post-content .gallery__item img:hover,
.page-content .gallery__item img:hover { transform: scale(1.02); opacity: 0.92; }

/* ── Publii video/embed block ── */
.post-content .media,
.page-content .media {
    margin: 2rem 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--text);
}
.post-content .media iframe,
.page-content .media iframe { width: 100%; height: 100%; border: none; }

/* ── Publii table of contents ── */
.post-content .post__toc,
.page-content .post__toc {
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-left: 3px solid var(--warm);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    padding: 1.2rem 1.5rem;
    margin: 2rem 0;
    font-size: 0.9rem;
}
.post-content .post__toc-title,
.page-content .post__toc-title {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--warm);
    margin-bottom: 0.75rem;
}
.post-content .post__toc ol,
.page-content .post__toc ol {
    margin: 0;
    padding-left: 1.2rem;
}
.post-content .post__toc li,
.page-content .post__toc li {
    font-size: 0.88rem;
    color: var(--text-mid);
    margin-bottom: 0.3em;
}
.post-content .post__toc a,
.page-content .post__toc a {
    color: var(--cool);
    text-decoration: none;
}
.post-content .post__toc a:hover,
.page-content .post__toc a:hover { text-decoration: underline; }

/* ── Drop cap (first paragraph of story) ── */
.post-content > p:first-of-type::first-letter,
.page-content > p:first-of-type::first-letter {
    font-family: var(--font-display);
    font-size: 3.5em;
    font-weight: 700;
    float: left;
    line-height: 0.78;
    margin-right: 0.08em;
    margin-top: 0.06em;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Keyboard shortcut ── */
.post-content kbd, .page-content kbd {
    font-family: var(--font-ui);
    font-size: 0.78em;
    padding: 0.1em 0.45em;
    border: 1px solid var(--border-med);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--bg-warm);
    color: var(--text-mid);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .post-content p, .page-content p,
    .post-content li, .page-content li { font-size: 1rem; }
    .post-content h2, .page-content h2 { font-size: 1.4rem; }
    .post-content blockquote, .page-content blockquote { padding: 1rem 1.2rem; font-size: 1rem; }
    .post-content table, .page-content table { font-size: 0.82rem; }
    .post-content th, .post-content td,
    .page-content th, .page-content td { padding: 0.5rem 0.7rem; }
    .post-content > p:first-of-type::first-letter,
    .page-content > p:first-of-type::first-letter { font-size: 2.8em; }
}

/* ================================================================
   FIGURES & IMAGES
   ================================================================ */

/* Default: block, centred, nicely spaced */
.post-content figure,
.page-content figure {
    display: block;
    margin: 2rem auto;
    text-align: center;
}

/* ── All content images ── */
.post-content figure img,
.page-content figure img {
    display: block;
    margin: 0 auto;
    border-radius: var(--radius);
    max-width: 100%;
    height: auto;
}

/* ── Character / portrait images — float left ── */
.post-content figure.is-portrait,
.page-content figure.is-portrait {
    float: left;
    clear: left;
    margin: 0.4rem 2rem 1.2rem 0;
    text-align: left;
    /* card treatment */
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px;
    box-shadow:
        0 2px 8px rgba(0,0,0,0.06),
        0 8px 28px rgba(166, 73, 0, 0.10);
    transition: box-shadow 0.25s, transform 0.25s;
}

.post-content figure.is-portrait:hover,
.page-content figure.is-portrait:hover {
    box-shadow:
        0 4px 16px rgba(0,0,0,0.09),
        0 14px 40px rgba(166, 73, 0, 0.15);
    transform: translateY(-2px);
}

.post-content figure.is-portrait img,
.page-content figure.is-portrait img {
    border-radius: calc(var(--radius-lg) - 4px);
    margin: 0;
    display: block;
}

/* gradient accent line at bottom of card */
.post-content figure.is-portrait::after,
.page-content figure.is-portrait::after {
    content: '';
    display: block;
    height: 3px;
    margin: 6px -6px -6px;
    background: var(--grad);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    opacity: 0.7;
}

/* ── Figcaptions ── */
.post-content figcaption,
.page-content figcaption {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

.post-content figure.is-portrait figcaption,
.page-content figure.is-portrait figcaption {
    text-align: center;
    margin-top: 5px;
    padding: 4px 4px 0;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-mid);
}

/* Clearfix */
.post-content .clear,
.page-content .clear { clear: both; }

/* Small inline images (badges, icons): sit side by side */
.post-content figure.is-inline,
.page-content figure.is-inline {
    display: inline-block;
    vertical-align: middle;
    margin: 0.25rem 0.3rem;
    text-align: center;
}
.post-content figure.is-inline img,
.page-content figure.is-inline img {
    margin: 0;
}

/* ================================================================
   PUBLII IMAGE BLOCKS (post__image classes set by the editor)
   ================================================================ */

/* ── All image blocks: base reset ── */
.post-content .post__image,
.page-content .post__image {
    margin: 1.5rem 0;
    text-align: center;
}

/* ── Center-aligned: block, centred ── */
.post-content .post__image--center,
.page-content .post__image--center {
    display: block;
    margin: 1.5rem auto;
    text-align: center;
}

/* ── Left-aligned: float left with card styling ── */
.post-content .post__image--left,
.page-content .post__image--left {
    float: left;
    clear: left;
    margin: 0.4rem 2rem 1.2rem 0;
    text-align: center;
}

/* ── Right-aligned: float right with card styling ── */
.post-content .post__image--right,
.page-content .post__image--right {
    float: right;
    clear: right;
    margin: 0.4rem 0 1.2rem 2rem;
    text-align: center;
}

/* ── Card treatment for left + right floats ── */
.post-content .post__image--left,
.post-content .post__image--right,
.page-content .post__image--left,
.page-content .post__image--right {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px;
    box-shadow:
        0 2px 8px rgba(0,0,0,0.06),
        0 8px 28px rgba(166,73,0,0.10);
    transition: box-shadow 0.25s, transform 0.25s;
}

.post-content .post__image--left:hover,
.post-content .post__image--right:hover,
.page-content .post__image--left:hover,
.page-content .post__image--right:hover {
    box-shadow:
        0 4px 16px rgba(0,0,0,0.09),
        0 14px 40px rgba(166,73,0,0.16);
    transform: translateY(-2px);
}

/* ── ALL image block imgs ── */
.post-content .post__image img,
.page-content .post__image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: calc(var(--radius-lg) - 4px);
    margin: 0 auto;
}

/* ── Gradient bar at bottom of floated cards ── */
.post-content .post__image--left::after,
.post-content .post__image--right::after,
.page-content .post__image--left::after,
.page-content .post__image--right::after {
    content: '';
    display: block;
    height: 3px;
    margin: 6px -6px -6px;
    background: var(--grad);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    opacity: 0.7;
}

/* ── Center-aligned also gets rounded img + shadow ── */
.post-content .post__image--center img,
.page-content .post__image--center img {
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 8px 32px rgba(166,73,0,0.08);
    margin: 0 auto;
}

/* ── Figcaptions inside image blocks ── */
.post-content .post__image figcaption,
.page-content .post__image figcaption {
    margin-top: 6px;
    padding: 4px 2px 0;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 500;
    font-style: normal;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-mid);
    text-align: center;
    line-height: 1.4;
}

/* ── Clearfix ── */
.post-content::after,
.page-content::after {
    content: '';
    display: table;
    clear: both;
}

/* ── Footer fixes ── */
.footer-inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    padding: 3.5rem 0 2.5rem;
}

/* Keep footer-cols on one row inside the right column */
.footer-cols {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 1.2rem 0;
    display: block;
    text-align: center;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.footer-bottom p {
    margin: 0.3rem 0;
}

.footer-bottom p.align-left  { text-align: left !important; }
.footer-bottom p.align-center { text-align: center !important; }
.footer-links p { margin-bottom: .1rem; }

/* ── Download icons: epub + mobi side by side ── */

/* epub: <figure><span>Downloads: <a class="download-icon"><img></a></span></figure> */
figure.post__image:has(.download-icon) {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    padding-left: 30px;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

/* mobi: <a class="download-icon"><figure class="post__image"><img></figure></a> */
.download-icon {
    display: inline-flex;
    align-items: center;
}

.download-icon figure.post__image {
    display: inline-flex;
    align-items: center;
    margin: 0 0 0 0.4rem;
    padding: 0;
}

.download-icon figure.post__image img {
    display: block;
}

/* ── Webring images ── */
.footer-webring img {
    max-height: 50px;
    width: auto;
}
