/* SEE IT: the interviews, one question and its photograph at a time, and
   the project page's mosaic. Fonts, colours and the article box come from
   GeneratePress. */

.btg-see-it {
    --btg-see-it-line: rgba(15, 15, 15, 0.14);
    --btg-see-it-muted: rgba(15, 15, 15, 0.55);
    /* Room the frame leaves for the site header, title, question and controls. */
    --btg-see-it-chrome: 330px;
}

.btg-see-it .inside-article {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

/* Head */

.btg-see-it__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.btg-see-it__series {
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-decoration: none;
    color: var(--btg-see-it-muted);
    white-space: nowrap;
}

.btg-see-it__series:hover,
.btg-see-it__series:focus-visible {
    color: inherit;
}

.btg-see-it__name {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    line-height: 1.1;
}

/* Carousel */

.btg-see-it__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.btg-see-it__track::-webkit-scrollbar {
    display: none;
}

.btg-see-it__track:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 4px;
}

.btg-see-it__slide {
    margin: 0;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.btg-see-it__question {
    min-height: 1.45em;
    margin: 0 0 0.75rem;
    padding: 0 0.5rem;
    text-align: center;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    line-height: 1.45;
}

.btg-see-it__number {
    margin-right: 0.5em;
    font-size: 0.75em;
    letter-spacing: 0.08em;
    color: var(--btg-see-it-muted);
    font-variant-numeric: tabular-nums;
}

.btg-see-it__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    max-height: calc(100vh - var(--btg-see-it-chrome));
    max-height: calc(100svh - var(--btg-see-it-chrome));
    min-height: 240px;
}

.btg-see-it__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top;
}

.js-btg-see-it .btg-see-it__frame {
    cursor: e-resize;
}

.js-btg-see-it .btg-see-it__frame.is-back {
    cursor: w-resize;
}

/* Controls */

.btg-see-it__controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 640px;
    margin: 1rem auto 0;
}

.btg-see-it__step {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--btg-see-it-line);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, opacity 0.15s ease;
}

/* GeneratePress fills buttons with the accent on hover, focus and press. */
.btg-see-it__step:hover,
.btg-see-it__step:focus,
.btg-see-it__step:active {
    border-color: currentColor;
    background: transparent;
    color: inherit;
}

.btg-see-it__step:disabled {
    opacity: 0.3;
    cursor: default;
    border-color: var(--btg-see-it-line);
}

.btg-see-it__step svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

.btg-see-it__dots {
    display: flex;
    flex: 1;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.btg-see-it__dots li {
    flex: 1;
    margin: 0;
}

.btg-see-it__dots button {
    display: block;
    width: 100%;
    height: 1.75rem;
    padding: 0;
    border: 0;
    background: linear-gradient(var(--btg-see-it-line), var(--btg-see-it-line)) center / 100% 2px no-repeat;
    color: inherit;
    cursor: pointer;
}

.btg-see-it__dots button:focus,
.btg-see-it__dots button:active {
    background-color: transparent;
}

.btg-see-it__dots button:hover,
.btg-see-it__dots button:focus-visible,
.btg-see-it__dots button[aria-current="true"] {
    background-color: transparent;
    background-image: linear-gradient(currentColor, currentColor);
}

.btg-see-it__count {
    flex: none;
    min-width: 3.5em;
    text-align: center;
    font-size: 0.8rem;
    color: var(--btg-see-it-muted);
    font-variant-numeric: tabular-nums;
}

.btg-see-it__step:focus-visible,
.btg-see-it__dots button:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 2px;
}

/* Other interviews */

.btg-see-it__more {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 640px;
    margin: 2rem auto 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--btg-see-it-line);
}

.btg-see-it__other {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-width: 48%;
    font-size: 0.95rem;
    text-decoration: none;
    color: inherit;
}

.btg-see-it__other span {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--btg-see-it-muted);
}

.btg-see-it__other:hover,
.btg-see-it__other:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.btg-see-it__other--newer {
    margin-left: auto;
    text-align: right;
}

@media (max-width: 768px) {
    .btg-see-it {
        --btg-see-it-chrome: 350px;
    }

    /* Phones: each photo at its own shape; the track follows the current
       one's height (btg-see-it.js), so nothing sits in a letterbox. */
    .btg-see-it__track {
        align-items: start;
        transition: height 0.25s ease;
    }

    .btg-see-it__frame {
        aspect-ratio: var(--btg-see-it-ratio, 1);
        min-height: 0;
    }

    .btg-see-it__controls {
        gap: 0.5rem;
    }

    .btg-see-it__count {
        display: none;
    }
}

/* Project page */

.btg-see-it-index__head {
    max-width: 640px;
    margin: 0 auto 2.5rem;
}

.btg-see-it-index__about {
    margin: 0.75rem 0 0;
    line-height: 1.6;
}

.btg-see-it-index__count {
    margin: 0;
    font-size: 0.8rem;
    color: var(--btg-see-it-muted);
}

.btg-see-it-index__mosaic {
    --cols: 6;
    --gap: 6px;
    container-type: inline-size;
    display: grid;
    grid-template-columns: repeat(var(--cols), 1fr);
    grid-auto-rows: calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols));
    grid-auto-flow: dense;
    gap: var(--gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.btg-see-it-index__tile {
    position: relative;
    margin: 0;
    overflow: hidden;
    background: rgba(15, 15, 15, 0.06);
}

.btg-see-it-index__tile a {
    display: block;
    height: 100%;
    color: #fff;
    text-decoration: none;
}

.btg-see-it-index__photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.6s ease;
}

/* The script gives each photo its src; without it the <noscript> copy shows. */
.btg-see-it-index__photo:not([src]) {
    display: none;
}

.btg-see-it-index__tile.is-loaded .btg-see-it-index__photo,
noscript .btg-see-it-index__photo {
    opacity: 1;
}

.btg-see-it-index__name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2rem 0.75rem 0.6rem;
    font-size: 0.8rem;
    line-height: 1.3;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btg-see-it-index__tile a:hover .btg-see-it-index__name,
.btg-see-it-index__tile a:focus-visible .btg-see-it-index__name {
    opacity: 1;
}

.btg-see-it-index__tile a:hover .btg-see-it-index__photo,
.btg-see-it-index__tile a:focus-visible .btg-see-it-index__photo {
    transform: scale(1.03);
}

.btg-see-it-index__tile a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

/* Touch screens have no hover: names always show. */
@media (hover: none) {
    .btg-see-it-index__name {
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    .btg-see-it-index__mosaic {
        --cols: 4;
    }
}

@media (max-width: 600px) {
    .btg-see-it-index__mosaic {
        --cols: 2;
        --gap: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btg-see-it__track,
    .btg-see-it-index__photo {
        transition: none;
    }
}
