/**
 * Module: Hero Variant Composition Layer
 * Target: src/core_apps/frontend/static/frontend/themes/_shared/sections/hero/hero-variants.css
 */

/* =============================================================================
   1. STRUCTURAL CONTAINER & POSITION CONTEXT
   ============================================================================= */

/* Structural context for composable sections — no overflow clipping here;
   breakout clipping is handled at the html level (reset.css) */

/*
|--------------------------------------------------------------------------
| Qorezo Rendering Invariant
|--------------------------------------------------------------------------
| Full-bleed breakout sections rely on negative inline margins to escape
| constrained layout containers.
|
| DO NOT combine breakout margins with width: 100%.
| Negative margins already expand the rendering box mathematically.
|
| Applying width: 100% constrains the element to the parent content box
| and produces asymmetric edge gaps.
|--------------------------------------------------------------------------
*/

/*
|--------------------------------------------------------------------------
| Transform Safety Rule
|--------------------------------------------------------------------------
| Never apply transform/scale/translate directly on breakout root
| containers. Apply motion only to inner visual wrappers to prevent
| phantom horizontal overflow on mobile devices.
|--------------------------------------------------------------------------
*/
.page-home .home-composer .section-hero {
    position: relative;
    overflow: visible;
    display: block;
    min-height: 70vh;
    z-index: 10;
    margin: var(--layout-breakout-inline); /* Ensure breakout if parent padded */
}

/* Ensure breakout is safe across viewports */
@media (max-width: 1024px) {
    .page-home .home-composer .section-hero {
        margin: 0;
    }
}

/* Native tenant-safe image containment */
.page-home .home-composer .section-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    overflow: hidden;
    display: block;
}

/* Scoped enforcement to guarantee input components utilize full allocated grid widths */
.page-composer .section-hero .booking-form__field :is(
    .input-wrap,
    input[type="text"],
    .booking-form__input,
    #property-dropdown,
    #guests,
    .flatpickr,
    #checkin,
    #checkout
),
.page-home .home-composer .section-hero .booking-form__field :is(
    .input-wrap,
    input[type="text"],
    .booking-form__input,
    #property-dropdown,
    #guests,
    .flatpickr,
    #checkin,
    #checkout
) { 
    width: 100% !important; 
}

/* Sacred DOM instrumentation container */
.page-home .home-composer .section-hero__booking-wrapper {
    position: relative;
    z-index: 20;
    width: 100%;
}

/* =============================================================================
   2. VARIANT: SPLIT (Asymmetric Horizontal Balance)
   ============================================================================= */
.page-home .home-composer .section-hero--split {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    min-height: 85vh;
    background: var(--background-secondary, #f9f9f9);
}

@media (min-width: 1024px) {
    .page-home .home-composer .section-hero--split {
        grid-template-columns: 1.1fr 0.9fr;
        min-height: 90vh;
    }
}

.page-home .home-composer .section-hero--split .hero-content-pane {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 5vw, 6rem) clamp(1.5rem, 4vw, 4rem);
    z-index: 2;
}

.page-home .home-composer .section-hero--split .hero-media-pane {
    position: relative;
    height: 100%;
    min-height: 400px;
}

@media (min-width: 1024px) {
    .page-home .home-composer .section-hero--split .hero-media-pane {
        height: 100%;
        clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%); /* Subtle elegant slant */
    }
}

/* Advanced Typography for Split Hero */
.page-home .home-composer .section-hero--split .hero-title {
    font-family: var(--font-family-secondary, serif);
    font-size: clamp(2.5rem, 4.5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-secondary, #111) !important; /* Authoritative dark brand contrast */
    margin-bottom: 1.5rem;
}

.page-home .home-composer .section-hero--split .hero-intro,
.page-home .home-composer .section-hero--split .hero-intro p {
    font-family: var(--font-family-primary, sans-serif);
    font-size: clamp(1rem, 1.3vw, 1.25rem);
    color: var(--color-secondary, #222) !important; /* Unified readable contrast */
    opacity: 0.85; /* Elegant visual hierarchy softening */
    margin-bottom: 2.5rem;
    max-width: 550px;
}

/* Refined COMPACT CARD layout for the Booking Widget in Split Context */
@media (min-width: 1025px) {
    .page-home .home-composer .section-hero--split .booking-form__fields {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
        padding: 2.25rem !important;
        border-radius: 20px !important;
        box-shadow: 0 20px 40px rgba(0,0,0,0.08) !important;
        background: #ffffff !important;
        max-width: 560px !important;
        margin: 0 !important; /* Left aligned with content */
    }

    /* Force fields that must remain full-width in stacked/compact card */
    .page-home .home-composer .section-hero--split .booking-form__field:has(#property-dropdown),
    .page-home .home-composer .section-hero--split .booking-form__field.guest-selection,
    .page-home .home-composer .section-hero--split .guest-selection.rooms-for {
        grid-column: 1 / -1 !important;
    }

    .page-home .home-composer .section-hero--split .booking-form__field + .booking-form__field::before {
        display: none !important; /* Remove standard vertical line separators */
    }

    .page-home .home-composer .section-hero--split .booking-form .button--primary {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        height: 3.5rem !important;
        border-radius: var(--border-radius-md, 8px) !important;
        margin-top: 0.5rem !important;
    }
}


/* =============================================================================
   3. VARIANT: IMMERSIVE (Full-Screen Cinematic Stage)
   Enterprise pattern: mirrors .hero base layout (isolation, place-items, etc.)
   with cinematic crossfade slideshow + glassmorphic booking widget.
   ============================================================================= */

/* --- 3a. Stage Container — Mirrors Default Hero Full-Bleed --- */
.page-home .home-composer .section-hero--immersive {
    display: grid;
    place-items: stretch;
    height: 97vh;
    background: #000;
    isolation: isolate;
    overflow: hidden;
    z-index: 5;
}

/* --- 3b. Background Pane — Crossfade Image Layer --- */
.page-home .home-composer .section-hero--immersive .immersive-bg-pane {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Individual slide images: stacked absolute, crossfade via opacity */
.page-home .home-composer .section-hero--immersive .immersive-bg-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.8s ease-in-out;
}

.page-home .home-composer .section-hero--immersive .immersive-bg-slide.is-active {
    opacity: 1;
}

/* --- 3c. Gradient Overlay — Separate Layer for Clean Z-Index --- */
.page-home .home-composer .section-hero--immersive .immersive-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.45) 0%,
        rgba(0, 0, 0, 0.15) 35%,
        rgba(0, 0, 0, 0.12) 60%,
        rgba(0, 0, 0, 0.55) 100%
    );
    z-index: 2;
    pointer-events: none;
}

/* --- 3d. Content Pane — Centered Stage --- */
.page-home .home-composer .section-hero--immersive .immersive-content-pane {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--section-padding-y, 5rem) var(--section-padding-x-desktop, 7.5rem);
    color: #fff;
}

/* --- 3e. Cinematic Typography --- */
.page-home .home-composer .section-hero--immersive .hero-title {
    font-family: var(--font-family-secondary, serif);
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    font-weight: 700;
    color: #ffffff !important;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 1.25rem 0;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
    max-width: 50rem;
}

.page-home .home-composer .section-hero--immersive .hero-intro {
    margin: 0 0 2.5rem 0;
    max-width: 42rem;
}

.page-home .home-composer .section-hero--immersive .hero-intro p {
    font-family: var(--font-family-primary, sans-serif);
    font-size: clamp(1.05rem, 1.4vw, 1.35rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.92) !important;
    line-height: 1.7;
    letter-spacing: 0.01em;
    margin: 0;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
    opacity: 1 !important;
}

/* --- 3f. Booking Widget — Centered Card --- */
.page-home .home-composer .section-hero--immersive .section-hero__booking-wrapper {
    width: 100%;
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

@media (min-width: 1025px) {
    /* Prevent the default white card from stretching awkwardly wide and apply cinematic frosted card style */
    .page-home .home-composer .section-hero--immersive .booking-form__fields {
        max-width: 1050px !important;
        margin: 0 auto;
        
        /* Cinematic Card Aesthetic */
        background: rgba(255, 255, 255, 0.95) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 20px !important;
        padding: 1.5rem 2rem !important;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
    }
}

/* --- 3g. Immersive Responsive Breakpoints --- */
@media (max-width: 1024px) {
    .page-home .home-composer .section-hero--immersive .immersive-content-pane {
        padding: 3rem var(--section-padding-x-tablet, 3rem);
    }
}

@media (max-width: 768px) {
    .page-home .home-composer .section-hero--immersive {
        height: 100svh;
    }

    .page-home .home-composer .section-hero--immersive .immersive-content-pane {
        padding: clamp(5rem, 15vh, 8rem) 1.25rem clamp(2rem, 5vh, 3rem);
    }

    .page-home .home-composer .section-hero--immersive .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.6rem);
        margin-bottom: 1rem;
    }

    .page-home .home-composer .section-hero--immersive .hero-intro {
        margin-bottom: 2rem;
    }

    .page-home .home-composer .section-hero--immersive .hero-intro p {
        font-size: 1rem;
    }
}

