/* ==========================================================================
   Hangar Eighteen. A magazine theme for Iron Road Press
   Palette: navy ink, document paper, oxidized amber
   Type: Fraunces (display), Spectral (body), IBM Plex Mono (control lines)
   ========================================================================== */

:root {
    --ink:        #11161d;   /* deep navy, masthead + headlines */
    --ink-soft:   #1b2530;
    --paper:      #efece4;   /* cool document paper, page background */
    --card:       #ffffff;   /* card and reading surface */
    --amber:      #9a6212;   /* oxidized brass accent */
    --amber-lift: #b97e22;   /* accent on dark backgrounds */
    --grey:       #5a6068;   /* secondary text */
    --grey-faint: #8a8f96;
    --hairline:   #cdc7ba;   /* rules on paper */
    --hairline-dk:#2c3744;   /* rules on navy */
    --text:       #1d2228;   /* body text on paper */

    --display: var(--gh-font-heading, "Fraunces", Georgia, "Times New Roman", serif);
    --body: var(--gh-font-body, "Spectral", Georgia, serif);
    --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

    --wrap: 1180px;
    --narrow: 720px;
    --gap: 2.4rem;
    --radius: 2px;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--text);
    font-family: var(--body);
    font-weight: 400;
    line-height: 1.62;
    font-feature-settings: "liga" 1, "onum" 1;
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--ink); }

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

p { margin: 0 0 1.2em; }

.screen-reader {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
}

/* ---------- layout wraps ---------- */
.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 1.6rem;
}
.wrap-narrow {
    width: 100%;
    max-width: var(--narrow);
    margin-left: auto;
    margin-right: auto;
    padding: 0 1.6rem;
}
.site-main { padding: clamp(2.5rem, 6vw, 5rem) 0 5rem; }

/* ---------- the signature: control line ---------- */
.control-line {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--amber);
    margin: 0 0 0.9rem;
}
.control-line.meta-faint { color: var(--grey-faint); }

/* ==========================================================================
   HEADER / MASTHEAD
   ========================================================================== */
.site-header {
    background: var(--ink);
    color: var(--paper);
    border-bottom: 3px solid var(--amber);
}
.site-header-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    padding-top: 2.2rem;
    padding-bottom: 1.6rem;
    flex-wrap: wrap;
}
.masthead-title {
    display: inline-block;
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(2rem, 5.2vw, 3.4rem);
    line-height: 0.98;
    letter-spacing: -0.02em;
    color: var(--paper);
}
.masthead-title:hover { color: #fff; }
.masthead-tagline {
    font-family: var(--body);
    font-style: italic;
    color: #c7ccd2;
    font-size: 1.02rem;
    margin: 0.5rem 0 0.6rem;
    max-width: 46ch;
}
.masthead-control {
    color: var(--amber-lift);
    margin: 0.5rem 0 0;
}

/* nav */
.site-nav { padding-bottom: 0.2rem; }
.nav-menu {
    list-style: none; margin: 0; padding: 0;
    display: flex; align-items: center; gap: 1.4rem;
    flex-wrap: wrap;
}
.nav-item a {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c7ccd2;
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
}
.nav-item a:hover { color: #fff; border-bottom-color: var(--amber-lift); }
.nav-cta a {
    color: var(--ink);
    background: var(--amber-lift);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius);
    border-bottom: none;
}
.nav-cta a:hover { background: #fff; color: var(--ink); }

.nav-toggle {
    display: none;
    background: none; border: 1px solid var(--hairline-dk);
    border-radius: var(--radius);
    width: 44px; height: 40px; cursor: pointer;
    position: relative;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
    content: ""; position: absolute; left: 11px; right: 11px; height: 2px;
    background: var(--paper); transition: transform 0.2s ease;
}
.nav-toggle-bar { top: 19px; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }

/* ==========================================================================
   HOMEPAGE. LEAD FEATURE
   ========================================================================== */
.lead-feature {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: clamp(1.6rem, 4vw, 3.4rem);
    align-items: center;
    padding-bottom: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
    border-bottom: 1px solid var(--hairline);
}
.lead-media {
    display: block;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: var(--ink);
    border-radius: var(--radius);
}
.lead-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.lead-media:hover img { transform: scale(1.025); }
.lead-noimg, .post-card-noimg {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    font-family: var(--display); color: var(--amber-lift);
    font-size: 1.4rem; text-align: center; padding: 1rem;
}
.lead-title {
    font-size: clamp(2rem, 4.4vw, 3.1rem);
    font-weight: 600;
    margin: 0.3rem 0 0.7rem;
}
.lead-title a { color: var(--ink); }
.lead-title a:hover { color: var(--amber); }
.lead-excerpt {
    font-size: 1.16rem;
    color: var(--ink-soft);
    margin-bottom: 1.3rem;
}
.read-link {
    font-family: var(--mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink);
    border-bottom: 2px solid var(--amber);
    padding-bottom: 3px;
}
.read-link:hover { color: var(--amber); }

/* feed header */
.feed-header {
    display: flex; align-items: baseline; gap: 1.2rem;
    margin-bottom: 2rem;
}
.feed-heading {
    font-size: 1rem;
    font-family: var(--mono);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--grey);
    white-space: nowrap;
    margin: 0;
}
.feed-rule { flex: 1; height: 1px; background: var(--hairline); }

/* ==========================================================================
   POST FEED GRID + CARDS
   ========================================================================== */
.post-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap) 2rem;
}
.post-card {
    display: flex; flex-direction: column;
    background: var(--card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.post-card:hover { border-color: var(--amber); transform: translateY(-2px); }
.post-card-media {
    display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--ink);
}
.post-card-media img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.post-card-body .control-line { margin-bottom: 0.6rem; }
.post-card-title {
    font-size: 1.32rem;
    line-height: 1.18;
    margin: 0 0 0.55rem;
}
.post-card-title a { color: var(--ink); }
.post-card-title a:hover { color: var(--amber); }
.post-card-excerpt {
    color: var(--grey);
    font-size: 0.97rem;
    margin-bottom: 1rem;
    flex: 1;
}
.post-card-body .meta-faint { margin: 0; }

/* ==========================================================================
   ARCHIVE (tag / author)
   ========================================================================== */
.archive-header { max-width: var(--narrow); margin: 0 auto 3rem; text-align: left; }
.archive-title { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 0.5rem; }
.archive-description { color: var(--grey); font-size: 1.1rem; margin-bottom: 1.4rem; }
.archive-header .feed-rule { display: block; width: 100%; }

/* ==========================================================================
   SINGLE POST
   ========================================================================== */
.post-header { padding-top: 0.5rem; text-align: center; }
.post-header .control-line { color: var(--amber); }
.post-title {
    font-size: clamp(2.2rem, 5.4vw, 3.6rem);
    line-height: 1.08;
    margin: 0.4rem 0 0.7rem;
}
.post-dek {
    font-family: var(--body);
    font-style: italic;
    font-size: 1.3rem;
    color: var(--grey);
    line-height: 1.4;
    margin: 0 auto 1rem;
    max-width: 38ch;
}
.post-byline { margin-top: 0.8rem; color: var(--grey-faint); }

.post-feature-image {
    margin: clamp(2rem, 4vw, 3rem) auto;
    max-width: var(--wrap);
    padding: 0 1.6rem;
}
.post-feature-image img {
    width: 100%; border-radius: var(--radius);
    max-height: 70vh; object-fit: cover;
}
.post-feature-image figcaption {
    font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.04em;
    color: var(--grey-faint); text-align: center; margin-top: 0.7rem;
}

/* ---------- reading content ---------- */
.post-content {
    font-size: 1.16rem;
    line-height: 1.72;
    color: var(--text);
}
.post-content > p:first-of-type::first-letter {
    font-family: var(--display);
    font-weight: 900;
    float: left;
    font-size: 3.6rem;
    line-height: 0.78;
    padding: 0.1rem 0.6rem 0 0;
    color: var(--amber);
}
.gh-content h2 { font-size: 1.85rem; margin: 2.4rem 0 0.8rem; }
.gh-content h3 { font-size: 1.4rem; margin: 2rem 0 0.6rem; }
.gh-content a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.gh-content a:hover { color: var(--ink); }
.gh-content blockquote {
    margin: 1.8rem 0;
    padding: 0.2rem 0 0.2rem 1.6rem;
    border-left: 3px solid var(--amber);
    font-style: italic;
    color: var(--ink-soft);
    font-size: 1.24rem;
}
.gh-content ul, .gh-content ol { padding-left: 1.3rem; margin: 0 0 1.3rem; }
.gh-content li { margin-bottom: 0.4rem; }
.gh-content hr {
    border: none; height: 1px; background: var(--hairline);
    margin: 2.6rem auto; width: 40%;
}
.gh-content img { margin: 1.8rem auto; border-radius: var(--radius); }
.gh-content figcaption {
    font-family: var(--mono); font-size: 0.74rem; color: var(--grey-faint);
    text-align: center; margin-top: 0.6rem;
}
.gh-content code {
    font-family: var(--mono); font-size: 0.86em;
    background: #e6e2d8; padding: 0.1em 0.35em; border-radius: 2px;
}
.gh-content pre {
    background: var(--ink); color: #e8eaed;
    padding: 1.2rem; border-radius: var(--radius); overflow-x: auto;
    font-family: var(--mono); font-size: 0.85rem; line-height: 1.55;
}
.gh-content pre code { background: none; padding: 0; }

/* Koenig cards that can run wider than the reading column */
.gh-content .kg-width-wide { max-width: 1020px; margin-left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full { max-width: 100vw; margin-left: 50%; transform: translateX(-50%); }

/* ---------- post footer ---------- */
.post-footer { margin-top: 3rem; }
.filed-under { padding-top: 1.4rem; border-top: 1px solid var(--hairline); }
.author-block {
    display: flex; gap: 1.1rem; align-items: flex-start;
    padding: 1.6rem 0; margin: 1rem 0 0;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
}
.author-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.author-block .control-line { margin-bottom: 0.3rem; }
.author-name { font-family: var(--display); font-size: 1.25rem; color: var(--ink); margin: 0 0 0.3rem; }
.author-bio { color: var(--grey); font-size: 0.98rem; margin: 0; }

/* ---------- subscribe CTA ---------- */
.subscribe-cta {
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--radius);
    padding: 2.4rem 2rem;
    text-align: center;
    margin: 2.6rem 0 0;
}
.subscribe-cta .control-line { color: var(--amber-lift); }
.subscribe-cta h2 { color: #fff; font-size: 1.7rem; margin-bottom: 0.6rem; }
.subscribe-cta p { color: #c7ccd2; max-width: 46ch; margin: 0 auto 1.4rem; }

/* buttons */
.button {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--amber);
    color: #fff;
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius);
    transition: background 0.2s ease;
}
.button:hover { background: var(--amber-lift); color: #fff; }
.button-light { background: var(--paper); color: var(--ink); }
.button-light:hover { background: #fff; color: var(--ink); }

/* read next */
.read-next { margin-top: clamp(3rem, 6vw, 5rem); }

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 2rem;
    margin: 3.5rem auto 0;
    font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em;
    text-transform: uppercase;
}
.pagination a { color: var(--ink); border-bottom: 2px solid var(--amber); padding-bottom: 3px; }
.pagination a:hover { color: var(--amber); }
.pagination .page-number { color: var(--grey); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    background: var(--ink);
    color: #c7ccd2;
    border-top: 3px solid var(--amber);
    margin-top: 4rem;
}
.site-footer-inner {
    display: flex; justify-content: space-between; gap: 2.5rem;
    padding: 3rem 1.6rem 3.4rem; flex-wrap: wrap;
}
.footer-title { font-family: var(--display); font-weight: 900; font-size: 1.7rem; color: var(--paper); margin: 0 0 0.5rem; }
.footer-brand .control-line { color: var(--amber-lift); margin-bottom: 1.1rem; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: 0.5rem; }
.footer-nav a {
    font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.05em;
    text-transform: uppercase; color: #c7ccd2;
}
.footer-nav a:hover { color: #fff; }
.footer-colophon .control-line { color: var(--grey-faint); margin-bottom: 0.4rem; }
.footer-colophon a { color: var(--amber-lift); }

/* ==========================================================================
   ERROR PAGE
   ========================================================================== */
.error-page { max-width: var(--narrow); text-align: center; padding: 4rem 1.6rem 6rem; }
.error-title { font-size: clamp(2.2rem, 6vw, 3.6rem); margin-bottom: 0.8rem; }
.error-text { color: var(--grey); font-size: 1.1rem; margin-bottom: 1.6rem; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .post-feed { grid-template-columns: repeat(2, 1fr); }
    .lead-feature { grid-template-columns: 1fr; }
    .lead-media { aspect-ratio: 16 / 9; }
}

@media (max-width: 640px) {
    html { font-size: 17px; }
    .post-feed { grid-template-columns: 1fr; }

    .site-header-inner { align-items: stretch; }
    .nav-toggle { display: block; align-self: flex-start; margin-top: 1rem; }
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--hairline-dk);
    }
    body.nav-open .nav-menu { display: flex; }
    .nav-cta a { display: inline-block; }

    .post-content > p:first-of-type::first-letter { font-size: 3rem; }
    .site-footer-inner { flex-direction: column; gap: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .lead-media:hover img { transform: none; }
}
