/* ==========================================================
   Blog clásico: menú lateral de categorías + listado de entradas
   ========================================================== */

:root {
    --content-width: 720px;
}

.blog-layout {
    padding: max(4.8vmin, 36px) max(2.5vmin, 18px) 8rem;
}

.blog-inner {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 200px;
    column-gap: 3.2rem;
    align-items: start;
    max-width: 1560px;
}

.blog-sidebar {
    grid-column: 1;
    position: sticky;
    top: 2rem;
    align-self: start;
}

.blog-main {
    grid-column: 2;
    min-width: 0;
}

/* En páginas de listado, la columna de entradas se limita y centra
   igual que la columna de contenido de una entrada. */
:is(.home-template, .tag-template, .author-template) .blog-main {
    width: 100%;
    max-width: var(--content-width, 720px);
    justify-self: center;
}

.gh-head-inner.inner,
.site-footer .inner {
    max-width: 1560px;
}

.gh-head.outer,
.site-footer.outer {
    padding-right: max(2.5vmin, 18px);
    padding-left: max(2.5vmin, 18px);
}

/* Menú lateral
/* ---------------------------------------------------------- */

.sidebar-box {
    margin-bottom: 3.6rem;
}

.sidebar-title {
    margin: 0 0 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-categories {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar-categories li {
    border-bottom: 1px solid var(--color-border);
}

.sidebar-categories li:last-child {
    border-bottom: 0;
}

.sidebar-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
    color: var(--color-darkgrey);
    font-size: 1.5rem;
    text-decoration: none;
    transition: color 0.15s ease;
}

.sidebar-category:hover,
.sidebar-category.is-active {
    color: var(--ghost-accent-color);
}

.sidebar-category.is-active {
    font-weight: 700;
}

.sidebar-count {
    flex-shrink: 0;
    min-width: 2.4rem;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    background: var(--color-lightgrey);
    color: var(--color-secondary-text);
    font-size: 1.2rem;
    line-height: 1.5;
    text-align: center;
}

.sidebar-about {
    margin: 0;
    color: var(--color-secondary-text);
    font-size: 1.5rem;
    line-height: 1.6;
}

/* Cabecera del listado
/* ---------------------------------------------------------- */

.blog-header {
    margin-bottom: 3.2rem;
    padding-bottom: 2.4rem;
    border-bottom: 2px solid var(--color-darkgrey);
}

.blog-kicker {
    margin: 0 0 0.6rem;
    color: var(--ghost-accent-color);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.blog-title {
    margin: 0;
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.blog-header-description {
    max-width: 680px;
    margin: 1.2rem 0 0;
    color: var(--color-secondary-text);
    font-size: 1.8rem;
    line-height: 1.5;
}

.author-header {
    display: flex;
    align-items: center;
    gap: 2.4rem;
}

.author-avatar-lg {
    flex-shrink: 0;
    width: 9.6rem;
    height: 9.6rem;
    border-radius: 50%;
    object-fit: cover;
}

.author-header-content {
    min-width: 0;
}

/* Listado de entradas
/* ---------------------------------------------------------- */

.post-list {
    display: flex;
    flex-direction: column;
}

.post-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 3rem;
    padding: 3.2rem 0;
    border-bottom: 1px solid var(--color-border);
}

.post-list-item:first-child {
    padding-top: 0;
}

.post-list-content {
    flex: 1 1 auto;
    min-width: 0;
}

.post-list-tag {
    display: inline-block;
    margin-bottom: 0.8rem;
    color: var(--ghost-accent-color);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
}

.post-list-title {
    margin: 0 0 0.8rem;
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.post-list-title a {
    color: inherit;
    text-decoration: none;
}

.post-list-title a:hover {
    color: var(--ghost-accent-color);
}

.post-list-meta {
    margin-bottom: 1.2rem;
    color: var(--color-secondary-text);
    font-size: 1.3rem;
}

.post-list-meta .bull {
    margin: 0 0.6rem;
}

.post-list-excerpt {
    margin: 0 0 1.4rem;
    color: var(--color-secondary-text);
    font-size: 1.6rem;
    line-height: 1.6;
}

.post-list-more {
    color: var(--ghost-accent-color);
    font-size: 1.4rem;
    font-weight: 600;
    text-decoration: none;
}

.post-list-more:hover {
    text-decoration: underline;
}

.post-list-thumb {
    display: block;
    flex: 0 0 160px;
    width: 160px;
    height: 110px;
    overflow: hidden;
}

.post-list-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-main .pagination {
    margin-top: 3.2rem;
}

/* Responsive
/* ---------------------------------------------------------- */

@media (max-width: 1200px) {
    .blog-inner {
        grid-template-columns: 200px minmax(0, 1fr);
        column-gap: 3.2rem;
        max-width: 100%;
    }

    .blog-sidebar {
        grid-column: 1;
    }

    .blog-main {
        grid-column: 2;
    }
}

@media (max-width: 900px) {
    .blog-inner {
        grid-template-columns: 1fr;
        gap: 4rem;
    }

    .blog-sidebar {
        grid-column: auto;
        position: static;
        order: 2;
    }

    .blog-main {
        grid-column: auto;
        order: 1;
    }

    .blog-title {
        font-size: 3.2rem;
    }

    .post-list-thumb {
        flex-basis: 110px;
        width: 110px;
        height: 80px;
    }
}

@media (max-width: 600px) {
    .post-list-item {
        gap: 1.6rem;
        padding: 2.4rem 0;
    }

    .post-list-title {
        font-size: 2.2rem;
    }

    .post-list-thumb {
        display: none;
    }

    .author-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Modo oscuro
/* ---------------------------------------------------------- */

.dark-mode .sidebar-category,
.dark-mode .post-list-title a {
    color: var(--color-lightgrey);
}

.dark-mode .sidebar-count {
    background: #2a2c2e;
}

/* Entrada individual con menú lateral
/* ---------------------------------------------------------- */

.post-template .blog-main .article {
    padding-top: 0;
}

.post-template .blog-main .article-header {
    padding-bottom: max(4.8vmin, 32px);
}

.post-template .blog-main .article-title {
    font-size: clamp(3rem, 4vw, 4.2rem);
}

/* Bloque "leer más": centrado vertical de las tarjetas
/* ---------------------------------------------------------- */

.read-more .post-card,
.read-more .post-card-content {
    justify-content: center;
}

.read-more {
    align-items: center;
}

.read-more-wrap {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

/* En entradas, igualar el aire bajo "leer más" con el de arriba */
.post-template .site-footer {
    margin-top: 0;
}

/* Centrar "leer más" en el espacio libre entre el contenido y el pie */
.post-template .site-content {
    display: flex;
    flex-direction: column;
}

.post-template .read-more-wrap {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
}
