/* Horizon Magazine overrides on top of Source.
   Layout mirrors the WordPress/Blocksy site; colours follow the brandbook.
   The brand headline font (Corporate S Pro) must not be used on the web. */

:root {
    /* Brandbook colours */
    --hz-red: #e63a3a;
    --hz-ink: #0c1d17;
    --hz-cream: #f9f3ea;
    --hz-border: rgb(12 29 23 / 0.12);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --background-color: var(--hz-cream);
    --color-darker-gray: var(--hz-ink);
    --color-primary-text: var(--hz-ink);
    --color-secondary-text: rgb(12 29 23 / 0.65);
    --color-border: var(--hz-border);
    --container-width: 1290px;
    --content-width: 750px;
}

body {
    background-color: var(--hz-cream);
    color: var(--hz-ink);
}

::selection {
    background: var(--hz-red);
    color: #fff;
}

h1, h2, h3, h4, h5, h6,
.gh-article-title,
.gh-card-title {
    color: var(--hz-ink);
    font-weight: 700;
}

/* Header: cream bar, centred logo, hairline rule, bold uppercase menu */
.gh-navigation {
    height: auto;
    min-height: 120px;
    background-color: var(--hz-cream);
    border-bottom: 1px solid var(--hz-border);
    position: relative;
    z-index: 10;
}

.gh-navigation.is-stacked .gh-navigation-brand {
    padding: 15px 0 10px;
}

/* Dominant square stacked logo */
.gh-navigation-logo img {
    max-height: 260px;
}

@media (min-width: 768px) {
    .gh-navigation.is-stacked .gh-navigation-brand {
        height: auto;
        padding: 16px 0;
    }

    /* Source draws its rules at fixed offsets (80px/140px) sized for a small
       logo, which cut through a tall one. Pin the top rule to the menu row
       instead; the header's own border-bottom replaces the second rule. */
    .gh-navigation.is-stacked .gh-navigation-menu {
        position: relative;
    }

    .gh-navigation.is-stacked .gh-navigation-menu::before {
        top: 0;
        left: 50%;
        width: 100vw;
        transform: translateX(-50%);
    }

    .gh-navigation.is-stacked .gh-navigation-menu::after {
        content: none;
    }
}

@media (min-width: 768px) {
    .gh-navigation.is-stacked {
        overflow-x: clip;
    }
}

/* Source fixes the mobile bar at 64px; let it grow with the logo */
@media (max-width: 767px) {
    #gh-navigation:not(.is-open) {
        height: auto;
    }

    /* Closed menu: the empty menu/actions grid rows would still add their gaps */
    #gh-navigation:not(.is-open) .gh-navigation-inner {
        grid-template-rows: auto;
        row-gap: 0;
    }

    #gh-navigation .gh-navigation-brand {
        height: auto;
        padding: 8px 0;
    }

    .gh-navigation-logo img {
        max-height: 150px;
    }
}

.gh-navigation-menu .nav a {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--hz-ink);
    position: relative;
}

.gh-navigation-menu .nav {
    gap: 37px;
}

.gh-navigation-menu .nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--hz-red);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.gh-navigation-menu .nav a:hover::after,
.gh-navigation-menu .nav-current a::after {
    transform: scaleX(1);
}

.gh-navigation-menu .nav a:hover {
    opacity: 1;
}

/* Links and buttons in red */
.gh-content a:not(.kg-btn):not(.gh-button) {
    color: var(--hz-red);
}

.gh-button,
.kg-btn-accent {
    background-color: var(--hz-red);
    color: #fff;
    border-radius: 3px;
}

/* Category label above card titles, like Blocksy's red meta line */
.gh-card-tag,
.gh-article-tag {
    color: var(--hz-red);
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Pull quotes keep the Georgia style from WordPress */
.gh-content blockquote.kg-blockquote-alt {
    font-family: Georgia, Times, serif;
    font-weight: 600;
    font-size: 2.5rem;
    color: var(--hz-ink);
}

.gh-content blockquote:not(.kg-blockquote-alt) {
    border-left-color: var(--hz-red);
}

/* Footer: cream with a hairline rule */
.gh-footer {
    background-color: var(--hz-cream);
    border-top: 1px solid var(--hz-border);
    padding-top: 60px;
    padding-bottom: 40px;
}

.gh-footer .gh-footer-signup {
    border-color: var(--hz-border);
}

/* Letters column on the homepage (partials/horizon/letters.hbs).
   Text only. Echoes the logo: a thin red frame with one solid red block,
   in the brand's three colours only (no white). */
.hz-letters {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--hz-red);
}

.hz-letters-header {
    margin: 0;
    padding: 14px 16px;
    background: var(--hz-red);
    text-align: center;
    font-size: 1.8rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.hz-letters-header a {
    color: var(--hz-cream);
}

.hz-letters-list {
    margin: 0;
    padding: 0 18px;
    list-style: none;
}

.hz-letter + .hz-letter {
    border-top: 1px solid var(--hz-border);
}

.hz-letter-link {
    display: block;
    padding: 16px 0;
    color: var(--hz-ink);
}

.hz-letter-link:hover {
    opacity: 1;
}

.hz-letter-title {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--hz-ink);
    transition: color 0.2s;
}

.hz-letter-link:hover .hz-letter-title {
    color: var(--hz-red);
}

.hz-letter-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-secondary-text);
}

.hz-letters-more {
    display: block;
    padding: 14px;
    border-top: 2px solid var(--hz-red);
    color: var(--hz-red);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-align: center;
    text-transform: uppercase;
    transition: background 0.2s, color 0.2s;
}

.hz-letters-more:hover {
    background: var(--hz-red);
    color: var(--hz-cream);
    opacity: 1;
}

/* Size the box to its letters, not to the height of the stories beside it */
.gh-header.is-magazine .hz-letters-column {
    align-self: start;
}

/* In Source's narrower layouts the right column becomes a full-width row */
@media (max-width: 1199px) and (min-width: 768px) {
    .gh-header.is-magazine .hz-letters-column .hz-letters {
        flex: 1;
    }

    .hz-letters-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        column-gap: 24px;
    }

    .hz-letter + .hz-letter {
        border-top: 0;
    }
}

/* Sign-up band and email fields: no grey on cream */
.gh-cta-inner {
    background-color: transparent;
    border-top: 1px solid var(--hz-border);
    border-bottom: 1px solid var(--hz-border);
}

.gh-form {
    background-color: transparent;
    box-shadow: inset 0 0 0 1px rgb(12 29 23 / 0.3);
}

.gh-form:hover {
    background-color: rgb(230 58 58 / 0.04);
}

/* Footnotes imported from WordPress (ids rebuilt by horizon.js) */
.hz-fn-ref {
    text-decoration: none;
    color: var(--hz-red);
    font-weight: 600;
    padding: 0 1px;
}

.gh-content [id] {
    scroll-margin-top: 24px;
}

.gh-content .hz-footnotes {
    margin-top: 3em;
    padding-top: 1.5em;
    border-top: 1px solid var(--hz-border);
    font-size: 0.85em;
    color: var(--color-secondary-text);
}

.gh-content .hz-footnotes li {
    word-break: break-word;
}

.gh-content .hz-footnotes li:target,
.gh-content .hz-fn-ref:target {
    background: rgb(230 58 58 / 0.12);
    outline: 4px solid rgb(230 58 58 / 0.12);
}

.gh-content .hz-footnotes a[href$="-link"] {
    text-decoration: none;
    margin-left: 4px;
}
