/* =====================================================================
   Not A Tech Guy — a broadsheet newspaper theme for Ghost
   Palette:  Royal blue  #0000CD  (name, rules, links, section nav)
             Paper white #FFFFFF  (background)
             Onyx        #353839  (underlines, shadows, hairlines)
             Ink black   #000000  (body text)
   ===================================================================== */

:root {
    --royal:   #0000CD;
    --royal-d: #00009e;
    --paper:   #FFFFFF;
    --onyx:    #353839;
    --ink:     #000000;
    --muted:   #55585a;
    --hair:    rgba(53, 56, 57, 0.28);   /* onyx hairline */
    --hair-2:  rgba(53, 56, 57, 0.14);
    --shadow:  0 2px 0 var(--onyx), 0 14px 32px -18px rgba(53, 56, 57, 0.55);

    /* Custom-font support: Ghost injects --gh-font-heading / --gh-font-body
       when the user picks fonts in admin; we fall back to our broadsheet stack. */
    --font-display: var(--gh-font-heading, 'Playfair Display', Georgia, 'Times New Roman', serif);
    --font-serif:   var(--gh-font-body, 'Source Serif 4', Georgia, 'Times New Roman', serif);
    --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

    --wrap: 1180px;
    --gap:  clamp(20px, 3vw, 40px);
}

/* ---- reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--royal); text-decoration: none; }
a:hover { color: var(--royal-d); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.12; color: var(--ink); }
p { margin: 0 0 1.1em; }

.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1 0 auto; width: 100%; }

/* =====================================================================
   Utility bar
   ===================================================================== */
.utility-bar {
    background: var(--paper);
    border-bottom: 1px solid var(--hair-2);
    font-family: var(--font-sans);
    font-size: 12px;
}
.utility-bar .inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 7px var(--gap);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.utility-date {
    display: flex; align-items: center; gap: 8px;
    color: var(--royal);
    font-weight: 600;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}
.utility-date .globe { color: var(--royal); font-size: 11px; }
.utility-date .sep { color: var(--hair); }
.utility-date .today { color: var(--ink); }
.utility-nav ul {
    list-style: none; margin: 0; padding: 0;
    display: flex; gap: 20px;
}
.utility-nav a {
    color: var(--royal);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 600;
    font-size: 11px;
}
.utility-nav a:hover { color: var(--royal-d); }

/* =====================================================================
   Masthead
   ===================================================================== */
.masthead { text-align: center; padding: 0; background: var(--paper); }
.masthead-rule { height: 3px; background: var(--royal); }
.masthead-rule.top { margin-top: 0; }
.masthead-rule.bottom { height: 1px; background: var(--onyx); }
.masthead-inner { max-width: var(--wrap); margin: 0 auto; padding: 22px var(--gap) 16px; }
.masthead-title {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 900;
    color: var(--ink);
    font-size: clamp(38px, 8vw, 82px);
    line-height: 0.98;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 0 rgba(53, 56, 57, 0.10);
}
.masthead-title:hover { color: var(--ink); }
.masthead-tagline {
    margin: 10px 0 0;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: 11px;
    font-weight: 500;
    color: var(--onyx);
}

/* =====================================================================
   Section navigation
   ===================================================================== */
.section-nav-wrap {
    position: sticky; top: 0; z-index: 40;
    background: var(--paper);
    border-bottom: 2px solid var(--onyx);
    box-shadow: 0 6px 18px -16px rgba(53, 56, 57, 0.8);
}
.section-nav {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gap);
}
.section-nav ul {
    list-style: none; margin: 0; padding: 0;
    display: flex; justify-content: center; flex-wrap: wrap;
}
.section-nav li { position: relative; }
.section-nav a {
    display: block;
    padding: 13px 18px;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.11em;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--royal);
    border-bottom: 3px solid transparent;
}
.section-nav a:hover { color: var(--royal-d); border-bottom-color: var(--royal); }

.menu-toggle { display: none; }

/* =====================================================================
   Front page
   ===================================================================== */
.front-page { max-width: var(--wrap); margin: 0 auto; padding: var(--gap); }

.lead-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--gap);
    padding-bottom: var(--gap);
    border-bottom: 3px double var(--onyx);
}

/* kicker / primary tag label */
.kicker {
    display: inline-block;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11px;
    font-weight: 700;
    color: var(--royal);
    margin-bottom: 8px;
    border-bottom: 2px solid var(--royal);
    padding-bottom: 2px;
}
.kicker.sm { font-size: 10px; margin-bottom: 6px; }
.kicker:hover { color: var(--royal-d); }

.lead-media { display: block; overflow: hidden; }
.lead-media img {
    width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
    box-shadow: var(--shadow);
    transition: transform .5s ease;
}
.lead-media:hover img { transform: scale(1.02); }
.lead-body { padding-top: 16px; }
.lead-title {
    font-family: var(--font-display);
    font-size: clamp(30px, 4.4vw, 50px);
    line-height: 1.03;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}
.lead-title a { color: var(--ink); }
.lead-title a:hover { color: var(--royal); }
.lead-excerpt { font-size: 20px; color: #1a1a1a; line-height: 1.5; }

.byline {
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--muted);
    display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
    margin-top: 12px;
}
.byline .author { color: var(--ink); font-weight: 600; }
.byline time, .byline .reading-time { position: relative; }
.byline .reading-time::before { content: "·"; margin-right: 14px; color: var(--hair); }
.byline.sm { font-size: 11.5px; margin-top: 8px; }

/* rail */
.lead-rail { padding-left: var(--gap); border-left: 1px solid var(--hair); }
.rail-heading {
    font-family: var(--font-sans);
    text-transform: uppercase; letter-spacing: 0.12em;
    font-size: 12px; font-weight: 700; color: var(--onyx);
    padding-bottom: 10px; margin-bottom: 14px;
    border-bottom: 2px solid var(--royal);
}
.rail-item { padding: 14px 0; border-bottom: 1px solid var(--hair-2); }
.rail-item:last-child { border-bottom: 0; }
.rail-title {
    font-family: var(--font-display);
    font-size: 21px; line-height: 1.15; font-weight: 700;
}
.rail-title a { color: var(--ink); }
.rail-title a:hover { color: var(--royal); }

/* =====================================================================
   Section heading + story grid
   ===================================================================== */
.section-heading {
    margin: calc(var(--gap) + 4px) 0 var(--gap);
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 14px; font-weight: 700; color: var(--onyx);
    display: flex; align-items: center; gap: 16px;
}
.section-heading::after {
    content: ""; flex: 1; height: 2px; background: var(--royal);
}
.section-heading span { position: relative; padding-left: 14px; }
.section-heading span::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 5px; height: 18px; background: var(--royal);
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}
.story-grid.wide { grid-template-columns: repeat(3, 1fr); }

.post-card { display: flex; flex-direction: column; }
.card-media { overflow: hidden; margin-bottom: 12px; }
.card-media img {
    width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
    box-shadow: 0 1px 0 var(--onyx), 0 10px 22px -16px rgba(53,56,57,0.5);
    transition: transform .5s ease;
}
.card-media:hover img { transform: scale(1.03); }
.card-title {
    font-family: var(--font-display);
    font-size: 22px; line-height: 1.13; margin-bottom: 8px;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--royal); }
.card-excerpt { font-size: 16px; color: #26292b; line-height: 1.5; margin-bottom: 10px; }

/* =====================================================================
   Article
   ===================================================================== */
.article { max-width: 1040px; margin: 0 auto; padding: var(--gap); }
.article-header { text-align: center; padding: 10px 0 4px; }
.article-header-inner { max-width: 700px; margin: 0 auto; }
.article-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1.05; letter-spacing: -0.01em;
    margin: 6px 0 14px;
}
.article-subtitle {
    font-family: var(--font-serif);
    font-size: 21px; color: var(--muted); font-style: italic;
    line-height: 1.45; margin-bottom: 16px;
}
.article-byline {
    font-family: var(--font-sans);
    font-size: 13px; color: var(--muted);
    display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px;
    padding: 14px 0; margin-top: 4px;
    border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
}
.article-byline .author { color: var(--ink); font-weight: 600; }
.article-byline .author a { color: var(--ink); }
.article-byline .reading-time::before { content: "·"; margin-right: 16px; color: var(--hair); }

.article-feature-image { margin: var(--gap) auto; max-width: 1000px; }
.article-feature-image img { width: 100%; box-shadow: var(--shadow); }
.article-feature-image figcaption {
    font-family: var(--font-sans); font-size: 12.5px; color: var(--muted);
    text-align: center; margin-top: 10px;
}

/* content typography — CSS grid gives a centered reading column while
   letting Koenig wide/full-width cards break out. */
.gh-content {
    font-size: 19px; line-height: 1.72;
    display: grid;
    grid-template-columns:
        [full-start] minmax(0, 1fr)
        [wide-start] minmax(0, 90px)
        [main-start] min(700px, 100%)
        [main-end] minmax(0, 90px)
        [wide-end] minmax(0, 1fr)
        [full-end];
}
.gh-content > * { grid-column: main-start / main-end; margin-top: 0; margin-bottom: 1.5rem; }
.gh-content > .kg-width-wide { grid-column: wide-start / wide-end; }
.gh-content > .kg-width-full { grid-column: full-start / full-end; }
.gh-content > .kg-width-full img { width: 100%; }
.gh-content a { color: var(--royal); text-decoration: underline; text-decoration-color: var(--onyx); text-underline-offset: 3px; }
.gh-content a:hover { text-decoration-color: var(--royal); }
.gh-content h2 {
    font-family: var(--font-display); font-size: 30px; line-height: 1.15;
    margin-top: 2.4rem; padding-bottom: 6px; border-bottom: 2px solid var(--royal);
}
.gh-content h3 { font-family: var(--font-display); font-size: 24px; margin-top: 2rem; }
.gh-content h4 { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.06em; font-size: 15px; }
.gh-content blockquote {
    margin: 1.8rem 0; padding: 4px 0 4px 24px;
    border-left: 4px solid var(--royal);
    font-family: var(--font-display); font-style: italic;
    font-size: 24px; line-height: 1.35; color: var(--ink);
}
.gh-content img, .gh-content .kg-card { box-shadow: 0 1px 0 var(--onyx), 0 12px 26px -18px rgba(53,56,57,0.55); }
.gh-content figcaption { font-family: var(--font-sans); font-size: 13px; color: var(--muted); text-align: center; margin-top: 8px; }
.gh-content hr { border: 0; border-top: 1px solid var(--hair); margin: 2.4rem 0; }
.gh-content ul, .gh-content ol { padding-left: 1.3em; }
.gh-content li { margin-bottom: 0.5em; }
.gh-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: #f2f2f6; padding: 2px 6px; border-radius: 3px; }
.gh-content pre { background: var(--onyx); color: #f5f5f5; padding: 18px; overflow-x: auto; border-radius: 4px; font-size: 15px; }
.gh-content pre code { background: transparent; padding: 0; }
.kg-bookmark-card, .kg-bookmark-container { border: 1px solid var(--hair); }

/* share bar */
.share-bar {
    max-width: 720px; margin: var(--gap) auto 0; padding: 18px 0;
    border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
    display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
}
.share-label {
    font-family: var(--font-sans); font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.12em; color: var(--onyx);
}
.share-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.share-btn {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--font-sans); font-size: 13px; font-weight: 600;
    color: var(--royal); background: none;
    border: 1.5px solid var(--royal); border-radius: 999px;
    padding: 7px 14px; cursor: pointer; line-height: 1; transition: all .15s ease;
}
.share-btn svg { display: block; }
.share-btn:hover { background: var(--royal); color: #fff; }
.share-btn.native { background: var(--royal); color: #fff; }
.share-btn.native:hover { background: var(--royal-d); }
.share-btn.copy.copied { background: var(--onyx); border-color: var(--onyx); color: #fff; }
@media (max-width: 620px) {
    .share-bar { flex-direction: column; align-items: flex-start; }
    .share-btn.x, .share-btn.fb, .share-btn.in { padding: 8px 11px; }
}

/* article footer */
.article-footer { max-width: 720px; margin: var(--gap) auto 0; padding-top: 20px; border-top: 3px double var(--onyx); }
.article-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.tag-pill {
    font-family: var(--font-sans); font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--royal); border: 1px solid var(--royal); padding: 5px 12px; border-radius: 999px;
}
.tag-pill:hover { background: var(--royal); color: #fff; }
.article-author-card { display: flex; gap: 16px; align-items: flex-start; }
.author-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--royal); }
.author-name { font-family: var(--font-sans); font-weight: 700; color: var(--ink); }
.author-bio { font-size: 16px; color: var(--muted); margin: 4px 0 0; }

/* read next */
.read-next { max-width: var(--wrap); margin: calc(var(--gap) * 1.4) auto 0; padding: 0 var(--gap) var(--gap); }

/* =====================================================================
   Archive (tag / author)
   ===================================================================== */
.archive { max-width: var(--wrap); margin: 0 auto; padding: var(--gap); }
.archive-header { text-align: center; padding: 12px 0 var(--gap); border-bottom: 3px double var(--onyx); margin-bottom: var(--gap); }
.archive-eyebrow { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.2em; font-size: 12px; font-weight: 600; color: var(--royal); }
.archive-title { font-family: var(--font-display); font-size: clamp(34px, 6vw, 60px); margin: 8px 0; }
.archive-description { font-size: 19px; color: var(--muted); max-width: 620px; margin: 0 auto 10px; }
.archive-count { font-family: var(--font-sans); font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--onyx); }

/* =====================================================================
   Empty state / error
   ===================================================================== */
.empty-state, .error-page { max-width: 640px; margin: 0 auto; padding: 80px var(--gap); text-align: center; }
.empty-state h1, .error-title { font-family: var(--font-display); font-size: clamp(30px, 5vw, 48px); margin-bottom: 14px; }
.error-code { font-family: var(--font-display); font-weight: 900; font-size: 96px; color: var(--royal); line-height: 1; }
.error-help { color: var(--muted); font-size: 19px; }
.error-home { font-family: var(--font-sans); font-weight: 600; display: inline-block; margin-top: 16px; }

/* =====================================================================
   Pagination
   ===================================================================== */
.pagination {
    max-width: var(--wrap); margin: 0 auto; padding: var(--gap);
    display: flex; align-items: center; justify-content: center; gap: 24px;
    font-family: var(--font-sans); font-size: 13px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    border-top: 1px solid var(--hair);
}
.pagination a { color: var(--royal); }
.pagination .page-number { color: var(--onyx); }

/* =====================================================================
   Footer
   ===================================================================== */
.site-footer { flex-shrink: 0; margin-top: calc(var(--gap) * 1.5); }
.footer-rule { height: 3px; background: var(--royal); }
.footer-inner {
    max-width: var(--wrap); margin: 0 auto;
    padding: var(--gap); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px;
}
.footer-title { font-family: var(--font-display); font-weight: 900; font-size: 30px; color: var(--ink); }
.footer-brand p { font-family: var(--font-sans); font-size: 13px; color: var(--muted); margin: 6px 0 0; max-width: 420px; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-nav a { font-family: var(--font-sans); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--royal); }
.footer-legal {
    max-width: var(--wrap); margin: 0 auto; padding: 16px var(--gap) 40px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    border-top: 1px solid var(--hair);
    font-family: var(--font-sans); font-size: 12px; color: var(--muted);
}
.footer-colophon a { color: var(--royal); }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 860px) {
    .lead-grid { grid-template-columns: 1fr; }
    .lead-rail { padding-left: 0; border-left: 0; border-top: 3px double var(--onyx); padding-top: 18px; margin-top: 4px; }
    .story-grid, .story-grid.wide { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    body { font-size: 17px; }
    .utility-nav { display: none; }
    .story-grid, .story-grid.wide { grid-template-columns: 1fr; }

    /* collapsible section nav */
    .section-nav-wrap { display: flex; align-items: center; padding: 0 var(--gap); }
    .menu-toggle {
        display: inline-flex; flex-direction: column; gap: 4px;
        background: none; border: 0; padding: 12px 0; cursor: pointer; margin-right: auto;
    }
    .menu-toggle span { width: 24px; height: 2px; background: var(--royal); display: block; }
    .section-nav {
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--paper); border-bottom: 2px solid var(--onyx);
        max-height: 0; overflow: hidden; transition: max-height .3s ease; padding: 0;
    }
    .section-nav.open { max-height: 70vh; }
    .section-nav ul { flex-direction: column; }
    .section-nav a { border-bottom: 1px solid var(--hair-2); text-align: center; }
    .footer-inner { flex-direction: column; }
}

/* ===== Email signup units (end-of-article + footer) ===== */
.signup-unit {
    max-width: 640px; margin: 44px auto 8px; padding: 34px 28px 30px;
    text-align: center; border-top: 3px solid var(--ink);
    border-bottom: 1px solid var(--hair);
}
.signup-kicker {
    font-family: var(--font-sans); font-size: 12px; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ghost-accent-color, #0000CD); margin: 0 0 10px;
}
.signup-title { font-family: var(--font-display); font-size: 30px; margin: 0 0 10px; }
.signup-sub { font-size: 17px; line-height: 1.55; color: var(--muted); margin: 0 auto 20px; max-width: 520px; }
.signup-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; position: relative; }
.signup-email {
    font-family: var(--font-sans); font-size: 15px; padding: 12px 14px;
    border: 1px solid var(--ink); border-radius: 2px; min-width: 260px;
    background: var(--paper); color: var(--ink);
}
.signup-email:focus { outline: 2px solid var(--ghost-accent-color, #0000CD); outline-offset: 1px; }
.signup-btn {
    font-family: var(--font-sans); font-size: 15px; font-weight: 700;
    padding: 12px 22px; border: 0; border-radius: 2px; cursor: pointer;
    background: var(--ghost-accent-color, #0000CD); color: #fff;
}
.signup-btn:hover { opacity: 0.88; }
.signup-form.loading .signup-btn { opacity: 0.6; pointer-events: none; }
.signup-msg { display: none; width: 100%; font-family: var(--font-sans); font-size: 14px; margin: 10px 0 0; }
.signup-form.success .signup-msg-success { display: block; color: #0a7a2f; }
.signup-form.success .signup-email, .signup-form.success .signup-btn { display: none; }
.signup-form.error .signup-msg-error { display: block; color: #b00020; }
.signup-note { font-family: var(--font-sans); font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }
.signup-form-footer { justify-content: flex-start; margin-top: 14px; }
.signup-form-footer .signup-email { min-width: 200px; font-size: 14px; padding: 9px 12px; }
.signup-form-footer .signup-btn { font-size: 14px; padding: 9px 16px; }
@media (max-width: 560px) {
    .signup-unit { padding: 28px 14px 24px; }
    .signup-email { min-width: 0; width: 100%; }
    .signup-btn { width: 100%; }
}
