/* ================================================================
   banner.css  –  Compliance Checker
   Shared page-header banner sitting below the breadcrumbs. Always
   spans the full viewport width (edge-to-edge) regardless of any
   .container parent, using the `100vw` + negative-half-margin
   breakout trick.

   Two variants:
     .cc-banner--main      title + description    (overview / selector pages)
     .cc-banner--specific  image + name           (per-entity detail pages)

   .cc-page-intro is the matching body-intro block for specific pages,
   where the description sits below the banner rather than inside it.
   ================================================================ */


/* === BREAKOUT WRAPPER ========================================== */

/* `.breadcrumb-trail` ships with `margin-bottom: -100px` so non-banner
   pages can lay their .content over the breadcrumb area. That negative
   margin pulls the banner up into the breadcrumb if we don't push back —
   `margin-top: var(--nav-h)` exactly cancels it on banner-bearing pages.
   The horizontal `margin-left/right` are the standard 100vw breakout so
   the grey fill spans the viewport regardless of any .container parent. */
.cc-banner {
    background: var(--card-bg);
    width: 100vw;
    margin-top: var(--nav-h, 100px);
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: var(--space-xs) var(--space-lg);
    box-sizing: border-box;
}

/* When a banner is present, .content already sits below it, so its
   built-in `margin-top: 120px` (meant to clear the fixed nav) becomes
   redundant whitespace. Reset it via sibling combinator — only kicks
   in on pages that actually rendered the banner block. */
.cc-banner + .content {
    margin-top: 0;
}

.cc-banner__inner {
    max-width: var(--page-max);
    margin: 0 auto;
}


/* === MAIN VARIANT (title + description) ======================== */

.cc-banner__title {
    font-family: var(--font-heading);
    font-size: var(--fs-h2);
    color: var(--ae-darkblue);
    margin: 0;
    line-height: 1.15;
}

.cc-banner__description {
    font-family: var(--font-body);
    font-size: var(--fs-lg);
    color: var(--text-muted);
    margin: var(--space-sm) 0 0;
    max-width: 70ch;
    line-height: 1.5;
}


/* === SPECIFIC VARIANT (image left, name right) ================= */

.cc-banner--specific .cc-banner__inner {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.cc-banner--specific .cc-banner__text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Default media slot: just size constraints, no box. Pages that want
   a card-style wrapper (e.g. transparent commodity icons or company
   logos that need an anchor) opt in via page-level CSS. */
.cc-banner__media {
    flex: 0 0 auto;
    width: clamp(60px, 8vw, 110px);
    height: clamp(60px, 8vw, 110px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cc-banner__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}


/* === MATCHING BODY-INTRO (specific pages) ====================== */

.cc-page-intro {
    max-width: 75ch;
    margin: var(--space-lg) auto var(--space-xl);
    font-family: var(--font-body);
    font-size: var(--fs-lg);
    color: var(--text-muted);
    line-height: 1.6;
}


/* === RESPONSIVE ================================================ */

@media (max-width: 768px) {
    .cc-banner {
        padding: var(--space-xs) var(--space-sm);
    }

    .cc-banner--specific .cc-banner__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .cc-banner__media {
        width: 72px;
        height: 72px;
    }
}
