/* =============================================================================
   page-header-band.css - shared page header band component
   -----------------------------------------------------------------------------
   Used by front/components/page-header-band.blade.php on any page that needs
   a header band: breadcrumb + H1 (+ optional subtitle and action link) over a
   background photo.

   Two modes, picked per banner in the admin:

     compact (default)  fixed 150px strip, the photo is a cover background.
                        The admin's focus point per screen size arrives as
                        --phb-pos-desktop / --phb-pos-tablet / --phb-pos-mobile.
     full (.phb--full)  the photo is an <img> at width 100% and height auto, so
                        it keeps its own ratio and is never cropped.

   Screen sizes (same split as BannerDisplay::SCREENS and the admin picker):
     mobile  under 768px, tablet 768 to 1199px, desktop 1200px and up.

   Without a photo the band gets .phb--solid and shows a plain brand colour.
   Class prefix phb- is scoped to this component only.
   ============================================================================= */

.phb {
    position: relative;
    overflow: hidden;
    min-height: 150px;
    background-color: var(--ink-deep);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: var(--phb-pos-mobile, 50% 50%);
}

@media (min-width: 768px) {
    .phb {
        background-position: var(--phb-pos-tablet, 50% 50%);
    }
}

@media (min-width: 1200px) {
    .phb {
        background-position: var(--phb-pos-desktop, 50% 50%);
    }
}

/* No photo: plain brand colour from variables.css, no scrim needed */
.phb--solid {
    background-color: var(--ink);
}

.phb__media {
    position: relative;
}

.phb__inner {
    position: relative;
    z-index: 1;
    padding: 14px 16px 16px;
}

/* Readability scrim: sits ONLY behind the text block (breadcrumb, title,
   subtitle), never over the whole photo. The negative left margin cancels
   the left padding so the text still lines up with the page content. */
.phb:not(.phb--solid) .phb__text {
    background: rgba(4, 61, 47, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: var(--r-md);
    padding: 12px 18px 14px;
    margin-left: -18px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
}

/* Breadcrumb */
.phb__crumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0 0 6px;
    font-size: 13px;
}

.phb__crumb a {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: color 0.15s ease;
}

.phb__crumb a:hover {
    color: var(--on-ink);
}

.phb__crumb-sep {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    line-height: 1;
}

.phb__crumb-current {
    color: var(--on-ink);
    font-weight: 500;
}

/* Title row */
.phb__row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.phb__title {
    font-family: var(--font-display);
    color: var(--on-ink);
    font-size: clamp(22px, 4vw, 34px);
    font-weight: var(--fw-semibold);
    line-height: 1.15;
    margin: 0;
}

.phb__subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    margin: 4px 0 0;
}

.phb__action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--on-ink);
    background: rgba(4, 61, 47, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--r-sm);
    padding: 8px 14px;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.phb__action:hover {
    background: var(--surface);
    border-color: var(--surface);
    color: var(--ink-deep);
    text-decoration: none;
}

@media (min-width: 992px) {
    .phb__inner {
        padding: 18px 24px 20px;
    }
}

/* =============================================================================
   FULL MODE (.phb--full)
   The band height follows the image: a 1920 x 480 file is 480px on desktop and
   about 100px on a 390px phone. The image sits in a media box with a max
   width, and the band colour fills the sides beyond it. Breadcrumb and H1 sit
   on the image in a small panel pinned to the top left.
   ============================================================================= */
.phb--full {
    min-height: 0;
    background-image: none;
}

.phb--full .phb__media {
    max-width: var(--phb-full-max, 1920px);
    margin: 0 auto;
}

.phb--full .phb__img {
    display: block;
    width: 100%;
    height: auto;
    /* Safety net: a very thin image still leaves room for the title panel
       on phones. A normal 4:1 image is untouched. */
    min-height: 110px;
    object-fit: cover;
    object-position: center;
}

.phb--full .phb__inner {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    /* Top offset keeps the panel off the image edge. Only padding-top is set
       so the side padding from .phb__inner still aligns with .container. */
    padding-top: 12px;
}

.phb--full .phb__row {
    align-items: flex-start;
}

.phb--full .phb__text {
    max-width: min(520px, 75%);
    padding: 8px 14px 10px;
    margin-left: -14px;
}

.phb--full .phb__crumb {
    font-size: 12px;
    margin-bottom: 2px;
}

.phb--full .phb__title {
    font-size: clamp(18px, 3.2vw, 30px);
}

/* Subtitle only where there is room for it */
.phb--full .phb__subtitle {
    display: none;
}

@media (min-width: 768px) {
    .phb--full .phb__inner {
        padding-top: 16px;
    }

    .phb--full .phb__subtitle {
        display: block;
    }

    .phb--full .phb__text {
        padding: 12px 20px 14px;
        margin-left: -20px;
    }

    .phb--full .phb__crumb {
        font-size: 13px;
        margin-bottom: 6px;
    }
}