/*
 * The poster wall at the top of the homepage (KMK-597, design hero 5a):
 * poster-wall.tpl and poster-wall-tile.tpl, moved by js/poster-wall.js.
 * Two rows, a poster as wide as a place and a banner as wide as two.
 *
 * Between the tiles and between the rows: a gap of --km-gap, where the page's
 * light background shows (the design's dark #1a1a1a ground is left out with
 * it). A banner spans two places and the gap between them, so a row is as
 * long as its places whatever it holds, and banners keep to the places the
 * server laid them out on. --km-gap: 0 puts the tiles edge to edge again.
 */
.km-wall {
    --km-yellow: #ffcc00;
    --km-gap: 2px;
    --km-row-h: 280px;
    --km-poster-w: 203px;
    --km-banner-w: calc(var(--km-poster-w) * 2 + var(--km-gap));
    position: relative;
    height: calc(var(--km-row-h) * 2 + var(--km-gap));
    overflow: hidden;
    font-family: "Source Sans Pro", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

.km-wall *,
.km-wall *::before,
.km-wall *::after {
    box-sizing: border-box;
}

.km-wall__rows {
    display: flex;
    flex-direction: column;
    gap: var(--km-gap);
    height: 100%;
}

.km-wall__row {
    display: flex;
    height: var(--km-row-h);
    width: max-content;
    will-change: transform;
}

.km-tile {
    position: relative;
    flex: none;
    display: block;
    width: var(--km-poster-w);
    height: 100%;
    margin-right: var(--km-gap);
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    background: #2a2a2a;
}

.km-tile:hover,
.km-tile:focus {
    color: #fff;
    text-decoration: none;
}

.km-tile--banner {
    width: var(--km-banner-w);
}

/* Layers set here: the theme gives every img a z-index of its own, which put
   the picture over its caption. */
.km-tile__img {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
}

/* The shade and the caption: hidden until hover, focus or a tap. */
.km-tile__shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(0deg, rgba(0, 20, 60, .92) 0%, rgba(0, 20, 60, .4) 70%, rgba(0, 20, 60, .1) 100%);
    opacity: 0;
    transition: opacity .25s;
}

.km-tile__info {
    position: absolute;
    z-index: 2;
    left: 16px;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s, transform .25s;
}

.km-tile:hover .km-tile__shade,
.km-tile:focus-visible .km-tile__shade,
.km-tile.is-active .km-tile__shade,
.km-tile:hover .km-tile__info,
.km-tile:focus-visible .km-tile__info,
.km-tile.is-active .km-tile__info {
    opacity: 1;
    transform: none;
}

/* The focus ring is drawn on ::after, above the picture and the caption. On
   the tile itself it did not show on staging (KMK-597): an outline is painted
   under the tile's positioned children, and kontramarka-theme.css removes the
   outline of every focused link with `outline: none !important` as well. An
   outline rather than a shadow, so that it stays in forced-colors mode. */
.km-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.km-tile:focus-visible::after {
    outline: 3px solid var(--km-yellow);
    outline-offset: -3px;
}

.km-tile__date {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--km-yellow);
}

.km-tile__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.15;
    text-wrap: balance;
}

.km-tile--banner .km-tile__title {
    font-size: 24px;
}

.km-tile__meta {
    font-size: 14px;
    line-height: 1.3;
    color: #dbe3f2;
}

.km-tile__cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    height: 38px;
    margin-top: 6px;
    padding: 0 16px;
    border-radius: 6px;
    background: var(--km-yellow);
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.km-tile__date-full {
    display: none;
}

.km-tile--banner .km-tile__date-short {
    display: none;
}

.km-tile--banner .km-tile__date-full {
    display: inline;
}

.km-wall__pause {
    position: absolute;
    right: 20px;
    bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    color: #1a1a1a;
    cursor: pointer;
}

/* !important: kontramarka-theme.css removes the outline of every focused
   button with `outline: none !important`, so the ring did not show on staging
   (KMK-597). This selector is more specific than its `button:focus`. */
.km-wall__pause:focus-visible {
    outline: 3px solid var(--km-yellow) !important;
    outline-offset: 2px;
}

.km-wall__icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

.km-wall__pause[aria-pressed="true"] .km-wall__icon--pause,
.km-wall__pause[aria-pressed="false"] .km-wall__icon--play {
    display: none;
}

@media (min-width: 641px) {
    .km-tile__cta-short {
        display: none;
    }
}

/* Phones */
@media (max-width: 640px) {
    .km-wall {
        --km-row-h: 220px;
        --km-poster-w: 159px;
    }

    .km-tile__info {
        left: 10px;
        right: 10px;
        bottom: 10px;
        gap: 4px;
    }

    .km-tile__date {
        font-size: 11px;
        letter-spacing: .05em;
    }

    .km-tile--banner .km-tile__date-full {
        display: none;
    }

    .km-tile--banner .km-tile__date-short {
        display: inline;
    }

    .km-tile__title {
        display: -webkit-box;
        overflow: hidden;
        font-size: 13px;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }

    .km-tile--banner .km-tile__title {
        font-size: 17px;
    }

    .km-tile__meta {
        font-size: 12px;
    }

    .km-tile__cities {
        display: none;
    }

    .km-tile__cta {
        height: 44px;
        margin-top: 4px;
        padding: 0 14px;
        font-size: 12px;
    }

    .km-tile__cta-long {
        display: none;
    }

    .km-wall__pause {
        right: 12px;
        bottom: 12px;
    }

    .km-wall__icon svg {
        width: 18px;
        height: 18px;
    }
}
