/*
 * Shorts and editorial home layout.
 * Shares typography, surfaces and accent colors with the Primary theme.
 */

.editorial-home .home-featured > .site-shell {
    max-width: 1160px;
    padding-inline: clamp(1.15rem, 3.4vw, 2.25rem);
}

.editorial-home .wj-home-featured-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.58fr) minmax(19.5rem, 1fr);
    align-items: stretch;
    gap: clamp(1.15rem, 2.6vw, 2.1rem);
}

.editorial-home .wj-home-featured-grid > * {
    min-width: 0;
}

.editorial-home .wj-home-featured-grid .home-featured__article,
.editorial-home .wj-shorts-side {
    border: 1px solid rgba(240, 240, 240, 0.13);
    border-radius: 22px;
    background: #151515;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
    overflow: hidden;
}

.editorial-home .wj-home-featured-grid .home-featured__article {
    display: flex;
    flex-direction: column;
}

.editorial-home .wj-home-featured-grid .home-featured__media {
    flex: 0 0 auto;
    margin: 0;
    border-radius: 0;
    background: #212121;
    aspect-ratio: 16 / 9;
}

.editorial-home .wj-home-featured-grid .home-featured__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(1.3rem, 2.6vw, 1.9rem);
}

.editorial-home .wj-home-featured-grid .home-featured__title {
    max-width: 23ch;
    font-size: clamp(1.65rem, 2.6vw, 2.5rem);
    line-height: 1.14;
    letter-spacing: -0.037em;
    overflow-wrap: break-word;
}

.editorial-home .wj-home-featured-grid .home-featured__excerpt {
    max-width: 53ch;
    margin-top: 1rem;
    font-size: 1rem;
    line-height: 1.62;
}

.editorial-home .wj-home-featured-grid .home-featured__read {
    margin-top: auto;
    padding-top: 1.55rem;
    font-size: 0.92rem;
}

.editorial-home .wj-home-featured-grid .home-featured__read > span {
    transition: transform 0.18s ease;
}

.editorial-home .wj-home-featured-grid .home-featured__read:is(:hover, :focus-visible) > span {
    transform: translate(2px, -2px);
}

.editorial-home .wj-shorts-side {
    display: flex;
    flex-direction: column;
    --wj-short-ink: #f0f0f0;
    --wj-short-muted: rgba(240, 240, 240, 0.62);
    --wj-short-line: rgba(240, 240, 240, 0.11);
    --wj-short-accent: #ff5252;
    color: var(--wj-short-ink);
}

.wj-shorts-side__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.4rem 1.55rem 1.2rem;
}

.wj-shorts-side__heading {
    min-width: 0;
}

.wj-shorts-side__eyebrow,
.wj-shorts-category__eyebrow,
.wj-shorts-page__eyebrow {
    display: block;
    margin: 0 0 0.35rem;
    color: var(--wj-short-accent, #e53935);
    font-family: Outfit, system-ui, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.11em;
    line-height: 1.45;
}

.wj-shorts-side__title {
    margin: 0;
    color: var(--wj-short-ink);
    font-family: Outfit, system-ui, sans-serif;
    font-size: 1.9rem;
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.045em;
}

.wj-shorts-side__signal {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--wj-short-line);
    border-radius: 50%;
}

.wj-shorts-side__signal > span {
    width: 0.47rem;
    height: 0.47rem;
    border-radius: 50%;
    background: var(--wj-short-accent);
}

.wj-shorts-side__list {
    flex: 1 1 auto;
}

.wj-short {
    min-width: 0;
    position: relative;
    color: var(--wj-short-ink);
}

.wj-shorts-side .wj-short {
    border-top: 1px solid var(--wj-short-line);
    padding: 1.05rem 1.55rem 1rem;
}

.wj-short__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    color: var(--wj-short-muted);
    font-size: 0.78rem;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
}

.wj-short__category,
.wj-short__meta > a {
    color: inherit;
    text-decoration: none;
}

.wj-short__category:is(:hover, :focus-visible),
.wj-short__meta > a:is(:hover, :focus-visible) {
    color: var(--wj-short-accent);
}

.wj-short__title {
    margin: 0.42rem 0 0;
    font-family: Outfit, system-ui, sans-serif;
    font-weight: 600;
    line-height: 1.32;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.wj-short__title a {
    color: inherit;
    text-decoration: none;
}

.wj-short__title a:is(:hover, :focus-visible) {
    color: var(--wj-short-accent);
}

.wj-short--home .wj-short__title {
    font-size: 1.02rem;
}

.wj-short__preview {
    display: -webkit-box;
    margin: 0.45rem 0 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    color: var(--wj-short-muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.wj-short__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 1.15rem;
    margin-top: 0.75rem;
    font-size: 0.78rem;
    line-height: 1.45;
}

.wj-short__source,
.wj-short__permalink {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    color: var(--wj-short-muted);
    text-decoration: none;
}

.wj-short__source:is(:hover, :focus-visible),
.wj-short__permalink:is(:hover, :focus-visible) {
    color: var(--wj-short-accent);
}

.wj-shorts-side__all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding: 1.1rem 1.55rem;
    border-top: 1px solid var(--wj-short-line);
    color: var(--wj-short-ink);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.wj-shorts-side__all:is(:hover, :focus-visible) {
    color: var(--wj-short-accent);
}

.wj-shorts-side__all > span {
    font-size: 1.1rem;
}

.wj-shorts-side__empty {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    margin: 0;
    padding: 2.25rem 1.55rem;
    border-top: 1px solid var(--wj-short-line);
    color: var(--wj-short-muted);
    font-size: 0.96rem;
    line-height: 1.65;
}

.wj-shorts-page,
.wj-shorts-category {
    --wj-short-ink: var(--color-base-content, #f0f0f0);
    --wj-short-muted: #aaa;
    --wj-short-line: rgba(128, 128, 128, 0.24);
    --wj-short-accent: #ff5252;
    background: var(--color-base-100, #0c0c0c);
    color: var(--wj-short-ink);
    font-family: Outfit, system-ui, sans-serif;
}

.wj-shorts-page {
    padding-top: 2.5rem;
}

.wj-shorts-page__header .site-shell,
.wj-shorts-page__stream .site-shell,
.wj-short-single .site-shell {
    max-width: 760px;
}

.wj-shorts-page__header {
    padding-block: 1.5rem 2rem;
}

.wj-shorts-page__title {
    margin: 0;
    font-size: clamp(2.55rem, 7vw, 4.5rem);
    line-height: 1.04;
    font-weight: 600;
    letter-spacing: -0.055em;
}

.wj-shorts-page__lead {
    max-width: 59ch;
    margin: 1rem 0 0;
    color: var(--wj-short-muted);
    font-size: 1.1rem;
    line-height: 1.65;
}

.wj-shorts-page__stream {
    padding-bottom: 3.25rem;
}

.wj-shorts-page__items {
    border-top: 1px solid var(--wj-short-line);
}

.wj-short--feed {
    padding: 1.45rem 0 1.55rem;
    border-bottom: 1px solid var(--wj-short-line);
}

.wj-short--feed .wj-short__title {
    margin-top: 0.5rem;
    font-size: clamp(1.25rem, 3vw, 1.55rem);
}

.wj-short__content {
    margin-top: 0.6rem;
    font-size: 1rem;
    line-height: 1.7;
}

.wj-short__content p + p,
.wj-short__content ul + p,
.wj-short__content ol + p,
.wj-short__content p + ul,
.wj-short__content p + ol {
    margin-top: 0.8rem;
}

.wj-short__content a,
.wj-short-single__content a {
    color: var(--wj-short-ink);
    text-decoration-color: var(--wj-short-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}

.wj-short__content a:is(:hover, :focus-visible),
.wj-short-single__content a:is(:hover, :focus-visible) {
    color: var(--wj-short-accent);
}

.wj-short__content ul,
.wj-short__content ol {
    padding-left: 1.25rem;
}

.wj-short--feed .wj-short__footer {
    margin-top: 1rem;
    font-size: 0.82rem;
}

.wj-shorts-page__empty {
    padding: 2rem 0 4rem;
    border-top: 1px solid var(--wj-short-line);
    color: var(--wj-short-muted);
    line-height: 1.6;
}

.wj-shorts-page .pagination {
    padding-top: 1.6rem;
}

.wj-shorts-category {
    padding-block: 1.6rem 2.25rem;
}

.wj-shorts-category .site-shell {
    max-width: 860px;
}

.wj-shorts-category__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.wj-shorts-category__title {
    margin: 0;
    font-size: clamp(1.4rem, 3.3vw, 1.9rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.wj-shorts-category__all {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    color: var(--wj-short-muted);
    font-size: 0.84rem;
    text-decoration: none;
}

.wj-shorts-category__all:is(:hover, :focus-visible) {
    color: var(--wj-short-accent);
}

.wj-shorts-category__list {
    border-top: 1px solid var(--wj-short-line);
    border-bottom: 1px solid var(--wj-short-line);
}

.wj-short--category {
    padding-block: 1.05rem 1.2rem;
}

.wj-short--category + .wj-short--category {
    border-top: 1px solid var(--wj-short-line);
}

.wj-short--category .wj-short__title {
    font-size: 1.1rem;
}

.wj-short--category .wj-short__preview {
    max-width: 68ch;
}

.wj-short--category .wj-short__footer {
    margin-top: 0.55rem;
}

.wj-short-single {
    padding-block: 2rem 5rem;
}

.wj-short-single__back {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 2.1rem;
    color: var(--wj-short-muted);
    font-size: 0.86rem;
    text-decoration: none;
}

.wj-short-single__back:is(:hover, :focus-visible) {
    color: var(--wj-short-accent);
}

.wj-short-single__title {
    margin: 0.8rem 0 1.65rem;
    font-size: clamp(2rem, 5vw, 3.1rem);
    font-weight: 600;
    line-height: 1.14;
    letter-spacing: -0.045em;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.wj-short-single__content {
    font-size: clamp(1.05rem, 2vw, 1.14rem);
    line-height: 1.78;
}

.wj-short-single__content p + p,
.wj-short-single__content p + ul,
.wj-short-single__content p + ol {
    margin-top: 1rem;
}

.wj-short-single__content ul,
.wj-short-single__content ol {
    margin-left: 1.3rem;
}

.wj-short-single__source {
    margin-top: 2rem;
    padding-top: 1.3rem;
    border-top: 1px solid var(--wj-short-line);
    font-size: 0.88rem;
}

html[data-theme="wojtek-light"] .wj-shorts-page,
html[data-theme="wojtek-light"] .wj-shorts-category,
html[data-theme="wojtek-light"] .wj-short-single {
    --wj-short-muted: #626262;
    --wj-short-line: rgba(20, 20, 20, 0.16);
    --wj-short-accent: #d71920;
}

:where(.wj-shorts-page, .wj-shorts-category, .wj-shorts-side, .wj-short-single) a:focus-visible {
    outline: 2px solid var(--wj-short-accent, #e53935);
    outline-offset: 4px;
    border-radius: 2px;
}

@media (max-width: 900px) {
    .editorial-home .wj-home-featured-grid {
        grid-template-columns: minmax(0, 1fr);
        max-width: 710px;
        margin-inline: auto;
        gap: 1.35rem;
    }

    .editorial-home .wj-shorts-side__list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .editorial-home .wj-short--home:nth-child(2) {
        border-left: 1px solid var(--wj-short-line);
    }

    .editorial-home .wj-short--home:nth-child(4) {
        border-left: 1px solid var(--wj-short-line);
    }

    .editorial-home .wj-short--home:nth-child(n + 3) {
        border-top: 1px solid var(--wj-short-line);
    }
}

@media (max-width: 580px) {
    .editorial-home .home-featured {
        padding-top: 1.35rem;
        padding-bottom: 2.5rem;
    }

    .editorial-home .wj-home-featured-grid .home-featured__article,
    .editorial-home .wj-shorts-side {
        border-radius: 14px;
    }

    .editorial-home .wj-home-featured-grid .home-featured__title {
        font-size: clamp(1.65rem, 7vw, 2.05rem);
    }

    .editorial-home .wj-home-featured-grid .home-featured__body {
        padding: 1.2rem;
    }

    .editorial-home .wj-shorts-side__list {
        display: block;
    }

    .editorial-home .wj-short--home {
        border-left: 0 !important;
    }

    .wj-shorts-side__header,
    .wj-shorts-side .wj-short,
    .wj-shorts-side__all {
        padding-inline: 1.2rem;
    }

    .wj-shorts-category__header {
        align-items: start;
    }

    .wj-shorts-page {
        padding-top: 1rem;
    }

    .wj-shorts-page__header {
        padding-top: 1.6rem;
    }

    .wj-short--feed {
        padding-block: 1.2rem 1.35rem;
    }

    .wj-short-single {
        padding-top: 1.2rem;
        padding-bottom: 3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .editorial-home .wj-home-featured-grid .home-featured__read > span {
        transition: none;
    }
}


/*
 * Match the category-card sizing to the wider editorial home layout.
 */
.editorial-home .home-category {
    --home-card-width: min(35rem, calc(100vw - 2.3rem));
}

.editorial-home .home-category__header {
    width: 100%;
    min-width: 0;
}

.editorial-home .home-category__track {
    gap: clamp(1.1rem, 2.25vw, 1.75rem);
}

.editorial-home .home-featured__article .home-featured__meta {
    gap: 0.4rem 0.65rem;
    align-items: center;
    font-size: 0.8rem;
    line-height: 1.55;
}

.editorial-home .home-featured__article .post-card__meta a {
    color: inherit;
    text-decoration: none;
}

.editorial-home .home-featured__article .post-card__meta a:is(:hover, :focus-visible) {
    color: var(--home-accent);
}

.editorial-home .home-featured__article .post-card__meta-sep {
    opacity: 0.65;
}

.editorial-home .home-featured__article .post-card__status {
    color: var(--home-ink);
}

.editorial-home .home-featured__article .home-featured__badge {
    margin-right: 0.35rem;
}

.editorial-home .home-featured__article .post-card__read-count {
    white-space: nowrap;
}

/*
 * Stable image hover in the carousels: a small fixed zoom rather than
 * mouse-position-driven translate, which could appear to jump.
 */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .editorial-home .home-category__item .post-card__image {
        transition: transform 0.22s ease-out;
    }

    .editorial-home .home-category__item .post-card__media:is(:hover, :focus-visible) .post-card__image {
        transform: scale(1.018);
    }
}

@media (hover: none), (prefers-reduced-motion: reduce) {
    .editorial-home .home-category__item .post-card__image,
    .editorial-home .home-category__item .post-card__media:is(:hover, :focus-visible) .post-card__image {
        transform: none;
        transition: none;
    }
}

@media (max-width: 580px) {
    .editorial-home .home-category {
        --home-card-width: min(calc(100vw - 2.3rem), 34rem);
    }

    .editorial-home .home-category__track {
        gap: 1rem;
    }

    .editorial-home .home-featured__article .home-featured__meta {
        gap: 0.35rem 0.55rem;
    }

    .editorial-home .home-featured__article .home-featured__badge {
        margin-right: 0.15rem;
    }
}


/*
 * Final editorial alignment.
 * All category heading shells and their first slides share the
 * same horizontal inset as the featured article and Shorts panel.
 */
.editorial-home {
    --wj-editorial-width: 1160px;
    --wj-editorial-inset: clamp(1.15rem, 3.4vw, 2.25rem);
}

.editorial-home .home-featured > .site-shell {
    width: 100%;
    max-width: var(--wj-editorial-width);
    padding-inline: var(--wj-editorial-inset);
}

.editorial-home .home-category {
    --home-shell-inset: max(
        var(--wj-editorial-inset),
        calc((100% - var(--wj-editorial-width)) / 2 + var(--wj-editorial-inset))
    );
}

/*
 * The slider headings and slide track both use --home-shell-inset.
 * The carousel script updates that value from the featured grid's actual
 * left edge, so headings and cards remain aligned at every viewport size.
 */
.editorial-home .home-category > .home-category__sticky > .site-shell {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-inline: var(--home-shell-inset);
}

.editorial-home .home-category__header {
    width: 100%;
    max-width: none;
}
