/* ==========================================================================
   LAYOUT GENERAL - Contenedor Noticias
   ========================================================================== */

.noticias-wrapper {
    min-height: calc(100vh - 62px);
    background: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);
    padding: 48px 0;
}

.noticias-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   LISTADO DE NOTICIAS - Grid Premium
   ========================================================================== */

.noticias-header {
    margin-bottom: 40px;
}

.noticias-header__top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.noticias-header__accent {
    display: block;
    width: 4px;
    height: 36px;
    background: #1B365D;
    border-radius: 2px;
    flex-shrink: 0;
}

.noticias-header__title {
    font-size: 2rem;
    font-weight: 700;
    color: #1B365D;
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1;
}

.noticias-header__subtitle {
    font-size: 0.9375rem;
    color: #6B7280;
    margin: 0;
    padding-left: 18px;
}

.noticias-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 48px;
}

/* Grid responsive - máximo 3 columnas en desktop */
@media (min-width: 640px) {
    .noticias-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .noticias-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   TARJETA DE NOTICIA - Card Premium con Thumbnail
   ========================================================================== */

.noticia-card {
    background-color: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.noticia-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(27, 54, 93, 0.15);
    border-color: #3B82F6;
}

/* Thumbnail superior - Contenedor rectangular para logotipos */
.noticia-card-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #FAFAFA;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border-bottom: 1px solid #F3F4F6;
}

.noticia-card-thumbnail img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.4s ease;
}

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

.noticia-card-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    border-radius: 8px;
    position: absolute;
    top: 0;
    left: 0;
}

.noticia-card-thumbnail-placeholder i {
    font-size: 52px;
    color: #9CA3AF;
    transition: all 0.3s ease;
}

.noticia-card:hover .noticia-card-thumbnail-placeholder i {
    color: #6B7280;
    transform: scale(1.1);
}

/* Contenido de la tarjeta */
.noticia-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.noticia-card-title {
    font-family: inherit;
    font-size: 1.375rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
    line-height: 1.4;
    transition: color 0.2s ease;
    
    /* Truncar a 2 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.noticia-card:hover .noticia-card-title {
    color: #1B365D;
}

.noticia-card-excerpt {
    font-size: 0.9375rem;
    color: #6B7280;
    line-height: 1.6;
    margin: 0 0 16px 0;
    flex-grow: 1;
    
    /* Truncar a 3 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.noticia-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid #E5E7EB;
}

.noticia-card-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #6B7280;
}

.noticia-card-date i {
    color: #9CA3AF;
}

.noticia-card-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #3B82F6;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.noticia-card-button:hover {
    background-color: #2563EB;
    transform: translateX(2px);
    color: #FFFFFF;
}

.noticia-card-button i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.noticia-card-button:hover i {
    transform: translateX(4px);
}

/* ==========================================================================
   VISTA DETALLE - Diseño Editorial Premium
   ========================================================================== */

.article-view {
    min-height: calc(100vh - 62px);
    background: linear-gradient(180deg, #FAFBFC 0%, #F1F5F9 100%);
    padding: 56px 0 80px 0;
}

.article-view__container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Cabecera del artículo */
.article-header {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 48px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* Logotipo destacado - Ancho completo */
.article-header__brand {
    width: 100%;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    padding: 40px;
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    border-radius: 8px;
    border: 1px solid #E8ECF1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.article-header__logo {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Badge de categoría */
.article-header__category {
    margin-bottom: 20px;
}

.article-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background-color: #1B365D;
    color: #FFFFFF;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.article-badge svg {
    opacity: 0.8;
}

/* Título */
.article-header__title {
    font-family: inherit;
    font-size: 2.5rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 24px 0;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

/* Metadatos */
.article-header__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid #E8ECF1;
}

.article-meta__date,
.article-meta__time {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
    color: #64748B;
}

.article-meta__date svg,
.article-meta__time svg {
    color: #94A3B8;
}

.article-meta__divider {
    width: 4px;
    height: 4px;
    background-color: #CBD5E1;
    border-radius: 50%;
}

/* Cuerpo del artículo */
.article-body {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 48px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.article-body__content {
    font-family: inherit;
    font-size: 1.0625rem;
    line-height: 1.85;
    color: #334155;
    
    /* Control de desbordamiento */
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.article-body__content h1,
.article-body__content h2,
.article-body__content h3,
.article-body__content h4 {
    color: #0F172A;
    margin-top: 40px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.article-body__content h1:first-child,
.article-body__content h2:first-child,
.article-body__content h3:first-child {
    margin-top: 0;
}

.article-body__content h1 { font-size: 1.875rem; }
.article-body__content h2 { font-size: 1.5rem; }
.article-body__content h3 { font-size: 1.25rem; }

.article-body__content p {
    margin-bottom: 24px;
}

.article-body__content a {
    color: #2563EB;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.article-body__content a:hover {
    color: #1D4ED8;
}

.article-body__content ul,
.article-body__content ol {
    margin: 0 0 24px 24px;
    padding: 0;
}

.article-body__content li {
    margin-bottom: 10px;
}

.article-body__content blockquote {
    border-left: 3px solid #1B365D;
    padding: 16px 0 16px 24px;
    margin: 32px 0;
    background-color: #F8FAFC;
    border-radius: 0 8px 8px 0;
}

.article-body__content blockquote p {
    margin: 0;
    font-style: italic;
    color: #475569;
}

/* Control de imágenes embebidas */
.article-body__content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 32px 0;
    display: block;
}

/* Tablas - Anti-desbordamiento */
.article-body__content table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
    margin: 24px 0;
    border-collapse: collapse;
}

.article-body__content th,
.article-body__content td {
    padding: 12px 16px;
    border: 1px solid #E2E8F0;
    text-align: left;
}

.article-body__content th {
    background-color: #F8FAFC;
    font-weight: 600;
}

/* iframes y embeds */
.article-body__content iframe,
.article-body__content embed,
.article-body__content object,
.article-body__content video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Código */
.article-body__content pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #1E293B;
    color: #E2E8F0;
    padding: 20px;
    border-radius: 8px;
    margin: 24px 0;
}

.article-body__content code {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.9em;
    background-color: #F1F5F9;
    padding: 2px 6px;
    border-radius: 4px;
}

.article-body__content pre code {
    background: none;
    padding: 0;
}

/* Pie del artículo */
.article-footer {
    display: flex;
    justify-content: flex-start;
}

.article-footer__back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background-color: #FFFFFF;
    color: #475569;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.article-footer__back:hover {
    background-color: #1B365D;
    color: #FFFFFF;
    border-color: #1B365D;
    box-shadow: 0 4px 12px rgba(27, 54, 93, 0.2);
}

.article-footer__back svg {
    transition: transform 0.25s ease;
}

.article-footer__back:hover svg {
    transform: translateX(-4px);
}

/* ==========================================================================
   PAGINACIÓN - Diseño Institucional
   ========================================================================== */

.noticias-paginacion {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 56px;
    padding: 24px 0;
}

#paginacionNumeros {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.noticias-paginacion__boton,
.noticias-paginacion__numero {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #64748B;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.noticias-paginacion__boton:hover:not(:disabled),
.noticias-paginacion__numero:hover:not(.noticias-paginacion__numero--activo) {
    background-color: #F8FAFC;
    border-color: #CBD5E1;
    color: #1B365D;
}

.noticias-paginacion__boton:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.noticias-paginacion__numero--activo {
    background-color: #1B365D;
    border-color: #1B365D;
    color: #FFFFFF;
    font-weight: 600;
}

.noticias-paginacion__puntos {
    color: #CBD5E1;
    padding: 0 4px;
    user-select: none;
}

/* ==========================================================================
   COMPATIBILIDAD - Clases antiguas
   ========================================================================== */

.noticia-detalle-wrapper { /* see .article-view */ }
.noticia-detalle-container { /* see .article-view__container */ }
.noticia-detalle-header { /* see .article-header */ }
.noticia-detalle-contenido { /* see .article-body */ }
.noticia-detalle-texto { /* see .article-body__content */ }

/* ==========================================================================
   ESTADOS VACÍOS
   ========================================================================== */

.noticias-vacio {
    background-color: #FFFFFF;
    border: 2px dashed #E5E7EB;
    border-radius: 16px;
    padding: 64px 32px;
    text-align: center;
}

.noticias-vacio-icono {
    font-size: 64px;
    color: #D1D5DB;
    margin-bottom: 20px;
}

.noticias-vacio-titulo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
}

.noticias-vacio-texto {
    font-size: 1rem;
    color: #6B7280;
    margin: 0;
}

/* ==========================================================================
   RESPONSIVE - Tablet
   ========================================================================== */

@media (max-width: 1024px) {
    .noticias-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 24px;
    }
    
    .article-header__title {
        font-size: 2.125rem;
    }
    
    .article-header,
    .article-body {
        padding: 36px;
    }
}

/* ==========================================================================
   RESPONSIVE - Mobile
   ========================================================================== */

@media (max-width: 768px) {
    .noticias-wrapper {
        padding: 32px 0;
    }
    
    .noticias-container {
        padding: 0 16px;
    }
    
    .noticias-grid {
        gap: 20px;
    }
    
    .noticias-paginacion {
        gap: 6px;
        margin-top: 40px;
    }
    
    .noticias-paginacion__boton,
    .noticias-paginacion__numero {
        min-width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    .noticia-card-thumbnail {
        padding: 20px;
    }
    
    .noticia-card-body {
        padding: 20px;
    }
    
    .noticia-card-title {
        font-size: 1.25rem;
    }
    
    .noticia-card-excerpt {
        font-size: 0.875rem;
    }
    
    /* Vista detalle móvil */
    .article-view {
        padding: 32px 0 48px 0;
    }
    
    .article-view__container {
        padding: 0 16px;
    }
    
    .article-header {
        padding: 28px 20px;
    }
    
    .article-header__brand {
        min-height: 180px;
        padding: 28px;
        margin-bottom: 24px;
    }
    
    .article-header__logo {
        max-height: 140px;
    }
    
    .article-header__title {
        font-size: 1.75rem;
        margin-bottom: 20px;
    }
    
    .article-header__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .article-meta__divider {
        display: none;
    }
    
    .article-body {
        padding: 28px 20px;
    }
    
    .article-body__content {
        font-size: 1rem;
    }
    
    .article-footer__back {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   RESPONSIVE - Small Mobile
   ========================================================================== */

@media (max-width: 640px) {
    .noticias-header__title {
        font-size: 1.5rem;
    }
    
    .noticias-header__accent {
        height: 28px;
    }
}
    
    .noticia-card-thumbnail {
        padding: 16px;
    }
    
    .noticia-card-body {
        padding: 16px;
    }
    
    .noticia-card-title {
        font-size: 1.125rem;
    }
    
    .noticia-card-button {
        width: auto;
        padding: 10px 18px;
    }
    
    .article-header {
        padding: 24px 16px;
    }
    
    .article-header__brand {
        min-height: 140px;
        padding: 20px;
    }
    
    .article-header__logo {
        max-height: 100px;
    }
    
    .article-header__title {
        font-size: 1.5rem;
    }
    
    .article-body {
        padding: 24px 16px;
    }
    
    .article-body__content {
        font-size: 0.9375rem;
        line-height: 1.75;
    }
}
