/* =========================================================
   shelly-out-loud — Ghost theme
   A warm, video-forward, slow-web stylesheet.
   =========================================================
   1. Tokens
   2. Reset & base
   3. Layout primitives
   4. Header / nav
   5. Hero
   6. Sections & cards
   7. Post / page
   8. Ghost content (kg-*) + embeds + video
   9. Author / tag archive
  10. Pagination, footer, utilities
  11. Responsive
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
    /* Warm "ember" default — fire-circle palette */
    --bg:           #f7f1e8;
    --bg-alt:       #f1e8d8;
    --surface:      #fffaf2;
    --surface-2:    #ede1cd;
    --border:       #d8c8ad;
    --border-soft:  #e8dcc4;

    --ink:          #241a10;
    --ink-soft:     #4a3a28;
    --muted:        #7a6a55;
    --faint:        #b3a489;

    --accent:       #b4421b;   /* ember */
    --accent-hi:    #d9612b;
    --accent-soft:  #f4d8c4;
    --accent-ink:   #ffffff;

    --highlight:    #fff7d6;

    --shadow-sm:    0 1px 2px rgba(40, 26, 10, 0.06);
    --shadow-md:    0 8px 24px rgba(40, 26, 10, 0.08);
    --shadow-lg:    0 24px 60px rgba(40, 26, 10, 0.14);

    --radius-sm:    6px;
    --radius:       12px;
    --radius-lg:    20px;
    --radius-xl:    28px;

    /* Ghost custom-font variables — admin can override via Design settings */
    --gh-font-heading: "Fraunces", Georgia, "Times New Roman", serif;
    --gh-font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --font-display: var(--gh-font-heading);
    --font-body:    var(--gh-font-body);
    --font-mono:    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --measure:      66ch;
    --container:    1180px;
    --container-narrow: 720px;

    --ease:         cubic-bezier(0.2, 0.7, 0.2, 1);
    --dur-fast:     160ms;
    --dur:          280ms;
    --dur-slow:     480ms;
}

/* Sage variant */
[data-accent="sage"] {
    --bg:          #f3f4ec;
    --bg-alt:      #e9ecdd;
    --surface:     #fbfcf5;
    --surface-2:   #dde3c8;
    --border:      #c8d1ad;
    --border-soft: #dde3c8;
    --accent:      #4a6b3a;
    --accent-hi:   #5e8449;
    --accent-soft: #d9e4c8;
}

/* Indigo / twilight variant */
[data-accent="indigo"] {
    --bg:          #ecedf3;
    --bg-alt:      #dde0ec;
    --surface:     #f7f8fc;
    --surface-2:   #cdd3e3;
    --border:      #a8b1cc;
    --border-soft: #cdd3e3;
    --ink:         #181a2b;
    --accent:      #3a4a8c;
    --accent-hi:   #5667b0;
    --accent-soft: #d0d6ee;
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img, picture, svg, video { max-width: 100%; height: auto; display: block; }

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--accent-hi); }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0 0 0.5em;
}
p { margin: 0 0 1em; }

::selection { background: var(--accent-soft); color: var(--ink); }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ink);
    color: var(--bg);
    padding: 0.6em 1em;
    z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- 3. Layout primitives ---------- */
.site-main { min-height: 60vh; }

.section {
    max-width: var(--container);
    margin: 0 auto;
    padding: 4rem 1.5rem;
}
.section-head {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 2rem;
}
.section-title {
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    margin: 0;
}
.section-sub {
    color: var(--muted);
    font-size: 1rem;
    margin: 0;
    max-width: 50ch;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.7em 1.3em;
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn--primary {
    background: var(--accent);
    color: var(--accent-ink);
}
.btn--primary:hover { background: var(--accent-hi); color: var(--accent-ink); transform: translateY(-1px); }
.btn--ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- 4. Header / nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border-soft);
}
.site-header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--ink);
}
.site-logo img { max-height: 38px; width: auto; }
.brand-mark { width: 36px; height: 36px; color: var(--accent); flex-shrink: 0; }
.site-wordmark {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.site-nav { display: flex; }
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}
.nav-item a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.4em 0;
    border-bottom: 2px solid transparent;
}
.nav-item a:hover { color: var(--accent); }
.nav-item--current a {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.6rem;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 5. Hero ---------- */
.hero {
    max-width: var(--container);
    margin: 2rem auto 1rem;
    padding: 3.5rem 1.5rem 3rem;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
    position: relative;
}
.hero-eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 500;
}
.hero-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.05;
    margin: 0 0 1rem;
    letter-spacing: -0.015em;
    max-width: 18ch;
}
.hero-lede {
    font-size: 1.15rem;
    color: var(--ink-soft);
    max-width: 46ch;
    margin: 0 0 1.6rem;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    align-items: center;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.hero-tag {
    display: inline-block;
    padding: 0.4em 0.9em;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.85rem;
    transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.hero-tag:hover { border-color: var(--accent); color: var(--accent); }

.hero-glyph {
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent);
    opacity: 0.9;
}
.hero-glyph .brand-mark {
    width: clamp(140px, 30vw, 240px);
    height: auto;
    animation: drift 12s ease-in-out infinite;
}
@keyframes drift {
    0%, 100% { transform: rotate(0deg); }
    50%      { transform: rotate(6deg); }
}

/* ---------- 6. Cards ---------- */
.card-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card-grid--featured {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card-grid--video .post-card-media {
    aspect-ratio: 16 / 9;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}
.post-card-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.post-card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface-2);
}
.post-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--dur-slow) var(--ease);
}
.post-card:hover .post-card-media img {
    transform: scale(1.04);
}
.post-card-badge {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    background: rgba(20, 12, 4, 0.75);
    color: #fff;
    padding: 0.3em 0.7em;
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    backdrop-filter: blur(4px);
}
.post-card-body {
    padding: 1.4rem 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}
.post-card-kicker {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    font-weight: 500;
}
.post-card-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.35rem;
    line-height: 1.2;
    margin: 0;
    color: var(--ink);
}
.post-card-excerpt {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0;
    flex: 1;
}
.post-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.6rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-soft);
}
.post-card-author { font-weight: 500; color: var(--ink-soft); }

.post-card--featured {
    border-color: var(--border);
}
.post-card--featured .post-card-body { padding-bottom: 1.8rem; }

/* ---------- 7. Post / page ---------- */
.post, .page {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 3rem 1.5rem 1rem;
}
.post-header, .page-header {
    text-align: center;
    margin-bottom: 2rem;
}
.post-kicker {
    display: inline-block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1rem;
}
.post-title, .page-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    margin: 0 0 0.8rem;
    letter-spacing: -0.015em;
}
.post-lede, .page-lede {
    font-size: 1.2rem;
    color: var(--ink-soft);
    max-width: 50ch;
    margin: 0 auto;
    line-height: 1.5;
}
.post-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.6rem 1.2rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}
.post-author {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 500;
}
.post-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.post-feature, .page-feature {
    max-width: var(--container);
    margin: 1rem auto 2.5rem;
    padding: 0 1.5rem;
}
.post-feature img, .page-feature img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.post-feature figcaption {
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
    margin-top: 0.8rem;
}

/* ---------- 8. Ghost content + cards + embeds ---------- */
.post-content {
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--ink);
}
.post-content > * {
    max-width: var(--measure);
    margin-left: auto;
    margin-right: auto;
}
.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2.2em;
    margin-bottom: 0.5em;
}
.post-content h2 { font-size: 1.75rem; }
.post-content h3 { font-size: 1.35rem; }
.post-content h4 { font-size: 1.1rem; }

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote {
    margin-bottom: 1.2em;
}
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content li { margin-bottom: 0.3em; }
.post-content li::marker { color: var(--accent); }

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.2em 0 0.2em 1.2em;
    margin-left: 0;
    font-style: italic;
    color: var(--ink-soft);
    font-family: var(--font-display);
    font-size: 1.2rem;
    line-height: 1.5;
}
.post-content blockquote p { margin-bottom: 0.5em; }

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.92em;
    background: var(--surface-2);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}
.post-content pre {
    background: #1c160e;
    color: #f4ebd9;
    padding: 1.2em 1.4em;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1.4em;
    font-size: 0.92em;
    line-height: 1.55;
}
.post-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5em auto;
    width: 100px;
}

.post-content mark, .post-content .kg-highlight {
    background: var(--highlight);
    padding: 0.05em 0.2em;
    border-radius: 3px;
}

/* ---- Ghost Koenig cards (kg-*) ---- */
/* Wide and full width images break the measure */
.post-content .kg-width-wide,
.post-content .kg-card.kg-width-wide {
    max-width: 1024px;
}
.post-content .kg-width-full,
.post-content .kg-card.kg-width-full {
    max-width: 100%;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.post-content .kg-card {
    margin: 2rem auto;
}

/* Image card */
.kg-image-card img,
.kg-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.kg-image-card figcaption,
.kg-card figcaption {
    text-align: center;
    font-size: 0.88rem;
    color: var(--muted);
    margin-top: 0.7rem;
    font-style: italic;
}

/* Gallery card */
.kg-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 1024px;
    margin-left: auto;
    margin-right: auto;
}
.kg-gallery-row {
    display: flex;
    flex-direction: row;
    gap: 0.6rem;
}
.kg-gallery-image {
    flex: 1 1 auto;
}
.kg-gallery-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* Bookmark card */
.kg-bookmark-card,
.kg-bookmark-container {
    width: 100%;
}
.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
    min-height: 148px;
}
.kg-bookmark-container:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}
.kg-bookmark-content {
    flex: 1 1 70%;
    padding: 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    min-width: 0;
}
.kg-bookmark-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--ink);
    line-height: 1.3;
}
.kg-bookmark-description {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.kg-bookmark-metadata {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.7rem;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.4rem;
}
.kg-bookmark-icon {
    width: 16px;
    height: 16px;
}
.kg-bookmark-thumbnail {
    flex: 0 0 38%;
    max-width: 38%;
    position: relative;
    min-height: 148px;
    background: var(--surface-2);
}
.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

/* Embed card — generic iframe / oEmbed (twitter, instagram, etc.) */
.kg-embed-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.kg-embed-card > * {
    max-width: 100%;
}

/* Responsive iframe wrapper (covers YouTube, Vimeo, etc.) */
.kg-embed-card iframe,
.post-content iframe[src*="youtube"],
.post-content iframe[src*="youtu.be"],
.post-content iframe[src*="vimeo"] {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: var(--radius);
    background: #000;
    display: block;
}

/* Any remaining iframe in content gets a 16:9 default */
.post-content iframe {
    max-width: 100%;
    border-radius: var(--radius);
}

/* Video card (HTML5) */
.kg-video-card {
    position: relative;
}
.kg-video-card video,
.kg-video-container video,
.post-content video {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    background: #000;
    display: block;
}
.kg-video-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}

/* File card */
.kg-file-card .kg-file-card-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
}
.kg-file-card .kg-file-card-container:hover {
    border-color: var(--border);
    background: var(--surface-2);
}

/* Audio card */
.kg-audio-card {
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
}

/* Toggle card */
.kg-toggle-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
}
.kg-toggle-heading {
    font-family: var(--font-display);
    margin: 0 0 0.3rem;
    font-size: 1.1rem;
}

/* Callout / button cards */
.kg-callout-card {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1.1rem 1.4rem;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--ink);
}
.kg-callout-emoji { font-size: 1.4rem; line-height: 1; }
.kg-callout-text { margin: 0; }

.kg-button-card { text-align: center; margin: 2rem auto; }
.kg-button-card a {
    display: inline-block;
    background: var(--accent);
    color: #fff !important;
    padding: 0.8em 1.6em;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 500;
}
.kg-button-card a:hover { background: var(--accent-hi); }

/* Header card */
.kg-header-card {
    padding: 4rem 2rem;
    text-align: center;
    background: var(--surface-2);
    border-radius: var(--radius-lg);
}
.kg-header-card h2 {
    font-family: var(--font-display);
    margin: 0 0 0.5rem;
    font-size: 2rem;
}

/* Product card */
.kg-product-card .kg-product-card-container {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.4rem;
}

/* ---- Tags footer ---- */
.post-footer {
    max-width: var(--measure);
    margin: 3rem auto 0;
}
.post-tags {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.post-tags a {
    display: inline-block;
    padding: 0.35em 0.8em;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.85rem;
}
.post-tags a:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Author bio (post footer) ---- */
.author-bio {
    max-width: var(--container-narrow);
    margin: 3rem auto;
    padding: 0 1.5rem;
}
.author-bio-inner {
    display: flex;
    gap: 1.4rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.8rem;
    align-items: flex-start;
}
.author-bio-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.author-bio-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--ink);
    text-decoration: none;
    display: block;
    margin-bottom: 0.3rem;
}
.author-bio-text p { margin: 0 0 0.5rem; color: var(--ink-soft); }
.author-bio-link { font-size: 0.9rem; }

/* ---------- 9. Author / tag archive ---------- */
.archive-header {
    max-width: var(--container);
    margin: 2rem auto 1rem;
    padding: 3rem 1.5rem 2rem;
    border-bottom: 1px solid var(--border-soft);
}
.archive-header-inner {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}
.archive-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}
.archive-feature {
    width: 180px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius);
}
.archive-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.archive-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    margin: 0 0 0.6rem;
    line-height: 1.1;
}
.archive-bio {
    color: var(--ink-soft);
    max-width: 60ch;
    margin: 0 0 0.8rem;
}
.archive-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.2rem;
    font-size: 0.9rem;
    color: var(--muted);
}
.archive-links a { color: var(--ink-soft); }

/* ---------- 10. Pagination, footer, utilities ---------- */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-soft);
}
.pagination-link {
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5em 1em;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.pagination-link:hover { border-color: var(--accent); color: var(--accent); }
.pagination-link.is-disabled { opacity: 0.4; pointer-events: none; }
.pagination-meta { color: var(--muted); font-size: 0.9rem; }

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-style: italic;
}

/* ---- Community card ---- */
.section--community {
    padding-top: 1rem;
    padding-bottom: 4rem;
}
.community-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    padding: 3rem clamp(1.5rem, 5vw, 3.5rem);
    text-align: center;
    max-width: 820px;
    margin: 0 auto;
}
.community-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    margin: 0 0 1rem;
    color: var(--ink);
}
.community-body {
    color: var(--ink-soft);
    font-size: 1.05rem;
    line-height: 1.65;
    max-width: 52ch;
    margin: 0 auto 1.6rem;
}
.community-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* ---- Error ---- */
.error-page {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 6rem 1.5rem;
    text-align: center;
}
.error-code {
    font-family: var(--font-display);
    font-size: clamp(4rem, 14vw, 8rem);
    color: var(--accent);
    line-height: 1;
    font-weight: 500;
    letter-spacing: -0.02em;
    display: block;
    margin-bottom: 1rem;
}
.error-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    margin: 0 0 0.8rem;
}
.error-message {
    color: var(--muted);
    margin-bottom: 2rem;
}

/* ---- Footer ---- */
.site-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border-soft);
    margin-top: 5rem;
}
.site-footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}
.footer-brand .brand-mark {
    color: var(--accent);
    width: 44px;
    height: 44px;
    margin-bottom: 0.8rem;
}
.footer-tagline {
    color: var(--ink-soft);
    max-width: 38ch;
    margin: 0;
    font-size: 0.95rem;
}
.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.footer-nav a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.95rem;
}
.footer-nav a:hover { color: var(--accent); }
.footer-meta {
    grid-column: 1 / -1;
    padding-top: 1.6rem;
    margin: 1rem 0 0;
    border-top: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.footer-meta a { color: var(--ink-soft); }

/* ---------- 11. Responsive ---------- */
@media (max-width: 860px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-top: 2.5rem;
        padding-bottom: 2rem;
    }
    .hero-glyph { order: -1; }
    .hero-glyph .brand-mark { width: 120px; }

    .archive-avatar { width: 88px; height: 88px; }
    .archive-feature { width: 100%; height: 160px; }
}

@media (max-width: 720px) {
    body { font-size: 16px; }
    .section { padding: 3rem 1.25rem; }
    .post, .page { padding-top: 2rem; }
    .post-content { font-size: 1.05rem; line-height: 1.7; }

    .nav-toggle { display: flex; }
    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border-soft);
        padding: 1rem 1.5rem;
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), visibility var(--dur);
    }
    .site-nav.is-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    .nav-list { flex-direction: column; gap: 0.4rem; }
    .nav-item a { display: block; padding: 0.6em 0; border-bottom: 1px solid var(--border-soft); }

    .kg-bookmark-container { flex-direction: column-reverse; }
    .kg-bookmark-thumbnail { max-width: 100%; flex-basis: auto; min-height: 180px; }

    .kg-gallery-row { flex-direction: column; }

    .author-bio-inner { flex-direction: column; align-items: center; text-align: center; }
    .author-bio-avatar { width: 88px; height: 88px; }

    .site-footer-inner { grid-template-columns: 1fr; }
    .footer-meta { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 1100px) {
    .card-grid--latest { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .card-grid--featured { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
