/* =========================================================
   NOTICIAS CSS - DARK GLASSMORPHISM (BINGLISH)
   ========================================================= */

:root {
    --noticias-bg: #0A0F1E;
    --noticias-card-bg: rgba(255, 255, 255, 0.03);
    --noticias-card-border: rgba(255, 255, 255, 0.1);
    --noticias-text-primary: #FFFFFF;
    --noticias-text-secondary: rgba(255, 255, 255, 0.6);
    --noticias-accent: #00E5FF;
    --noticias-accent-hover: #00B3CC;
    --noticias-gradient-1: #0A1128;
    --noticias-gradient-2: #16244A;
}

body.noticias-page {
    background-color: var(--noticias-bg);
    background-image: radial-gradient(circle at 15% 50%, rgba(0, 229, 255, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(33, 150, 243, 0.08), transparent 25%);
    background-attachment: fixed;
    color: var(--noticias-text-primary);
    min-height: 100vh;
}

/* --- PAGE WRAPPER --- */
.noticias-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
}

/* --- HEADER --- */
.noticias-header {
    text-align: center;
    margin-bottom: 50px;
}

.noticias-eyebrow {
    color: var(--noticias-accent);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.noticias-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 800;
    color: var(--noticias-text-primary);
    margin-bottom: 15px;
}

.noticias-subtitle {
    font-size: 1.1rem;
    color: var(--noticias-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* --- TOOLBAR (FILTROS Y BUSCADOR) --- */
.noticias-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    background: var(--noticias-card-bg);
    border: 1px solid var(--noticias-card-border);
    padding: 15px 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.noticias-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--noticias-card-border);
    color: var(--noticias-text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: rgba(0, 229, 255, 0.1);
    border-color: var(--noticias-accent);
    color: var(--noticias-accent);
}

.search-wrap {
    position: relative;
    flex-grow: 1;
    max-width: 300px;
}

.search-wrap i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--noticias-text-secondary);
}

.search-wrap input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--noticias-card-border);
    color: #fff;
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.search-wrap input:focus {
    outline: none;
    border-color: var(--noticias-accent);
}

/* --- GRID Y CARDS --- */
.noticias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.noticia-card {
    background: var(--noticias-card-bg);
    border: 1px solid var(--noticias-card-border);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.noticia-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.1);
}

.noticia-img {
    height: 200px;
    background: #1A233A;
    /* Fallback */
    position: relative;
    overflow: hidden;
}

.noticia-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.noticia-card:hover .noticia-img img {
    transform: scale(1.05);
}

.noticia-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: var(--noticias-accent);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.noticia-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.noticia-date {
    font-size: 0.8rem;
    color: var(--noticias-accent);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.noticia-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--noticias-text-primary);
    margin-bottom: 15px;
    line-height: 1.4;
    width: 100%;
    text-wrap: wrap;
    word-break: break-word;
}

.noticia-excerpt {
    font-size: 0.95rem;
    color: var(--noticias-text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;

    /* Truncate multi-line with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.noticia-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--noticias-card-border);
    padding-top: 15px;
}

.noticia-readmore {
    color: var(--noticias-accent);
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s ease;
}

.noticia-card:hover .noticia-readmore {
    gap: 10px;
}

/* --- VISTA DETALLADA --- */
#vista-detalle {
    display: none;
}

.noticia-detalle-header {
    margin-bottom: 40px;
    text-align: left;
}

.noticia-detalle-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    margin: 15px 0;
    text-align: justify;
}

.noticia-detalle-meta {
    color: var(--noticias-accent);
    font-size: 0.9rem;
}

/* --- CUSTOM IMAGE SLIDER --- */
.detalle-slider-wrapper {
    position: relative;
    width: 100%;
}

.detalle-slider-viewport {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--noticias-card-border);
    position: relative;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.detalle-slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.detalle-slider-track img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    max-height: 450px;
    object-fit: contain;
    flex-shrink: 0;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
}

.slider-btn-prev {
    left: 16px;
}

.slider-btn-next {
    right: 16px;
}

.slider-btn:hover {
    background: rgba(0, 229, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

/* Slider sin imágenes (icono) */
.detalle-slider-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    max-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid var(--noticias-card-border);
}

.noticia-detalle-content {
    font-size: 1.1rem;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 40px;
    text-align: justify;
}

.noticia-detalle-content h1,
.noticia-detalle-content h2,
.noticia-detalle-content h3 {
    color: #fff;
    font-family: 'Playfair Display', serif;
    margin-top: 30px;
    margin-bottom: 15px;
}

/* --- QUILL SIZES Y FONTS --- */
.noticia-detalle-content .ql-size-small {
    font-size: 0.85em !important;
}

.noticia-detalle-content .ql-size-large {
    font-size: 1.5em !important;
}

.noticia-detalle-content .ql-size-huge {
    font-size: 2.5em !important;
}

.noticia-detalle-content .ql-font-serif {
    font-family: 'Playfair Display', serif !important;
}

.noticia-detalle-content .ql-font-monospace {
    font-family: monospace !important;
}

/* --- QUOTE BLOCK (Citas periodísticas) --- */
.quote-block,
.noticia-detalle-content blockquote {
    border-left: 3px solid var(--noticias-accent);
    padding: 14px 22px;
    margin: 28px 0;
    background: rgba(0, 229, 255, 0.05);
    border-radius: 0 8px 8px 0;
}

.quote-block p,
.noticia-detalle-content blockquote p {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--noticias-accent);
    line-height: 1.6;
    margin: 0;
    font-style: italic;
}

.quote-block cite {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: normal;
}

/* --- SHARE ROW --- */
.share-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid var(--noticias-card-border);
}

.share-label {
    font-weight: 600;
    color: var(--noticias-text-secondary);
    font-size: 0.95rem;
    margin-right: 8px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--noticias-text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.share-btn.wa i {
    color: #25D366;
}

.share-btn.wa:hover {
    background: rgba(37, 211, 102, 0.2);
    border-color: #25D366;
    color: #25D366;
}

.share-btn.fb i {
    color: #1877F2;
}

.share-btn.fb:hover {
    background: rgba(24, 119, 242, 0.2);
    border-color: #1877F2;
    color: #1877F2;
}

.share-btn:not(.wa):not(.fb) i {
    color: #00E5FF;
}

/* --- GALERÍA DE IMÁGENES MODERNIZADA --- */
.noticia-galeria {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 220px;
    gap: 20px;
    margin-top: 30px;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--noticias-card-bg);
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.3);
    z-index: 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.6s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
    filter: brightness(0.6) blur(2px);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 229, 255, 0.15);
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    backdrop-filter: blur(5px);
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}

.gallery-item:hover .gallery-icon {
    transform: translateY(0) scale(1);
    opacity: 1;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- LIGHTBOX MODAL --- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 20px;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000;
}

.lightbox-close:hover {
    background: rgba(220, 53, 69, 0.8);
    border-color: #dc3545;
    transform: rotate(90deg);
}

.lightbox-overlay img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    object-fit: contain;
}

.lightbox-overlay.active img {
    transform: scale(1);
    opacity: 1;
}

.btn-back {
    background: transparent;
    border: 1px solid var(--noticias-card-border);
    color: var(--noticias-text-primary);
    padding: 10px 20px;
    border-radius: 20px;
    margin-bottom: 30px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--noticias-accent);
    border-color: var(--noticias-accent);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .noticias-title {
        font-size: 2.2rem;
    }

    .noticia-detalle-title {
        font-size: 2rem;
    }

    .noticia-detalle-content {
        padding: 20px;
    }

    .pagination-row {
        flex-direction: column;
        justify-content: center;
    }
}

/* --- PAGINATION --- */
.pagination-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--noticias-card-border);
}

.pagination-info {
    color: var(--noticias-text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.page-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--noticias-card-border);
    color: var(--noticias-text-primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.page-btn:hover:not(:disabled) {
    background: rgba(0, 229, 255, 0.1);
    border-color: var(--noticias-accent);
    color: var(--noticias-accent);
}

.page-btn.active {
    background: var(--noticias-accent);
    border-color: var(--noticias-accent);
    color: var(--noticias-bg);
    font-weight: bold;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}