/* =============================================
   BLOG (público) — CSS
   Guardar como public/css/blog.css
   ============================================= */

/* ===== FILTROS ===== */
.blog-grid-section {
    padding: 70px 0 100px;
    background: white;
}

.blog-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.blog-filtro {
    padding: 8px 18px;
    border: 1px solid var(--border-dark);
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.blog-filtro:hover {
    border-color: rgba(13, 110, 253, 0.3);
    color: var(--blue);
}

.blog-filtro.active {
    background: var(--blue);
    border-color: var(--blue);
    color: white;
}

/* ===== GRID DE TARJETAS ===== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

.blog-card {
    display: block;
    background: var(--off-white);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    transition: var(--transition);
}

.blog-card:hover {
    border-color: rgba(13, 110, 253, 0.2);
    box-shadow: 0 16px 36px rgba(13, 110, 253, 0.08);
    transform: translateY(-4px);
}

.blog-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--navy);
    overflow: hidden;
}

.blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

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

.blog-card-noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.15);
    font-size: 2rem;
}

.blog-card-cat {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(10, 15, 30, 0.75);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
}

.blog-card-body { padding: 22px 22px 24px; }

.blog-card-date {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.blog-card-body h3 {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
    margin: 8px 0 8px;
    line-height: 1.4;
}

.blog-card-body p {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
}

.blog-card-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--blue);
}

/* ===== ESTADO VACÍO ===== */
.blog-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.blog-empty i { font-size: 2rem; color: rgba(13, 110, 253, 0.25); margin-bottom: 14px; }

.blog-pagination { margin-top: 40px; }

/* ===== DETALLE ===== */
.blog-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    margin-bottom: 18px;
}

.blog-back-link:hover { color: var(--blue-light); }

.blog-detalle-section {
    padding: 70px 0 90px;
    background: white;
}

.blog-detalle-wrap {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 50px;
    align-items: start;
}

.blog-detalle-img {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 34px;
    aspect-ratio: 1 / 1;      /* simplifiqué el 40/40, es lo mismo */
    max-height: 380px;        /* antes: 260px */
}

.blog-detalle-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;      /* nuevo — antes solo tenía width */
    display: block;
}

.blog-detalle-content {
    font-size: 1rem;
    color: var(--navy);
    line-height: 1.85;
}

.blog-detalle-content p { margin-bottom: 18px; }
.blog-detalle-content h2,
.blog-detalle-content h3 {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--navy);
    margin: 30px 0 14px;
}
.blog-detalle-content ul { padding-left: 22px; margin-bottom: 18px; }
.blog-detalle-content li { margin-bottom: 6px; }
.blog-detalle-content a { color: var(--blue); }
.blog-detalle-content img { width: 100%; border-radius: var(--radius); margin: 14px 0; }

/* ===== SIDEBAR ===== */
.blog-sidebar-card {
    background: var(--off-white);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 26px 24px;
    position: sticky;
    top: 100px;
}

.blog-sidebar-card h4 {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-dark);
}

.blog-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blog-sidebar-list a {
    font-size: 0.85rem;
    color: var(--navy);
    text-decoration: none;
    line-height: 1.5;
    transition: var(--transition);
}

.blog-sidebar-list a:hover { color: var(--blue); }

.blog-sidebar-empty {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ===== RELACIONADOS ===== */
.blog-relacionados { margin-top: 80px; }

.blog-rel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 30px;
}

.blog-rel-card {
    display: block;
    background: var(--off-white);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    transition: var(--transition);
}

.blog-rel-card:hover {
    border-color: rgba(13, 110, 253, 0.2);
    transform: translateY(-3px);
}

.blog-rel-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

.blog-rel-body { padding: 14px 16px; }

.blog-rel-body span {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--blue);
    text-transform: uppercase;
}

.blog-rel-body h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
    margin-top: 6px;
    line-height: 1.4;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .blog-detalle-wrap { grid-template-columns: 1fr; }
    .blog-sidebar-card { position: static; }
    .blog-rel-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .blog-grid { grid-template-columns: 1fr; }
    .blog-rel-grid { grid-template-columns: 1fr; }
}
