/* ════════════════════════════════════════════════════════════════════════
   GAZETTE · SHARED COMPONENTS
   The formal government-document language used across the application:
   the page masthead (.gz-head) and the small pieces that depend on it.
   Linked by every layout that can host an authenticated page, so a view
   renders identically under layouts.admin (HR/admin) and layouts.home
   (employees/teachers).

   Self-contained: every token has a fallback, so it works even if the
   host layout does not define --go-*.
   ════════════════════════════════════════════════════════════════════════ */

:root {
    --gz-blue: var(--go-blue, var(--site-primary, #00209F));
    --gz-blue-deep: var(--go-blue-deep, #000F52);
    --gz-blue-ink: var(--go-blue-ink, #040B33);
    --gz-blue-soft: var(--go-blue-soft, #EEF2FF);
    --gz-green: var(--go-green, var(--site-secondary, #009543));
    --gz-green-deep: var(--go-green-deep, #05612F);
    --gz-green-soft: var(--go-green-soft, #E9F6EE);
    --gz-gold: var(--go-gold, #F6BC3A);
    --gz-gold-deep: var(--go-gold-deep, #9C7508);
    --gz-gold-soft: var(--go-gold-soft, #FFF3D6);
    --gz-ink: var(--go-ink, #111A34);
    --gz-body: var(--go-body, #3A4462);
    --gz-muted: var(--go-muted, #67718C);
    --gz-faint: var(--go-faint, #97A0B6);
    --gz-line: var(--go-line, #D8DEE9);
    --gz-line-soft: var(--go-line-soft, #EAEFF5);
    --gz-paper: var(--go-paper, #F5F6F9);
    --gz-white: var(--go-white, #FFFFFF);
    --gz-r: var(--go-r, 3px);
    --gz-r-lg: var(--go-r-lg, 6px);
    --gz-ff-d: var(--go-ff-d, 'Source Serif 4', Georgia, 'Times New Roman', serif);
    --gz-ff-b: var(--go-ff-b, 'Public Sans', 'Segoe UI', system-ui, -apple-system, sans-serif);
    --gz-sh: var(--go-sh, 0 1px 2px rgba(16, 26, 52, .06), 0 12px 32px rgba(16, 26, 52, .09));
}

/* ── the masthead plate ──────────────────────────────────────────────── */
.gz-head {
    display: block;
    background: var(--gz-white);
    border: 1px solid var(--gz-line);
    border-radius: var(--gz-r-lg);
    box-shadow: var(--gz-sh);
    margin: 0 0 1.25rem;
    overflow: hidden;
    font-family: var(--gz-ff-b);
}

.gz-head__strip {
    display: flex;
    height: 3px;
    width: 100%;
    /* clip the flag to the plate's rounded corners */
    border-radius: var(--gz-r-lg) var(--gz-r-lg) 0 0;
    overflow: hidden;
    /* the centre third is white and the plate is white, so give the band a
       hairline backdrop — otherwise it reads as two disconnected bars */
    background: var(--gz-line-soft);
}

.gz-head__strip > span {
    display: block;
    height: 100%;
    min-width: 0;
}

.gz-head__strip span:nth-child(1) {
    flex: 3;
    background: var(--gz-blue);
}

.gz-head__strip span:nth-child(2) {
    flex: 1;
    background: #fff;
}

.gz-head__strip span:nth-child(3) {
    flex: 3;
    background: var(--gz-green);
}

.gz-head__in {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.1rem 1.25rem;
}

.gz-head__ico {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--gz-blue);
    background: var(--gz-blue-soft);
    border: 1px solid rgba(0, 32, 159, .3);
    border-radius: var(--gz-r);
}

.gz-head__txt {
    min-width: 0;
    flex: 1 1 auto;
}

.gz-head__over {
    display: block;
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gz-gold-deep);
    margin-bottom: .2rem;
}

.gz-head__title {
    display: block;
    font-family: var(--gz-ff-d) !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    line-height: 1.15;
    letter-spacing: -.01em;
    color: var(--gz-blue-ink) !important;
    margin: 0 !important;
    padding: 0 !important;
}

.gz-head__sub {
    display: block;
    font-size: .8rem;
    color: var(--gz-muted);
    margin-top: .15rem;
    line-height: 1.45;
}

/* ── breadcrumbs ─────────────────────────────────────────────────────── */
.gz-crumbs {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gz-faint);
    flex-shrink: 0;
}

.gz-crumbs a {
    color: var(--gz-blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.gz-crumbs a:hover {
    text-decoration: underline;
}

.gz-crumbs strong {
    color: var(--gz-gold-deep);
    font-weight: 800;
}

/* ── responsive ──────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .gz-head__in {
        flex-wrap: wrap;
        padding: .9rem 1rem;
    }

    .gz-head__ico {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .gz-head__title {
        font-size: 1.25rem !important;
    }

    .gz-crumbs {
        margin-left: 0;
        width: 100%;
        padding-top: .5rem;
        border-top: 1px solid var(--gz-line-soft);
    }
}

@media print {
    .gz-head {
        box-shadow: none;
        border: 1px solid #999;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   De-duplicate the flag strip on application pages.

   The public layout (layouts.home) opens with its own 4px .gov-strip bar
   above the masthead. On a document page the .gz-head plate already opens
   with the same tricolor, so the two stack and read as a broken/offset bar.
   Only suppress it where a page masthead is actually present.
   ════════════════════════════════════════════════════════════════════════ */
body:has(.gz-head) .gov-strip {
    display: none !important;
}

/* Fallback for browsers without :has() — the strip is only ever the first
   child of <body>'s header, so this covers the same case without breaking
   the welcome page (which has no .gz-head). */
@supports not selector(:has(*)) {
    /* left untouched: without :has() we cannot scope it safely */
}
