/* ============================================================
   Monocle Ghost theme — screen.css
   Minimal, image-forward editorial theme (Uncrate spirit).
   Stark black-and-white palette. No framework, vanilla CSS.
   ============================================================ */

/* ---------- Brand tokens ---------- */
:root {
    --paper: #ffffff;        /* page background */
    --card: #ffffff;         /* card surfaces */
    --ink: #111111;          /* near-black text */
    --muted: #666666;        /* muted secondary text */
    --border: #e8e8e8;       /* light hairline borders */
    --paper-deep: #f4f4f4;   /* light gray for wells and hovers */
    --ink-soft: #333333;     /* softer black for hovers */

    --font-body: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-kicker: "Oswald", "Libre Franklin", sans-serif;

    --max-width: 1200px;
    --max-reading: 760px;
    --radius: 3px;
}

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

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

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

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

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }

/* Condensed eyebrow label used for section kickers and tag labels */
.kicker {
    font-family: var(--font-kicker);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 0.75rem;
}
.kicker a { color: var(--ink); }
.kicker a:hover { text-decoration: underline; }
.kicker-light { color: rgba(255, 255, 255, 0.65); }

/* ---------- Buttons ---------- */
.button {
    display: inline-block;
    font-family: var(--font-kicker);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffffff;
    background: var(--ink);
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    padding: 0.8rem 1.6rem;
    transition: background 0.2s ease, color 0.2s ease;
}
.button:hover { background: var(--ink-soft); border-color: var(--ink-soft); color: #ffffff; }

.button-light {
    background: transparent;
    border-color: #ffffff;
    color: #ffffff;
}
.button-light:hover { background: #ffffff; border-color: #ffffff; color: var(--ink); }

.button-subscribe {
    padding: 0.55rem 1.1rem;
    font-size: 0.78rem;
}

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

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 0.9rem;
    border-bottom: 2px solid var(--ink);
}
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
}
.section-link {
    font-family: var(--font-kicker);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
.section-link:hover { color: var(--ink); }

/* ---------- Topbar + sticky header ---------- */
.topbar {
    background: var(--ink);
    color: #ffffff;
    text-align: center;
    padding: 0.45rem 1rem;
}
.topbar-text {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    margin: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.25s ease;
}
.site-header.is-scrolled { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); }

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.wordmark {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-right: auto;
}

.site-nav { display: flex; gap: 1.35rem; }
.site-nav a {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink);
    position: relative;
    padding: 0.25rem 0;
}
.site-nav a::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 2px;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}
.site-nav a:hover::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 0.9rem; }

.search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    color: var(--ink);
    transition: background 0.2s ease;
}
.search-button:hover { background: var(--paper-deep); }

/* Hamburger, hidden on desktop */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px; height: 38px;
    align-items: center;
}
.nav-toggle span {
    display: block;
    width: 20px; height: 2px;
    background: var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Hero (featured story) ---------- */
.hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem 1rem;
}
.hero-feature {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 3rem;
    align-items: center;
}
.hero-image img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: var(--radius);
}
.hero-title {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.hero-title a:hover { text-decoration: underline; }
.hero-deck {
    font-size: 1.15rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
}
.hero-meta {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 1.75rem;
}

/* Slimmer editorial hero above the product feed */
.hero-slim { padding: 2rem 1.5rem 0.5rem; }
.hero-slim .hero-feature { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.hero-slim .hero-title { font-size: 1.9rem; }
.hero-slim .hero-deck { font-size: 1.05rem; margin-bottom: 1.5rem; }

/* Date shown beside "The Latest" section title */
.section-date {
    font-size: 0.88rem;
    color: var(--muted);
    white-space: nowrap;
    margin: 0;
}

/* Category chips under the feed section head */
.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}
.chip {
    font-family: var(--font-kicker);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Homepage sections + card grid ---------- */
.home-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 0.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.25rem 1.5rem;
}

/* ---------- Post card: borderless product-feed card ---------- */
.post-card {
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
}
.post-card:hover {
    transform: translateY(-3px);
}
.post-card-image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius);
}
.post-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    background: var(--paper-deep);
    color: var(--muted);
    font-weight: 700;
    font-size: 1.25rem;
    border-radius: var(--radius);
}
.post-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 0.75rem;
    margin-bottom: 0;
}
.post-card-title a:hover { text-decoration: underline; }

/* ---------- Newsletter band ---------- */
.newsletter-band {
    margin-top: 4rem;
    background: var(--ink);
    color: #ffffff;
    padding: 4rem 1.5rem;
    text-align: center;
}
.newsletter-inner { max-width: 620px; margin: 0 auto; }
.newsletter-title {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: #ffffff;
}
.newsletter-text {
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 1.75rem;
}
.newsletter-band-post { margin-top: 3rem; }

/* ---------- Ghost editor card widths (required) ---------- */
.post-content .kg-width-wide { max-width: 1020px; }
.post-content .kg-width-wide img { width: 100%; }
.post-content .kg-width-full { max-width: none; }
.post-content .kg-width-full img { width: 100%; }

/* ---------- Gallery slider (CSS scroll-snap, no JS) ----------
   A Ghost gallery card becomes a swipeable strip: one row of
   full-height images, snap on each image, hidden scrollbar. */
.post-content figure.kg-gallery-card {
    width: min(1020px, calc(100vw - 3rem));
    margin-left: 50%;
    transform: translateX(-50%);
}
.post-content .kg-gallery-container {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.post-content .kg-gallery-container::-webkit-scrollbar { display: none; }
.post-content .kg-gallery-row { display: contents; }
.post-content .kg-gallery-image {
    flex: 0 0 auto !important;
    height: 460px;
    scroll-snap-align: start;
}
.post-content .kg-gallery-image img {
    height: 100%;
    width: auto;
    max-width: none;
}
@media (max-width: 700px) {
    .post-content .kg-gallery-image { height: 300px; }
}

/* ---------- Single post ---------- */
.post-full { padding-bottom: 1rem; }

.post-header {
    max-width: var(--max-reading);
    margin: 0 auto;
    padding: 3.5rem 1.5rem 2rem;
    text-align: left;
}
.post-title {
    font-size: 2.6rem;
    margin-bottom: 1rem;
}
.post-deck {
    font-size: 1.2rem;
    color: var(--muted);
    margin-bottom: 1.75rem;
}

.byline {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}
.byline-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.byline-name { font-weight: 600; }
.byline-name:hover { text-decoration: underline; }
.byline-meta { font-size: 0.86rem; color: var(--muted); margin: 0; }

.post-hero {
    max-width: 1020px;
    margin: 0 auto 2.5rem;
    padding: 0 1.5rem;
}
.post-hero img {
    width: 100%;
    border-radius: var(--radius);
}
.post-hero figcaption {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.6rem;
}

/* Article body typography (Ghost outputs .gh-content) */
.post-content {
    max-width: var(--max-reading);
    margin: 0 auto;
    padding: 0 1.5rem;
    font-size: 1.08rem;
}
.post-content > * + * { margin-top: 1.5em; }
.post-content h2 { font-size: 1.7rem; margin-top: 2.2em; }
.post-content h3 { font-size: 1.35rem; margin-top: 2em; }
.post-content h4 { font-size: 1.1rem; margin-top: 1.8em; }
.post-content a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: var(--muted); }
.post-content blockquote {
    border-left: 3px solid var(--ink);
    padding: 0.25rem 0 0.25rem 1.25rem;
    font-size: 1.2rem;
    color: var(--muted);
    font-style: italic;
}
.post-content ul, .post-content ol { padding-left: 1.5rem; }
.post-content li + li { margin-top: 0.5em; }
.post-content img { border-radius: var(--radius); }
.post-content figure { margin: 2em 0; }
.post-content figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; text-align: center; }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }
.post-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9em;
    background: var(--paper-deep);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}
.post-content pre {
    background: var(--ink);
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
}
.post-content pre code { background: none; padding: 0; color: inherit; }

.post-footer {
    max-width: var(--max-reading);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 0;
}

.post-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.tag-pill {
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
}
.tag-pill:hover { border-color: var(--ink); color: var(--ink); }

.share-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.share-label {
    font-family: var(--font-kicker);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 0.25rem;
}
.share-link {
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: var(--radius);
    padding: 0.45rem 0.95rem;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.share-link:hover { border-color: var(--ink); color: var(--ink); }
.share-feedback { font-size: 0.85rem; color: var(--muted); }

.author-box {
    display: flex;
    gap: 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1rem;
}
.author-box-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.author-box .kicker { margin-bottom: 0.35rem; }
.author-box-name { font-size: 1.15rem; margin-bottom: 0.4rem; }
.author-box-name a:hover { text-decoration: underline; }
.author-box-bio { font-size: 0.95rem; color: var(--muted); margin: 0; }

/* Related posts */
.related-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem 0.5rem;
}

/* ---------- Static page ---------- */
.page-full { padding-bottom: 3rem; }
.page-header {
    max-width: var(--max-reading);
    margin: 0 auto;
    padding: 3.5rem 1.5rem 2rem;
}
.page-title { font-size: 2.4rem; margin-bottom: 0.75rem; }
.page-deck { font-size: 1.15rem; color: var(--muted); }

/* ---------- Archive pages (tag / author) ---------- */
.archive-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3.5rem 1.5rem 2rem;
    border-bottom: 2px solid var(--ink);
}
.archive-title { font-size: 2.4rem; margin-bottom: 0.6rem; }
.archive-description { font-size: 1.1rem; color: var(--muted); max-width: 640px; }
.archive-count, .archive-meta { font-size: 0.9rem; color: var(--muted); margin-top: 0.75rem; }
.archive-avatar {
    width: 84px; height: 84px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}
.card-grid-archive {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 0.5rem;
}

/* ---------- Pagination ---------- */
.pagination { padding: 2.5rem 1.5rem 3.5rem; }
.pagination-links {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.pagination-link { font-weight: 600; font-size: 0.95rem; }
.pagination-link:hover { color: var(--muted); }
.pagination-disabled { color: var(--border); cursor: default; }
.pagination-info { font-size: 0.88rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 4rem;
    border-top: 2px solid var(--ink);
    background: var(--card);
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3.5rem 1.5rem 2.5rem;
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 3rem;
}
.footer-brand .wordmark { font-size: 1.8rem; }
.footer-tagline { color: var(--muted); font-size: 0.95rem; margin-top: 0.75rem; max-width: 300px; }

.footer-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}
.footer-col { display: flex; flex-direction: column; gap: 0.55rem; }
.footer-heading {
    font-family: var(--font-kicker);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 0.35rem;
}
.footer-col a { font-size: 0.92rem; color: var(--muted); }
.footer-col a:hover { color: var(--ink); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
}
.copyright { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; }
.affiliate-note {
    font-size: 0.78rem;
    color: var(--muted);
    max-width: 720px;
    margin: 0 auto;
}

/* ---------- Error page ---------- */
.error-page {
    max-width: var(--max-reading);
    margin: 0 auto;
    padding: 5rem 1.5rem;
    text-align: center;
}
.error-title { font-size: 2.6rem; margin-bottom: 1rem; }
.error-text { color: var(--muted); margin-bottom: 0.5rem; }
.error-page .button { margin-top: 1.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-feature { grid-template-columns: 1fr; gap: 1.75rem; }
    .hero-title { font-size: 2rem; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-columns { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
    /* Mobile nav becomes a dropdown panel */
    .nav-toggle { display: flex; }
    .site-nav {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    }
    .site-header.nav-open .site-nav { display: flex; }
    .site-nav a {
        padding: 0.85rem 1.5rem;
        border-top: 1px solid var(--border);
    }
    .site-nav a::after { display: none; }
    .site-header { position: sticky; }
    .header-inner { gap: 1rem; padding: 0 1rem; }
    .wordmark { font-size: 1.4rem; }

    /* Hamburger to X */
    .site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
    .site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .card-grid { grid-template-columns: 1fr; }
    .post-title { font-size: 2rem; }
    .hero { padding-top: 2rem; }
    .author-box { flex-direction: column; }
    .newsletter-title { font-size: 1.6rem; }
    .footer-columns { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

@media (max-width: 480px) {
    .button-subscribe { display: none; }
    .footer-columns { grid-template-columns: 1fr; }
}
