/* Fork additions to Headline. Loaded as its own stylesheet right after
   Headline's built/screen.css (see default.hbs), so these rules override
   Headline's by order. Plain CSS, served as-is: no build step.

   Don't edit assets/css/screen.css or rebuild assets/built/: rebuilding with
   the published npm packages doesn't match upstream's build and silently
   undoes upstream fixes. Keep built/ exactly as upstream ships it. */

/* Date and Share row under the headline (partials/satire-post-meta.hbs) */
.gh-article-byline {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 16px;
    font-size: 1.3rem;
    color: var(--color-secondary-text);
    letter-spacing: -0.003em;
}

/* Hide homepage tag sections left empty because their posts already appear
   higher up (home.hbs, partials/topic-*.hbs) */
.gh-topic:not(:has(.gh-card)),
.gh-topic-list:not(:has(.gh-card)) {
    display: none;
}

/* Header logo: a definite height (Headline only caps it at 40px), so an SVG
   without width/height attributes can't collapse to 0 wide. Fits the existing
   header rows (80px desktop, 64px phone); a wide logo shrinks on narrow phones.
   aspect-ratio reserves its width before it loads: update it if the logo's shape changes. */
.gh-head-logo img {
    aspect-ratio: 485 / 80;
    height: 56px;
    max-height: none;
    width: auto;
    max-width: 100%;
    object-fit: contain; /* keep proportions when max-width kicks in */
}

@media (max-width: 767px) {
    .gh-head-logo img {
        height: 40px;
    }
}

/* Accessible gray text. Headline's #999 is 2.85:1 on white, under WCAG AA's 4.5:1,
   so on white it's #6b6b6b (5.33:1): dates, bylines, the tagline, captions, "Show
   more" links. The footer (#15171a) and the photo lightbox are dark, where a darker
   gray would fail instead, so they keep #999 (6.30:1 on the footer). Any new dark
   section that shows gray text needs the same reset. */
:root {
    --color-secondary-text: #6b6b6b;
}

.gh-foot,
.pswp {
    --color-secondary-text: #999;
}

/* Tagline under the logo (default.hbs). Centered under the centered desktop logo;
   on phones the logo sits left, so the tagline lines up with its left edge. The
   brand row grows to fit it instead of Headline's fixed 80px / 64px. */
.gh-head-brand-wrapper:has(.satire-tagline) {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.satire-tagline {
    margin: 0;
    color: var(--color-secondary-text);
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
}

#gh-head .gh-head-brand:has(.satire-tagline) {
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
}

@media (max-width: 767px) {
    .gh-head-brand-wrapper:has(.satire-tagline) {
        align-items: flex-start;
        gap: 4px;
    }

    .satire-tagline {
        font-size: 0.9rem;
        letter-spacing: 0.08em;
        text-align: left;
    }

    #gh-head .gh-head-brand:has(.satire-tagline) {
        padding-top: 10px;
        padding-bottom: 10px;
    }
}

/* Tighter page spacing: 40px (32px on phones) under the header and around the
   sign-up banner, 64px (48px on phones) above the footer. Headline's values were
   80px (64px) under the header and 200px (184px) above the footer.
   Static pages set their own spacing with more specific rules. */
.gh-main {
    padding-top: 40px;
    padding-bottom: 64px;
}

.gh-foot {
    margin-top: 0;
}

/* Without the footer CTA, match the 32px below the footer menu (Headline: 80px,
   64px on phones) */
.gh-foot:not(:has(.gh-subscribe)) {
    padding-top: 32px;
}

/* Members don't need the footer's Subscribe link. Ghost builds the nav-subscribe
   class from the label in Settings → Navigation, so renaming the link means
   updating these two rules. With no other links, the empty menu goes too. */
.gh-foot-menu.is-member .nav-subscribe,
.gh-foot-menu.is-member:not(:has(li:not(.nav-subscribe))) {
    display: none;
}

/* Footer menu: the theme's Home and About list (default.hbs) and Ghost's secondary
   navigation are two lists in one menu; show them as one centered line with
   Headline's spacing between links (32px, 12px on phones). */
.gh-foot-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 32px;
    row-gap: 12px;
}

@media (max-width: 767px) {
    .gh-foot-menu {
        column-gap: 12px;
    }
}

/* For members, a list left with only the hidden Subscribe link would still take
   a slot and the gap beside it, pushing the line 16px off center. */
.gh-foot-menu.is-member .nav:not(:has(li:not(.nav-subscribe))) {
    display: none;
}

/* Same space above the social icons as below them: .gh-foot-inner puts a gap
   between its items, and Headline pulls the copyright up by 16px; do the same to
   the icons (Headline adds 32px instead). */
.gh-foot-menu + .gh-social-links:has(a) {
    margin-top: -16px;
}

/* Privacy and Terms links on the copyright line (default.hbs). Same muted color
   as the copyright text; underline on hover. Kept together so they wrap as a unit
   on narrow screens. */
.gh-legal-links {
    white-space: nowrap;
}

.gh-legal-links a {
    color: inherit;
    text-decoration: none;
}

.gh-legal-links a:hover {
    text-decoration: underline;
}

@media (max-width: 767px) {
    .gh-main {
        padding-top: 32px;
        padding-bottom: 48px;
    }
}

/* Newsletter sign-up banner (partials/satire-signup.hbs). A container query
   decides the layout, because the banner is wider on the homepage than in the
   article column. */
.satire-signup {
    margin-top: 40px;
    color: var(--color-white);
    background-color: var(--ghost-accent-color);
    container-type: inline-size;
}

/* Homepage: .gh-topic-footer above already adds 20px of padding */
.gh-inner > .satire-signup {
    margin-top: 20px;
}

/* Homepage: a gap only when tag sections with posts follow */
.gh-inner > .satire-signup:has(~ * .gh-card) {
    margin-bottom: 40px;
}

/* Posts: applies only when the banner shows, so members keep the usual gap */
.gh-canvas:has(.satire-signup) + .gh-read-next {
    margin-top: 40px;
}

@media (max-width: 767px) {
    .satire-signup {
        margin-top: 32px;
    }

    .gh-inner > .satire-signup {
        margin-top: 12px;
    }

    .gh-inner > .satire-signup:has(~ * .gh-card) {
        margin-bottom: 32px;
    }

    .gh-canvas:has(.satire-signup) + .gh-read-next {
        margin-top: 32px;
    }
}

.satire-signup-inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px 24px;
}

.satire-signup-title {
    font-size: 2.8rem;
    color: var(--color-white);
}

.has-serif-title:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]) .satire-signup-title {
    font-family: var(--gh-font-heading, var(--font-serif));
}

.satire-signup-description {
    margin-top: 8px;
    font-size: 1.7rem;
    line-height: 1.4;
}

.satire-signup-fields {
    display: flex;
    padding: 5px;
    background-color: var(--color-white);
    border-radius: 100px;
}

.satire-signup-fields:focus-within {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

.satire-signup-input {
    flex: 1;
    min-width: 0;
    padding: 0 8px 0 16px;
    font-size: 1.6rem;
    color: var(--color-darker-gray);
    background: transparent;
    border: 0;
    outline: 0;
}

.satire-signup-input::placeholder {
    color: var(--color-dark-gray);
    opacity: 1;
}

.satire-signup-btn {
    flex-shrink: 0;
}

.satire-signup-form.loading .satire-signup-btn {
    pointer-events: none;
    opacity: 0.6;
}

.satire-signup-success,
.satire-signup-error {
    display: none;
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1.4;
}

.satire-signup-form.success .satire-signup-fields {
    display: none;
}

.satire-signup-form.success .satire-signup-success {
    display: block;
}

.satire-signup-form.error .satire-signup-error:not(:empty) {
    display: block;
    margin-top: 12px;
}

@container (min-width: 680px) {
    .satire-signup-inner {
        flex-direction: row;
        gap: 40px;
        align-items: center;
        justify-content: space-between;
        padding: 40px;
    }

    .satire-signup-text {
        flex: 1 1 auto;
    }

    .satire-signup-title {
        font-size: 3.2rem;
        white-space: nowrap;
    }

    .satire-signup-form {
        flex: 1 1 300px;
        min-width: 0; /* lets the email input shrink instead of overflowing */
        max-width: 440px;
    }
}

/* Stacked header with an empty primary nav (Admin → Navigation → Primary has no
   links): collapse the 56px nav row and its two rules, and keep one line under
   the logo bar instead. Desktop only; on phones the menu sits behind the burger. */
@media (min-width: 768px) {
    .is-head-stacked .gh-head-menu:not(:has(*)) {
        display: none;
    }
    .is-head-stacked .gh-head-inner:not(:has(.gh-head-menu *)) {
        border-bottom: 1px solid var(--color-light-gray);
    }
}
