/*!
 * Global brand lockup — one crest + one typographic plate for every page.
 *
 * The home header, the 14 interior pages and the footer all print the same two
 * layers: the calligraphic crest of the supplied logo file, and the name plate
 * that belongs to it. Keeping the rules in this single small sheet (instead of
 * three copies inside the HOME / interior bundles) is what makes the identity
 * global: it loads on every front-end request, after every other plugin sheet.
 *
 * Artwork: assets/reference-crops/brand-mark-cream.png is the owner's own logo,
 * re-inked in cream with a keyed-out ground (tools/build-brand-assets.py).
 */

:root {
    --uirh-brand-cream: #f4ede2;
    --uirh-brand-ink: #073c45;
    --uirh-brand-gold: #cbaa6e;
    --uirh-brand-plate-line: rgba(244, 237, 226, .46);
}

/* ---------------------------------------------------------------------------
   1. Skeleton shared by the home header, interior header and footer.
   Repeated class names raise specificity above the section bundles without
   resorting to !important, so the cascade stays inspectable.
   --------------------------------------------------------------------------- */
.uirh-brand.uirh-brand.uirh-brand {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    flex: none;
    text-decoration: none;
    color: var(--uirh-brand-cream);
    line-height: 1.1;
}

.uirh-brand.uirh-brand .uirh-brand-mark {
    display: block;
    flex: none;
    width: auto;
    height: 2.45em;
    max-width: none;
    object-fit: contain;
    object-position: center;
}

.uirh-brand.uirh-brand .uirh-brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .32em;
    min-width: 0;
}

/* The typographic plate of the supplied logo: a ruled capsule that carries the
   name, exactly like the plate under the crest in the artwork. */
.uirh-brand.uirh-brand .uirh-brand-name {
    display: inline-block;
    margin: 0;
    padding: .16em .62em .22em;
    border: 1px solid var(--uirh-brand-plate-line);
    border-radius: .3em;
    background: rgba(255, 255, 255, .045);
    box-shadow: inset 0 0 0 1px rgba(7, 60, 69, .22);
    color: var(--uirh-brand-cream);
    font-size: 1em;
    font-weight: 700;
    letter-spacing: .012em;
    line-height: 1.25;
    white-space: nowrap;
}

.uirh-brand.uirh-brand .uirh-brand-tagline {
    display: block;
    color: rgba(244, 237, 226, .74);
    font-size: .52em;
    font-weight: 600;
    letter-spacing: .002em;
    line-height: 1.5;
    white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   2. Home header sizing (fluid 1440 grid → scales with --hl-u where present).
   --------------------------------------------------------------------------- */
.site-header .uirh-brand.uirh-brand {
    font-size: calc(15 * var(--hl-u, 1px));
    order: 1;
}

.site-header .uirh-brand .uirh-brand-mark {
    height: calc(35 * var(--hl-u, 1px));
}

.site-header .uirh-brand .uirh-brand-name {
    border-color: rgba(203, 170, 110, .55);
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
}

/* ---------------------------------------------------------------------------
   3. Interior page header (40-unit reference grid, dark teal bar).
   --------------------------------------------------------------------------- */
/* The interior bar is a compact 40-unit strip: the lockup has to size itself from
   its own content, otherwise the traced width on .uip-brand collapses and the
   plate slides under the menu. */
.uip-header .uip-brand.uip-brand {
    width: auto;
    max-width: none;
    flex: 0 0 auto;
    height: 100%;
}

.uip-header .uip-brand-lockup.uirh-brand {
    position: static;
    inset: auto;
    width: auto;
    overflow: visible;
}

.uip-header .uirh-brand.uirh-brand {
    width: auto;
    max-width: none;
    height: 100%;
    gap: .4em;
    font-size: calc(7.6 * var(--uip-u, 1px));
    margin-inline-end: calc(4 * var(--uip-u, 1px));
}

.uip-header .uirh-brand .uirh-brand-mark {
    height: calc(28 * var(--uip-u, 1px));
}

.uip-header .uirh-brand .uirh-brand-name {
    padding: .1em .5em .14em;
    border-radius: .26em;
    font-weight: 700;
}

.uip-header .uirh-brand .uirh-brand-tagline {
    display: none;
}

/* ---------------------------------------------------------------------------
   4. Footer brand block (dark teal, centered column).
   --------------------------------------------------------------------------- */
.footer-brand .uirh-brand.uirh-brand,
.site-footer .uirh-brand.uirh-brand {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: .5em;
    font-size: 15px;
}

.site-footer .uirh-brand .uirh-brand-mark {
    height: 46px;
}

.site-footer .uirh-brand .uirh-brand-name {
    color: var(--uirh-brand-cream);
    border-color: rgba(203, 170, 110, .5);
    font-size: 15px;
}

/* ---------------------------------------------------------------------------
   5. Responsive tuning.
   --------------------------------------------------------------------------- */
@media (max-width: 899px) {
    .site-header .uirh-brand.uirh-brand {
        font-size: 15px;
    }

    .site-header .uirh-brand .uirh-brand-mark {
        height: 38px;
    }

    .site-header .uirh-brand .uirh-brand-tagline {
        font-size: 8px;
    }
}

@media (max-width: 599px) {
    .site-header .uirh-brand.uirh-brand {
        font-size: 14px;
        gap: .42em;
    }

    .site-header .uirh-brand .uirh-brand-mark {
        height: 32px;
    }

    .site-header .uirh-brand .uirh-brand-tagline {
        max-width: 20ch;
        white-space: normal;
    }

    .uip-header .uirh-brand .uirh-brand-mark {
        height: 26px;
    }

    .uip-header .uirh-brand.uirh-brand {
        margin-inline-end: 0;
    }
}
