/* --- HERO BANNER COMPONENT --- */
.hero-section {
    position: relative;
    width: 100%;
    max-width: var(--content-max-width, none);
    margin-left: auto;
    margin-right: auto;
    min-height: 550px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    padding: 80px 5%;
    transition: all 0.3s ease;
    overflow: hidden;
    border-bottom: var(--hero-border-bottom, none);
}

/* Image-tag variant: the hero is a full-bleed <img>, not a background. Its width cap is
   --hero-img-tag-max-width (e.g. none for a banner across the page), else the section's own. */
.hero-section--img-tag {
    max-width: var(--hero-img-tag-max-width, var(--content-max-width, none));
    background-color: var(--color-bg);
    padding: 0;
    min-height: auto;
    display: block;
}

.hero-img-link {
    display: block;
    text-decoration: none;
}

.hero-img-element {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--hero-overlay-background);
    z-index: 1;
    display: var(--hero-overlay-display, block);
}


.hero-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}


.hero-content {
    max-width: 600px;
    color: var(--color-text-dark);
    display: var(--hero-content-display, block);
}


.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--border-radius-button);
    background-color: var(--badge-bg);
    color: var(--badge-text-color);
    text-transform: var(--badge-transform);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.hero-title {
    font-size: var(--font-size-hero-title);
    line-height: 1.2;
    font-weight: var(--font-weight-hero-title);
    margin-bottom: var(--hero-title-margin-bottom, 20px);
}

.hero-pretitle {
    font-size: var(--font-size-hero-pretitle, 18px);
    font-weight: var(--font-weight-hero-pretitle, normal);
    color: var(--color-hero-pretitle, inherit);
    margin-bottom: var(--hero-pretitle-margin-bottom, 8px);
}

.hero-subtitle {
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-ctas {
    display: flex;
    gap: 15px;
    flex-direction: var(--hero-ctas-flex-direction, row);
    align-items: var(--hero-ctas-align-items, center);
}

.hero-btn {
    padding: 14px 30px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--border-radius-button);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hero-btn--primary {
    background-color: var(--color-button-primary-bg);
    color: var(--color-button-primary-text);
    border: none;
}

.hero-btn--secondary {
    background-color: var(--color-button-secondary-bg);
    color: var(--color-button-secondary-text);
    border: var(--button-secondary-border);
}


.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* --- BANNER VARIANT (opt-in: data.variant 'banner') ---
   A plain photo band: no scrim, a set height, the title top-left in its own
   size/colour. Every rule needs .hero-section--banner, which only the variant
   adds. The title selector carries both classes so the variant's type wins
   over a brand's general .hero-section .hero-title styling. */
.hero-section--banner {
    min-height: 0;
    height: var(--hero-banner-height, 550px);
    padding: 0;
    align-items: flex-start;
    text-align: left;
}
.hero-section--banner .hero-overlay {
    display: none;
}
.hero-section--banner .hero-container {
    display: block;
    max-width: none;
    margin: 0;
    padding: var(--hero-banner-padding, 60px 5% 0);
}
.hero-section--banner .hero-content {
    max-width: none;
}
.hero-section.hero-section--banner .hero-title {
    font-size: var(--hero-banner-title-size, var(--font-size-hero-title));
    line-height: var(--hero-banner-title-line-height, normal);
    letter-spacing: var(--hero-banner-title-letter-spacing, normal);
    color: var(--hero-banner-title-color, inherit);
    margin: 0;
}

/* --- RESPONSIVE MOBILE STYLES (max-width: 768px) --- */
@media (max-width: 768px) {
    .hero-section {
        padding: var(--hero-padding-mobile, 80px 4% 60px 4%);
        text-align: center;
    }
    /* The image variant keeps the generic mobile padding above unless a brand
       sets --hero-img-tag-padding-mobile (e.g. 0 for a full-bleed image).
       Declared after that rule on purpose: same specificity. */
    .hero-section--img-tag {
        padding: var(--hero-img-tag-padding-mobile, var(--hero-padding-mobile, 80px 4% 60px 4%));
    }
    /* !important: the desktop image is an inline style. */
    .hero-section--mobile-bg {
        background-image: var(--hero-bg-mobile) !important;
    }
    .hero-section--banner {
        height: var(--hero-banner-height-mobile, var(--hero-banner-height, 550px));
        padding: 0;
        text-align: left;
    }
    .hero-section--banner .hero-container {
        padding: var(--hero-banner-padding-mobile, var(--hero-banner-padding, 60px 5% 0));
    }
    .hero-title {
        font-size: 28px !important;
        line-height: 1.2;
    }
    /* !important only to match the generic mobile title rule just above. */
    .hero-section.hero-section--banner .hero-title {
        font-size: var(--hero-banner-title-size-mobile, 28px) !important;
        line-height: var(--hero-banner-title-line-height-mobile, 1.2);
        letter-spacing: var(--hero-banner-title-letter-spacing-mobile, normal);
    }
}

/* --- Optional tokens on properties hero did not set before (image variant) ---
   A picture cropped to a set format: --hero-img-aspect-ratio (and -mobile) with --hero-img-object-fit
   (e.g. 1728 / 580 and cover). Their fallbacks (auto, fill) are only placeholders: the rules sit in a
   cascade layer, so with no token they lose to every unlayered rule whatever its weight or order, exactly
   as before they existed, and the <img> keeps its own height. A brand that sets the token gets its value,
   unless one of its own rules sets the same property on the same element. Browsers without cascade layers
   skip the block: no token, as before. */
@layer hero-tokens {
    .hero-img-element {
        aspect-ratio: var(--hero-img-aspect-ratio, auto);
        object-fit: var(--hero-img-object-fit, fill);
    }
    @media (max-width: 767px) {
        .hero-img-element {
            aspect-ratio: var(--hero-img-aspect-ratio-mobile, var(--hero-img-aspect-ratio, auto));
        }
    }
}
