/* ==============================================================================
   "Letters to My Children" - Site-wide stylesheet
   Design language: fine correspondence / manuscript, not generic "church site"
   ============================================================================== */

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

:root {
    /* --- Core palette --- */
    --ink: #14171F;
    --ink-soft: #2A2E3A;
    --parchment: #F7F2E7;
    --parchment-soft: #EDE6D6;
    --gold-leaf: #C9A24B;

    /* --- Category jewel tones --- */
    --cat-messages: #1B3A6B;
    --cat-theology: #7B1E3A;
    --cat-philosophy: #1F5C3F;
    --cat-reflections: #B8860B;

    /* --- Type --- */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Source Serif 4', Georgia, serif;
    --font-utility: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* --- Mode-aware tokens (overridden under [data-theme="dark"]) --- */
    --bg: var(--parchment);
    --bg-elevated: #FFFFFF;
    --text-primary: var(--ink);
    --text-secondary: #5A5648;
    --border-subtle: rgba(20, 23, 31, 0.12);
    --shadow-color: rgba(20, 23, 31, 0.08);
}

[data-theme="dark"] {
    --bg: var(--ink);
    --bg-elevated: var(--ink-soft);
    --text-primary: var(--parchment);
    --text-secondary: #B8B3A0;
    --border-subtle: rgba(247, 242, 231, 0.12);
    --shadow-color: rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ------------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------------ */

.site-header {
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

.site-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-brand img.site-logo {
    height: clamp(60px, 8vw, 120px);
    width: auto;
    display: block;
}

.site-brand__text {
    display: flex;
    flex-direction: column;
    align-items: center;     /* center title + byline as a unit */
    text-align: center;       /* center the byline beneath the title */
    line-height: 1.1;
}

.site-brand__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.site-brand__tagline {
    font-family: var(--font-utility);
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-leaf);
    margin-top: 0.15rem;
    text-align: center;        /* byline centered beneath the title */
}

.site-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1.5rem;
    font-family: var(--font-utility);
    font-size: 1.0rem;   /* +2px on the Home / Featured / About links */
}

.site-nav a {
    opacity: 0.85;
    transition: opacity 0.2s ease;
    white-space: nowrap;   /* keep link text on one line (no vertical stacking) */
}

.site-nav a:hover,
.site-nav a:focus-visible {
    opacity: 1;
    color: var(--gold-leaf);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.45rem;          /* larger icon */
    line-height: 1;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    border-color: var(--gold-leaf);
}

.theme-toggle:active {
    transform: scale(0.94);
}

/* ------------------------------------------------------------------------------
   Header graphic band (optional, configurable image)
   ------------------------------------------------------------------------------ */

.header-graphic {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--border-subtle);
}

/* ------------------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------------------ */

.page-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.content-column {
    max-width: 680px;
    margin: 0 auto;
}

.page-shell-wide {
    width: 100%;
}

main {
    padding: 3rem 0 5rem;
}

/* ------------------------------------------------------------------------------
   Article rows (full-width horizontal cards, used on homepage)
   ------------------------------------------------------------------------------ */

.article-list-wide {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.article-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elevated);
    border-left: 4px solid var(--cat-color, var(--border-subtle));
    border-radius: 4px;
    box-shadow: 0 1px 3px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    text-decoration: none;
}

.article-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-color);
}

.article-row__thumb {
    flex: 0 0 154px;
    width: 154px;
    overflow: hidden;
    background: color-mix(in srgb, var(--cat-color, var(--border-subtle)) 15%, var(--bg));
}

.article-row__thumb img {
    width: 100%;
    height: 100%;
    /* Show the WHOLE image (no cropping) so 1:1 images scale to fit the box and
       portrait images keep the subject's head intact. object-position:top keeps
       the top anchored if anything is ever clipped. */
    object-fit: contain;
    object-position: top;
    display: block;
}

.article-row__thumb-placeholder {
    width: 100%;
    height: 100%;
    min-height: 120px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--cat-color, var(--border-subtle)) 30%, transparent) 0%,
        transparent 100%);
}

.article-row__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.4rem 2rem;
    min-width: 0;
}

.article-row__title {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 600;
    margin: 0.4rem 0 0.4rem;
    color: var(--text-primary);
}

.article-row__meta {
    font-family: var(--font-utility);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

@media (max-width: 640px) {
    .article-row {
        flex-direction: column;
        border-left: none;
        border-top: 4px solid var(--cat-color, var(--border-subtle));
    }
    .article-row__thumb {
        flex: none;
        width: 100%;
        height: 160px;
    }
    .article-row__body {
        padding: 1.1rem 1.25rem 1.4rem;
    }
}

/* ------------------------------------------------------------------------------
   Category badge - the signature element: a wax-seal-style mark
   ------------------------------------------------------------------------------ */

.category-seal {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-utility);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cat-color, var(--gold-leaf));
}

.category-seal__mark {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--cat-color, var(--gold-leaf));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat-color, var(--gold-leaf)) 25%, transparent);
    flex-shrink: 0;
}

/* ------------------------------------------------------------------------------
   Browse bar (search + filter + sort, on the homepage)
   ------------------------------------------------------------------------------ */

.browse-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 2rem;
}

.browse-bar__search {
    flex: 1 1 200px;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-utility);
    font-size: 0.9375rem;
}

.browse-bar__select {
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-utility);
    font-size: 0.9375rem;
}

.browse-bar .btn {
    padding: 0.55rem 1.25rem;
    border-radius: 6px;
    border: none;
    background: var(--gold-leaf);
    color: var(--ink);
    font-family: var(--font-utility);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
}

.browse-bar .btn:hover {
    opacity: 0.85;
}

.browse-bar__clear {
    font-family: var(--font-utility);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: underline;
}

.browse-bar__clear:hover {
    color: var(--gold-leaf);
}

@media (max-width: 640px) {
    .browse-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ------------------------------------------------------------------------------
   Article cards (homepage / category listings)
   ------------------------------------------------------------------------------ */

.article-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.article-card {
    background: var(--bg-elevated);
    border-left: 3px solid var(--cat-color, var(--border-subtle));
    border-radius: 4px;
    padding: 1.75rem 2rem;
    box-shadow: 0 1px 3px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-color);
}

.article-card__title {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 600;
    margin: 0.5rem 0 0.4rem;
}

.article-card__meta {
    font-family: var(--font-utility);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.article-card__excerpt {
    color: var(--text-secondary);
    margin-top: 0.6rem;
}

/* ------------------------------------------------------------------------------
   Article detail page
   ------------------------------------------------------------------------------ */

.article-header {
    margin-bottom: 2rem;
}

.article-header__title {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 600;
    line-height: 1.15;
    margin: 0.6rem 0 0.8rem;
}

.article-header__meta {
    font-family: var(--font-utility);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.article-featured-image {
    display: block;
    width: auto;
    max-width: 100%;
/* Featured image with text-wrapping ON: float it top-left so the article body
   text wraps around it. Only rendered when featured_show is true (template
   gate). Native aspect ratio preserved via height:auto. No pixel cap -- let
   the 42% column width fully govern so the image can scale large on wide
   screens; the inline height:auto keeps the native aspect ratio. (The phone
   media query below keeps its own smaller cap for narrow screens.) */
.article-featured-image--wrap {
    float: left;
    width: 42%;
    max-width: none;
    max-height: none;
    height: auto;
    margin: 0.25rem 1.75rem 1rem 0;
}
@media (max-width: 640px) {
    .article-featured-image--wrap {
        float: none;
        width: 75%;
        max-width: 340px;
        margin: 1rem auto;
    }
}
    /* Cap the on-screen size so a large/tall image does not fill the whole
       screen before the text. height:auto keeps each image's native aspect
       ratio; object-fit:contain guarantees no cropping or distortion. */
    max-height: 50vh;
    height: auto;
    object-fit: contain;
    margin: 1.5rem auto 2rem;
    border-radius: 6px;
}

.article-body {
    font-size: 1.125rem;
}
/* Keep the body box from collapsing when it contains floated decorative
   images (top-left / bottom-right). Use a clearfix rather than overflow:hidden:
   overflow:hidden creates a block formatting context that would push a featured
   image placed BEFORE the body (a sibling) into a side column instead of letting
   the body text wrap around it. */
.article-body::after {
    content: "";
    display: block;
    clear: both;
}

/* Links inside article / About body text: make them visibly a link
   (gold accent + underline) instead of inheriting body text color. */
.article-body a {
    color: var(--gold-leaf);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 1px;
}
.article-body a:hover,
.article-body a:focus-visible {
    color: var(--text-primary);
    text-decoration-thickness: 2px;
}

.article-body h1, .article-body h2, .article-body h3, .article-body h4 {
    font-family: var(--font-display);
    line-height: 1.25;
}

.article-body blockquote {
    border-left: 3px solid var(--gold-leaf);
    margin: 1.75rem 0;
    padding: 0.25rem 0 0.25rem 1.5rem;
    font-style: italic;
    color: var(--text-secondary);
}

.article-body img {
    max-width: 100%;
    border-radius: 6px;
}

/* ------------------------------------------------------------------------------
   Category page header
   ------------------------------------------------------------------------------ */

.category-page-header {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2.5rem;
}

.category-page-header__title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--cat-color);
}

/* ------------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------------ */

.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 2rem;
    text-align: center;
    font-family: var(--font-utility);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ------------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------------ */

@media (max-width: 640px) {
    .site-header__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .article-header__title {
        font-size: 2rem;
    }
    .page-shell {
        padding: 0 1.25rem;
    }
}

/* ------------------------------------------------------------------------------
   Accessibility: visible keyboard focus everywhere
   ------------------------------------------------------------------------------ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--gold-leaf);
    outline-offset: 2px;
}

/* ==============================================================================
   Homepage article rows — 2026-07-17 redesign
   Goals: rows ~35% of prior height (more articles per screen), article column
   ~70% of viewport width (whitespace on both sides). Category/featured images
   keep their aspect ratio (object-fit: cover crops to fill, never stretches).
   ============================================================================== */

/* Break the homepage column out of the 1100px page-shell cap and center it at
   ~70vw, leaving roughly 15vw of breathing room on each side. */
.page-shell-wide {
    width: 70vw;
    max-width: 70vw;
    margin-left: calc(50% - 35vw);
    margin-right: calc(50% - 35vw);
}

/* Tighter vertical rhythm between rows now that each row is shorter. */
.article-list-wide {
    gap: 0.75rem;
}

/* Compact row: ~35% of the previous height. */
.article-row {
    min-height: 0;
    height: 112px;
}

/* Category/featured image on the left — fixed box, aspect ratio preserved. */
.article-row__thumb {
    flex: 0 0 168px;
    width: 168px;
}
.article-row__thumb img {
    width: 100%;
    height: 100%;
    /* Whole image, no crop (same as base rule): 1:1 fits the box, portraits
       keep heads. object-position:top anchors the top if anything clips. */
    object-fit: contain;
    object-position: top;
    display: block;
}
.article-row__thumb-placeholder {
    min-height: 0;
}

/* Condensed text block so the whole row fits the shorter height. */
.article-row__body {
    padding: 0.55rem 1.5rem;
    gap: 0.15rem;
}
.article-row__title {
    font-size: 1.2rem;
    margin: 0.15rem 0;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-row__meta {
    font-size: 0.75rem;
    margin-top: 0.1rem;
}
.category-seal {
    font-size: 0.68rem;
}
.category-seal__mark {
    width: 11px;
    height: 11px;
}

/* On phones, go full width and let the row stack (image on top). */
@media (max-width: 640px) {
    .page-shell-wide {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    .article-row {
        height: auto;
    }
    .article-row__thumb {
        flex: none;
        width: 100%;
        height: 150px;
    }
}

/* ==============================================================================
   Featured Article of the Month — homepage banner + archive page
   ============================================================================== */

.featured-banner {
    width: 70vw;
    max-width: 70vw;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: stretch;
    background: var(--bg-elevated);
    border: 1px solid var(--gold-leaf);
    border-left: 5px solid var(--gold-leaf);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow-color);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.featured-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-color);
}
.featured-banner__thumb {
    flex: 0 0 154px;
    width: 154px;
    overflow: hidden;
    background: color-mix(in srgb, var(--gold-leaf) 15%, var(--bg));
}
.featured-banner__thumb img {
    width: 100%;
    height: 100%;
    /* Featured banner thumbnail: show the whole image, no crop. */
    object-fit: contain;
    object-position: top;
    display: block;
}
.featured-banner__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.1rem 1.75rem;
    min-width: 0;
}
.featured-banner__eyebrow {
    font-family: var(--font-utility);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-leaf);
    font-weight: 700;
    margin-bottom: 0.3rem;
}
.featured-banner__title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.1rem 0 0.35rem;
    line-height: 1.2;
}
.featured-banner__meta {
    font-family: var(--font-utility);
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.featured-archive-link {
    display: inline-block;
    margin: 0.25rem auto 1.75rem;
    font-family: var(--font-utility);
    font-size: 0.8rem;
    color: var(--gold-leaf);
}

/* Featured archive page list */
.featured-archive {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.featured-archive__item {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    background: var(--bg-elevated);
    border-left: 4px solid var(--gold-leaf);
    border-radius: 4px;
    padding: 0.9rem 1.25rem;
    text-decoration: none;
    box-shadow: 0 1px 3px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.featured-archive__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-color);
}
.featured-archive__period {
    flex: 0 0 auto;
    font-family: var(--font-utility);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold-leaf);
    font-weight: 700;
    min-width: 180px;
}
.featured-archive__title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
}
@media (max-width: 640px) {
    .featured-banner { width: 100%; max-width: 100%; }
    .featured-banner__thumb { flex-basis: 84px; width: 84px; }
    .featured-archive__item { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
    .featured-archive__period { min-width: 0; }
}

/* ==============================================================================
   2026-07-17 (batch 2) — article detail width + featured label/star
   ============================================================================== */

/* Item 2: article detail page should use the same wide column as the homepage
   listing (70vw), instead of the narrow 680px reading column. */
.article-detail-wide {
    width: 70vw;
    max-width: 70vw;
    /* Break out of the 1100px .page-shell cap and center at 70vw, matching
       the homepage listing. Plain margin:auto cannot center a child wider than
       its parent, which pushed the article to the right. */
    margin-left: calc(50% - 35vw);
    margin-right: calc(50% - 35vw);
}
.article-detail-wide .article-body,
.article-detail-wide .article-header {
    max-width: 100%;
}

/* Item 1: "Read this month's featured article..." label between search + list */
.featured-callout {
    width: 70vw;
    max-width: 70vw;
    margin: 0 auto 1rem;
    padding: 0.85rem 1.25rem;
    background: color-mix(in srgb, var(--gold-leaf) 10%, var(--bg-elevated));
    border: 1px solid var(--gold-leaf);
    border-left: 5px solid var(--gold-leaf);
    border-radius: 6px;
    font-family: var(--font-utility);
    font-size: 0.95rem;
    color: var(--text-primary);
}
.featured-callout a {
    color: var(--gold-leaf);
    font-weight: 700;
    text-decoration: none;
}
.featured-callout a:hover {
    text-decoration: underline;
}

/* Item 1: star marking the featured article in the listing (category color) */
.article-row__star {
    display: inline-flex;
    align-items: center;
    margin-left: 0.4rem;
    color: var(--cat-color, var(--gold-leaf));
    font-size: 1rem;
    line-height: 1;
}
.article-row__titleline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .article-detail-wide,
    .featured-callout {
        width: 100%;
        max-width: 100%;
    }
}


/* ------------------------------------------------------------------------------
   Subscribe nav link (public header) - same gold hover as other nav items,
   just ~4px smaller, no box/background.
   ------------------------------------------------------------------------------ */
.subscribe-link {
    font-family: var(--font-utility);
    font-size: 0.78rem;            /* nav links are 1.0rem; ~4px smaller */
    letter-spacing: 0.04em;
    opacity: 0.85;
    transition: opacity 0.2s ease, color 0.2s ease;
}
.site-nav .subscribe-link:hover,
.site-nav .subscribe-link:focus-visible {
    opacity: 1;
    color: var(--gold-leaf);
}
@media (max-width: 640px) {
    .subscribe-link { font-size: 0.72rem; }
}

/* ------------------------------------------------------------------------------
   Subscribe page (public)
   ------------------------------------------------------------------------------ */
.subscribe-page { max-width: 820px; margin: 0 auto; }
.subscribe-page h1 {
    font-family: var(--font-display);
    font-size: 2.3rem;
    margin-bottom: 0.5rem;
}
.subscribe-page .lede { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 1.75rem; }
.subscribe-form .form-row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.subscribe-form .form-row .form-group { flex: 1 1 240px; }
.subscribe-form .form-group { margin-bottom: 1.25rem; }
.subscribe-form label {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.subscribe-form input[type="text"],
.subscribe-form input[type="email"],
.subscribe-form input[type="url"] {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: var(--font-utility);
}
.subscribe-form input:focus-visible {
    outline: 2px solid var(--gold-leaf);
    outline-offset: 2px;
    border-color: var(--gold-leaf);
}
.form-group .optional { font-weight: 400; color: var(--text-secondary); font-size: 0.95rem; }
.field-hint { font-size: 0.95rem; color: var(--text-secondary); margin: 0.45rem 0 0; }

.notice {
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin: 1rem 0;
    font-size: 0.95rem;
    border: 1px solid var(--border-subtle);
}
.notice--success { background: rgba(38,153,63,0.12); border-color: rgba(38,153,63,0.4); }
.notice--info    { background: rgba(77,163,255,0.12); border-color: rgba(77,163,255,0.4); }
.notice--error   { background: rgba(191,57,89,0.12);  border-color: rgba(191,57,89,0.4); }

.subscribe-help {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}
.subscribe-help h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}
.subscribe-help ol { padding-left: 1.3rem; }
.subscribe-help li { margin-bottom: 0.5rem; }
.subscribe-help code {
    background: var(--bg-elevated);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Footer unsubscribe link - inherits footer text, gold on hover, no box. */
.site-footer .footer-link {
    color: inherit;
    text-decoration: none;
    opacity: 0.85;
    transition: color 0.2s ease, opacity 0.2s ease;
}
.site-footer .footer-link:hover,
.site-footer .footer-link:focus-visible {
    color: var(--gold-leaf);
    opacity: 1;
}

/* Footer unsubscribe link - inherits footer text, gold on hover, no box. */
.site-footer .footer-link {
    color: inherit;
    text-decoration: none;
    opacity: 0.85;
    transition: color 0.2s ease, opacity 0.2s ease;
}
.site-footer .footer-link:hover,
.site-footer .footer-link:focus-visible {
    color: var(--gold-leaf);
    opacity: 1;
}

/* Space between the Send Request and Cancel buttons on the subscribe form */
.action-row--subscribe {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

/* Understated outlined-pill buttons on the subscribe form. Both the
   "Send Request" <button> and the "Cancel" <a> share one look: transparent
   fill, faint 1px border marking the click area, filling in on hover so the
   user knows they're in the button. Matches the site's restrained CTA style. */
.subscribe-form .action-row--subscribe .btn,
.subscribe-form .action-row--subscribe .btn:link,
.subscribe-form .action-row--subscribe .btn:visited {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    font-family: var(--font-utility);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: transparent;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.subscribe-form .action-row--subscribe .btn:hover,
.subscribe-form .action-row--subscribe .btn:focus-visible {
    border-color: var(--gold-leaf);
    background: rgba(201, 149, 31, 0.12);
    color: var(--gold-leaf);
}

/* ------------------------------------------------------------------------------
   About page figures. quill (tall portrait) floats top-left; sealing (square)
   floats bottom-right. width is a % of the (already narrow) content column with
   a px cap so it is never too big or too small; height:auto keeps the native
   aspect ratio on every screen. They stack full-width & centered on phones.
   ------------------------------------------------------------------------------ */
.about-fig {
    display: block;
    height: auto;              /* preserve aspect ratio */
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.about-fig--left {
    float: left;
    width: 28%;            /* 70% of prior 40% */
    max-width: 140px;      /* 70% of prior 200px */
    margin: 0.25rem 1.5rem 1rem 0;
}
.about-fig--right {
    float: right;
    width: 29.4%;          /* 70% of prior 42% */
    max-width: 147px;      /* 70% of prior 210px */
    margin: 0.25rem 0 1rem 1.5rem;
}
/* Inside the wide article column, let the per-image size_pct (10-90%, set in
   the editor and clamped in the backend) fully govern on-screen width. No pixel
   cap, so the whole slider range is live and the image scales with the column;
   the inline height:auto keeps the native aspect ratio at every size. */
.article-detail-wide .about-fig--left,
.article-detail-wide .about-fig--right {
    max-width: none;
}
/* use_wrap=False => image sits inline/centered instead of floating. */
.about-fig--nowrap {
    float: none !important;
    display: block;
    margin: 1.25rem auto;
}
.about-body::after { content: ""; display: block; clear: both; }

@media (max-width: 640px) {
    .about-fig--left,
    .about-fig--right {
        float: none;
        clear: both;
        width: 49%;           /* 70% of prior 70% (mobile) */
        max-width: 224px;     /* 70% of prior 320px */
        margin: 1.25rem auto;
    }
}

/* About page uses the narrow reading column so floated images wrap tightly
   with the text hugging them (not a wide blocky channel). */
.about-shell {
    /* Match the article detail page width: break out of the 1100px .page-shell
       cap and center at 70vw. Plain margin:auto can't center a child wider
       than its parent, so use the same calc() trick as .article-detail-wide. */
    width: 70vw;
    max-width: 70vw;
    margin-left: calc(50% - 35vw);
    margin-right: calc(50% - 35vw);
}


/* The Ramp Scandal: float the (scaled) featured image top-left so the article
   text wraps around it. Native aspect ratio preserved via height:auto. */
.article--my-response-to-the-ramp-scandal .article-featured-image,
.article--last-night .article-featured-image {
    float: left;
    width: 40%;
    max-width: 320px;
    max-height: none;
    height: auto;
    margin: 0.25rem 1.75rem 1rem 0;
}
.article--my-response-to-the-ramp-scandal .article-body::after,
.article--last-night .article-body::after {
    content: "";
    display: block;
    clear: both;
}
@media (max-width: 640px) {
    .article--my-response-to-the-ramp-scandal .article-featured-image,
    .article--last-night .article-featured-image {
        float: none;
        width: 75%;
        max-width: 320px;
        margin: 1rem auto;
    }
}


/* WOLVES: shrink the top-left image slightly so the opening scripture block
   clears beside it and "meat for them" no longer dangles in the gap below. */
.article--wolves-in-shepherd-s-clothing .about-fig--left {
    width: 34%;
    max-width: 270px;
}
/* WOLVES: smaller bottom-right image to balance against the top-left one. */
.article--wolves-in-shepherd-s-clothing .about-fig--right {
    width: 34%;
    max-width: 270px;
}


/* Portrait image at the right end of the nav (after the theme toggle).
   Matches the logo height band; width:auto preserves aspect ratio. */
.site-nav-img {
    height: clamp(46px, 6vw, 90px);
    width: auto;
    display: block;
    border-radius: 6px;
    object-fit: contain;
}
@media (max-width: 640px) {
    .site-nav-img { height: 40px; }
}


/* KINGS AND KINGDOMS: smaller images so they don't dominate the article,
   while leaving enough width for the text to keep wrapping cleanly. */
.article--kings-and-kingdoms .about-fig--left {
    width: 60%;
    max-width: 324px;
}
.article--kings-and-kingdoms .about-fig--right {
    width: 45%;
    max-width: 250px;
}


/* THERE IS A SERPENT IN YOUR GARDEN: single top-left image, text wraps. */
.article--the-serpent-in-your-garden .about-fig--left {
    width: 50%;
    max-width: 375px;
}


/* TRIBUTE TO DENYSE: single top-left image, text wraps. */
.article--tribute-to-denyse .about-fig--left {
    width: 40%;
    max-width: 300px;
}

/* ===== Home/browse pagination ===== */
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 2.5rem 0 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}
.pager__btn,
.pager__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-utility);
    font-size: 0.9375rem;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.pager__btn:hover,
.pager__page:hover {
    border-color: var(--gold-leaf);
    color: var(--gold-leaf);
}
.pager__page.is-current {
    background: var(--gold-leaf);
    border-color: var(--gold-leaf);
    color: var(--ink);
    font-weight: 600;
    cursor: default;
}
.pager__btn.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}
.pager__gap {
    color: var(--text-secondary);
    padding: 0 0.15rem;
}
.pager__status {
    margin-left: auto;
    color: var(--text-secondary);
    font-family: var(--font-utility);
    font-size: 0.875rem;
}

/* === Mature-content gate modal (public article pages) =====================
   Mirrors the admin `.dialog-modal` conventions (gold-leaf top border,
   rounded panel, centered overlay) but lives on the public site, which only
   loads site.css. The panel sizes to its content (dynamic) up to a max width
   and max height, so longer notices grow the box instead of overflowing. */
.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border-radius: 6px;
    border: none;
    background: var(--gold-leaf);
    color: var(--ink);
    font-family: var(--font-utility);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.btn:hover {
    opacity: 0.85;
}
.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.mature-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(20, 23, 31, 0.55);
    align-items: center;
    justify-content: center;
    padding: 2.5vh 2vw;
}
.mature-modal.is-open {
    display: flex;
}
.mature-modal__panel {
    /* Dynamic size: grows with the notice content up to sane bounds. */
    width: min(560px, 94vw);
    max-height: 86vh;
    overflow-y: auto;
    background: var(--bg-elevated, #fff);
    border-radius: 10px;
    padding: 1.6rem 1.6rem 1.3rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    border-top: 3px solid var(--gold-leaf);
}
.mature-modal__body {
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.55;
    margin: 0 0 1.1rem;
}
.mature-modal__body h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0 0 0.6rem;
}
.mature-modal__body p {
    margin: 0 0 0.7rem;
}
.mature-modal__body p:last-child {
    margin-bottom: 0;
}
.mature-modal__actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
}

/* Hide the article body until the gate is accepted. Kept in the DOM so the
   page is still crawlable / OG-complete; only visually suppressed. */
.article-detail-wide.is-gated {
    visibility: hidden;
}

/* === Registered-Subscriber access badges (listing) ===================== */
.article-row__lock,
.article-row__mature {
    font-size: 0.72rem;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 0.4rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
}
.article-row__lock {
    background: #2a2a2a;
    color: #f1d27a;
}
.article-row__mature {
    background: #7a2a2a;
    color: #fff;
}

/* === Reader (Registered Subscriber) nav =============================== */
.reader-greeting {
    color: var(--text-secondary, #6b6256);
    font-size: 0.9rem;
    margin-right: 0.25rem;
}

/* === Privacy & no-cost pledge (signup pages) ===================== */
.privacy-note {
    margin: 0.75rem 0 1.5rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--gold-leaf);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* === Reader greeting (logged-in nav) ================================ */
.reader-greeting {
    color: #fff;
    font-weight: 600;
    margin: 0 0.4rem;
}

/* === Account dropdown (logged-in Registered Subscriber) ============== */
.account-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
.account-menu__trigger {
    background: none;
    border: none;
    font: inherit;
    color: var(--text-primary);
    opacity: 0.85;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}
.account-menu__trigger:hover,
.account-menu__trigger:focus-visible {
    opacity: 1;
    color: var(--gold-leaf);
}

/* === Edit-account modal ============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
}
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(440px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-top: 3px solid var(--gold-leaf);
    border-radius: 10px;
    padding: 1.5rem 1.5rem 1.25rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 101;
}
.modal[hidden] { display: none; }
.modal-backdrop[hidden] { display: none; }
.account-edit-modal h2 {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
}
.account-edit-modal label {
    display: block;
    margin: 0 0 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.account-edit-modal input[type="text"],
.account-edit-modal input[type="email"],
.account-edit-modal input[type="url"] {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.55rem 0.7rem;
    font: inherit;
    color: var(--text-primary);
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
}
.account-edit-modal input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.account-edit-modal .field-note {
    margin: -0.5rem 0 0.85rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.account-edit-modal .form-errors {
    margin: 0 0 0.85rem;
    padding: 0.6rem 0.9rem 0.6rem 1.6rem;
    color: #FFE0E6;
    background: #7B1E3A;
    border-radius: 6px;
    font-size: 0.85rem;
}
.account-edit-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

/* === Terms of Service (printed on subscribe page) ==================== */
.tos-page { max-width: 760px; }
.tos-block {
    margin: 2rem 0 0;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-primary);
}
.tos-block h2 {
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}
.tos-block h3 {
    font-size: 1rem;
    margin: 1.1rem 0 0.3rem;
    color: var(--text-primary);
}
.tos-block p { line-height: 1.6; margin: 0.35rem 0; }
.tos-form .btn { margin-top: 0.5rem; }

/* === Private-article gate (members-only) ============================== */
.private-modal .mature-modal__panel {
    border-top: 4px solid #2a2a2a;
}

/* === Consolidated subscribe hub ============================== */
.sub-card {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-elevated);
    color: var(--text-primary);
}
.sub-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    color: var(--text-primary);
}
.sub-card__hint {
    margin: 0 0 1.25rem;
    color: var(--text-secondary);
    line-height: 1.55;
}
.reg-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.reg-tab {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #d8cbb0;
    background: #f3ede3;
    color: #5a4a36;
    font: inherit;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}
.reg-tab.is-active {
    background: #2a2a2a;
    color: #fff;
    border-color: #2a2a2a;
}
