/* ===== SECCIÓN DE PUBLICACIONES CATEGORIZADAS ===== */
.kb-cat-section {
    padding: 100px 0;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%232d4f95' fill-opacity='0.4' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
    width: 100%;
    box-sizing: border-box;
}

/* ===== CABECERA DE CATEGORÍA ===== */
.kb-cat-header {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 56px;
    padding-bottom: 24px;
    border-bottom: 1px solid #1d468d;
}

.kb-cat-index {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    font-weight: 700;
    color: #1d468d;
    line-height: 1;
}

.kb-cat-header-text {
    flex: 1;
}

.kb-cat-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #2d4f95;
    display: block;
    margin-bottom: 8px;
}

.kb-cat-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(22px, 3.2vw, 28px);
    font-weight: 700;
    color: #0a1b36;
    margin: 0;
    letter-spacing: -0.01em;
}

.kb-cat-count {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    background: #ffffff;
    border: 1px solid #54575c;
    padding: 6px 16px;
    border-radius: 30px;
    letter-spacing: 0.5px;
}

/* ===== REJILLA CON PROFUNDIDAD ===== */
.kb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    grid-gap: 25px;
    perspective: 1500px;
    /* Habilita el entorno 3D hiperrealista */
}

/* ===== TARJETA INDIVIDUAL EDITORIAL 3D ===== */
.kb-card {
    position: relative;
    background: #ffffff;
    border: 3px solid rgb(226, 232, 240);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 10px 30px -15px rgba(10, 27, 54, 0.696);
    overflow: hidden;

    /* Variables de transformación 3D controladas en hover */
    transform-style: preserve-3d;
    transform: translateZ(0) rotateX(0deg) rotateY(0deg);
    transition:
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.4s ease;
}

/* Hover 3D asimétrico (Sutil inclinación realista) */
.kb-card:hover {
    transform: translateY(-8px) translateZ(20px) rotateX(3deg) rotateY(-1.5deg);
    border-color: rgba(45, 79, 149, 0.12);
    box-shadow:
        0 20px 40px -10px rgba(10, 27, 54, 0.08),
        0 40px 80px -20px rgba(45, 79, 149, 0.06);
}

/* Sutil línea de acento superior */
.kb-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: #1d468d;
    z-index: 10;
}

/* ===== CONTENEDOR DE IMAGEN (FIGURE) ===== */
.kb-card-figure {
    position: relative;
    margin: 0;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #0a1b36;
}

.kb-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(20%) brightness(0.95);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
    will-change: transform;
}

/* Zoom cinematográfico sutil al hacer hover */
.kb-card:hover .kb-card-img {
    transform: scale(1.06) translateY(2px);
    filter: grayscale(0%) brightness(1);
}

/* Insignia dinámica sobre la imagen */
.kb-start-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffffff;
    background: #d01341;
    /* Rojo quirúrgico */
    padding: 6px 14px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(208, 19, 65, 0.25);
    z-index: 5;
}

/* ===== CUERPO DE LA TARJETA ===== */
.kb-card-body {
    padding: 32px 32px 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    transform: translateZ(10px);
    /* Hace que el texto flote en un plano superior al fondo de la tarjeta */
}

.kb-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.kb-card .kb-tag {
    font-size: 10px;
    font-weight: 700;
    color: #2d4f95;
    background: rgba(45, 79, 149, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kb-refs {
    font-size: 10.5px;
    font-weight: 600;
    color: #94a3b8;
}

.kb-card .kb-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;
    color: #0a1b36;
    margin: 0 0 12px 0;
    transition: color 0.3s ease;
}

.kb-card:hover .kb-card-title {
    color: #2d4f95;
}

.kb-card-excerpt {
    font-size: 13.5px;
    line-height: 1.65;
    color: #64748b;
    margin: 0;
}

/* ===== PIE DE LA TARJETA ===== */
.kb-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(241, 245, 249, 0.8);
    padding: 24px 32px;
    background: #ffffff;
    transform: translateZ(15px);
}

.kb-author {
    display: flex;
    flex-direction: column;
}

.kb-author-name {
    font-size: 12px;
    font-weight: 700;
    color: #0a1b36;
}

.kb-author-cred {
    font-size: 9px;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 1px;
    letter-spacing: 0.2px;
}

/* Link editorial de lectura */
.kb-read-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #b4935a;
    /* Tu dorado */
    text-decoration: none;
    transition: color 0.3s ease;
}

.kb-read-link svg {
    width: 14px;
    height: 14px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.kb-card:hover .kb-read-link {
    color: #d01341;
    /* Rojo en hover */
}

.kb-card:hover .kb-read-link svg {
    transform: translateX(6px) scale(1.1);
}

/* Fecha de revisión inferior */
.kb-review-date {
    font-size: 9px;
    font-weight: 700;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 32px 24px;
    background: #ffffff;
    display: block;
}

/* ===== RESPONSIVO ADAPTATIVO ===== */
@media (max-width: 992px) {
    .kb-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        grid-gap: 28px;
    }
}

@media (max-width: 768px) {
    .kb-cat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 36px;
    }

    .kb-card-figure {
        height: 180px;
    }

    .kb-card-body {
        padding: 24px 24px 10px;
    }

    .kb-card-footer {
        padding: 20px 24px;
    }

    .kb-review-date {
        padding: 0 24px 20px;
    }

    .kb-card:hover {
        transform: translateY(-4px) translateZ(0);
        /* Desactiva la rotación pesada en móviles */
    }
}