/*
 * The feed's shelf (templates/shows/_clip_shelf.html): tall cards in a row (a sound's its artwork on the artwork blurred), as the Þættir front page's rows are
 * (site/thaettir/thaettir.css .tc-row): on a phone two and the edge of the next, swiped; on a computer five or six
 * across, the rest by the arrows by the heading (hilla.js). The card's words under its picture, as the site's cards have
 * them (their classes: each outlet's look styles them).
 */
.kh {
    margin-bottom: 1.5rem;
}

.kh-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.kh__label {
    align-items: center;
}

.kh__arrows {
    display: inline-flex;
    gap: 0.375rem;
    margin-left: 0.75rem;
}

.kh__arrows[hidden] {
    display: none;
}

.kh__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--st-fill);
    color: inherit;
    cursor: pointer;
}

.kh__arrow svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.kh__arrow:hover {
    background: var(--st-fill-hover);
}

.kh__arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.kh__arrow:focus {
    outline: none;
}

.kh__arrow:focus-visible,
.kh-card:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.kh__row {
    --kh-gap: 0.75rem;
    display: flex;
    gap: var(--kh-gap);
    margin: 0 -16px;
    padding: 0 16px 0.25rem;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    scrollbar-width: none;
}

.kh__row::-webkit-scrollbar {
    display: none;
}

.kh__item {
    flex: 0 0 42vw;
    max-width: 200px;
    min-width: 0;
    margin: 0;
    padding: 0;
    scroll-snap-align: start;
}

.kh-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

.kh-card:hover {
    color: inherit;
    text-decoration: none;
}

.kh-card:hover .kh-card__title {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.kh-card__still {
    position: relative;
    display: block;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: var(--sp-r-media, 4px); /* (as every teaser's picture: .mediaentry-item__image, teasers/_extras.scss) */
    background: #222;
}

.kh-card__still img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.kh-card:hover .kh-card__still img {
    transform: scale(1.03);
}

/* A sound: its artwork, square, on the artwork blurred */
.kh-card__still .kh-card__blur {
    position: absolute;
    inset: -12%;
    width: 124%;
    height: 124%;
    filter: blur(18px) brightness(0.6) saturate(1.2);
}

.kh-card__still .kh-card__art {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 78%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 5px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    transform: translate(-50%, -58%);
}

.kh-card:hover .kh-card__still .kh-card__blur {
    transform: none;
}

.kh-card:hover .kh-card__still .kh-card__art {
    transform: translate(-50%, -58%) scale(1.03);
}

/* Its length, as a card's "Horfa" mark (thaettir.css .tc-mark); subscribers', as .tc-lock */
.kh-card__time,
.kh-card__lock {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3125rem 0.5625rem 0.3125rem 0.4375rem;
    border-radius: 999px;
    font-family: var(--st-font-sans, "sanomattextsans_web", system-ui, sans-serif);
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    pointer-events: none;
}

.kh-card__time {
    left: 0.5rem;
    bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
}

.kh-card__time svg {
    width: 0.8125rem;
    height: 0.8125rem;
    fill: currentColor;
}

.kh-card__lock {
    left: 0.5rem;
    top: 0.5rem;
    padding: 0.3125rem 0.5625rem;
    background: #fff;
    color: #111;
}

.kh-card__meta {
    flex-wrap: wrap;
    margin: 0.5rem 0 0.25rem;
}

.kh-card__title {
    display: block;
    font-weight: 700;
    line-height: 1.25;
}

.kh-card__credit {
    display: block;
    margin-top: 0.25rem;
    font-family: var(--st-font-sans, "sanomattextsans_web", system-ui, sans-serif);
    font-size: 0.75rem;
    color: var(--base-muted, #6b6b6b);
}

@media (min-width: 768px) {
    .kh__row {
        --kh-gap: 1rem;
        margin: 0;
        padding: 0 0 0.25rem;
        scroll-padding: 0;
    }

    .kh__item {
        flex-basis: calc((100% - 3 * var(--kh-gap)) / 4);
        max-width: none;
    }
}

@media (min-width: 992px) {
    .kh__item {
        flex-basis: calc((100% - 4 * var(--kh-gap)) / 5);
    }
}

@media (min-width: 1200px) {
    .kh__item {
        flex-basis: calc((100% - 5 * var(--kh-gap)) / 6);
    }
}

@media (prefers-reduced-motion: reduce) {
    .kh-card__still img {
        transition: none;
    }

    .kh-card:hover .kh-card__still img {
        transform: none;
    }

    .kh-card:hover .kh-card__still .kh-card__art {
        transform: translate(-50%, -58%);
    }
}
