/* ==========================================================================
   hero-home.css - Hero Banner Exclusivo da Home (Grupo Casanova)
   Arquitetura 100% Mobile First (Base Mobile -> min-width: 768px -> min-width: 1024px)
   ========================================================================== */

/* ==========================================================================
   1. Variáveis de Ajuste do Spotlight (Altere aqui para testar facilmente)
   ========================================================================== */
:root {
    --spotlight-height: 542px;  /* Altura / alcance vertical do feixe de luz */
    --spotlight-width: 612px;   /* Largura / abertura horizontal do feixe */
}

/* ==========================================================================
   2. Contentor Principal da Seção Hero (Mobile First)
   ========================================================================== */
.home-hero-section {
    position: relative;
    background-color: var(--color-base-papel, #F6F1E8);
    overflow: hidden;
    padding-top: clamp(40px, 6vw, 76px);
    padding-bottom: clamp(60px, 8vw, 110px);
    box-sizing: border-box;
}

/* ==========================================================================
   3. Feixe de Luz / Holofote Cônico Dinâmico
   (Oculto por padrão no Mobile; ativado progressivamente a partir de 768px)
   ========================================================================== */
.home-spotlight-layer {
    display: none; /* Mobile First: holofote desativado no mobile */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 2; /* Fica POR CIMA da imagem do card, mas POR BAIXO dos textos (z-index: 10) */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 16px, rgba(0, 0, 0, 0.35) 40px, rgba(0, 0, 0, 0.85) 75px, #000000 110px);
    mask-image: linear-gradient(to bottom, transparent 0%, transparent 16px, rgba(0, 0, 0, 0.35) 40px, rgba(0, 0, 0, 0.85) 75px, #000000 110px);
}

.home-spotlight {
    position: absolute;
    width: var(--spotlight-width, 612px);
    height: var(--spotlight-height, 542px);
    top: 0;
    left: 50%;
    margin-left: calc(var(--spotlight-width, 612px) / -2);
    transform-origin: calc(var(--spotlight-width, 612px) / 2) 0;
    pointer-events: none;
    transition: transform 0.55s cubic-bezier(0.25, 1, 0.35, 1);
    will-change: transform;
}

.spotlight-cone-svg {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

/* ==========================================================================
   4. Títulos Centrais da Home (Mobile First com clamp)
   ========================================================================== */
.home-hero-container {
    position: relative;
}

.home-hero-header {
    position: relative;
    z-index: 10; /* Textos SEMPRE por cima do feixe de luz */
    text-align: center;
    margin-bottom: clamp(32px, 5vw, 56px);
}

.home-hero-title {
    font-family: var(--font-serif, 'Source Serif Pro', Georgia, serif);
    font-size: clamp(40px, 5.5vw, 64px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--casa-acento-800, #510C15);
    margin: 0;
    text-align: center;
    overflow-wrap: break-word;
    word-break: break-word;
}

.home-hero-title .title-dal {
    font-style: normal;
    font-weight: 600;
}

.home-hero-title em,
.home-hero-title i,
.home-hero-title .title-year {
    font-style: italic;
    font-weight: 600;
}

.home-hero-subtitle {
    font-family: var(--font-sans, 'Source Sans 3', sans-serif);
    font-weight: 400;
    font-size: clamp(16px, 2.2vw, 22px);
    line-height: 1.5;
    letter-spacing: 0;
    color: var(--color-neutral-800, #3A3733);
    text-align: center;
    max-width: 680px;
    margin: 16px auto 0 auto;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ==========================================================================
   5. Galeria de Cards (Mobile First: Slide Único / Carrossel Horizontal)
   ========================================================================== */
.home-cards-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    width: 100%;
    overflow: hidden;
    margin: 0 auto;
    box-sizing: border-box;
    touch-action: pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
}

/* Card no Mobile: 100% de largura, desliza via CSS custom property */
.home-card {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: clamp(380px, 85vw, 440px);
    overflow: hidden;
    cursor: pointer;
    background-color: var(--color-neutral-900, #1E1C1A);
    box-sizing: border-box;
    user-select: none;
    border-radius: 0;
    transform: translateX(calc(-100% * var(--mobile-slide-index, 0)));
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.35, 1);
    will-change: transform;
    outline: none;
}

.home-card:focus-visible {
    outline: 2px solid var(--casa-acento-600);
    outline-offset: 4px;
}

.home-card-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.home-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.home-card:hover .home-card-img {
    transform: scale(1.03);
}

/* Sombras da Imagem (Mobile First: sombra de 50% ativa por padrão no slide) */
.home-card-shadow {
    display: none; /* Desativada no mobile; ativada no desktop para hover/recolhido */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.home-card-shadow-active {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    z-index: 2;
    background: linear-gradient(180deg, rgba(18, 15, 13, 0) 0%, rgba(18, 15, 13, 0.53) 40%, rgba(18, 15, 13, 0.82) 100%);
    opacity: 1; /* Visível por padrão no mobile para proteger a leitura do card */
    pointer-events: none;
    transition: opacity 0.35s ease;
}

/* Botão Circular (+) e Título Recolhido (Ocultos por padrão no Mobile) */
.home-card-plus-btn {
    display: none;
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #ffffff;
    color: var(--color-neutral-900, #1E1C1A);
    border: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    z-index: 4;
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, box-shadow 0.2s ease;
}

.home-card-plus-btn svg {
    display: block;
    stroke: currentColor;
}

.home-card-title-collapsed {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 80px;
    margin: 0;
    font-family: var(--font-serif, 'Source Serif Pro', Georgia, serif);
    font-weight: 400;
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--color-base-branco, #FEFAFA);
    pointer-events: none;
    user-select: none;
}

/* Conteúdo Textual do Card */
.home-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    z-index: 3;
    box-sizing: border-box;
    pointer-events: none;
}

/* Conteúdo Expandido do Card (Visível por padrão em cada slide do Mobile) */
.home-card-body-expanded {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    box-sizing: border-box;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.home-card-title-expanded {
    font-family: var(--font-serif, 'Source Serif Pro', Georgia, serif);
    font-weight: 600;
    font-size: clamp(28px, 3.2vw, 36px);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--color-base-branco, #FEFAFA);
    margin: 0;
}

.home-card-subtitle {
    font-family: var(--font-archivo, 'Source Sans 3', sans-serif);
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--color-base-branco, #FEFAFA);
    margin: 4px 0 16px 0;
}

.home-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-archivo, 'Source Sans 3', sans-serif);
    font-weight: 500;
    font-size: 13px;
    line-height: 1;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--color-base-branco, #FEFAFA);
    text-decoration: none;
    padding: 6px 0;
    position: relative;
    z-index: 5;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.home-card-cta-arrow {
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.home-card:hover .home-card-cta-arrow {
    transform: translateX(4px);
}

/* Link direto de tela inteira do card ativo */
.home-card-direct-link {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
}

.home-card.is-active .home-card-direct-link {
    display: block;
}

/* ==========================================================================
   6. Bullets de Paginação do Carrossel (Mobile First: Visíveis por padrão)
   ========================================================================== */
.home-slider-bullets {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 4px 0;
}

.home-slider-bullet {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background-color: rgba(81, 12, 21, 0.22);
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    transition: width 0.35s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Área de toque expandida para dedos no mobile (mínimo 32x32px) */
.home-slider-bullet::after {
    content: '';
    position: absolute;
    top: -12px;
    bottom: -12px;
    left: -8px;
    right: -8px;
}

.home-slider-bullet:focus-visible {
    outline: 2px solid var(--casa-acento-800, #510C15);
    outline-offset: 2px;
}

/* Bullet ativo: expande horizontalmente em formato de pílula */
.home-slider-bullet.is-active {
    width: 26px;
    height: 8px;
    border-radius: 4px;
    background-color: var(--casa-acento-800, #510C15);
}

/* ==========================================================================
   7. Adaptação para Tablet (min-width: 768px)
   - Ativa o holofote
   - Oculta os bullets
   - Transforma a galeria em acordeão expansível lado a lado
   ========================================================================== */
@media (min-width: 768px) {
    /* Holofote ativado no Tablet/Desktop */
    .home-spotlight-layer {
        display: block;
    }

    .home-spotlight[data-active-index="0"] {
        transform: rotate(20deg);
    }

    .home-spotlight[data-active-index="1"] {
        transform: rotate(0deg);
    }

    .home-spotlight[data-active-index="2"] {
        transform: rotate(-20deg);
    }

    /* Bullets ocultados no Tablet/Desktop */
    .home-slider-bullets {
        display: none;
    }

    /* Galeria em Acordeão */
    .home-cards-wrapper {
        flex-direction: row;
        gap: 12px;
        overflow: visible;
    }

    .home-card {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        max-width: none;
        height: 380px;
        transform: none;
        transition: flex 0.55s cubic-bezier(0.25, 1, 0.35, 1);
    }

    .home-card.is-active {
        flex: 1.8 1 0;
    }

    /* Elementos do Acordeão: Título recolhido e botão (+) */
    .home-card-title-collapsed {
        display: block;
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1), transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .home-card.is-active .home-card-title-collapsed {
        opacity: 0;
        transform: translateY(10px);
        visibility: hidden;
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0.2s;
    }

    .home-card-plus-btn {
        display: flex;
    }

    .home-card:not(.is-active):hover .home-card-plus-btn {
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
    }

    .home-card-plus-btn:hover {
        transform: scale(1.08);
        background-color: #FEFAFA;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.26);
        color: var(--casa-acento-600);
    }

    .home-card-plus-btn:active {
        transform: scale(0.96);
    }

    .home-card.is-active .home-card-plus-btn {
        opacity: 0;
        transform: scale(0.6);
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    /* Conteúdo Expandido no Acordeão */
    .home-card-body-expanded {
        opacity: 0;
        transform: translateY(16px);
        pointer-events: none;
        visibility: hidden;
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0.25s;
    }

    .home-card.is-active .home-card-body-expanded {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        visibility: visible;
        transition: opacity 0.45s cubic-bezier(0.25, 1, 0.35, 1) 0.15s, transform 0.45s cubic-bezier(0.25, 1, 0.35, 1) 0.15s;
    }

    /* Camadas de Sombra no Desktop/Tablet */
    .home-card-shadow {
        display: block;
    }

    .home-card-shadow::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 91px;
        z-index: 1;
        background: linear-gradient(180deg, rgba(18, 15, 13, 0) 0%, rgba(18, 15, 13, 0.53) 40%, rgba(18, 15, 13, 0.82) 100%);
        opacity: 1;
        pointer-events: none;
        transition: opacity 0.35s ease;
    }

    .home-card-shadow::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 2;
        background: linear-gradient(180deg, rgba(18, 15, 13, 0.25) 0%, rgba(18, 15, 13, 0.55) 45%, rgba(18, 15, 13, 0.85) 100%);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s ease;
    }

    .home-card:not(.is-active):hover .home-card-shadow::after {
        opacity: 1;
    }

    .home-card.is-active .home-card-shadow::before,
    .home-card.is-active .home-card-shadow::after {
        opacity: 0;
    }

    .home-card-shadow-active {
        opacity: 0;
    }

    .home-card.is-active .home-card-shadow-active {
        opacity: 1;
        transition: opacity 0.35s ease;
    }
}

/* ==========================================================================
   8. Adaptação para Desktop (min-width: 1024px)
   - Dimensões exatas dos cards (290px e 530px)
   - Rotações do holofote de 30deg
   ========================================================================== */
@media (min-width: 1024px) {
    .home-cards-wrapper {
        justify-content: center;
        align-items: stretch;
        gap: 16px;
        max-width: 1140px;
    }

    /* Cards inativos no Desktop: 290px x 404px */
    .home-card {
        flex: 1 1 290px;
        width: 290px;
        max-width: 290px;
        height: 404px;
        transition: flex 0.55s cubic-bezier(0.25, 1, 0.35, 1), width 0.55s cubic-bezier(0.25, 1, 0.35, 1), max-width 0.55s cubic-bezier(0.25, 1, 0.35, 1);
    }

    /* Card ativo no Desktop: 530px x 404px */
    .home-card.is-active {
        flex: 1.83 1 530px;
        width: 530px;
        max-width: 530px;
    }

    /* Rotação do holofote no Desktop */
    .home-spotlight[data-active-index="0"] {
        transform: rotate(30deg);
    }

    .home-spotlight[data-active-index="1"] {
        transform: rotate(0deg);
    }

    .home-spotlight[data-active-index="2"] {
        transform: rotate(-30deg);
    }
}