/* Lateral de los artículos (single-post): índice del artículo + categorías. 2026-11-23.
   Sustituye la caja gris con etiquetas amarillas. Sticky en escritorio. */

.single-post .apartado.seccion-principal[id^="content-"],
.single-post .subapartado[id^="content-"] {
    scroll-margin-top: 96px;
}

/* Rótulo común (mismo motivo que el "Summary" de la cabecera) */
.single-post .pc-post-aside .titulo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-family: "Outfit", sans-serif;
    font-weight: 600;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #1B1C1F;
}
.single-post .pc-post-aside .titulo::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    background: #2F69FF;
}

/* ---------- Índice del artículo ---------- */
.single-post .pc-post-toc {
    margin-bottom: 40px;
}
.single-post .pc-post-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(27, 28, 31, .14);
}
.single-post .pc-post-toc__list li {
    margin: 0;
    padding: 0;
}
.single-post .pc-post-toc__list li::before {
    display: none !important;
}
.single-post .pc-post-toc__link {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(27, 28, 31, .14);
    font-family: "Outfit", sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 20px;
    color: #1B1C1F;
    text-decoration: none;
    transition: padding-left .2s ease;
}
.single-post .pc-post-toc__n {
    flex: 0 0 auto;
    min-width: 20px;
    font-weight: 500;
    font-size: 12px;
    line-height: 20px;
    font-variant-numeric: tabular-nums;
    color: #4B5563;
}
.single-post .pc-post-toc__t {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* Desplegable con el resto de apartados (a partir del 7) */
.single-post .pc-post-toc__more {
    margin: 0;
}
.single-post .pc-post-toc__toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(27, 28, 31, .14);
    list-style: none;
    cursor: pointer;
    font-family: "Outfit", sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: #1B1C1F;
    transition: padding-left .2s ease;
}
.single-post .pc-post-toc__toggle::-webkit-details-marker {
    display: none;
}
.single-post .pc-post-toc__toggle::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: 4px;
    border-right: 1.5px solid #1B1C1F;
    border-bottom: 1.5px solid #1B1C1F;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .2s ease;
}
.single-post .pc-post-toc__more[open] > .pc-post-toc__toggle::after {
    transform: translateY(2px) rotate(-135deg);
}
.single-post .pc-post-toc__close,
.single-post .pc-post-toc__more[open] .pc-post-toc__open {
    display: none;
}
.single-post .pc-post-toc__more[open] .pc-post-toc__close {
    display: inline;
}
.single-post .pc-post-toc__toggle::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 2px;
    background: #2F69FF;
    transform: scaleY(0);
    transition: transform .2s ease;
}
.single-post .pc-post-toc__toggle:hover,
.single-post .pc-post-toc__toggle.is-active {
    padding-left: 14px;
}
.single-post .pc-post-toc__toggle:hover::before,
.single-post .pc-post-toc__toggle.is-active::before {
    transform: scaleY(1);
}
.single-post .pc-post-toc__toggle:focus-visible {
    outline: 2px solid #2F69FF;
    outline-offset: 2px;
}
.single-post .pc-post-toc__list--more {
    border-top: 0;
}

.single-post .pc-post-toc__link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 2px;
    background: #2F69FF;
    transform: scaleY(0);
    transition: transform .2s ease;
}
.single-post .pc-post-toc__link:hover,
.single-post .pc-post-toc__link:focus-visible,
.single-post .pc-post-toc__link.is-active {
    padding-left: 14px;
}
.single-post .pc-post-toc__link:hover::before,
.single-post .pc-post-toc__link:focus-visible::before,
.single-post .pc-post-toc__link.is-active::before {
    transform: scaleY(1);
}
.single-post .pc-post-toc__link.is-active {
    font-weight: 600;
}
.single-post .pc-post-toc__link.is-active .pc-post-toc__n {
    color: #1B1C1F;
}
.single-post .pc-post-toc__link:focus-visible {
    outline: 2px solid #2F69FF;
    outline-offset: 2px;
}

/* ---------- Categorías ---------- */
.single-post .categorias-bloque {
    padding: 0;
    background: transparent;
}
.single-post .categorias-bloque .categorias {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}
.single-post .categorias-bloque .categorias .categoria-post {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border: 1px solid rgba(27, 28, 31, .22);
    background: transparent;
    font-family: "Outfit", sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 16px;
    color: #1B1C1F;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.single-post .categorias-bloque .categorias .categoria-post:hover,
.single-post .categorias-bloque .categorias .categoria-post:focus-visible {
    border-color: #1B1C1F;
}
.single-post .categorias-bloque .categorias .categoria-post.is-current {
    background: #1B1C1F;
    border-color: #1B1C1F;
    color: #FFFFFF;
    font-weight: 500;
}
.single-post .categorias-bloque .categorias .categoria-post:focus-visible {
    outline: 2px solid #2F69FF;
    outline-offset: 2px;
}

/* ---------- Escritorio: lateral fijo mientras se lee ---------- */
@media only screen and (min-width: 1240px) {
    .single-post .wrapper-contenido-resumen {
        align-items: start;
    }
    /* top lo ajusta pc-post-toc.js: 96px si cabe en pantalla; si no, negativo para que
       el lateral acompañe al scroll hasta mostrar su final (nunca queda cortado) */
    .single-post .pc-post-aside {
        position: sticky;
        top: var(--pc-aside-top, 96px);
        align-self: start;
        max-width: 300px;
        margin-top: 75px;
        padding-bottom: 24px;
    }
    .single-post .pc-post-aside .categorias-bloque {
        max-width: none;
        margin: 0;
    }
}

/* ---------- Móvil y tablet ---------- */
@media only screen and (max-width: 1239px) {
    .single-post .pc-post-toc {
        display: none;
    }
    .single-post .categorias-bloque {
        margin-top: 8px;
        margin-bottom: 8px;
    }
    .single-post .categorias-bloque .categorias .categoria-post {
        font-size: 14px;
        line-height: 18px;
        padding: 8px 12px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    html:has(body.single-post) {
        scroll-behavior: smooth;
    }
}
@media (prefers-reduced-motion: reduce) {
    .single-post .pc-post-toc__link,
    .single-post .pc-post-toc__link::before,
    .single-post .categorias-bloque .categorias .categoria-post {
        transition: none;
    }
}
