/*
 * Featured pages: expanding panels at the top of the home page.
 * Below 1024px it is a horizontal scroll-snap row; from 1024px the panels share
 * the width and the active one grows.
 */
.ater-featured {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: #0d0d10;
    color: #fff;
    overflow: hidden;
}

.ater-featured .ater-featured__list {
    display: flex;
    height: clamp(360px, 62vh, 560px);
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ater-featured .ater-featured__list::-webkit-scrollbar {
    display: none;
}

.ater-featured .ater-featured__panel {
    position: relative;
    flex: 0 0 85vw;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    overflow: hidden;
    scroll-snap-align: start;
}

.ater-featured .ater-featured__panel + .ater-featured__panel {
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.ater-featured .ater-featured__panel > a {
    position: absolute;
    inset: 0;
    display: block;
    color: #fff;
    text-decoration: none;
    background: #0d0d10;
}

.ater-featured .ater-featured__panel--no-image > a {
    background: linear-gradient(135deg, #24242c, #0d0d10);
}

.ater-featured .ater-featured__img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
}

.ater-featured .ater-featured__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0) 65%);
    pointer-events: none;
}

.ater-featured .ater-featured__title {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    font-family: var(--awb-typography1-font-family, inherit);
    font-weight: var(--awb-typography1-font-weight, 700);
    font-size: clamp(1.4rem, 6vw, 2rem);
    line-height: 1.1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    overflow-wrap: anywhere;
}

.ater-featured .ater-featured__line {
    display: block;
    width: 56px;
    height: 1px;
    background: #fff;
}

.ater-featured .ater-featured__arrow {
    font-size: 1.4rem;
    line-height: 1;
}

.ater-featured .ater-featured__label {
    display: none;
}

/* Two-tone focus ring (dark, white, dark), visible over light and dark images. */
.ater-featured .ater-featured__panel > a:focus-visible {
    outline: none;
}

.ater-featured .ater-featured__panel > a:focus-visible::after {
    content: "";
    position: absolute;
    inset: 4px;
    z-index: 1;
    border: 2px solid #fff;
    outline: 2px solid #000;
    box-shadow: inset 0 0 0 2px #000;
    pointer-events: none;
}

/* Pause / resume button of the rotation (added by the script). The rotation only
   runs from 1024px and without reduced motion, so it is shown only there. */
.ater-featured .ater-featured__toggle {
    display: none;
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    line-height: 1;
    cursor: pointer;
}

.ater-featured .ater-featured__toggle:hover {
    background: rgba(0, 0, 0, 0.85);
}

.ater-featured .ater-featured__toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #000, 0 0 0 6px #000;
}

@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
    .ater-featured.is-enhanced .ater-featured__toggle {
        display: inline-flex;
    }
}

@media (min-width: 1024px) {
    .ater-featured .ater-featured__list {
        height: clamp(420px, 68vh, 760px);
        overflow: hidden;
        scroll-snap-type: none;
    }

    .ater-featured .ater-featured__panel {
        flex: 1 1 0;
        transition: flex 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .ater-featured .ater-featured__panel.is-active {
        flex: 4 1 0;
    }

    /* Without JS the hovered or focused panel opens, and the first one (is-active
       from the server) closes while another is hovered. */
    .ater-featured:not(.is-enhanced) .ater-featured__panel:hover,
    .ater-featured:not(.is-enhanced) .ater-featured__panel:focus-within {
        flex: 4 1 0;
    }

    .ater-featured:not(.is-enhanced) .ater-featured__list:hover .ater-featured__panel.is-active:not(:hover),
    .ater-featured:not(.is-enhanced) .ater-featured__list:focus-within .ater-featured__panel.is-active:not(:focus-within) {
        flex: 1 1 0;
    }

    .ater-featured .ater-featured__img {
        filter: brightness(0.65) saturate(0.9);
        transition: filter 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .ater-featured .ater-featured__panel.is-active .ater-featured__img,
    .ater-featured:not(.is-enhanced) .ater-featured__panel:hover .ater-featured__img,
    .ater-featured:not(.is-enhanced) .ater-featured__panel:focus-within .ater-featured__img {
        filter: none;
    }

    .ater-featured .ater-featured__shade {
        opacity: 0.7;
        transition: opacity 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .ater-featured .ater-featured__panel.is-active .ater-featured__shade,
    .ater-featured:not(.is-enhanced) .ater-featured__panel:hover .ater-featured__shade,
    .ater-featured:not(.is-enhanced) .ater-featured__panel:focus-within .ater-featured__shade {
        opacity: 1;
    }

    /* The vertical label of a closed panel. */
    .ater-featured .ater-featured__label {
        position: absolute;
        left: 16px;
        bottom: 20px;
        display: block;
        max-height: calc(100% - 40px);
        overflow: hidden;
        white-space: nowrap;
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        font-family: var(--awb-typography1-font-family, inherit);
        font-size: 0.8rem;
        font-weight: 600;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
        opacity: 1;
        transition: opacity 250ms ease;
    }

    .ater-featured .ater-featured__panel.is-active .ater-featured__label,
    .ater-featured:not(.is-enhanced) .ater-featured__panel:hover .ater-featured__label,
    .ater-featured:not(.is-enhanced) .ater-featured__panel:focus-within .ater-featured__label {
        opacity: 0;
    }

    /* The large title of the open panel. Its width does not follow the panel, so
       the text does not rewrap while the panel grows. */
    .ater-featured .ater-featured__title {
        left: clamp(20px, 3vw, 40px);
        right: auto;
        bottom: clamp(20px, 3vw, 40px);
        width: clamp(240px, 32vw, 520px);
        font-size: clamp(1.6rem, 3vw, 2.8rem);
        opacity: 0;
        transition: opacity 250ms ease;
    }

    .ater-featured .ater-featured__panel.is-active .ater-featured__title,
    .ater-featured:not(.is-enhanced) .ater-featured__panel:hover .ater-featured__title,
    .ater-featured:not(.is-enhanced) .ater-featured__panel:focus-within .ater-featured__title {
        opacity: 1;
        transition: opacity 350ms ease 250ms;
    }
}

@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
    .ater-featured .ater-featured__panel,
    .ater-featured .ater-featured__img,
    .ater-featured .ater-featured__shade,
    .ater-featured .ater-featured__label,
    .ater-featured .ater-featured__title,
    .ater-featured .ater-featured__panel.is-active .ater-featured__title {
        transition: none;
    }
}
