/* ============================================================================
   branding.css                                                     VERSION 1.1
   LCAP Tools -- shared tool-page header and footer branding

   THIS IS THIS PROJECT'S OWN COPY, AND THAT IS DELIBERATE.
   Adapted from the Chronic Absenteeism Tool's branding.css 1.1, which was
   itself adapted from the CAASPP DFP Tool's 1.4. Projects on this share are
   self-contained: no shared stylesheet, no path reaching into a sibling
   project's folder, no reused module. If Chronic restyles its header later,
   this file does not follow, and that is the intended trade. Duplication is
   the correct answer here -- a shared file would couple tools that are
   released, tested and versioned separately. The logos in images\ are this
   project's own copies for the same reason.

   WHAT WAS LEFT OUT, AND WHY
   Chronic carries a .predictive-notice band saying its results are estimates.
   This tool has no equivalent and must not borrow one: it reports CDE's
   PUBLISHED figures, the same numbers on the public Dashboard. Labelling them
   an estimate would be false. The class is absent rather than unused.

   LOADED AFTER dashboard-red.css. It sets the brand colours and the two
   coloured bands; page width and spacing belong in dashboard-red.css, which
   is why body has no side padding -- the bands must reach the window edge.

   ACCESSIBILITY (requirements, not preferences)
     - White on --brand-blue is 8.9:1.
     - Dark blue on --brand-yellow (the eyebrow pill) is 7.4:1.
     - No meaning is carried by colour alone.
     - Nothing here removes a focus outline.

   There is no web font and no external image. Both logos are local files in
   this project's own images\ folder, so the page still makes no network call
   of any kind.

   CHANGELOG
     1.1  2026-09-25  Shared this header/footer treatment with Baseline
                      Difference and added the gold divider below every tool
                      header. The existing gold footer divider is unchanged.
     1.0  2026-08-26  First version.
   ========================================================================== */

:root {
    --brand-blue: #0f4c81;
    --brand-blue-dark: #0a365c;
    --brand-blue-light: #eaf2f8;
    --brand-yellow: #f8c22a;
}

/* Header ----------------------------------------------------------------- */

.site-header {
    padding: 24px 0 22px;
    border-bottom: 6px solid var(--brand-yellow);
    background: var(--brand-blue);
}

.site-header .header-content {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    gap: 32px;
    padding-inline: clamp(16px, 3.5vw, 64px);
}

.header-text {
    min-width: 0;
}

/*
 * The county logo is the reversed (white) artwork, so it sits directly on the
 * blue. Do not add a white panel behind it -- the wordmark is white and would
 * disappear. The print rules at the foot of this file give it a dark panel,
 * because the header prints on white.
 */
/* The logo links home to the Data Portal ("/", so it also works on test). */
.county-logo-link {
    flex: 0 0 auto;
    display: block;
    line-height: 0;
    border-radius: 4px;
}
.county-logo-link:focus-visible {
    outline: 3px solid var(--brand-yellow);
    outline-offset: 4px;
}

.county-logo {
    flex: 0 0 auto;
    display: block;
    width: auto;
    height: clamp(2.5rem, 4.5vw, 3.5rem);
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    object-fit: contain;
    object-position: left center;
}

/* A filled pill rather than plain text. Dark blue on brand yellow, 7.4:1. */
.site-header .eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 0 0 7px;
    padding: 5px 12px;
    border-radius: 999px;
    color: var(--brand-blue-dark);
    background: var(--brand-yellow);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.09em;
}

/*
 * No white-space: nowrap. Holding this title on one line would overflow
 * sideways and give the page a horizontal scrollbar at narrow widths, which is
 * worse than wrapping.
 */
.site-header h1 {
    margin: 0 0 6px;
    color: #ffffff;
    font-size: clamp(1.4rem, 2.2vw, 2.2rem);
    font-weight: 900;
    line-height: 1.15;
}

/*
 * Deliberately uncapped. A max-width here wraps the sentence after a few words
 * and makes the banner two lines taller than it needs to be. The
 * header-content padding already keeps it off the window edge.
 */
.header-description {
    max-width: none;
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
}

/* Footer ----------------------------------------------------------------- */

.site-footer {
    margin-top: 3rem;
    padding: 28px 0 32px;
    border-top: 6px solid var(--brand-yellow);
    background: var(--brand-blue);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding-inline: clamp(16px, 3.5vw, 64px);
    text-align: center;
}

/*
 * The team logo is dark artwork, so it gets a white panel for contrast.
 */
.team-logo {
    display: block;
    width: min(380px, 76vw);
    height: auto;
    padding: 14px 20px;
    box-sizing: border-box;
    object-fit: contain;
    object-position: center;
    border: 3px solid var(--brand-yellow);
    border-radius: 12px;
    background: #ffffff;
    box-shadow:
        0 8px 20px rgb(4 32 57 / 24%),
        0 0 0 1px rgb(255 255 255 / 20%);
}

.site-footer p {
    max-width: 70ch;
    margin: 0;
    color: #ffffff;
}

.site-footer code {
    padding: 0 .2rem;
    border-radius: 3px;
    color: #ffffff;
    background: rgb(255 255 255 / 18%);
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1100px) {
    .site-header {
        padding: 20px 0 18px;
    }

    .county-logo {
        height: clamp(2.2rem, 4vw, 3rem);
    }
}

@media (max-width: 760px) {
    /* Too narrow to sit the logo beside the title, so stack them. */
    .site-header .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .site-header {
        padding: 16px 0 14px;
    }

    .county-logo {
        height: clamp(2rem, 7vw, 2.75rem);
    }

    .site-header h1 {
        font-size: clamp(1.05rem, 4.3vw, 1.5rem);
    }

    .team-logo {
        width: min(300px, 82vw);
        padding: 12px 14px;
        border-width: 2px;
    }
}

/* Print ------------------------------------------------------------------ */

@media print {
    .site-header {
        border-bottom-color: #000000;
        background: #ffffff;
    }

    /*
     * ⚠️ The header prints on white, so the reversed county logo needs a dark
     * panel behind it. Without this it prints white on white and vanishes --
     * which looks like a missing image rather than a styling mistake, so it is
     * easy to "fix" in the wrong direction.
     */
    .county-logo {
        padding: 10px 14px;
        border: 2px solid #000000;
        border-radius: 8px;
        background: var(--brand-blue);
        box-shadow: none;
    }

    .site-header h1,
    .site-header .eyebrow,
    .header-description {
        color: #000000;
    }

    .site-header .eyebrow {
        border: 1px solid #000000;
        background: #ffffff;
    }

    .team-logo {
        border-color: #000000;
        background: #ffffff;
        box-shadow: none;
    }

    .site-footer {
        border-top-color: #000000;
        background: #ffffff;
    }

    .site-footer p,
    .site-footer code {
        color: #000000;
        background: none;
    }
}
