/* ARQUIVO: assets/css/parts/_media-center.css */

/* --- WRAPPER PRINCIPAL --- */
.ch-media-wrapper {
    background: #fdfbf7; 
    width: 100%;
    
    /* AUMENTADO DE 550px PARA 650px */
    height: 650px; 
    
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    font-family: 'Nunito', sans-serif;
    box-sizing: border-box;
    margin: 0 auto; 
    
    /* Layout Flex Vertical */
    display: flex;
    flex-direction: column;
}

.ch-media-wrapper * { box-sizing: border-box; }

/* Barra Lateral Decorativa */
.ch-media-wrapper::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
    background: linear-gradient(180deg, #009688 0%, #80cbc4 100%);
    z-index: 5;
}

/* INTERIOR: ZERO PADDING NO TOPO */
.media-content-inner { 
    /* Padding Top = 0 (Cola no teto) */
    /* Laterais 20px, Base 5px */
    padding: 15px 20px 5px 20px !important; 
    
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0 !important;
}

/* HEADER: SEM MARGEM */
.media-header { 
    margin: 0 0 5px 0 !important; /* Margem mínima embaixo apenas */
    padding: 0 !important;
    flex-shrink: 0;
    line-height: 1;
}

.media-header h2 {
    margin: 0 !important; 
    padding: 0 !important;
    font-size: 18px; /* Fonte ajustada */
    color: #2c3e50; 
    font-weight: 800;
    display: flex; align-items: center; gap: 6px;
    text-transform: uppercase;
    line-height: 1 !important;
}
.icon-eco { color: #009688; font-size: 18px; }

/* --- SEÇÃO DE VÍDEOS --- */
.video-section { 
    position: relative; 
    /* Força o vídeo a ocupar TODO o espaço restante */
    flex: 1 1 auto; 
    display: flex;
    flex-direction: column;
    min-height: 0; /* Essencial para flexbox não estourar */
    margin-bottom: 5px;
    margin-top: 0 !important;
}

.section-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
    color: #009688; font-weight: 800; 
    margin-bottom: 5px; /* Mínimo espaço entre label e vídeo */
    display: flex; align-items: center; gap: 6px;
    flex-shrink: 0;
}

/* SEGURANÇA: Garante que o timer suma mesmo se o HTML sobrar */
.timer-badge {
    display: none !important;
}

/* Container do Player */
.video-player-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%; 
    min-height: 0; /* Permite encolher se necessário */
}

.cine-fauna-layout { 
    display: block; 
    width: 100%; 
    height: 100%; 
    flex-grow: 1;
    position: relative;
}

/* PALCO DO VÍDEO */
.main-video-stage {
    background: #000; border-radius: 8px; overflow: hidden;
    position: relative; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 100%; 
    height: 100% !important; /* Força altura total */
    cursor: pointer;
}

/* IMAGEM: AQUI ESTÁ O FIX DO "ACHATADO" */
.main-video-stage img.cover-img { 
    width: 100%; 
    height: 100%; 
    /* Cover: Corta as bordas se preciso, mas NUNCA distorce/achata a imagem */
    object-fit: cover; 
    object-position: center;
    opacity: 0.9; 
    transition: opacity 0.5s ease;
    display: block;
}

/* Botões Navegação Vídeo */
.vid-nav-btn {
    width: 30px; height: 30px; border-radius: 50%;
    background: #009688; color: #fff; border: none;
    font-size: 16px; font-weight: bold; cursor: pointer; 
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; opacity: 1; transition: none !important;
}
.vid-nav-btn:hover { background: #00796b !important; }

/* Iframe e Play */
.video-iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: none; z-index: 10;
}
.video-iframe.active { display: block; }

.play-big {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 50px; height: 50px; 
    background: rgba(255,255,255,0.9);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #009688; font-size: 24px; box-shadow: 0 0 15px rgba(0,0,0,0.2);
    transition: 0.3s; z-index: 5;
}
.main-video-stage:hover .play-big { transform: translate(-50%,-50%) scale(1.1); background: #fff; }

.video-info-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 8px 12px; 
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    pointer-events: none; transition: opacity 0.3s; z-index: 5;
}
.video-info-overlay h3 { font-size: 13px; margin: 0; line-height: 1.2; }
.video-info-overlay p { font-size: 10px; margin: 1px 0 0; opacity: 0.9; }

.progress-container {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 3px;
    background: rgba(255,255,255,0.2); z-index: 6;
}
.progress-fill {
    height: 100%; width: 0%;
    background: #00E5FF;
    transition: width 0.1s linear; 
}

/* --- SEÇÃO DE LIVROS (Compacta no Rodapé) --- */
.book-section { 
    position: relative; 
    flex-shrink: 0; /* Garante que não suma */
    height: auto;
    border-top: 1px dashed rgba(0,0,0,0.1);
    padding-top: 5px;
    margin-top: auto; 
}

.book-carousel-container { position: relative; }

.book-carousel-track {
    display: flex; gap: 15px; overflow-x: auto; 
    padding: 5px 2px 10px; scrollbar-width: none;
    scroll-behavior: smooth; align-items: flex-start;
}
.book-carousel-track::-webkit-scrollbar { display: none; }

/* CARD DO LIVRO */
.book-card {
    flex: 0 0 auto; 
    /* LARGURA AUMENTADA */
    width: 110px; 
    background: transparent; 
    border-radius: 4px; padding: 0; position: relative;
    cursor: pointer; display: flex; flex-direction: column; 
    align-items: center; text-align: center; transition: transform 0.2s;
}
.book-card:hover { transform: translateY(-2px); }

/* CAPA DO LIVRO (Maior) */
.book-cover { 
    /* ALTURA AUMENTADA PARA 140px */
    height: 140px !important; 
    width: auto !important;   
    max-width: 110px !important;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
    margin-bottom: 6px; border-radius: 2px; display: block;
}

.book-info { width: 100%; }

.book-title { 
    font-size: 10px; font-weight: 700; color: #333; 
    line-height: 1.1; margin-bottom: 4px; 
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    height: 22px; 
}
.book-meta { display: none; } 

.btn-download {
    display: block; 
    background: rgba(0, 150, 136, 0.1); color: #00796b; 
    font-size: 9px; font-weight: 800; text-transform: uppercase; padding: 3px 0; 
    border-radius: 3px; 
    
    /* REMOVENDO SUBLINHADO FORÇADAMENTE */
    text-decoration: none !important; 
    border-bottom: none !important;
    
    width: 100%; 
    transition: all 0.2s;
}
.book-card:hover .btn-download { background: #009688; color: #fff; }

/* Botões Nav Livros */
.book-nav-btn {
    position: absolute; top: 40%; transform: translateY(-50%);
    width: 24px; height: 24px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15); border: 1px solid #eee; color: #333;
    font-size: 14px; cursor: pointer; z-index: 20; 
    display: flex; align-items: center; justify-content: center;
}
.book-nav-btn:hover { background: #009688; color: #fff; border-color: #009688; }
.prev { left: -8px; }
.next { right: -8px; }

/* RESPONSIVO */
@media (max-width: 600px) {
    .ch-media-wrapper { height: auto; min-height: 650px; } 
    .video-player-container { flex-direction: column; gap: 10px; }
    .cine-fauna-layout { height: 250px; width: 100%; }
    .vid-nav-btn { display: none; } 
    .media-content-inner { padding: 15px; }
}

/* DARK MODE */
body.ceclimar-dark-mode .ch-media-wrapper { background: #181818; border-color: #333; }
body.ceclimar-dark-mode .media-header h2 { color: #fff; }
body.ceclimar-dark-mode .book-title { color: #ccc; }
body.ceclimar-dark-mode .btn-download { background: #333; color: #009688; }
body.ceclimar-dark-mode .book-nav-btn { background: #333; border-color: #444; color: #fff; }