/* ========================================
   HERO BLOCK STYLES
   ======================================== */

/* Hero section base - height is controlled by JS */
.hero-section {
    min-height: 100vh;
    /* Fallback only */
}

/* Fixed 620px height option */
.hero-section[data-hero-height="620px"] {
    min-height: 620px !important;
}

.hero-container {
    min-height: clamp(500px, 80vh, 1080px);
}

/* Limit container height for fixed 620px hero */
.hero-section[data-hero-height="620px"] .hero-container {
    min-height: 620px !important;
    max-height: 620px !important;
    height: 620px !important;
}

/* Mobile */
@media (max-width: 640px) {
    .hero-container {
        min-height: 100svh !important;
        padding-top: 100px !important;
    }

    /* 620px hero uses 45vh on mobile */
    .hero-section[data-hero-height="620px"] {
        min-height: 45vh !important;
    }

    .hero-section[data-hero-height="620px"] .hero-container {
        min-height: 45vh !important;
        max-height: 45vh !important;
        height: 45vh !important;
    }
}

/* Tablet (641px - 1279px) */
@media (min-width: 641px) and (max-width: 1279px) {
    .hero-container {
        min-height: clamp(600px, 85vh, 900px) !important;
        padding-top: 140px !important;
    }
}

/* Desktop (1280px+) */
@media (min-width: 1280px) {
    .hero-container {
        padding-top: 300px !important;
    }
}

@media (min-width: 1600px) {
    .hero-container {
        padding-top: 350px !important;
    }
}

/* Let a stack of standard banners expand a fixed-height hero when needed. */
.hero-section--stacked-banners[data-hero-height="620px"] .hero-container {
    height: auto !important;
    max-height: none !important;
}

/* Reduce text spacing on mobile/tablet */
@media (max-width: 1279px) {
    .hero-text-content {
        gap: 0.75rem !important;
    }

    .hero-text-content>* {
        margin-bottom: 0.25rem;
    }
}

/* Mobile text sizing - scale down hero text */
@media (max-width: 640px) {
    .hero-text-content .text-6xl {
        font-size: 2rem !important;
        /* 32px instead of 60px */
        line-height: 1.2 !important;
    }

    .hero-text-content .text-5xl {
        font-size: 1.75rem !important;
        /* 28px instead of 48px */
        line-height: 1.2 !important;
    }

    .hero-text-content .text-4xl {
        font-size: 1.5rem !important;
        /* 24px instead of 36px */
        line-height: 1.25 !important;
    }

    .hero-text-content .text-3xl {
        font-size: 1.25rem !important;
        /* 20px instead of 30px */
        line-height: 1.3 !important;
    }

    .hero-text-content .text-2xl {
        font-size: 1.125rem !important;
        /* 18px instead of 24px */
        line-height: 1.4 !important;
    }

    .hero-text-content .text-xl {
        font-size: 1rem !important;
        /* 16px instead of 20px */
        line-height: 1.5 !important;
    }
}

/* ========================================
   HERO LANGUAGE BANNER
   ======================================== */

.hero-lang-banner {
    position: relative;
    overflow: hidden;
    color: white;
    border: 2px solid #FFFFFF;
    border-left: none; /* Removed left divider */
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
}

/* Desktop: breakout to the left screen edge */
@media (min-width: 1280px) {
    .hero-lang-banner {
        /* Calculate distance from left edge of centered content to screen edge */
        --breakout-offset: calc(max(24px, (100vw - 1360px) / 2 + 24px));
        
        /* Total width from screen edge is exactly 515px */
        width: 515px;
        min-height: 150px;
        margin-left: calc(-1 * var(--breakout-offset));
        
        box-shadow: 0 8px 30px -5px rgba(0, 0, 0, 0.45);
    }

    .hero-lang-banner__content {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px 28px;
        z-index: 3;
    }
}

/* Mobile/Tablet: responsive radius and spacing */
@media (max-width: 1279px) {
    .hero-lang-banner {
        /* Default for Tablet: 50% width */
        width: 60%;
        margin-bottom: 2rem;
        
        /* Hug the left screen edge by offsetting the container padding */
        margin-left: -24px; /* matches md:px-6 */
    }

    @media (max-width: 768px) {
        .hero-lang-banner {
            margin-left: -20px; /* matches sm:px-5 */
        }
    }

    @media (max-width: 640px) {
        .hero-lang-banner {
            /* Mobile: 90% width */
            width: 90%;
            margin-left: -16px; /* matches px-4 */
        }
    }

    .hero-lang-banner__content {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 14px 20px;
        z-index: 3;
    }

    /* Without a background image, the text supplies the banner's height. */
    .hero-container .hero-lang-banner__content:only-child {
        position: relative;
        min-height: 80px;
    }
}

.hero-banner-layer {
    position: absolute;
    inset: 0;
    z-index: 21;
    pointer-events: none;
}

.hero-banner-layer .hero-lang-banner {
    position: absolute;
    box-sizing: border-box;
    left: var(--banner-x);
    top: var(--banner-y);
    translate: calc(-1 * var(--banner-x)) calc(-1 * var(--banner-y));
    margin: 0;
    width: var(--banner-desktop-width);
    max-width: 100%;
    min-height: 0;
    max-height: 100%;
    aspect-ratio: var(--banner-aspect-ratio);
    border: 2px solid white;
    border-radius: 14px;
}

.hero-banner-layer a.hero-lang-banner {
    pointer-events: auto;
}

.hero-banner-layer .hero-lang-banner__bg {
    position: absolute;
    inset: 0;
    min-height: 0;
}

.hero-banner-list { display: contents; }
.hero-banner-mobile-item { display: none; }

@media (max-width: 640px) {
    .hero-standard-banner { display: none; }
    .hero-section:has(> .hero-banner-list) {
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: auto !important;
        max-height: none !important;
    }
    .hero-section:has(> .hero-banner-list) > .hero-container {
        width: 100%;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
    }
    .hero-banner-list {
        position: relative;
        z-index: 21;
        display: grid;
        gap: .75rem;
        padding: 0 1rem 1.5rem;
    }
    .hero-banner-mobile-item { display: block; }
    .hero-banner-list .hero-banner-layer {
        position: static;
        pointer-events: auto;
    }
    .hero-banner-list .hero-lang-banner {
        position: relative;
        inset: auto;
        translate: none;
        /* A default 515px banner fills the column. Smaller designs keep their relative width. */
        width: min(100%, var(--banner-desktop-width), calc(100% / 515 * var(--banner-design-width)));
        margin-inline: auto;
        margin-block: 0;
        container-type: inline-size;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
        max-height: none;
        aspect-ratio: auto;
        border: 2px solid white;
        border-radius: 14px;
    }
    /* The image proportions and the text share a row; the taller one determines its height. */
    .hero-banner-list .hero-lang-banner::before {
        content: "";
        grid-area: 1 / 1;
        align-self: start;
        width: 100%;
        aspect-ratio: var(--banner-aspect-ratio);
    }
    .hero-banner-list .hero-lang-banner__bg {
        position: absolute;
        inset: 0;
        min-height: 0;
    }
    .hero-banner-list .hero-lang-banner__content {
        position: relative;
        grid-area: 1 / 1;
        min-width: 0;
        padding: clamp(.375rem, 2cqi, .75rem) clamp(.5rem, 5cqi, 1.75rem);
    }
    .hero-banner-list .hero-lang-banner__text {
        --banner-type-unit: calc(100cqi / var(--banner-design-width));
        font-size: clamp(.875rem, calc(20 * var(--banner-type-unit)), 1.25rem);
        line-height: 1.35;
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .hero-banner-list .hero-lang-banner__text span[style*="font-size"] {
        font-size: clamp(.875rem, calc(var(--banner-font-pixels, 20) * var(--banner-type-unit)),
                         min(2rem, calc(var(--banner-font-pixels, 20) * .0625rem))) !important;
    }
}

/* The image scales to fill the extended container */
.hero-lang-banner__bg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 80px;
    object-fit: cover;
}

.hero-lang-banner__text {
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-align: center;
}

@media (min-width: 1280px) {
    .hero-lang-banner__text {
        font-size: 1.25rem; /* Slightly larger on desktop */
    }
}

/* ========================================
   HERO ANCHOR NAVIGATION (below form)
   ======================================== */

.hero-anchor-nav {
    position: relative;
    z-index: 20;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    /* background color is set via inline style from snippet */
    box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.3s ease;
}

.hero-anchor-nav:hover {
    box-shadow: 0 12px 40px -4px rgba(0, 0, 0, 0.45);
}

.hero-anchor-nav__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    border-radius: 14px;
}

.hero-anchor-nav__content {
    position: relative;
    z-index: 3;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-anchor-nav__title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    color: white;
}

.hero-anchor-nav__text {
    font-size: 0.78rem;
    line-height: 1.45;
    font-weight: 400;
    letter-spacing: 0.01em;
    opacity: 0.9;
}

/* ── Anchor Buttons ── */

.hero-anchor-nav__buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.hero-anchor-nav__btn {
    display: block;
    width: 100%;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.3;
}

/* Yellow (filled) button */
.hero-anchor-nav__btn--yellow {
    background: #FACC15;
    color: #1a1a1a;
    border: 2px solid #FACC15;
}

.hero-anchor-nav__btn--yellow:hover {
    background: #EAB308;
    border-color: #EAB308;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(250, 204, 21, 0.35);
}

.hero-anchor-nav__btn--yellow:active {
    transform: translateX(2px);
}

/* Outline button */
.hero-anchor-nav__btn--outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.hero-anchor-nav__btn--outline:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: white;
    transform: translateX(4px);
}

.hero-anchor-nav__btn--outline:active {
    transform: translateX(2px);
}

/* ── Responsive ── */

/* Mobile/Tablet: anchor nav appears ABOVE the form */
@media (max-width: 1279px) {
    .hero-anchor-nav-wrap {
        order: -1;
    }

    .hero-anchor-nav {
        max-width: 100%;
    }
}

@media (min-width: 1600px) {
    .hero-anchor-nav {
        max-width: 420px;
    }

    .hero-anchor-nav__title {
        font-size: 1.1rem;
    }

    .hero-anchor-nav__text {
        font-size: 0.82rem;
    }

    .hero-anchor-nav__btn {
        padding: 8px 16px;
        font-size: 0.78rem;
    }
}

