/* ZA Slider v2.0 Styles */
/* Integrated with Main Site Theme */

/* Note: We rely on the main style.css variables (var(--dark-bg), etc.) */

/* LAYOUT FIX: Ensure Section stacks vertical (Header Top, Slider Bottom) */
#services.slide {
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding-top: 100px;
    /* Clear fixed navbar */
}

:root {
    --za-gap: 1.5%;
    --za-radius: 20px;
    --za-anim-speed: 1.0s;
    --za-ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* Main Container */
#za-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background-color: var(--darker-bg);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    /* Match Site Font */
    display: flex;
    flex-direction: column;
    transition: background-color 0.5s ease;
}

/* Inner Layout */
.za-viewport {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2vw;
    position: relative;
}

/* THE ASPECT RATIO STACK */
.za-slider-stack {
    position: relative;
    width: 100%;
    max-width: 1600px;
    aspect-ratio: 16 / 8;
    height: auto;
    max-height: 85vh;
}

/* Individual Slides */
.za-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    display: none;
}

.za-slide.active {
    pointer-events: auto;
    z-index: 10;
    display: block;
}

.za-slide.exit {
    display: block;
    z-index: 5;
}

/* Bento Grid */
.za-bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(12, 1fr);
    gap: var(--za-gap);
    width: 100%;
    height: 100%;
}

/* Grid Items */
.b-item {
    position: relative;
    /* Use Site Card Background for cohesion */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    /* Add border to match site cards */
    border-radius: var(--za-radius);
    overflow: hidden;
    opacity: 0;
    backdrop-filter: blur(10px);
    /* Glassmorphism match */
}

/* Images opacity might need tweak if we want more theme color to bleed through? 
   No, images should pop. But maybe the overlay gradient uses theme colors? */
.b-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.1);
    transition: transform 0.6s ease;
}

.b-item:hover img {
    transform: scale(1.05);
}

.overlay-grad {
    position: absolute;
    inset: 0;
    /* Use site gradient or black? Site uses specific gradients. 
       Let's stick to black fade for readability, but maybe hint of purple? */
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, transparent 60%);
    z-index: 2;
}

/* Minimal Theme Overrides */
[data-theme="minimal"] .overlay-grad {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.9) 0%, transparent 60%);
}

[data-theme="minimal"] .b-item {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="minimal"] #za-container {
    background-color: #ffffff;
    color: #000000;
}

[data-theme="minimal"] .big-title,
[data-theme="minimal"] h2,
[data-theme="minimal"] h3,
[data-theme="minimal"] p,
[data-theme="minimal"] .section-title {
    color: #000000 !important;
}

[data-theme="minimal"] .desc-text,
[data-theme="minimal"] .section-subtitle {
    color: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="minimal"] .tag-pill {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.2);
    color: #000000;
}

[data-theme="minimal"] .section-label {
    border-bottom-color: rgba(0, 0, 0, 0.2);
    color: #000000;
}

[data-theme="minimal"] .nav-btn {
    border-color: rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.05);
    color: #000000;
}

[data-theme="minimal"] .nav-btn:hover {
    background: #000000;
    color: #ffffff;
}

/* Luxury Theme Overrides */
[data-theme="luxury"] #za-container {
    background-color: #000000;
}

[data-theme="luxury"] .big-title,
[data-theme="luxury"] .section-title {
    background: linear-gradient(135deg, #BF953F 0%, #FCF6BA 50%, #B38728 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="luxury"] .tag-pill {
    border-color: #D4AF37;
    color: #D4AF37;
}

/* Typography w/ Fluid Scaling */
.big-title {
    font-size: clamp(1.5rem, 4vw, 5rem);
    /* Responsive Font */
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.02em;
    margin-bottom: 2%;
}

.section-label {
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 10px;
    display: inline-block;
    opacity: 0.8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 5px;
}

.desc-text {
    font-size: clamp(0.8rem, 1.1vw, 1.1rem);
    line-height: 1.4;
    color: var(--za-text-muted);
    max-width: 95%;
}

.tag-pill {
    position: absolute;
    top: 5%;
    left: 5%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 0.5vw 1.2vw;
    border-radius: 50px;
    font-size: clamp(0.6rem, 0.8vw, 0.85rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.box-content {
    position: absolute;
    bottom: 5%;
    left: 5%;
    right: 5%;
    z-index: 5;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s ease 0.4s;
}

.za-slide.active .box-content {
    transform: translateY(0);
    opacity: 1;
}

/* Slots */
.slot-hero {
    grid-column: 1 / 7;
    grid-row: 1 / 13;
}

.slot-top-mid {
    grid-column: 7 / 10;
    grid-row: 1 / 6;
    background: rgba(255, 255, 255, 0.08);
    /* Fallback */
    background: var(--card-bg);
    /* Use theme */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2vw;
}

.slot-right-tall {
    grid-column: 10 / 13;
    grid-row: 1 / 9;
}

.slot-mid-low {
    grid-column: 7 / 10;
    grid-row: 6 / 13;
}

.slot-nav-box {
    grid-column: 10 / 13;
    grid-row: 9 / 13;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Animations (Scalable Units) */
.za-slide.active .dir-l {
    animation: revealRight var(--za-anim-speed) var(--za-ease-out-expo) forwards;
}

.za-slide.active .dir-r {
    animation: revealLeft var(--za-anim-speed) var(--za-ease-out-expo) forwards;
}

.za-slide.active .dir-t {
    animation: revealDown var(--za-anim-speed) var(--za-ease-out-expo) forwards;
}

.za-slide.active .dir-b {
    animation: revealUp var(--za-anim-speed) var(--za-ease-out-expo) forwards;
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(10%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes revealDown {
    from {
        opacity: 0;
        transform: translateY(-10%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes revealRight {
    from {
        opacity: 0;
        transform: translateX(-10%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes revealLeft {
    from {
        opacity: 0;
        transform: translateX(10%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.za-slide.active .b-item {
    animation-delay: 0s !important;
}

/* Exit Animation */
.za-slide.exit .b-item {
    animation: bentoHide 0.6s var(--za-ease-out-expo) forwards;
}

@keyframes bentoHide {
    to {
        opacity: 0;
        transform: scale(0.92);
    }
}

/* Nav Buttons */
.nav-wrapper {
    display: flex;
    gap: 10px;
    height: 100%;
}

.nav-btn {
    flex: 1;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: var(--za-radius);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.7rem, 1vw, 0.9rem);
}

.nav-btn:hover {
    background: var(--text-primary);
    color: var(--dark-bg);
    border-color: var(--text-primary);
}


/* --- RESPONSIVENESS VIA ASPECT RATIO --- */

/* Tablet Portrait (Vertical Orientation) */
@media (max-width: 1024px) {
    .za-slider-stack {
        aspect-ratio: 3 / 4;
    }

    .slot-hero {
        grid-column: 1 / 13;
        grid-row: 1 / 6;
    }

    .slot-top-mid {
        grid-column: 1 / 7;
        grid-row: 6 / 9;
    }

    .slot-right-tall {
        grid-column: 7 / 13;
        grid-row: 6 / 13;
    }

    .slot-mid-low {
        grid-column: 1 / 7;
        grid-row: 9 / 13;
    }

    .slot-nav-box {
        grid-column: 7 / 13;
        grid-row: 11 / 13;
        position: absolute;
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(5px);
    }

    .big-title {
        font-size: 5vw;
    }
}

/* Mobile (Phone) Uses Tall Ratio */
@media (max-width: 768px) {
    .za-viewport {
        padding: 10px;
    }

    .za-slider-stack {
        aspect-ratio: 9 / 16;
        max-height: 90vh;
    }

    .slot-hero {
        grid-column: 1 / 13;
        grid-row: 1 / 6;
    }

    .slot-top-mid {
        grid-column: 1 / 7;
        grid-row: 6 / 9;
    }

    .slot-mid-low {
        grid-column: 7 / 13;
        grid-row: 6 / 9;
    }

    .slot-right-tall {
        grid-column: 1 / 13;
        grid-row: 9 / 12;
    }

    .slot-nav-box {
        grid-column: 1 / 13;
        grid-row: 12 / 13;
        position: relative;
        background: none;
        backdrop-filter: none;
    }

    .big-title {
        font-size: 8vw;
    }

    .desc-text {
        font-size: 3.5vw;
    }
}