/* =============================================
   EVENT COVERS V5.0 - AUTOMATIC HEIGHT (PC & MOBILE)
   ============================================= */

/* --- BASE GERAL (Reset) --- */
.event-cover-wrapper {
    display: block;
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #1a1a24; /* Cor de fundo de carregamento */
    padding: 0;
    margin: 0;
    line-height: 0;
}

.event-cover-image {
    width: 100%;
    height: 100%;
    display: block;
    margin: 0;
    padding: 0;
    transition: transform 0.5s ease;
}

/* Badge Flutuante */
.event-cover-badge {
    position: absolute;
    z-index: 2;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
}

/* =============================================
   📱 MOBILE (Até 768px)
   Comportamento: Altura Automática (Já estava a funcionar)
   ============================================= */
@media (max-width: 768px) {
    
    .event-cover-wrapper {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        aspect-ratio: unset !important;
        border-radius: 16px 16px 0 0;
        background-color: transparent !important;
    }

    .event-cover-image {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        position: relative !important;
    }

    /* Carrossel Mobile */
    .carousel-slide .event-cover-wrapper {
        min-height: 0 !important;
        height: auto !important;
    }

    .event-cover-badge {
        top: 10px;
        right: 10px;
        font-size: 10px;
        padding: 4px 10px;
        border-radius: 8px;
    }
}

/* =============================================
   💻 DESKTOP (Acima de 769px)
   Comportamento: Híbrido (Auto para Destaques, Fixo para Grid)
   ============================================= */
@media (min-width: 769px) {

    /* 1. CARDS DE GRID/LISTA (Mantém alinhamento fixo) */
    .glass-card .event-cover-wrapper {
        height: 200px;
        min-height: 200px;
        background-color: #1a1a24;
        border-radius: 16px 16px 0 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .glass-card .event-cover-image {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Corta para preencher o quadrado */
        object-position: top center;
    }

    /* 2. 🔥 CARROSSEL / DESTAQUES (CORREÇÃO DE ALTURA AUTOMÁTICA) */
    /* Removemos a altura fixa de 280px e deixamos a imagem mandar */
    .carousel-slide .event-cover-wrapper {
        width: 100%;
        height: auto !important; /* A MÁGICA: Altura automática */
        min-height: auto !important; /* Remove mínimo forçado */
        max-height: 400px; /* Limite de segurança */
        background-color: transparent; /* Remove fundo preto */
        border-radius: 16px 16px 0 0;
        display: block; 
    }

    .carousel-slide .event-cover-image {
        width: 100%;
        height: auto !important; /* Altura segue a largura */
        object-fit: contain; /* Garante qualidade máxima */
        position: relative;
    }

    /* Zoom no hover */
    .glass-card:hover .event-cover-image,
    .carousel-slide:hover .event-cover-image {
        transform: scale(1.03);
    }

    /* 3. PÁGINA DE INSCRIÇÃO (Banner) */
    .event-detail-cover .event-cover-wrapper {
        height: auto !important;
        max-height: 500px !important;
        border-radius: 24px;
        background-color: transparent;
    }
    
    .event-detail-cover .event-cover-image {
        object-fit: contain;
    }

    /* Badge Desktop */
    .event-cover-badge {
        top: 16px;
        right: 16px;
        font-size: 12px;
        padding: 6px 14px;
        border-radius: 20px;
    }
}

/* =============================================
   AJUSTES GERAIS
   ============================================= */

/* Garante flexibilidade no container do card */
.carousel-slide > div {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* A imagem não pode encolher além do seu tamanho */
.carousel-slide .event-cover-wrapper {
    flex-shrink: 0;
}

/* Miniaturas (Admin/Listas) */
.event-cover-mini {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
}