/**
 * Global Hero Responsive Scaling System
 * Height-driven composition via CSS custom properties.
 */

.cms-hero,
.hero-section.cms-hero {
    height: var(--hero-height-mobile, var(--hero-height, 500px));
    min-height: var(--hero-height-mobile, var(--hero-height, 500px));
    max-height: var(--hero-height-mobile, var(--hero-height, 500px));
}

@media (min-width: 768px) {
    .cms-hero,
    .hero-section.cms-hero {
        height: var(--hero-height, 500px);
        min-height: var(--hero-height, 500px);
        max-height: var(--hero-height, 500px);
    }
}

.cms-hero .container,
.cms-hero > .container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: inherit;
}

.cms-hero .container > .row,
.cms-hero-content-wrapper {
    flex: 1;
    width: 100%;
    min-height: 0;
}

.cms-hero-content,
.hero-section.cms-hero .hero-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--hero-spacing, 1rem);
}

.cms-hero.hero-valign-top .cms-hero-content,
.cms-hero.hero-valign-top .hero-content {
    justify-content: flex-start;
}

.cms-hero.hero-valign-bottom .cms-hero-content,
.cms-hero.hero-valign-bottom .hero-content {
    justify-content: flex-end;
}

.cms-hero--compact .cms-hero-content,
.cms-hero--compact .hero-content {
    gap: var(--hero-spacing, 0.35rem);
}

.cms-hero--compact .hero-title,
.cms-hero--compact .hero-content h1 {
    margin-bottom: 0.25rem;
}

.cms-hero--compact .hero-label {
    margin-bottom: 0.25rem;
}

.cms-hero--compact .hero-actions {
    margin-top: 0.25rem;
}

.cms-hero .hero-title,
.cms-hero .hero-content h1 {
    font-size: var(--hero-title-size, var(--hero-heading-size, clamp(2rem, 5vw, 4.5rem)));
    margin-bottom: var(--hero-spacing, 1rem);
}

.cms-hero .hero-description,
.cms-hero .hero-content .lead {
    font-size: var(--hero-subtitle-size, clamp(1rem, 2vw, 1.5rem));
    max-width: 650px;
}

/* ── Hero CTA buttons — unified dimensions ─────────────────────────────── */

.cms-hero .hero-actions a,
.hero-section .hero-actions a,
.cms-hero .hero-actions .hero-btn,
.hero-section .hero-actions .hero-btn {
    height: 52px;
    min-height: 52px;
    padding: 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    box-sizing: border-box;
    white-space: nowrap;
    border-width: 1px;
    border-style: solid;
}

.cms-hero .hero-actions .hero-btn-primary.btn-cta,
.hero-section .hero-actions .hero-btn-primary.btn-cta,
.cms-hero .hero-actions .hero-btn-primary.btn-hero-primary,
.hero-section .hero-actions .hero-btn-primary.btn-hero-primary {
    border-color: var(--btn-primary-bg, var(--cm-blue));
}

.cms-hero .hero-actions .hero-btn-primary.btn-light,
.hero-section .hero-actions .hero-btn-primary.btn-light {
    border-color: rgba(255, 255, 255, 0.85);
}

.cms-hero .hero-actions .hero-btn-secondary.btn-outline-light,
.hero-section .hero-actions .hero-btn-secondary.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.65);
}

.cms-hero .hero-actions .hero-btn-secondary.btn-outline-steel,
.hero-section .hero-actions .hero-btn-secondary.btn-outline-steel {
    border-color: var(--cm-steel-300, #cbd5e1);
}

.cms-hero .hero-actions .hero-btn-secondary.btn-outline-light:hover,
.cms-hero .hero-actions .hero-btn-secondary.btn-outline-light:focus-visible,
.hero-section .hero-actions .hero-btn-secondary.btn-outline-light:hover,
.hero-section .hero-actions .hero-btn-secondary.btn-outline-light:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: #fff;
    color: #fff !important;
}

@media (max-width: 767.98px) {
    .cms-hero .hero-actions .hero-btn,
    .hero-section .hero-actions .hero-btn {
        flex: 1 1 calc(50% - 0.375rem);
        min-width: 9rem;
    }
}

@media (max-width: 575.98px) {
    .cms-hero .hero-actions,
    .hero-section .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cms-hero .hero-actions a,
    .hero-section .hero-actions a,
    .cms-hero .hero-actions .hero-btn,
    .hero-section .hero-actions .hero-btn {
        width: 100%;
        min-width: 0;
    }
}

.cms-hero-background,
.hero-animation-bg,
.hero-video-bg,
.hero-animation-bg canvas,
.hero-animation-bg video,
.hero-animation-bg img.hero-animation-image,
.hero-gradient-animation,
.hero-animation-mobile-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-position: center;
    background-size: cover;
}

.cms-hero.hero-has-overlay::before {
    opacity: 1;
}

.cms-hero--split .cms-hero-split__media {
    display: flex;
    align-items: stretch;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.cms-hero--split .cms-hero-split__media .hero-visual {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.cms-hero--split .hero-visual .cm-media--hero,
.cms-hero--split .hero-visual .media-presenter {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.cms-hero--split .hero-visual .cm-media--hero .cm-media__img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    object-fit: cover;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .cms-hero--split .cms-hero-split__media {
        flex: 0 0 40%;
        max-width: 40%;
    }

    .cms-hero--split .cms-hero-content {
        flex: 0 0 60%;
        max-width: 60%;
    }
}

@media (min-width: 992px) {
    .cms-hero--split .cms-hero-split__media,
    .cms-hero--split .cms-hero-content {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 767.98px) {
    .cms-hero--split .cms-hero-split__media {
        order: 1;
        margin-bottom: 1rem;
    }

    .cms-hero--split .cms-hero-content {
        order: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cms-hero.hero-motion--ken_burns .hero-animation-image,
    .cms-hero.hero-motion--slow_zoom .hero-animation-image,
    .cms-hero.hero-motion--floating .hero-animation-image,
    .cms-hero.hero-anim-fade-in .hero-content > *,
    .cms-hero.hero-anim-slide-up .hero-content > *,
    .cms-hero.hero-anim-slide-left .hero-content > *,
    .cms-hero.hero-anim-zoom-in .hero-content > * {
        animation: none !important;
        transform: none !important;
    }
}

.hero-theme-preview.cms-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-theme-preview.cms-hero .hero-theme-preview__content {
    position: relative;
    z-index: 2;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
}

.hero-theme-preview.cms-hero .hero-theme-preview__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.hero-theme-preview.cms-hero .hero-title {
    font-size: var(--hero-title-size, clamp(1.5rem, 4vw, 2.5rem));
}

.hero-theme-preview.cms-hero .hero-description {
    font-size: var(--hero-subtitle-size, clamp(0.9375rem, 2vw, 1.125rem));
    max-width: 650px;
}

.hero-theme-preview.cms-hero .hero-theme-preview__button {
    height: 52px;
    min-height: 52px;
    padding: 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 6px;
    box-sizing: border-box;
}
