/* Estilos para la página del Blog */

/* Hero con imagen de fondo */
.blog-header {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), 
                url("../img/blog-header-bg.b2d97fcb925f.png");
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 100px 0;
    margin-top: 90px;
    width: 100%;
}

.blog-header h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.blog-header p {
    font-size: 1.4rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    animation: fadeInUp 1.2s ease;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}
.blog-header {
    margin-bottom: 60px; 
}
@media (max-width: 768px) {
    .blog-header {
        margin-bottom: 40px; /* Un poco menos de margen en móviles */
    }
    
    .blog-container {
        margin-top: 30px;
    }
}
.featured-post, .blog-card:first-child {
    margin-top: 0; /* Eliminar cualquier margen superior que pueda causar espacios innecesarios */
}
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estructura del blog */
.page-wrapper {
    min-height: 100vh;
    background-color: var(--bg-color);
    padding-bottom: 80px; /* Espacio inferior para evitar que el contenido toque el footer */
}

.blog-container {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 30px;
    margin-bottom: 60px;
}

.blog-main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Tarjetas de blog */
.blog-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.blog-card-image {
    height: 180px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-category {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.blog-date {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.blog-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    margin-bottom: 18px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
}

.blog-title:after {
    content: '';
    position: absolute;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    left: 0;
    bottom: -6px;
    transition: width 0.3s ease;
}

.blog-card:hover .blog-title:after {
    width: 70px;
}

.blog-excerpt {
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    display: inline-flex;
    align-items: center;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    margin-top: auto;
}

.read-more:hover {
    color: var(--primary-color);
}

.read-more i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.read-more:hover i {
    transform: translateX(5px);
}

/* Barra lateral */
.blog-sidebar {
    position: sticky;
    top: 120px;
    align-self: start;
}

.sidebar-box {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
}

.sidebar-box h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    position: relative;
}

.categories-list {
    list-style: none;
    padding: 0;
}

.categories-list li {
    margin-bottom: 12px;
}

.categories-list a {
    display: flex;
    justify-content: space-between;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.categories-list a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.category-count {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.recent-post {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.recent-post:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-post-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
}

.recent-post-content {
    flex: 1;
}

.recent-post-title {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
    line-height: 1.4;
}

.recent-post-title:hover {
    color: var(--primary-color);
}

.recent-post-date {
    font-size: 0.8rem;
    color: #777;
}

/* Búsqueda */
.search-form {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 0.95rem;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.search-button {
    position: absolute;
    right: 5px;
    top: 5px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.search-button:hover {
    background-color: var(--secondary-color);
}

/* Nube de etiquetas */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    background-color: rgba(var(--primary-color-rgb), 0.1);
    color: var(--text-color);
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition);
}

.tag:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    margin-bottom: 20px;
    gap: 10px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.page-link.active, .page-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Post destacado */
.featured-post {
    grid-column: 1 / -1;
    position: relative;
    height: 400px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.featured-post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-post-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
}

.featured-category {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.featured-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.featured-excerpt {
    font-size: 1rem;
    margin-bottom: 20px;
    opacity: 0.9;
    max-width: 800px;
}

.featured-read-more {
    display: inline-flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.featured-read-more:hover {
    color: var(--accent-color);
}

.featured-read-more i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.featured-read-more:hover i {
    transform: translateX(5px);
}

/* Mensaje sin posts */
.no-posts {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow);
    grid-column: 1 / -1;
}

.no-posts h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.no-posts p {
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Modo oscuro */
.dark-mode .sidebar-box {
    background-color: #222935;
}

.dark-mode .recent-post {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .recent-post-date {
    color: #aaa;
}

.dark-mode .search-input {
    background-color: #2a2e3a;
    border-color: #444;
    color: var(--text-color);
}

/* Adaptabilidad */
@media (max-width: 992px) {
    .blog-container {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar {
        position: static;
        margin-top: 30px;
    }
    
    .featured-post {
        height: 350px;
    }
    
    .featured-post-overlay {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .blog-header {
        padding: 60px 20px;
    }
    
    .blog-header h1 {
        font-size: 2.5rem;
    }
    
    .blog-header p {
        font-size: 1.2rem;
    }
    
    .featured-post {
        height: 300px;
    }
    
    .featured-title {
        font-size: 1.5rem;
    }
    
    .featured-excerpt {
        font-size: 0.9rem;
    }
    
    .blog-main {
        grid-template-columns: 1fr;
    }
    
    .sidebar-box {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .blog-header h1 {
        font-size: 2rem;
    }
    
    .featured-post {
        height: 250px;
    }
    
    .featured-post-overlay {
        padding: 20px;
    }
}