/* templates/classic/css/news.css */

/* --- FUENTES Y VARIABLES (FORZADO DARK) --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Cinzel:wght@400;700;900&display=swap');

:root {
    /* Forzamos colores oscuros aunque el template sea claro */
    --news-gold: #FF8A3B;
    --news-bg-card: #151515;      /* Fondo MUY oscuro para las tarjetas */
    --news-bg-dark: #0d1117;      /* Fondo para inputs/modal */
    --news-border: #333;          /* Bordes oscuros */
    --news-text-main: #e0e0e0;    /* Texto claro */
    --news-text-muted: #999;      /* Texto secundario */
    --news-radius: 6px;
}

/* --- CONTENEDOR PRINCIPAL --- */
.news-container {
    padding: 10px 0;
    width: 100%;
    margin: 0 auto;
    font-family: 'Poppins', sans-serif !important;
}

/* --- HEADER & BUSCADOR --- */
.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--news-gold); /* Línea dorada */
    flex-wrap: wrap;
    gap: 15px;
}

.news-h1 {
    font-family: 'Cinzel', serif !important;
    font-size: 2rem;
    font-weight: 700;
    color: #333; /* Título oscuro porque el fondo del Classic es blanco */
    margin: 0;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-h1 i {
    color: var(--news-gold);
}

/* Buscador Estilo Dark */
.news-search-box {
    position: relative;
    width: 280px;
}

.news-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #8b949e;
    font-size: 14px;
    z-index: 2;
}

.news-search-input {
    width: 100%;
    background: #222 !important; /* Forzamos fondo oscuro */
    border: 1px solid #444 !important;
    padding: 10px 10px 10px 35px;
    border-radius: 4px;
    color: #fff !important; /* Texto blanco */
    font-size: 13px;
    outline: none;
    transition: 0.3s;
}

.news-search-input:focus {
    border-color: var(--news-gold) !important;
    box-shadow: 0 0 8px rgba(255, 138, 59, 0.2);
}

/* --- GRID SYSTEM --- */
#newsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* Layout Full (Lista) */
#newsGrid.layout-full {
    grid-template-columns: 1fr;
}

/* --- NEWS CARD (ESTILO MORPHEUS/DARK) --- */
.news-card {
    background-color: var(--news-bg-card) !important; /* Fondo NEGRO */
    border: 1px solid var(--news-border) !important;
    border-radius: var(--news-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4); /* Sombra fuerte para resaltar sobre blanco */
}

.news-card:hover {
    transform: translateY(-5px);
    border-color: var(--news-gold) !important;
    box-shadow: 0 15px 30px rgba(0,0,0,0.6);
}

.news-img-box {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #000;
    border-bottom: 1px solid #222;
}

.news-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    opacity: 0.9;
}

.news-card:hover .news-img {
    transform: scale(1.1);
    opacity: 1;
}

.news-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Fecha */
.news-date {
    font-size: 11px;
    color: var(--news-gold) !important; /* Fecha dorada */
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Título de la noticia */
.news-item-title {
    font-family: 'Cinzel', serif !important;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff !important; /* Texto blanco forzado */
    margin-bottom: 10px;
    line-height: 1.3;
    transition: color 0.3s;
}

/* Descripción */
.news-desc {
    font-size: 0.85rem;
    color: #aaa !important; /* Gris claro para leer sobre negro */
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- ESTILOS ESPECÍFICOS PARA LAYOUT 'FULL' --- */
.layout-full .news-card {
    flex-direction: row;
    height: 220px;
}

.layout-full .news-img-box {
    width: 40%;
    height: 100%;
    border-bottom: none;
    border-right: 1px solid #222;
}

.layout-full .news-body {
    width: 60%;
    justify-content: center;
}

.layout-full .news-item-title {
    font-size: 1.4rem;
}

/* --- MODAL LECTOR (DARK MODE) --- */
.news-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Animación de apertura */
.news-modal-overlay[style*="display: flex"] { opacity: 1; }

.news-modal {
    background: #111; /* Modal totalmente oscuro */
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border: 1px solid #333;
    border-radius: var(--news-radius);
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.news-modal-overlay[style*="display: flex"] .news-modal { transform: translateY(0); }

.nm-header {
    padding: 15px 25px;
    border-bottom: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0a0a0a;
    border-radius: var(--news-radius) var(--news-radius) 0 0;
}

.nm-title {
    font-family: 'Cinzel', serif !important;
    color: var(--news-gold);
    font-size: 18px;
    font-weight: 700;
}

.nm-close {
    color: #666;
    cursor: pointer;
    font-size: 18px;
    transition: 0.2s;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.nm-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

.nm-content-scroll {
    padding: 30px;
    overflow-y: auto;
    color: #ccc; /* Texto legible en modal oscuro */
    line-height: 1.7;
    font-size: 14px;
    background: #111;
}

/* Scrollbar interno */
.nm-content-scroll::-webkit-scrollbar { width: 6px; }
.nm-content-scroll::-webkit-scrollbar-track { background: #000; }
.nm-content-scroll::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.nm-content-scroll::-webkit-scrollbar-thumb:hover { background: var(--news-gold); }

.nm-banner {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #333;
    display: none;
}

/* Contenido de la noticia */
#nmBody img { max-width: 100%; height: auto; border-radius: 4px; margin: 10px 0; border: 1px solid #333; }
#nmBody p { margin-bottom: 15px; }
#nmBody a { color: var(--news-gold); text-decoration: none; font-weight: 600; }
#nmBody a:hover { text-decoration: underline; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .news-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .news-search-box {
        width: 100%;
    }
    
    /* En móvil, forzamos cards verticales incluso en layout full */
    .layout-full .news-card {
        flex-direction: column;
        height: auto;
    }
    .layout-full .news-img-box {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #222;
    }
    .layout-full .news-body {
        width: 100%;
    }
}