/* Estilos para Sección y Página de Newsletter - Corvalán y Córdova Ltda. */

.newsletter-section {
    padding: 5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.newsletter-container {
    max-width: 1200px;
    margin: 0 auto;
}

.newsletter-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 3rem auto;
}

.newsletter-header .section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ede9fe;
    color: #6d28d9;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.newsletter-header .section-subtitle {
    color: #64748b;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-top: 0.75rem;
}

/* Grid de Publicaciones */
.newsletter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.newsletter-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.newsletter-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.newsletter-card-img-wrap {
    height: 190px;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.newsletter-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.newsletter-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 3.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.newsletter-card-category-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
    letter-spacing: 0.3px;
}

.newsletter-card-body {
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.newsletter-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.8rem;
}

.newsletter-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    line-height: 1.35;
    color: #0f172a;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.newsletter-card-summary {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1.5rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.newsletter-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
    margin-top: auto;
    gap: 10px;
}

.btn-read-newsletter {
    color: #d32f2f;
    font-weight: 700;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: gap 0.2s;
}

.btn-read-newsletter:hover {
    gap: 10px;
    color: #b71c1c;
}

.btn-pdf-download {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-pdf-download:hover {
    background: #fca5a5;
    color: #991b1b;
}

.newsletter-footer-cta {
    text-align: center;
}

.btn-newsletter-all {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #0d47a1;
    color: #ffffff !important;
    padding: 14px 28px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.25);
    transition: background 0.2s, transform 0.2s;
}

.btn-newsletter-all:hover {
    background: #0a3880;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 71, 161, 0.35);
}

/* Loader */
.newsletter-loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.newsletter-loader .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0d47a1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: nl-spin 0.8s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes nl-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Lector de Artículos */
.nl-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.nl-modal-card {
    background: #ffffff;
    width: 850px;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: nlModalFade 0.2s ease-out;
}

@keyframes nlModalFade {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.nl-modal-header-img {
    height: 240px;
    width: 100%;
    object-fit: cover;
    background: #1e293b;
}

.nl-modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.nl-modal-close-btn:hover {
    background: #000;
}

.nl-modal-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.nl-modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 0.8rem;
}

.nl-modal-meta-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.nl-modal-body {
    font-size: 1rem;
    line-height: 1.75;
    color: #334155;
}

.nl-modal-body p {
    margin-bottom: 1.2rem;
}

.nl-modal-actions {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
