/* ═══════════════════════════════════════════════════════════════
   FROM ZERO TO AI – Custom Ghost Theme
   Style: Art-Journal · Cream-Paper · Calligraphy · Ink ornaments
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
    /* Colors */
    --bg:           #faf7f2;        /* warm cream */
    --bg-card:      #f5f0e8;        /* card area, slightly darker */
    --bg-hero:      #f0ead8;        /* hero area */
    --ink:          #1c160e;        /* main text, near black */
    --ink-mid:      #4a3f30;        /* secondary text */
    --ink-light:    #8c7b68;        /* metadata, muted */
    --accent-gold:  #b8913a;        /* gold accent */
    --accent-teal:  #3d7d78;        /* teal accent */
    --accent-rose:  #9c4a4a;        /* warm red for quotes */
    --border:       rgba(28,22,14,0.12);
    --ornament:     #5a4a36;        /* ink ornaments */

    /* Typography */
    --font-head:    'Cormorant Garamond', 'Georgia', serif;
    --font-body:    'Lora', 'Georgia', serif;
    --font-small:   'Cormorant SC', 'Georgia', serif;
    --font-ui:      'Cormorant Garamond', serif;

    /* Dimensions */
    --max-width:    780px;
    --max-width-wide: 1100px;
    --gap:          2rem;
    --radius:       3px;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 18px; scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.75;
    min-height: 100vh;
    position: relative;
}

/* Background image – opacity controllable independently of content */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('../img/blog-bg.jpg');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    opacity: 0.70;
    z-index: -1;
    pointer-events: none;
}

/* Subtle paper texture overlay */
.paper-texture {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
    opacity: 0.6;
}

/* ── Links ──────────────────────────────────────────────────── */
a {
    color: var(--accent-teal);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--accent-gold); }

/* ── Ornaments ──────────────────────────────────────────────── */
.ornament {
    color: var(--ornament);
    display: flex;
    justify-content: center;
    margin: 1rem auto;
    max-width: 600px;
    opacity: 0.7;
}
.ornament svg { width: 100%; height: auto; }
.ornament--top { margin-bottom: 0.4rem; }
.ornament--subtitle { margin-top: 0.4rem; }
.ornament--footer { margin-top: 0; opacity: 0.5; }
.ornament--post-header { margin: 1.5rem auto 2rem; max-width: 400px; }
.ornament--post-footer { margin: 2.5rem auto 1.5rem; max-width: 400px; }

/* ── Filigree corner ornaments ──────────────────────────────── */
.corner-ornament {
    position: absolute;
    width: 192px;
    height: 192px;
    overflow: visible;
    color: var(--ornament);
    pointer-events: none;
    z-index: 5;
    opacity: 0.75;
}
.corner-ornament--left {
    top: 0; left: 0;
}
.corner-ornament--right {
    top: 0; right: 0;
    transform: scaleX(-1);
}
@media (max-width: 768px) {
    .corner-ornament { width: 115px; height: 115px; opacity: 0.5; }
}

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
    position: relative;
    z-index: 10;
    overflow: visible;
    padding: 2rem 1.5rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(to bottom, var(--bg-hero) 0%, var(--bg) 100%);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.site-title-link { text-decoration: none; }

/* ── Generated PNG header (desktop) ── */
.site-header-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    -webkit-mask-image:
        linear-gradient(to right,  transparent 0px, black 8px, black calc(100% - 8px), transparent 100%),
        linear-gradient(to bottom, transparent 0px, black 8px, black calc(100% - 8px), transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to right,  transparent 0px, black 8px, black calc(100% - 8px), transparent 100%),
        linear-gradient(to bottom, transparent 0px, black 8px, black calc(100% - 8px), transparent 100%);
    mask-composite: intersect;
}

/* Mobile fallback hidden always – PNG header shown on all screen sizes */
.site-header-mobile { display: none; }

@media (max-width: 639px) {
    .ornament--desktop-only { display: none; }
}

.site-title {
    font-family: var(--font-head);
    font-size: clamp(2.2rem, 5.5vw, 4rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
    line-height: 1;
    text-shadow: 1px 1px 0 rgba(28,22,14,0.08);
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.0rem;
}

.title-row--2 {
    padding-left: 0;
}

.title-from {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--ink-mid);
    font-style: italic;
}

.title-badge {
    display: inline-block;
    flex-shrink: 0;
    flex-grow: 0;
    line-height: 0;
}

.badge-svg {
    display: block;
    color: var(--ornament);
    overflow: visible;
}

/* Badge images: plaque + MAF */
.badge-img { display: block; height: auto; }
.badge-img--it  { width: clamp(220px, 32vw, 500px); }
.badge-img--maf { width: clamp(270px, 42vw, 620px); }

/* Rainbow animation for "AI" in the tagline */
@keyframes ai-rainbow {
    0%   { color: #e03333; }
    16%  { color: #e08020; }
    33%  { color: #b0c020; }
    50%  { color: #30b050; }
    66%  { color: #2080d0; }
    83%  { color: #8030c0; }
    100% { color: #e03333; }
}
.ai-rainbow {
    animation: ai-rainbow 3s linear infinite;
    font-style: italic;
}

/* Fine gold underline */
.site-title::after {
    content: '';
    display: block;
    height: 2px;
    width: 60%;
    margin: 0.35rem auto 0;
    background: linear-gradient(to right, transparent, var(--accent-gold), transparent);
    opacity: 0.6;
}

.site-subtitle {
    font-family: var(--font-head);
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 500;
    font-style: italic;
    letter-spacing: 0.03em;
    color: var(--ink-mid);
    margin-top: 0.4rem;
    text-shadow: 1px 1px 0 rgba(28,22,14,0.06);
}

.site-logo { max-height: 80px; width: auto; }

/* Navigation */
.site-nav {
    margin-top: 1.2rem;
    padding: 0.55rem 2rem 0.75rem;
    background: rgba(240, 234, 216, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 8px;
    border: 1px solid rgba(184, 145, 58, 0.18);
}

.nav-list,
.nav-list .nav {
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.2rem 3.5rem;
    padding: 0;
    margin: 0;
}

.nav-list li a {
    font-family: var(--font-small);
    font-size: 1.275rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-mid);
    padding: 0.3rem 0;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.nav-list li a:hover {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

/* ── Hero ────────────────────────────────────────────────────── */
.home-hero {
    position: relative;
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.12;
    filter: sepia(40%);
}

.hero-text { position: relative; z-index: 1; }

.hero-tagline {
    font-family: var(--font-head);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 300;
    font-style: italic;
    color: var(--ink-mid);
    letter-spacing: 0.03em;
}

/* ── Blog Layout (Sidebar + Content) ────────────────────────── */
.blog-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    gap: 3rem;
    align-items: start;
}

.blog-main { min-width: 0; }

/* ── Sidebar ──────────────────────────────────────────────────── */
.blog-sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar-inner {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.2rem 1.6rem;
    position: relative;
    overflow: hidden;
}

/* Decorative ornament top-left in the sidebar */
.sidebar-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 60px; height: 60px;
    background-image: url("data:image/svg+xml,<svg viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%235a4a36'> <path d='M2 75 C8 58 28 25 75 2' stroke-width='0.7' opacity='0.45'/> <path d='M2 60 C10 46 30 18 60 2' stroke-width='0.55' opacity='0.38'/> <path d='M2 45 C12 35 35 12 45 2' stroke-width='0.4' opacity='0.28'/> <path d='M2 80 C4 70 12 55 25 42 C32 35 38 28 36 18 C34 9 25 10 27 17 C29 24 36 22 34 14 C32 7 24 10 26 17' stroke-width='0.5' opacity='0.55'/> <path d='M42 18 C46 11 53 5 57 9 C61 13 57 20 51 18 C45 16 44 10 48 7 C52 4 57 7 58 12' stroke-width='0.45' opacity='0.5'/> <path d='M10 52 C6 43 4 33 8 24 C12 15 19 20 16 27 C13 34 7 31 9 24' stroke-width='0.45' opacity='0.5'/> <path d='M9 14 C12 9 17 6 18 10 C19 14 16 18 12 16 C9 14 10 10 13 9' stroke-width='0.42' opacity='0.48'/> <circle cx='27' cy='17' r='1.0' fill='%235a4a36' opacity='0.42'/> <circle cx='9' cy='2' r='0.6' fill='%235a4a36' opacity='0.32'/> <circle cx='2' cy='9' r='0.6' fill='%235a4a36' opacity='0.32'/> </svg>");
    background-repeat: no-repeat;
    background-size: 60px 60px;
    pointer-events: none;
    opacity: 0.5;
}

.sidebar-heading {
    font-family: var(--font-small);
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-light);
    margin-bottom: 0.6rem;
}

.sidebar-ornament {
    color: var(--ornament);
    margin-bottom: 1rem;
    opacity: 0.6;
}
.sidebar-ornament svg { width: 100%; max-width: 120px; height: auto; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sidebar-story-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--ink-mid);
    padding: 0.42rem 0.5rem;
    border-radius: var(--radius);
    border-left: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.sidebar-story-link:hover {
    color: var(--accent-gold);
    border-left-color: var(--accent-gold);
    background: rgba(184,145,58,0.06);
}

.sidebar-story-icon {
    font-size: 0.65rem;
    color: var(--ink-light);
    flex-shrink: 0;
    transition: color 0.2s;
}
.sidebar-story-link:hover .sidebar-story-icon { color: var(--accent-gold); }

.sidebar-story-name { flex: 1; }

.sidebar-count {
    font-family: var(--font-small);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--ink-light);
    background: rgba(28,22,14,0.07);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    flex-shrink: 0;
}

/* ── Post Feed ──────────────────────────────────────────────── */
.post-feed-wrapper {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.section-label {
    text-align: center;
    margin: 2rem 0 2rem;
    position: relative;
}

.section-label__text {
    font-family: var(--font-small);
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-light);
    background: var(--bg);
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.section-label::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 1px;
    background: var(--border);
}

.post-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.post-feed--small {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* ── Post Card ──────────────────────────────────────────────── */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}

/* Hairline corner ornaments */
.post-card::before,
.post-card::after {
    content: '';
    position: absolute;
    width: 80px; height: 80px;
    pointer-events: none;
    z-index: 2;
    background-image: url("data:image/svg+xml,<svg viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%235a4a36'> <path d='M2 75 C8 58 28 25 75 2' stroke-width='0.7' opacity='0.45'/> <path d='M2 60 C10 46 30 18 60 2' stroke-width='0.55' opacity='0.38'/> <path d='M2 45 C12 35 35 12 45 2' stroke-width='0.4' opacity='0.28'/> <path d='M2 80 C4 70 12 55 25 42 C32 35 38 28 36 18 C34 9 25 10 27 17 C29 24 36 22 34 14 C32 7 24 10 26 17' stroke-width='0.5' opacity='0.55'/> <path d='M42 18 C46 11 53 5 57 9 C61 13 57 20 51 18 C45 16 44 10 48 7 C52 4 57 7 58 12' stroke-width='0.45' opacity='0.5'/> <path d='M10 52 C6 43 4 33 8 24 C12 15 19 20 16 27 C13 34 7 31 9 24' stroke-width='0.45' opacity='0.5'/> <path d='M16 46 C20 37 23 27 20 18' stroke-width='0.35' opacity='0.38'/> <path d='M34 26 C39 18 43 10 41 3' stroke-width='0.35' opacity='0.33'/> <path d='M5 66 C3 56 5 45 3 36' stroke-width='0.3' opacity='0.28'/> <path d='M3 18 C6 12 11 6 9 2' stroke-width='0.38' opacity='0.42'/> <path d='M18 3 C13 6 7 11 2 9' stroke-width='0.38' opacity='0.42'/> <path d='M9 14 C12 9 17 6 18 10 C19 14 16 18 12 16 C9 14 10 10 13 9' stroke-width='0.42' opacity='0.48'/> <path d='M48 8 C52 3 59 1 61 5 C63 9 59 14 53 11 C49 9 50 5 54 4' stroke-width='0.38' opacity='0.42'/> <path d='M28 36 C33 28 36 20 33 12' stroke-width='0.32' opacity='0.32'/> <path d='M60 8 C64 4 70 2 72 6 C74 10 70 14 65 12' stroke-width='0.32' opacity='0.3'/> <path d='M6 38 C4 30 6 22 4 14' stroke-width='0.28' opacity='0.25'/> <circle cx='27' cy='17' r='1.0' fill='%235a4a36' opacity='0.42'/> <circle cx='58' cy='12' r='0.8' fill='%235a4a36' opacity='0.36'/> <circle cx='8' cy='24' r='0.8' fill='%235a4a36' opacity='0.36'/> <circle cx='41' cy='3' r='0.7' fill='%235a4a36' opacity='0.32'/> <circle cx='3' cy='36' r='0.6' fill='%235a4a36' opacity='0.28'/> <circle cx='9' cy='2' r='0.6' fill='%235a4a36' opacity='0.32'/> <circle cx='2' cy='9' r='0.6' fill='%235a4a36' opacity='0.32'/> </svg>");
    background-repeat: no-repeat;
    background-size: 80px 80px;
}
.post-card::before {
    top: 0; left: 0;
    background-position: top left;
}
.post-card::after {
    bottom: 0; right: 0;
    background-position: bottom right;
    transform: rotate(180deg);
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(28,22,14,0.10);
}

.post-card-image-link { display: block; overflow: hidden; }

.post-card-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    transition: transform 0.35s ease;
    filter: sepia(15%);
}
.post-card:hover .post-card-image { transform: scale(1.03); filter: sepia(0%); }

.post-card-content { padding: 1.4rem; flex: 1; display: flex; flex-direction: column; }

.post-card-tag a {
    font-family: var(--font-small);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-teal);
    display: block;
    margin-bottom: 0.5rem;
}

.post-card-title {
    font-family: var(--font-head);
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 0.6rem;
}
.post-card-title a { color: var(--ink); }
.post-card-title a:hover { color: var(--accent-gold); }

.post-card-excerpt {
    font-size: 0.92rem;
    color: var(--ink-mid);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1rem;
}

.post-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-small);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: var(--ink-light);
    border-top: 1px solid var(--border);
    padding-top: 0.8rem;
    margin-top: auto;
}

/* ── Single Article ─────────────────────────────────────────── */
/* ── Paper texture on all main areas ────────────────────────── */
.post-single,
.post-comments,
.page-single,
.sidebar-inner,
.site-header,
.site-footer {
    position: relative;
}

.post-single::after,
.post-comments::after,
.page-single::after,
.site-header::after,
.site-footer::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background-image:
        /* Darker parchment spots */
        radial-gradient(ellipse 55% 35% at 12% 20%, rgba(110, 75, 25, 0.22) 0%, transparent 70%),
        radial-gradient(ellipse 40% 50% at 88% 80%, rgba(95, 65, 20, 0.20) 0%, transparent 65%),
        radial-gradient(ellipse 30% 40% at 75% 12%, rgba(120, 85, 30, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 25% 35% at 5%  75%, rgba(100, 70, 20, 0.16) 0%, transparent 55%),
        /* Lighter areas – like faded parchment */
        radial-gradient(ellipse 50% 45% at 50% 48%, rgba(255, 248, 220, 0.35) 0%, transparent 65%),
        radial-gradient(ellipse 35% 30% at 28% 85%, rgba(250, 238, 195, 0.25) 0%, transparent 55%),
        /* Edges darker – typical for old parchment */
        radial-gradient(ellipse 100% 100% at 50% 50%, transparent 45%, rgba(90, 60, 20, 0.22) 100%),
        /* Paper fibers */
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 3px,
            rgba(90, 65, 30, 0.07) 3px,
            rgba(90, 65, 30, 0.07) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 5px,
            rgba(90, 65, 30, 0.04) 5px,
            rgba(90, 65, 30, 0.04) 6px
        );
    z-index: 0;
}

.sidebar-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background-image:
        radial-gradient(ellipse 55% 35% at 12% 20%, rgba(110, 75, 25, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 40% 50% at 88% 80%, rgba(95, 65, 20, 0.07) 0%, transparent 65%),
        radial-gradient(ellipse 50% 45% at 50% 48%, rgba(255, 248, 220, 0.12) 0%, transparent 65%),
        radial-gradient(ellipse 100% 100% at 50% 50%, transparent 55%, rgba(90, 60, 20, 0.08) 100%),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 3px,
            rgba(90, 65, 30, 0.03) 3px,
            rgba(90, 65, 30, 0.03) 4px
        );
    z-index: 0;
}

.post-single {
    max-width: var(--max-width);
    padding: 2rem 2rem 4rem;
    background: rgba(250, 247, 242, 0.72);
    border-radius: 4px;
    box-shadow: 0 2px 24px rgba(28, 22, 14, 0.08);
}

.page-single {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
    background: rgba(250, 247, 242, 0.72);
    border-radius: 4px;
    box-shadow: 0 2px 24px rgba(28, 22, 14, 0.08);
}

.post-header { text-align: center; margin-bottom: 2rem; }

.post-tag a {
    font-family: var(--font-small);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-teal);
    display: inline-block;
    margin-bottom: 0.8rem;
}

.post-title {
    font-family: var(--font-head);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: var(--ink);
    margin-bottom: 1rem;
}

.post-excerpt {
    font-family: var(--font-head);
    font-size: 1.15rem;
    font-style: italic;
    font-weight: 300;
    color: var(--ink-mid);
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-small);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--ink-light);
}

.post-feature-image {
    margin: 0 0 2.5rem;
    border-radius: var(--radius);
    overflow: hidden;
}
.post-feature-image img {
    width: 100%;
    height: auto;
    display: block;
    filter: sepia(10%);
    transition: filter 0.3s;
}
.post-feature-image:hover img { filter: sepia(0%); }
.post-feature-image figcaption {
    text-align: center;
    font-size: 0.82rem;
    font-style: italic;
    color: var(--ink-light);
    padding: 0.5rem;
}

/* ── Article Content ────────────────────────────────────────── */
.gh-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #0f0c08;
    font-weight: 500;
}

.gh-content h2, .gh-content h3, .gh-content h4 {
    font-family: var(--font-head);
    font-weight: 500;
    color: var(--ink);
    margin: 2.5rem 0 0.8rem;
    line-height: 1.25;
}
.gh-content h2 { font-size: 1.8rem; }
.gh-content h3 { font-size: 1.4rem; }
.gh-content h4 { font-size: 1.15rem; }

.gh-content p { margin-bottom: 1.6rem; }
.gh-content hr { display: none; }

.gh-content blockquote {
    border-left: 2px solid var(--accent-rose);
    margin: 2rem 0;
    padding: 0.5rem 0 0.5rem 1.5rem;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--accent-rose);
    font-family: var(--font-head);
    font-weight: 400;
}

.gh-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    filter: sepia(8%);
    transition: filter 0.3s;
}
.gh-content img:hover { filter: sepia(0%); }

.gh-content code {
    font-size: 0.88em;
    background: rgba(28,22,14,0.07);
    padding: 0.15em 0.4em;
    border-radius: 2px;
    font-family: 'Courier New', monospace;
}

.gh-content pre {
    background: #1c160e;
    color: #f0ead8;
    padding: 1.2rem 1.4rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.88rem;
    line-height: 1.6;
}
.gh-content pre code { background: none; padding: 0; color: inherit; }

.gh-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 3rem auto;
    max-width: 200px;
}

.gh-content ul, .gh-content ol {
    margin: 0 0 1.4rem 1.5rem;
}
.gh-content li { margin-bottom: 0.4rem; }

/* ── Koenig Editor Cards ─────────────────────────────────────── */
.kg-width-wide {
    margin-left: -5vw;
    margin-right: -5vw;
    max-width: none;
}

.kg-width-full {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    width: 100vw;
}

.kg-image { display: block; max-width: 100%; }

.kg-image-card figcaption {
    text-align: center;
    font-size: 0.78rem;
    font-style: italic;
    font-weight: 400;
    color: var(--ink-mid);
    margin-top: 0.4rem;
    padding: 0 1rem;
}

/* ── Post Footer ─────────────────────────────────────────────── */
.post-footer { margin-top: 2rem; }

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}
.post-tag-link {
    font-family: var(--font-small);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-light);
    border: 1px solid var(--border);
    padding: 0.25rem 0.7rem;
    border-radius: 2px;
    transition: border-color 0.2s, color 0.2s;
}
.post-tag-link:hover {
    color: var(--accent-teal);
    border-color: var(--accent-teal);
}

.post-author {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
}
.author-avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    filter: sepia(15%);
}
.author-name {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.2rem;
}
.author-bio {
    font-size: 0.88rem;
    color: var(--ink-mid);
    line-height: 1.6;
}

/* ── About photo with tape strips ───────────────────────────── */
.about-photo-wrap {
    float: right;
    margin: 0.5rem 0 1.5rem 2rem;
    padding-top: 18px;   /* space for tape strip at top */
    position: relative;
}

.about-photo {
    position: relative;
    display: inline-block;
    transform: rotate(-4deg);
}

.about-photo img {
    display: block;
    width: 140px;
    border: 5px solid #f5f0e8;
    outline: 1px solid rgba(120, 85, 30, 0.30);
    box-shadow: 3px 5px 16px rgba(0, 0, 0, 0.40);
    border-radius: 1px;
}

/* Tape strips */
.about-photo::before,
.about-photo::after {
    content: '';
    position: absolute;
    width: 52px;
    height: 18px;
    background: linear-gradient(
        105deg,
        rgba(255, 255, 248, 0.75) 0%,
        rgba(230, 228, 205, 0.60) 40%,
        rgba(255, 255, 248, 0.70) 100%
    );
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.20);
    z-index: 3;
}

.about-photo::before {
    top: -14px;
    left: 8px;
    transform: rotate(-5deg);
}

.about-photo::after {
    top: -14px;
    right: 8px;
    transform: rotate(6deg);
}

/* Clearfix after the float */
.about-photo-wrap + * { }
.gh-content::after {
    content: '';
    display: table;
    clear: both;
}

/* ── Projects ────────────────────────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.8rem;
    margin-top: 2rem;
}

.project-card {
    position: relative;
    background: rgba(250, 247, 242, 0.82);
    border-radius: 4px;
    padding: 1.6rem;
    box-shadow: 0 2px 12px rgba(90, 65, 30, 0.12), inset 0 0 0 1px rgba(120, 85, 30, 0.14);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(90, 65, 30, 0.18), inset 0 0 0 1px rgba(120, 85, 30, 0.18);
    text-decoration: none;
    color: inherit;
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background-image:
        radial-gradient(ellipse 55% 35% at 12% 20%, rgba(110, 75, 25, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 40% 50% at 88% 80%, rgba(95, 65, 20, 0.15) 0%, transparent 65%),
        radial-gradient(ellipse 50% 45% at 50% 48%, rgba(255, 248, 220, 0.28) 0%, transparent 65%),
        radial-gradient(ellipse 100% 100% at 50% 50%, transparent 50%, rgba(90, 60, 20, 0.16) 100%);
    z-index: 0;
}

.project-card-icon {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    position: relative;
    z-index: 1;
}

.project-card-title {
    font-family: var(--font-head);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.project-card-desc {
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--ink-light);
    line-height: 1.6;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.project-card-status {
    display: inline-block;
    font-family: var(--font-small);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    position: relative;
    z-index: 1;
}

.project-card-status--active {
    background: rgba(61, 125, 120, 0.15);
    color: var(--accent-teal);
    border: 1px solid rgba(61, 125, 120, 0.3);
}

.project-card-status--wip {
    background: rgba(184, 145, 58, 0.12);
    color: var(--accent-gold);
    border: 1px solid rgba(184, 145, 58, 0.3);
}

/* ── Back Navigation & Project Detail ───────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-small);
    font-size: 0.85rem;
    color: var(--accent-teal);
    text-decoration: none;
    margin-bottom: 2rem;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.back-link:hover { opacity: 1; text-decoration: none; color: var(--accent-teal); }

.project-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.project-detail-icon { font-size: 2.5rem; }

.project-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1.5rem 0;
}

.project-feature-list {
    padding-left: 1.2rem;
    margin: 1rem 0 1.5rem;
    line-height: 1.9;
}

.project-tech {
    font-family: var(--font-small);
    font-size: 0.82rem;
    color: var(--ink-light);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1.5rem;
}

/* ── Read More ───────────────────────────────────────────────── */
.post-comments {
    margin-top: 2rem;
    padding: 2rem 2rem 2.5rem;
    background: rgba(250, 247, 242, 0.82);
    border-radius: 4px;
    box-shadow: 0 1px 8px rgba(90, 65, 30, 0.10), inset 0 0 0 1px rgba(120, 85, 30, 0.12);
}

.read-more {
    padding: 0 0 3rem;
}

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 3rem 0 0;
    font-family: var(--font-small);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}
.pagination a {
    color: var(--ink-mid);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: var(--radius);
    transition: border-color 0.2s, color 0.2s;
}
.pagination a:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 1.5rem 2.5rem;
    text-align: center;
    background: var(--bg-hero);
}
.footer-copy, .footer-powered {
    font-family: var(--font-small);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--ink-light);
    margin-top: 0.5rem;
}
.footer-copy a { color: var(--ink-light); }
.footer-copy a:hover { color: var(--accent-gold); }

/* ── Error Page ──────────────────────────────────────────────── */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem;
    text-align: center;
}
.error-code {
    font-family: var(--font-head);
    font-size: 6rem;
    font-weight: 300;
    color: var(--ink-light);
    line-height: 1;
}
.error-message {
    font-family: var(--font-head);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--ink-mid);
    margin: 1rem 0;
}
.btn-home {
    display: inline-block;
    margin-top: 1.5rem;
    font-family: var(--font-small);
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-teal);
    border: 1px solid var(--accent-teal);
    padding: 0.5rem 1.4rem;
    border-radius: var(--radius);
    transition: background 0.2s, color 0.2s;
}
.btn-home:hover { background: var(--accent-teal); color: #fff; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .blog-layout {
        grid-template-columns: 1fr;
        padding: 1.5rem 1rem 3rem;
        gap: 0;
    }
    .blog-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
    .sidebar-inner {
        padding: 1rem;
    }
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .sidebar-story-link {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 0.3rem 0.6rem;
        background: rgba(28,22,14,0.04);
        border-radius: var(--radius);
    }
    .sidebar-story-link:hover {
        border-left-color: transparent;
        border-bottom-color: var(--accent-gold);
    }
    .sidebar-count { display: none; }
}

@media (max-width: 640px) {
    .post-feed { grid-template-columns: 1fr; }
    .post-single { padding: 1.5rem 1rem 2rem; }
    .page-single { padding: 2rem 1rem 3rem; }
    .site-header { padding: 1.5rem 1rem 0; }

    /* Nav stays on one line – reduce gap and font to fit on narrow screens */
    .nav-list,
    .nav-list .nav {
        flex-wrap: nowrap;
        gap: 0.2rem 1.2rem;
    }
    .nav-list li a {
        font-size: 0.95rem;
    }

    /* iOS Safari: background-attachment:fixed causes blank screen on scroll */
    body::before {
        background-attachment: scroll;
    }
}

@media (max-width: 480px) {
    /* Badges too wide on small phones (320–375px) */
    .badge-img--it  { width: clamp(160px, 48vw, 220px); }
    .badge-img--maf { width: clamp(200px, 60vw, 270px); }

    /* Float clears on narrow screens – photo stacks above text instead of beside it */
    .about-photo-wrap {
        float: none;
        margin: 0 auto 1.5rem;
        text-align: center;
    }

    /* Nav font smaller on very small screens */
    .nav-list li a {
        font-size: 0.8rem;
        letter-spacing: 0.08em;
    }
    .nav-list,
    .nav-list .nav {
        gap: 0.2rem 0.8rem;
    }

    /* Tighten blog layout padding */
    .blog-layout {
        padding: 1rem 0.75rem 2.5rem;
    }

    /* Post/page content: full bleed feel with minimal padding */
    .post-single { padding: 1.25rem 0.75rem 2rem; }
    .page-single { padding: 1.5rem 0.75rem 2.5rem; }
}
