/* ============================================
   PORTADA.CSS - Hero Grid y Bloques Netflix
   ============================================ */

/* HERO GRID (Portada Principal) */
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    margin-bottom: 40px;
}

.hero-main {
    position: relative;
    height: auto;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: white;
    background-color: #f0f0f0;
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hero-small {
    position: relative;
    height: auto;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: white;
    background-color: #f0f0f0;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.hero-main:hover .hero-img,
.hero-small:hover .hero-img {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    padding: 25px;
}

.hero-cat {
    /* COMPORTAMIENTO DE BLOQUE FLUIDO */
    display: table; /* Truco: Ocupa solo el ancho del texto pero se comporta como bloque */
    margin-bottom: 10px; /* Separación con el título */
    
    /* ESTILO */
    background: var(--color-primario);
    color: white;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 3px;
    line-height: 1; /* Evita alturas raras */
    
    /* SEGURIDAD */
    white-space: nowrap; /* Prohibido romper línea */
    max-width: 100%; /* Si es gigante, se corta */
    overflow: hidden;
    text-overflow: ellipsis;
}

/*.hero-title {
    //margin: 0;
    //font-size: 1.8rem;
    //line-height: 1.1;
    //text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}*/

.hero-excerpt {
    font-size: 1rem;
    margin-top: 10px;
    opacity: 0.9;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-title-sm {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

/* TITULO BASE (Dinámico) */
.hero-title {
    margin: 0;
    line-height: 1.2; /* Un poco más de aire para leer mejor */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9); /* Sombra más fuerte para contraste */
    
    /* LA MAGIA: clamp(MÍNIMO, IDEAL, MÁXIMO) */
    /* En celular será 1.2rem, en tablet crecerá, en PC será 1.8rem */
    font-size: clamp(1.25rem, 4vw, 1.8rem);
    
    /* SEGURIDAD: Cortar texto si es muy largo (puntos suspensivos...) */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Máximo 3 líneas */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* TITULOS PEQUEÑOS (Los del costado / abajo en móvil) */
.hero-title-sm {
    /* Hacemos estos un poco más chicos todavía */
    font-size: clamp(1rem, 3.5vw, 1.4rem);
    
    /* Máximo 2 o 3 líneas para los secundarios */
    -webkit-line-clamp: 3; 
}

/* SECCIONES DE CATEGORÍAS */
.cat-section {
    margin-bottom: 40px;
}

.cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 2px solid #000;
    padding-bottom: 5px;
}

.cat-section-title {
    font-size: 1.4rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #000;
    margin: 0;
}

/* SLIDER HORIZONTAL (Estilo Netflix) */
.slider-row {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 15px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.slider-row::-webkit-scrollbar {
    height: 6px;
}

.slider-row::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.news-card {
    flex: 0 0 260px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
}

.news-img-box {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    background-color: #f0f0f0;
}

.news-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-title {
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.4;
    margin: 0;
    color: #333;
}

/* TAGS DENTRO DE BLOQUES */
.block-tags-wrapper {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-borde);
    display: flex;
    align-items: center;
    overflow-x: auto;
    white-space: nowrap;
}

.block-tags-wrapper::-webkit-scrollbar {
    height: 2px;
}

.block-tags-wrapper::-webkit-scrollbar-thumb {
    background: var(--color-primario);
}

.block-tag {
    font-size: 0.75rem;
    color: var(--color-texto-claro);
    background: #f4f4f4;
    padding: 4px 10px;
    border-radius: 20px;
    margin-right: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
    border: 1px solid var(--color-borde);
}

.block-tag:hover {
    background: var(--color-primario);
    color: white;
    border-color: var(--color-primario);
}

.block-tag-icon {
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--color-primario);
    margin-right: 8px;
    text-transform: uppercase;
}

/* GRID DE CATEGORÍAS (Para buscador) */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.cat-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--sombra-card);
    transition: transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.cat-card:hover {
    transform: translateY(-5px);
}

.cat-img-box {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f0f0f0;
}

.cat-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.cat-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0 0 10px 0;
    line-height: 1.3;
    color: var(--color-texto);
}

.cat-excerpt {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
}

.cat-meta {
    font-size: 0.8rem;
    color: var(--color-texto-claro);
    margin-top: auto;
    border-top: 1px solid var(--color-borde);
    padding-top: 10px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-main {
        height: auto;
        aspect-ratio: 16/9;
    }

    .hero-side {
        display: none;
    }

    .hero-excerpt {
        display: none;
    }

    .news-card {
        flex: 0 0 85vw;
    }
}