/* blog.css - Versión optimizada */

/* ===== Estructura principal ===== */
.blog-hero {
    padding: 120px 0;
    background: linear-gradient(135deg, #002C6B 0%, #004AAD 100%);
    color: white;
    text-align: center;
    margin-bottom: 0;
}

.blog-hero h1 {
    font-size: 36px;
    margin-bottom: 20px;
    color: white;
}

.blog-hero p {
    font-size: 18px;
    margin-bottom: 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.blog-section {
    padding: 50px 0;
    background-color: #f8f9fa;
    margin-top: 20px;
}

/* ===== Barra de búsqueda ===== */
.search-bar-container {
    background-color: #f1f1f1;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
}

.search-bar {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.search-bar input {
    flex-grow: 1;
    padding: 14px 20px;
    border: none;
    font-size: 16px;
    outline: none;
}

.search-bar button {
    background-color: #00B1EB;
    color: white;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-bar button:hover {
    background-color: #0091C8;
}

/* ===== Filtros de categorías ===== */
.filter-container {
    background-color: #F8FAFC;
    padding: 15px 0;
    border-bottom: 1px solid #E5E7EB;
    position: sticky;
    top: 0;
    z-index: 100;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f5f5f5;
    color: #333;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #E5E7EB;
    font-size: 0.95rem;
}

.filter-btn:hover, .filter-btn.active {
    background-color: #00B1EB;
    color: white;
    border-color: #00B1EB;
}

/* ===== Grid de artículos ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.article-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.article-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.article-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #00B1EB;
    color: white;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 1;
}

.article-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

.article-title a {
    color: #002C6B;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:hover {
    color: #00B1EB;
}

.article-excerpt {
    color: #4B5563;
    margin-bottom: 15px;
    line-height: 1.6;
    flex-grow: 1;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #6B7280;
}

.article-author {
    display: flex;
    align-items: center;
}

.author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.article-date {
    display: flex;
    align-items: center;
}

.article-date i {
    margin-right: 5px;
}

.read-more {
    display: inline-flex;
    align-items: center;
    color: #00B1EB;
    text-decoration: none;
    font-weight: 500;
    margin-top: auto;
    transition: color 0.2s ease;
}

.read-more:hover {
    color: #002C6B;
}

/* ===== Paginación ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
}

.page-link, .current-page {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 8px;
    text-decoration: none;
}

.page-link {
    background-color: #f8f9fa;
    color: #4B5563;
    transition: all 0.2s ease;
    border: 1px solid #E5E7EB;
}

.page-link:hover {
    background-color: #00B1EB;
    color: white;
    border-color: #00B1EB;
}

.current-page {
    background-color: #00B1EB;
    color: white;
    border: 1px solid #00B1EB;
}

/* ===== Newsletter ===== */
.newsletter-section-bottom {
    background: linear-gradient(135deg, #002C6B 0%, #004AAD 100%);
    color: white;
    padding: 50px 0;
    margin-top: 60px;
    border-radius: 8px;
}

.newsletter-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-content h3 {
    font-size: 28px;
    margin-bottom: 15px;
    color: white;
}

.newsletter-content p {
    font-size: 18px;
    margin-bottom: 25px;
    opacity: 0.9;
}

.newsletter-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.newsletter-input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
}

.subscribe-btn {
    background-color: #00B1EB;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.subscribe-btn:hover {
    background-color: #0091C8;
}

/* ===== Página de artículo ===== */
.article-hero {
    background: linear-gradient(135deg, #002C6B 0%, #004AAD 100%);
    color: white;
    padding: 60px 0 40px;
    margin-bottom: 0;
}

.article-hero .container {
    max-width: 900px;
}

.hero-breadcrumbs {
    margin-bottom: 20px;
    font-size: 14px;
}

.hero-breadcrumbs a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.hero-breadcrumbs a:hover {
    color: white;
    text-decoration: underline;
}

.hero-breadcrumbs .separator {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.6);
}

.article-hero h1 {
    font-size: 36px;
    margin-bottom: 20px;
    color: white;
    line-height: 1.3;
}

.article-meta-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
}

.article-meta-hero .article-author {
    display: flex;
    align-items: center;
}

.article-meta-hero .author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.article-section {
    padding: 60px 0;
    background-color: #f8f9fa;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.article-main {
    background-color: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.article-featured-image {
    margin: -30px -30px 30px -30px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    height: 400px;
}

.article-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-sidebar {
    position: sticky;
    top: 30px;
}

.sidebar-section {
    background-color: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.sidebar-title {
    font-size: 1.2rem;
    color: #002C6B;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #E5E7EB;
    font-weight: 600;
}

.sidebar-section.newsletter-section {
    background: linear-gradient(135deg, #002C6B 0%, #004AAD 100%);
    color: white;
}

.sidebar-section.newsletter-section .sidebar-title {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

/* ===== Contenido del artículo ===== */
.article-content {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}

.article-content h2 {
    font-size: 28px;
    color: #002C6B;
    margin-top: 40px;
    margin-bottom: 20px;
}

.article-content h3 {
    font-size: 24px;
    color: #004AAD;
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 30px 0;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.article-content ul, .article-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

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

/* ===== Compartir en redes ===== */
.article-share {
    margin: 40px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 16px;
}

.article-share h3 {
    font-size: 1.4rem;
    color: #002C6B;
    margin-bottom: 20px;
}

.share-buttons {
    display: flex;
    gap: 12px;
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.share-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.share-button i {
    font-size: 1.2rem;
}

.share-button:nth-child(1) { background-color: #3b5998; }
.share-button:nth-child(2) { background-color: #1da1f2; }
.share-button:nth-child(3) { background-color: #0a66c2; }
.share-button:nth-child(4) { background-color: #25d366; }

/* ===== Artículos relacionados ===== */
.related-articles {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.related-articles h3 {
    font-size: 24px;
    color: #002C6B;
    margin-bottom: 25px;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-article-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    height: 100%;
    background: white;
}

.related-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.related-article-image {
    height: 160px;
    overflow: hidden;
}

.related-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-article-card:hover .related-article-image img {
    transform: scale(1.05);
}

.related-article-content {
    padding: 15px;
}

.related-article-content h4 {
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.related-article-content h4 a {
    color: #002C6B;
    text-decoration: none;
}

.related-article-content h4 a:hover {
    color: #00B1EB;
}

.related-article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.related-article-meta .category {
    color: #00B1EB;
    font-weight: 500;
}

/* ===== Comentarios ===== */
.comments-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.comments-section h3 {
    font-size: 24px;
    color: #002C6B;
    margin-bottom: 25px;
}

.comments-list {
    margin-bottom: 40px;
}

.comment {
    display: flex;
    margin-bottom: 30px;
}

.comment-avatar {
    margin-right: 20px;
}

.comment-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex-grow: 1;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    position: relative;
}

.comment-content:before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #f8f9fa;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.comment-author {
    font-size: 18px;
    color: #002C6B;
    margin: 0;
    font-weight: 600;
}

.comment-date {
    font-size: 14px;
    color: #666;
}

.comment-text {
    color: #333;
    line-height: 1.6;
}

/* ===== Formulario de comentarios ===== */
.comment-form h3 {
    font-size: 24px;
    color: #002C6B;
    margin-bottom: 25px;
}

.comment-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    border-color: #00B1EB;
    outline: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

.captcha-container {
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 10px;
    font-weight: bold;
}

.form-submit {
    background-color: #00B1EB;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.form-submit i {
    margin-left: 8px;
}

.form-submit:hover {
    background-color: #0091C8;
}

/* ===== Notificaciones ===== */
.notification {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.notification-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.notification-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.notification-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* ===== Componentes móviles ===== */
.mobile-search-filter {
    display: none;
}

/* ===== Media Queries ===== */
@media (min-width: 768px) {
    .form-row {
        flex-direction: row;
        gap: 10px;
    }
    
    .form-row .form-group {
        flex: 1;
    }
}

@media (max-width: 991px) {
    .article-layout {
        grid-template-columns: 1fr;
    }
    
    .article-hero {
        padding: 40px 0 30px;
    }
    
    .article-hero h1 {
        font-size: 28px;
    }
    
    .article-meta-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .article-featured-image {
        height: 250px;
    }
    
    .article-main {
        padding: 20px;
    }
    
    .article-sidebar {
        margin-top: 30px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .mobile-search-filter {
        display: flex;
        gap: 10px;
        margin: 20px 0;
    }
    
    .mobile-search-filter .search-form-container {
        flex-grow: 1;
    }
    
    .filter-toggle {
        display: flex;
        align-items: center;
        padding: 10px 15px;
        background: #00B1EB;
        color: white;
        border: none;
        border-radius: 8px;
        font-weight: 500;
    }
    
    .filter-toggle i {
        margin-right: 5px;
    }
}

@media (max-width: 767px) {
    .blog-hero h1 {
        font-size: 28px;
    }
    
    .blog-hero p {
        font-size: 16px;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .article-card {
        margin-bottom: 20px;
    }
    
    .article-image {
        height: 180px;
    }
    
    .article-content {
        padding: 15px;
    }
    
    .related-articles-grid {
        grid-template-columns: 1fr;
    }
    
    .comment {
        flex-direction: column;
    }
    
    .comment-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .comment-content:before {
        display: none;
    }
    
    .comment-form-grid {
        grid-template-columns: 1fr;
    }
    
    .article-featured-image {
        height: 200px;
        margin: -20px -20px 20px -20px;
    }
}

/* =====================================================================
   PAGINACION - correccion 2026
   El contenedor .page-numbers no era flex y la clase .page-number no
   tenia estilos, por eso el numero de pagina aparecia como enlace azul
   subrayado caido debajo del boton. Estas reglas van al final para que
   sobrescriban por orden de cascada.
   ===================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 40px;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination .page-link,
.pagination .page-number,
.pagination .current-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    margin: 0;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination .page-link,
.pagination .page-number {
    background-color: #f8f9fa;
    color: #4b5563;
}

.pagination .page-link:hover,
.pagination .page-number:hover {
    background-color: #00b1eb;
    color: #fff;
    border-color: #00b1eb;
}

.pagination .current-page {
    background-color: #00b1eb;
    color: #fff;
    border-color: #00b1eb;
    cursor: default;
}

.pagination .page-link i {
    font-size: 0.8rem;
    margin-left: 6px;
}

.pagination .page-link i.fa-chevron-left {
    margin-left: 0;
    margin-right: 6px;
}

@media (max-width: 576px) {
    .pagination .page-link,
    .pagination .page-number,
    .pagination .current-page {
        min-width: 38px;
        height: 38px;
        padding: 0 12px;
        font-size: 0.9rem;
    }
}

/* Filtros de categoria: evitar que la ultima fila quede descolgada */
.category-filter,
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}