:root {
    --expo-transition: cubic-bezier(0.19, 1, 0.22, 1);
    --lines-opacity: 6%;
    --svh: 1svh;
}

.relative {
    position: relative;
    z-index: 2;
}

.our-selection {
    position: relative;
    background-color: var(--background-color);
    border-top: 1px solid color-mix(in srgb, var(--text-color) 6%, transparent);
}

/* Shared with Keel's global.css - missing from Snook, needed so the
   feature image fills the card instead of sitting at its natural height */
.image-wrapper {
    position: absolute;
    inset: 0;
}

.image-wrapper figure::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: black;
    opacity: var(--dark-overlay-opacity);
}

.our-selection-inner {
    position: relative;
    height: 100%;
    min-height: calc(var(--svh) * 100);
    padding: 0;
    display: flex;
    overflow: hidden;
}

.our-selection-inner.position-first {
    justify-content: flex-start;
}

.our-selection-inner.position-second,
.our-selection-inner.position-third {
    justify-content: center;
}

.our-selection-inner.position-fourth {
    justify-content: flex-end;
}

.our-selection-item {
    flex: 1;
    position: relative;
    display: flex;
    width: calc(100% / 6);
    min-width: calc(100% / 6);
    transition: color .2s ease, min-width .6s var(--expo-transition), transform .6s var(--expo-transition);
}

our-selection-item {
    cursor: pointer;
    overflow: hidden;
}

our-selection-item.no-image,
our-selection-item.no-image .our-selection-title .title {
    color: var(--text-color) !important;
}

/* Snook's global `p { color: var(--text-color-70) }` would otherwise block
   inheritance here, so the about/excerpt text couldn't pick up the
   no-image (text-color) vs. has-image (overlay-text-color) state above. */
.our-selection-item p {
    color: inherit;
}

our-selection-item:hover {
    color: var(--overlay-text-color);
}

.our-selection-item.opened {
    width: 50%;
    min-width: 50%;
    color: var(--overlay-text-color);
    cursor: auto;
}

.our-selection-item .placeholder-center {
    transition: opacity .5s ease, transform .6s var(--expo-transition);
    z-index: 2;
}

.our-selection-item.opened .placeholder-center {
    opacity: 0;
    transform: rotate(360deg);
}

.our-selection-item.opened .our-selection-item-inner {
    opacity: 1;
}

.our-selection-item::after {
    content: '';
    position: absolute;
    right: 0;
    width: 1px;
    height: 100%;
    background-color: var(--text-color);
    opacity: var(--lines-opacity);
}

.our-selection-title {
    position: absolute;
    top: max(48px, calc(3.34vw * var(--scale)));
    left: max(24px, 1.67vw);
    z-index: 2;
    width: calc(33vw * var(--scale));
}

.our-selection-item-inner {
    opacity: 0;
    transition: opacity .2s ease;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 50vw;
}

our-selection-item:hover .our-selection-item-inner {
    opacity: 1;
}

/* Base layout for .section-bottom/.bottom-item - shared with Keel's global.css,
   missing from Snook. Without these the two bottom-item blocks (about text and
   the read story link) stack in plain block flow instead of a flex row. */
.section-bottom {
    position: relative;
    display: flex;
    gap: max(48px, 3.34vw);
}

.bottom-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: max(12px, calc(0.83vw * var(--scale)));
}

.our-selection-item .section-bottom {
    position: absolute;
    bottom: max(18px, 1.25vw);
    left: max(24px, 1.67vw);
    right: max(24px, 1.67vw);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--expo-transition);
}

.our-selection-item .section-bottom .bottom-item:nth-of-type(1) {
    flex: 5;
    max-width: max(432px, calc(30vw * var(--scale)));
}

.our-selection-item .close-button {
    position: absolute;
    top: max(52px, calc(3.61vw * var(--scale)));
    right: max(24px, 1.67vw);
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--expo-transition);
    width: fit-content !important;
    display: flex;
}

.our-selection-title .title {
    text-decoration: none;
    color: var(--overlay-text-color);
    display: block;
    width: fit-content;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: transform 1s var(--expo-transition), opacity 0.3s var(--expo-transition);
}

.our-selection-item.opened .our-selection-title .title {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.our-selection-title .number {
    position: absolute;
    opacity: 1;
    transform: translateY(0px);
    transition: transform 1s var(--expo-transition), opacity 0.3s var(--expo-transition);
}

.our-selection-item.opened .our-selection-title .number {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.our-selection-item.opened .section-bottom,
.our-selection-item.opened .close-button {
    opacity: 1;
    pointer-events: auto;
}

.our-selection-item.opened .cursor-text {
    opacity: 0 !important;
}

our-selection-item[data-index="2"] .our-selection-item-inner,
our-selection-item[data-index="3"] .our-selection-item-inner,
our-selection-item[data-index="4"] .our-selection-item-inner {
    left: unset;
}

our-selection-item[data-index="4"] .our-selection-item-inner {
    right: 0;
}

.our-selection-heading {
    position: absolute;
    bottom: max(42px, calc(2.92vw * var(--scale)));
    left: max(24px, 1.67vw);
    background-color: transparent;
    opacity: 0.06;
    z-index: -1;
}

@media screen and (max-width: 1080px) {
    .our-selection-item {
        width: calc(100% / 4);
        min-width: calc(100% / 4);
    }

    .move-left .our-selection-item {
        transform: translateX(-25vw);
    }

    .move-right .our-selection-item {
        transform: translateX(25vw);
    }

    .our-selection-item.empty {
        display: none;
    }

    our-selection-item:hover {
        color: var(--text-color);
    }

    .our-selection-item.opened {
        width: 100%;
        min-width: 100%;
        color: var(--overlay-text-color);
    }

    .our-selection-title {
        top: 38px;
        width: 66vw;
    }

    .our-selection-item-inner {
        width: 100vw;
    }

    our-selection-item:hover .our-selection-item-inner {
        opacity: 0;
    }

    .our-selection-item .section-bottom .bottom-item:nth-of-type(1) {
        flex: auto;
    }

    .our-selection-item .section-bottom .bottom-item:nth-of-type(2) {
        display: flex;
    }

    .our-selection-item .close-button {
        top: 42px;
    }

    our-selection-item[data-index="2"] .our-selection-item-inner {
        left: 0;
    }

    our-selection-item[data-index="3"] .our-selection-item-inner {
        right: 0;
    }

    .our-selection-inner.position-second {
        justify-content: flex-start;
    }

    .our-selection-inner.position-third {
        justify-content: flex-end;
    }

    .our-selection-heading {
        bottom: 32px;
    }
}

@media screen and (max-width: 767px) {
    .our-selection-title {
        top: 30px;
        width: 72vw;
        left: 18px;
    }

    .our-selection-item .close-button {
        top: 34px;
        right: 18px;
    }

    .our-selection-item .section-bottom {
        flex-direction: column;
        bottom: 16px;
        left: 18px;
        right: 18px;
    }

    .our-selection-heading {
        bottom: 24px;
        left: 18px;
    }
}

/* "Read story" (and the featured-slider section's tag links) reuse Snook's
   own .bracket-button (hero/featured-post tags) instead of a ported Keel
   button, just reskinned to body font/paragraph size via the shared
   .paragraph-bracket-link class. .bracket-button's own font-family/size/
   hover-swap animation elsewhere on the site are untouched. */
.paragraph-bracket-link .medium-text {
    font-family: var(--font2);
    font-size: max(18px, calc(1.25vw * var(--scale)));
    font-weight: 400;
    letter-spacing: normal;
}

.read-story-link {
    margin-top: max(12px, calc(0.83vw * var(--scale)));
}

.placeholder-center {
    position: absolute;
    width: max(24px, calc(1.39vw * var(--scale)));
    height: max(24px, calc(1.39vw * var(--scale)));
}

.placeholder-line {
    position: absolute;
}

.placeholder-line.vertical {
    height: 100%;
    width: 1px;
    background-color: color-mix(in srgb, currentColor 40%, transparent);
}

.placeholder-line.horizontal {
    height: 1px;
    width: 100%;
    background-color: color-mix(in srgb, currentColor 40%, transparent);
}

.link-button {
    display: flex;
    align-items: center;
    gap: max(6px, 0.42vw);
}

.link-circle {
    width: max(10px, calc(0.69vw * var(--scale)));
    min-width: max(10px, calc(0.69vw * var(--scale)));
    aspect-ratio: 1;
    border-radius: 100%;
    background-color: currentColor;
    margin-bottom: 1px;
}

.cursor-text {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity .2s ease;
}

.cursor-text.active {
    opacity: 1;
}

.cursor-text-inner {
    position: absolute;
    transform: translate(10px, 10px);
    white-space: nowrap;
}

@media screen and (max-width: 1080px) {
    .relative {
        position: relative;
        z-index: 2;
    }

    .cursor-text {
        display: none !important;
    }

    .read-story-link {
        margin-top: 6px;
    }

    .paragraph-bracket-link .medium-text {
        font-size: 16px;
    }
}

@media screen and (max-width: 767px) {
    .link-button {
        font-size: 16px;
        gap: 5px;
    }

    .link-circle {
        width: 8px;
        min-width: 8px;
    }
}
