/* Kisure shared desk-style hero for the home, category, and tag archive pages. */
.ks-page-desk-hero,
.ks-page-desk-hero * {
    box-sizing: border-box;
}

.ks-page-desk-hero {
    width: 100%;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    border-radius: 28px;
    padding: 1rem;
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, .8fr);
    gap: 1rem;
    color: var(--text);
    overflow: hidden;
}

.ks-page-desk-hero a {
    color: inherit;
    text-decoration: none;
}

.ks-page-desk-hero img,
.ks-page-desk-hero picture {
    display: block;
    max-width: 100%;
}

.ks-page-desk-hero .ks-desk-lead,
.ks-page-desk-hero .ks-desk-small-card {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.ks-page-desk-hero .ks-desk-lead {
    overflow: hidden;
    border-radius: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr);
    min-height: 420px;
}

.ks-page-desk-hero .ks-desk-lead__image {
    display: block;
    min-height: 420px;
    background: var(--bg-soft);
    overflow: hidden;
    line-height: 0;
}

.ks-page-desk-hero .ks-desk-lead__image picture,
.ks-page-desk-hero .ks-desk-lead__image img,
.ks-page-desk-hero .ks-desk-small-card__image picture,
.ks-page-desk-hero .ks-desk-small-card__image img {
    width: 100%;
    height: 100%;
}

.ks-page-desk-hero .ks-desk-lead__image img,
.ks-page-desk-hero .ks-desk-small-card__image img {
    object-fit: cover;
    object-position: center center;
}

.ks-page-desk-hero .ks-desk-lead__body {
    min-width: 0;
    padding: clamp(1.2rem, 2.4vw, 2rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .8rem;
    background: var(--surface);
}

.ks-page-desk-hero .ks-desk-tag {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: .4rem;
    border-radius: 999px;
    color: var(--primary-strong);
    background: rgba(14, 165, 164, .12);
    border: 1px solid rgba(14, 165, 164, .22);
    font-size: .73rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .45rem .62rem;
}

.ks-page-desk-hero .ks-desk-tag--small {
    font-size: .66rem;
    padding: .34rem .5rem;
}

.ks-page-desk-hero .ks-desk-lead__body h1,
.ks-page-desk-hero .ks-desk-lead__body h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.75rem, 3vw, 3.3rem);
    line-height: 1.02;
    letter-spacing: -.045em;
    font-weight: 950;
    overflow-wrap: anywhere;
    word-break: normal;
}

.ks-page-desk-hero .ks-desk-lead__body h1 a:hover,
.ks-page-desk-hero .ks-desk-lead__body h2 a:hover,
.ks-page-desk-hero .ks-desk-small-card strong:hover {
    color: var(--primary-strong);
}

.ks-page-desk-hero .ks-desk-meta {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
    color: var(--text-soft);
    font-size: .86rem;
    font-weight: 800;
}

.ks-page-desk-hero .ks-desk-meta span + span::before {
    content: '';
    width: .32rem;
    height: .32rem;
    border-radius: 50%;
    background: var(--primary);
    display: inline-block;
    margin-right: .55rem;
    vertical-align: middle;
}

.ks-page-desk-hero .ks-desk-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: fit-content;
    min-height: 2.65rem;
    border-radius: 999px;
    padding: .72rem 1rem;
    font-size: .86rem;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    border: 1px solid transparent;
    transition: transform .2s ease, filter .2s ease;
}

.ks-page-desk-hero .ks-desk-link:hover,
.ks-page-desk-hero .ks-desk-small-card:hover {
    transform: translateY(-2px);
}

.ks-page-desk-hero .ks-desk-rail {
    display: grid;
    gap: .8rem;
    min-width: 0;
}

.ks-page-desk-hero .ks-desk-small-card {
    border-radius: 20px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr);
    min-height: 126px;
    transition: transform .2s ease, box-shadow .2s ease;
}

.ks-page-desk-hero .ks-desk-small-card__image {
    display: block;
    min-height: 126px;
    background: var(--bg-soft);
    overflow: hidden;
    line-height: 0;
}

.ks-page-desk-hero .ks-desk-small-card__body {
    min-width: 0;
    padding: .85rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .48rem;
}

.ks-page-desk-hero .ks-desk-small-card strong {
    color: var(--text);
    font-size: .96rem;
    line-height: 1.2;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.ks-page-desk-hero .ks-desk-small-card small {
    color: var(--text-soft);
    font-weight: 800;
}

.ks-page-desk-hero [data-kisure-drag-scroll] {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ks-page-desk-hero [data-kisure-drag-scroll]::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.ks-page-desk-hero [data-kisure-drag-scroll].kisure-drag-scroll-ready {
    cursor: grab;
}

.ks-page-desk-hero [data-kisure-drag-scroll].is-dragging,
.ks-page-desk-hero [data-kisure-drag-scroll].is-gliding {
    cursor: grabbing !important;
    user-select: none;
    scroll-snap-type: none !important;
}

.ks-page-desk-hero [data-kisure-drag-scroll].is-dragging a,
.ks-page-desk-hero [data-kisure-drag-scroll].is-gliding a {
    pointer-events: none;
}

html[data-theme="dark"] .ks-page-desk-hero,
html[data-theme="dark"] .ks-page-desk-hero .ks-desk-lead,
html[data-theme="dark"] .ks-page-desk-hero .ks-desk-small-card,
html[data-theme="dark"] .ks-page-desk-hero .ks-desk-lead__body {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: none;
}

html[data-theme="dark"] .ks-page-desk-hero .ks-desk-tag {
    background: rgba(79, 209, 197, .1);
    border-color: rgba(79, 209, 197, .18);
}

@media (max-width: 1180px) {
    .ks-page-desk-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .ks-page-desk-hero .ks-desk-lead {
        grid-template-columns: minmax(0, 1fr);
    }

    .ks-page-desk-hero .ks-desk-lead,
    .ks-page-desk-hero .ks-desk-lead__image {
        min-height: 0;
    }

    .ks-page-desk-hero .ks-desk-lead__image {
        aspect-ratio: 16 / 10;
        max-height: 320px;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] {
        display: flex;
        flex-wrap: nowrap;
        gap: .8rem;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        padding: .05rem .05rem .35rem;
        margin: 0;
        scroll-snap-type: x proximity;
        touch-action: pan-x pan-y;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] .ks-desk-small-card {
        flex: 0 0 clamp(245px, 38vw, 330px);
        width: clamp(245px, 38vw, 330px);
        scroll-snap-align: start;
    }
}

@media (max-width: 900px) {
    .ks-page-desk-hero {
        border-radius: 22px;
        padding: .82rem;
        gap: .75rem;
    }

    .ks-page-desk-hero .ks-desk-lead__body h1,
    .ks-page-desk-hero .ks-desk-lead__body h2 {
        font-size: clamp(1.35rem, 7vw, 2.1rem);
        line-height: 1.06;
    }

    .ks-page-desk-hero .ks-desk-link {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .ks-page-desk-hero {
        border-radius: 18px;
        padding: .68rem;
        gap: .68rem;
    }

    .ks-page-desk-hero .ks-desk-lead {
        border-radius: 16px;
    }

    .ks-page-desk-hero .ks-desk-lead__image {
        max-height: 260px;
    }

    .ks-page-desk-hero .ks-desk-lead__body {
        padding: .88rem;
        gap: .55rem;
    }

    .ks-page-desk-hero .ks-desk-lead__body h1,
    .ks-page-desk-hero .ks-desk-lead__body h2 {
        font-size: clamp(1.22rem, 6.2vw, 1.75rem);
        line-height: 1.1;
        letter-spacing: -.03em;
    }

    .ks-page-desk-hero .ks-desk-tag {
        font-size: .61rem;
        padding: .34rem .46rem;
        letter-spacing: .055em;
    }

    .ks-page-desk-hero .ks-desk-meta {
        font-size: .72rem;
        gap: .32rem;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] {
        display: flex;
        grid-template-columns: none;
        gap: .62rem;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 0;
        -webkit-overflow-scrolling: touch;
        padding: 0 0 .18rem;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] .ks-desk-small-card {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        min-width: 100%;
        display: grid;
        grid-template-columns: clamp(104px, 34vw, 132px) minmax(0, 1fr);
        height: clamp(126px, 33vw, 142px);
        min-height: clamp(126px, 33vw, 142px);
        max-height: clamp(126px, 33vw, 142px);
        align-items: stretch;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        overflow: hidden;
        border-radius: 16px;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] .ks-desk-small-card__image {
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: none;
        aspect-ratio: auto;
        align-self: stretch;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] .ks-desk-small-card__image picture,
    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] .ks-desk-small-card__image img {
        display: block;
        width: 100%;
        height: 100%;
        min-width: 100%;
        min-height: 100%;
        max-width: none;
        object-fit: cover;
        object-position: center center;
        line-height: 0;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] .ks-desk-small-card__body {
        height: 100%;
        min-height: 0;
        padding: .66rem .72rem;
        justify-content: center;
        overflow: hidden;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] .ks-desk-small-card strong {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.16;
    }
}

@media (max-width: 390px) {
    .ks-page-desk-hero {
        padding: .62rem;
    }

    .ks-page-desk-hero .ks-desk-lead__image {
        max-height: 230px;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] .ks-desk-small-card {
        grid-template-columns: 96px minmax(0, 1fr);
        height: 124px;
        min-height: 124px;
        max-height: 124px;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] .ks-desk-small-card__body {
        padding: .58rem .62rem;
    }
}

/* v325: category-aware rail stability, no blank hero column, and stronger tablet image fit. */
.ks-page-desk-hero {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
}

.ks-page-desk-hero.ks-page-desk-hero--with-rail {
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr) !important;
}

.ks-page-desk-hero.ks-page-desk-hero--single {
    grid-template-columns: minmax(0, 1fr) !important;
}

.ks-page-desk-hero .ks-desk-lead,
.ks-page-desk-hero .ks-desk-rail,
.ks-page-desk-hero .ks-desk-small-card,
.ks-page-desk-hero .ks-desk-lead__image,
.ks-page-desk-hero .ks-desk-lead__body {
    min-width: 0 !important;
    max-width: 100% !important;
}

.ks-page-desk-hero .ks-desk-lead__image,
.ks-page-desk-hero .ks-desk-small-card__image {
    display: block !important;
    overflow: hidden !important;
    line-height: 0 !important;
}

.ks-page-desk-hero .ks-desk-lead__image picture,
.ks-page-desk-hero .ks-desk-lead__image img,
.ks-page-desk-hero .ks-desk-small-card__image picture,
.ks-page-desk-hero .ks-desk-small-card__image img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center center !important;
}

.ks-page-desk-hero .ks-desk-rail {
    overflow: hidden !important;
}

@media (min-width: 1181px) {
    .ks-page-desk-hero .ks-desk-lead {
        grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr) !important;
        min-height: 420px !important;
    }

    .ks-page-desk-hero .ks-desk-lead__image {
        min-height: 420px !important;
        height: 100% !important;
    }

    .ks-page-desk-hero .ks-desk-rail {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: .8rem !important;
        align-self: stretch !important;
    }
}

@media (max-width: 1180px) {
    .ks-page-desk-hero,
    .ks-page-desk-hero.ks-page-desk-hero--with-rail,
    .ks-page-desk-hero.ks-page-desk-hero--single {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .ks-page-desk-hero .ks-desk-lead {
        grid-template-columns: minmax(0, 1fr) !important;
        min-height: 0 !important;
    }

    .ks-page-desk-hero .ks-desk-lead__image,
    .ks-page-desk-hero .ks-desk-lead__body {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .ks-page-desk-hero .ks-desk-lead__image {
        height: clamp(280px, 44vw, 430px) !important;
        min-height: 0 !important;
        max-height: none !important;
        aspect-ratio: auto !important;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: .8rem !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: .05rem .05rem .35rem !important;
        scroll-snap-type: x proximity !important;
        touch-action: pan-x pan-y !important;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] .ks-desk-small-card {
        flex: 0 0 clamp(245px, 38vw, 330px) !important;
        width: clamp(245px, 38vw, 330px) !important;
        scroll-snap-align: start !important;
    }
}

@media (max-width: 640px) {
    .ks-page-desk-hero .ks-desk-lead__image {
        height: clamp(205px, 56vw, 260px) !important;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] .ks-desk-small-card {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        height: clamp(126px, 33vw, 142px) !important;
        min-height: clamp(126px, 33vw, 142px) !important;
        max-height: clamp(126px, 33vw, 142px) !important;
        grid-template-columns: clamp(104px, 34vw, 132px) minmax(0, 1fr) !important;
    }
}

@media (max-width: 390px) {
    .ks-page-desk-hero .ks-desk-lead__image {
        height: 224px !important;
    }

    .ks-page-desk-hero .ks-desk-rail[data-kisure-drag-scroll] .ks-desk-small-card {
        grid-template-columns: 96px minmax(0, 1fr) !important;
        height: 124px !important;
        min-height: 124px !important;
        max-height: 124px !important;
    }
}
