/* Category heading and category-specific shorts share the wide editorial shell. */
.wj-category-page {
    --wj-category-shell-width: 1160px;
    --wj-category-shell-gutter: clamp(1.15rem, 3.4vw, 2.25rem);
    --wj-category-accent: #ff5252;
    --wj-category-divider: rgba(240, 240, 240, 0.13);
}

.wj-category-page .wj-category-header {
    padding-block: clamp(1.8rem, 3.8vw, 3.5rem) clamp(2.25rem, 4vw, 3.5rem);
}

.wj-category-page .wj-category-header__shell,
.wj-category-page .post-list > .site-shell {
    width: 100%;
    max-width: var(--wj-category-shell-width);
    padding-inline: var(--wj-category-shell-gutter);
}

.wj-category-page .wj-category-header__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.58fr) minmax(19.5rem, 1fr);
    gap: clamp(1.15rem, 2.6vw, 2.1rem);
    align-items: start;
}

.wj-category-page .wj-category-header__intro,
.wj-category-page .wj-category-header__sidebar {
    min-width: 0;
}

.wj-category-page .wj-category-header__intro {
    padding-block: clamp(0.45rem, 1.2vw, 0.95rem);
}

.wj-category-page .wj-category-header__intro .archive-header__title {
    max-width: 20ch;
    font-size: clamp(2.4rem, 4.4vw, 3.8rem);
    line-height: 1.08;
    letter-spacing: -0.046em;
    overflow-wrap: break-word;
}

.wj-category-page .wj-category-header__intro .archive-header__desc {
    max-width: 55ch;
    margin-top: 1.4rem;
    font-size: clamp(0.97rem, 1.5vw, 1.06rem);
    line-height: 1.66;
    font-weight: 400;
}

.wj-category-page .wj-category-header__sidebar .wj-shorts-category {
    margin: 0;
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--wj-category-divider);
    border-radius: 20px;
    background: #161616;
    color: #f0f0f0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.wj-category-page .wj-category-header__sidebar .wj-shorts-category .site-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.wj-category-page .wj-category-header__sidebar .wj-shorts-category__header {
    margin-bottom: 1.15rem;
    align-items: start;
}

.wj-category-page .wj-category-header__sidebar .wj-shorts-category__title {
    color: #f0f0f0;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.wj-category-page .wj-category-header__sidebar .wj-shorts-category__all {
    color: rgba(240, 240, 240, 0.65);
}

.wj-category-page .wj-category-header__sidebar .wj-shorts-category__list {
    border-color: rgba(240, 240, 240, 0.13);
}

.wj-category-page .wj-category-header__sidebar .wj-short {
    --wj-short-ink: #f0f0f0;
    --wj-short-muted: rgba(240, 240, 240, 0.65);
    --wj-short-line: rgba(240, 240, 240, 0.13);
    --wj-short-accent: #ff5252;
}

.wj-category-page .wj-category-header__sidebar .wj-shorts-category__empty {
    color: rgba(240, 240, 240, 0.65);
}

.wj-category-page .post-list__items,
.wj-category-page .post-list .pagination,
.wj-category-page .post-list .wj-infinite-footer {
    width: 100%;
    max-width: 675px;
}

/* Load the next page automatically, with an accessible manual alternative. */
.wj-infinite-footer {
    padding-top: 1.5rem;
    padding-bottom: 0.8rem;
    text-align: center;
}

.wj-infinite-footer__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.6rem 1.45rem;
    border: 1px solid rgba(128, 128, 128, 0.36);
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.wj-infinite-footer__button:is(:hover, :focus-visible) {
    border-color: var(--wj-category-accent, #ff5252);
    color: var(--wj-category-accent, #ff5252);
}

.wj-infinite-footer__button:focus-visible {
    outline: 2px solid var(--wj-category-accent, #ff5252);
    outline-offset: 3px;
}

.wj-infinite-footer__button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.wj-infinite-footer__button[hidden],
.wj-infinite-footer__sentinel[hidden],
.wj-infinite-enabled .pagination[hidden] {
    display: none;
}

.wj-infinite-footer__status {
    margin: 0.65rem 0 0;
    color: color-mix(in oklab, var(--color-base-content) 68%, transparent);
    font-size: 0.84rem;
    line-height: 1.5;
}

.wj-infinite-footer__status:empty {
    display: none;
}

.wj-infinite-footer__sentinel {
    height: 1px;
    margin-top: 0.65rem;
}

.wj-shorts-page .wj-infinite-footer {
    max-width: 760px;
    margin-inline: auto;
}

@media (max-width: 900px) {
    .wj-category-page .wj-category-header__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .wj-category-page .wj-category-header__sidebar {
        max-width: 720px;
    }

    .wj-category-page .post-list__items,
    .wj-category-page .post-list .pagination,
    .wj-category-page .post-list .wj-infinite-footer {
        max-width: 720px;
    }
}

@media (max-width: 580px) {
    .wj-category-page .wj-category-header {
        padding-block: 1.5rem 2rem;
    }

    .wj-category-page .wj-category-header__sidebar .wj-shorts-category {
        padding: 1.15rem 1.2rem;
        border-radius: 14px;
    }

    .wj-category-page .wj-category-header__sidebar .wj-shorts-category__header {
        gap: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wj-infinite-footer__button {
        transition: none;
    }
}
