/* ============================================
   LAYOUT STYLES
   Section containers, positioning, grid layouts
   ============================================ */

/* Video Background */
.video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: var(--z-video-bg);
    opacity: 0;
    filter: grayscale(25%) brightness(0.50) contrast(1.2);
    transition: filter 2.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-bg.animate {
    animation: fadeIn 0.5s ease-in forwards;
}

/* ============================================
   BLOCKS - Base Container System
   ============================================ */

.block {
    position: relative;
    width: 100%;
}

/* ============================================
   HERO SECTION LAYOUT
   ============================================ */

.hero-block {
    height: var(--viewport-height);
    padding: clamp(40px, 10vh, 80px) clamp(20px, 5vw, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-container {
    display: grid;
    gap: clamp(20px, 4vh, 40px);
    justify-items: center;
    max-width: min(800px, 90vw);
    max-height: 80vh;
    width: 100%;
    text-align: center;
}

.hero-logo {
    height: clamp(60px, 12vh, 140px);
    width: auto;
    max-width: 90vw;
    object-fit: contain;
}

.hero-text {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* ============================================
   EPISODI SECTION LAYOUT
   ============================================ */

/* Episodi Spacer - Creates scroll range */
.episodi-spacer {
    height: var(--viewport-height);
    width: 1px;
    visibility: hidden;
}

/* Episodi Container Wrapper - Parent container (centered, fixed) */
.episodi-container-wrapper {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: auto;
    max-height: 95vh;
    max-width: 95vw;
    z-index: var(--z-episodi);
    opacity: 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Episodi Sidebar Wrapper - Child of container */
.episodi-sidebar-wrapper {
    width: clamp(150px, 18vw, 250px);
    height: 100%;
    flex-shrink: 0;
}

/* Episodi Content Wrapper - Child of container */
.episodi-content-wrapper {
    height: 100%;
    flex: 1;
    min-width: 0;
}

/* Content Area - Fixed wrapper, content sized to fit */
.content-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: visible;
    overflow-x: visible;
}

.episodio-content {
    display: none;
}

.episodio-content.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.coreografie-section {
    margin-top: clamp(5px, 1vh, 10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: var(--video-width, 100%);
    max-width: 100%;
    flex-shrink: 0;
}

.coreografie-grid {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
    width: fit-content;
    max-width: 100%;
    touch-action: pan-x pan-y;
    pointer-events: auto;
    will-change: scroll-position;
}

/* DESKTOP: Simple horizontal grid */
.carousel-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.carousel-track {
    display: flex;
    gap: 20px;
    justify-content: center;
    width: 100%;
}

/* ============================================
   MISSIONE SECTION LAYOUT
   ============================================ */

.missione-block {
    min-height: var(--viewport-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 8vh, 80px) clamp(15px, 5vw, 40px);
}

.missione-container {
    max-width: clamp(300px, 80vw, 800px);
    text-align: center;
    /* max-height removed - content scales to fit via JS height-based scaling */
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ============================================
   CANDIDATI SECTION LAYOUT
   ============================================ */

/* Candidati spacer - for scroll range */
.candidati-spacer {
    height: 600vh;
    width: 1px;
    visibility: hidden;
}

/* Title wrapper - independent fixed element */
.candidati-title-wrapper {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: calc(var(--z-candidati) + 10);
    opacity: 0;
}

/* Card wrappers - independent fixed elements with stacked z-indexes */
.candidati-card-wrapper {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translate(-50%, 0);
    opacity: 0;
    transition: opacity 0.15s ease-out;
    background: var(--bg-overlay-30);
    backdrop-filter: blur(20px) saturate(90%);
    -webkit-backdrop-filter: blur(20px) saturate(90%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    box-shadow:
        var(--shadow-8),
        var(--shadow-5),
        0 3px 6px rgba(0, 0, 0, 0.25),
        0 1px 3px rgba(0, 0, 0, 0.2),
        var(--shadow-inset-1);
}

/* Individual cards get incrementing z-indexes */
.candidati-card-wrapper[data-card="0"] { z-index: calc(var(--z-candidati) + 0); }
.candidati-card-wrapper[data-card="1"] { z-index: calc(var(--z-candidati) + 1); }
.candidati-card-wrapper[data-card="2"] { z-index: calc(var(--z-candidati) + 2); }
.candidati-card-wrapper[data-card="3"] { z-index: calc(var(--z-candidati) + 3); }
.candidati-card-wrapper[data-card="4"] { z-index: calc(var(--z-candidati) + 4); }

/* ============================================
   CONTATTI SECTION LAYOUT
   ============================================ */

/* Contatti Spacer - Creates scroll range */
.contatti-spacer {
    height: 200vh;
    width: 1px;
    visibility: hidden;
}

/* Contatti Container - Fixed positioned, scroll-animated */
.contatti-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    gap: clamp(20px, 4vh, 40px);
    justify-items: center;
    max-width: min(800px, 85vw);
    width: 100%;
    text-align: center;
    z-index: var(--z-contatti);
    opacity: 0;
    visibility: hidden;
    padding: clamp(20px, 5vw, 40px);
}

.contatti-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: clamp(40px, 5vw, 80px);
    margin-top: 50px;
}
