/* GENM styles
/* ----------------------------------------------------------
Uses the --genm- tokens from genm-tokens.css.
Loaded after Source's stylesheet, genm-fonts.css and the tokens file.
*/

/* Gold line across the very top of every page (pipeline test) */
body {
    border-top: 3px solid var(--genm-gold);
}

/* Fonts
/* ----------------------------------------------------------
Source reads its fonts from --font-sans, --font-serif and --font-mono,
and from --gh-font-heading and --gh-font-body (which Ghost only sets when
Brand typography is not "Theme default"). Pointing them at the GENM
tokens gives: headings in Source Serif 4, body and interface text in
Inter, code in IBM Plex Mono.
*/

:root {
    --font-sans: var(--genm-font-sans);
    --font-serif: var(--genm-font-serif);
    --font-mono: var(--genm-font-mono);
    --gh-font-heading: var(--genm-font-serif);
    --gh-font-body: var(--genm-font-sans);
}

/* Figures and numbers for tools and charts */
.genm-figures {
    font-family: var(--genm-font-mono);
    font-variant-numeric: tabular-nums;
}

/* Text on the gold accent color
/* ----------------------------------------------------------
Source and Ghost's cards put white text on the accent color. On gold
that is hard to read, so it is navy here. The card rules are prefixed
with body because Ghost loads its card styles after this file.
*/

.gh-button {
    color: var(--genm-navy);
}

body .kg-button-card a.kg-btn-accent,
body .kg-product-card a.kg-product-card-btn-accent,
body .kg-header-card.kg-style-light a.kg-header-card-button {
    color: var(--genm-navy);
}

/* Taglines (partials/genm-taglines.hbs)
/* ----------------------------------------------------------
Real HTML text in the existing fonts and colors: Inter in the header,
Source Serif 4 elsewhere, navy text with a gold accent. Gold is the
accent only (gold text on the light background is too faint to read).
Every line sits in the page's normal flow from the first paint, so
nothing moves after load.
*/

.genm-lockup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* The plain-text header name. It wraps onto two lines on a phone rather than pushing the menu button off the screen. */
.gh-navigation .genm-wordmark {
    font-size: 1.9rem;
    line-height: 1.15;
    letter-spacing: 0;
    white-space: normal;
    text-wrap: balance;
}

.gh-navigation .genm-lockup {
    min-width: 0;
}

@media (max-width: 767px) {
    .gh-navigation .genm-wordmark {
        font-size: 1.6rem;
        max-width: 15em;
    }

    /* The header name is long and takes three lines on a phone, so the header grows with it instead of keeping
       a fixed 64px height (which let the name and tagline spill over the content below). The open menu keeps
       its own full-height rule. */
    #gh-navigation {
        height: auto;
        min-height: 64px;
    }

    #gh-navigation .gh-navigation-brand {
        height: auto;
        min-height: 64px;
        padding: 10px 0;
    }

    /* Closed menu: nothing but the brand row is in the flow, so the 48px menu gap adds no empty space under it. */
    #gh-navigation:not(.is-open) .gh-navigation-inner {
        row-gap: 0;
    }
}

.gh-navigation.is-middle-logo .genm-lockup,
.gh-navigation.is-stacked .genm-lockup {
    align-items: center;
}

.genm-tagline {
    margin: 0;
    color: var(--genm-navy);
}

.genm-tagline-header {
    font-family: var(--genm-font-sans);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.02em;
    white-space: nowrap;
    color: inherit;
    opacity: 0.8;
}

.genm-tagline-hero,
.genm-tagline-title,
.genm-tagline-section {
    font-family: var(--genm-font-serif);
    font-weight: 500;
    line-height: 1.3;
}

.genm-tagline-hero {
    margin: 0 0 16px;
    font-size: clamp(20px, 3vw, 26px);
    text-align: center;
}

.genm-tagline-hero::after {
    display: block;
    width: 48px;
    height: 2px;
    margin: 10px auto 0;
    content: "";
    background-color: var(--genm-gold);
}

.genm-tagline-title,
.genm-tagline-section {
    padding-left: 12px;
    border-left: 3px solid var(--genm-gold);
}

.genm-tagline-title {
    margin: 0 0 12px;
    font-size: 20px;
}

.genm-tagline-section {
    margin: -8px 0 16px;
    font-size: 18px;
}

/* Blog article end block (place article-end): after the article body,
in the article's text column. The space above and its own cream panel keep
it apart from any legal line or "Not financial advice" text that ends the
body. */
.genm-article-end {
    box-sizing: border-box;
    width: min(var(--content-width, 720px), 100% - var(--container-gap, 16px) * 2);
    margin: 56px auto 0;
    padding: 20px 24px 24px;
    border-top: 3px solid var(--genm-gold);
    border-radius: 0 0 8px 8px;
    background-color: rgba(243, 235, 214, 0.5);
    color: var(--genm-navy);
    font-family: var(--genm-font-sans);
}

.genm-article-end > * {
    margin: 0;
}

.genm-tagline-article {
    font-family: var(--genm-font-serif);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.3;
}

.genm-article-end-text {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.5;
}

.genm-article-end-go {
    margin-top: 16px;
}

.genm-article-end .genm-article-end-button {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    background-color: var(--genm-gold);
    color: var(--genm-navy);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
}

.genm-article-end .genm-article-end-button:hover {
    opacity: 1;
    background-color: var(--genm-cream);
}

.genm-article-end .genm-article-end-button:focus-visible {
    outline: 2px solid var(--genm-navy);
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .genm-article-end {
        margin-top: 40px;
        padding: 16px 16px 20px;
    }

    .gh-navigation .genm-lockup {
        align-items: flex-start;
    }

    .genm-tagline-header {
        font-size: 11px;
    }

    /* Homepage and Home preview: the hero line sits right under the header, so the
    header copy of the same line is hidden on small screens only. */
    body:has(.genm-tagline-hero) .genm-tagline-header {
        display: none;
    }
}

/* Header logo (partials/components/navigation.hbs)
/* ----------------------------------------------------------
Shown when a publication logo is set in Ghost Admin (Design & branding, Brand);
the header then carries .has-logo. The logo is a wide gold and navy image, so
the header turns navy (--genm-navy) and its text and links turn cream. With no
logo the header keeps its existing look. The logo sits centered with the
Logo in the middle layout (.is-middle-logo). Colors come from genm-tokens.css.
*/

.gh-navigation.has-logo {
    background-color: var(--genm-navy);
    color: var(--genm-cream);
}

.gh-navigation.has-logo .gh-navigation-actions {
    background-color: var(--genm-navy);
}

.gh-navigation.has-logo .genm-tagline {
    color: var(--genm-cream);
}

.gh-navigation.has-logo .gh-button {
    background-color: var(--genm-gold);
    color: var(--genm-navy);
}

/* The dropdown menu keeps its white panel, so its links stay dark on it */
.gh-navigation.has-logo .gh-dropdown li a {
    color: var(--genm-navy);
}

.gh-navigation .genm-logo-link {
    display: block;
    max-width: 100%;
    line-height: 0;
}

.gh-navigation .genm-logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 56px;
}

@media (min-width: 768px) {
    .gh-navigation .genm-logo {
        max-height: 80px;
    }
}

.gh-navigation.is-middle-logo .genm-logo-link,
.gh-navigation.is-stacked .genm-logo-link {
    margin-right: auto;
    margin-left: auto;
}

/* With a logo the header is at least tall enough for it, instead of the fixed 100px / 64px */
@media (min-width: 768px) {
    .gh-navigation.has-logo {
        height: auto;
        min-height: 100px;
    }
}

/* Weekly Data Article: the still picture of the yield by maturity chart (a linked image) is for the weekly email only.
The website shows the live chart at the end of the article instead (post.hbs). Ghost turns the article HTML into its own
editor format and may drop a class, so these rules key on the picture's file name (gzevnum-yield-by-maturity-<record date>.png),
which stays in the image address. They apply inside the article body only, so no featured image is touched. The email is
built from the post body, not from the theme, so the picture stays there. The first rule alone hides the picture; the
:has() rules also remove the empty link and figure around it. */
.gh-content img[src*="gzevnum-yield-by-maturity"] {
    display: none;
}

.gh-content a:has(> img[src*="gzevnum-yield-by-maturity"]),
.gh-content figure:has(img[src*="gzevnum-yield-by-maturity"]) {
    display: none;
}
