/* The swipe on a filter set's page (btg-compare.php), under the description:
   the still without the filter underneath, the one through it on top, cut
   at --btg-compare from the left; a magnifier follows the cursor. */

.btg-compare {
    margin: 2rem 0 0;
}

.btg-compare__title {
    margin: 0 0 0.75rem;
    color: var(--btg-rentals-muted, rgba(232, 228, 220, 0.62));
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.btg-compare__frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    background: var(--btg-deep, #0d0d0c);
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.btg-compare__clear,
.btg-compare__through {
    position: absolute;
    inset: 0;
}

.btg-compare__through {
    clip-path: inset(0 0 0 var(--btg-compare));
}

.btg-compare__frame img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.btg-compare__take {
    visibility: hidden;
}

.btg-compare__take.is-on {
    visibility: visible;
}

/* Each tag lives in its own layer, so the line hides it as it passes */
.btg-compare__tag {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.3rem 0.55rem;
    border-radius: 4px;
    background: rgba(13, 13, 12, 0.72);
    color: var(--btg-strong, #f6f3ed);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
}

.btg-compare__tag--take {
    right: 0.75rem;
    left: auto;
}

/* The line and its handle; the line is the slider (arrow keys) */
.btg-compare__line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--btg-compare);
    width: 44px;
    margin-left: -22px;
    cursor: ew-resize;
}

.btg-compare__line::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 21px;
    width: 2px;
    background: var(--btg-strong, #f6f3ed);
    box-shadow: 0 0 0 1px rgba(13, 13, 12, 0.25);
}

.btg-compare__handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border-radius: 50%;
    background: var(--btg-strong, #f6f3ed);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

/* Two arrows, drawn as borders */
.btg-compare__handle::before,
.btg-compare__handle::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    margin-top: -5px;
    border: 5px solid transparent;
}

.btg-compare__handle::before {
    left: 6px;
    border-right: 6px solid var(--btg-on-strong, #161514);
}

.btg-compare__handle::after {
    right: 6px;
    border-left: 6px solid var(--btg-on-strong, #161514);
}

.btg-compare__line:focus-visible {
    outline: none;
}

.btg-compare__line:focus-visible .btg-compare__handle {
    outline: 2px solid var(--btg-strong, #f6f3ed);
    outline-offset: 3px;
}

.btg-compare__line[hidden],
.btg-compare__loupe[hidden],
.btg-compare__pick[hidden] {
    display: none;
}

/* The magnifier: both stills, enlarged, cut at the same line */
.btg-compare__frame.is-looking {
    cursor: none;
}

.btg-compare__loupe {
    --size: 200px;
    position: absolute;
    top: 0;
    left: 0;
    width: var(--size);
    height: var(--size);
    overflow: hidden;
    border: 2px solid var(--btg-strong, #f6f3ed);
    border-radius: 50%;
    background: var(--btg-deep, #0d0d0c);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.btg-compare__loupe i {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
}

.btg-compare__loupe::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--seam, -10px);
    width: 2px;
    margin-left: -1px;
    background: var(--btg-strong, #f6f3ed);
}

/* What the buttons pick, then the buttons: the views switch's look (btg-rentals.css) */
.btg-compare__pick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.75rem;
}

.btg-compare__pick-label {
    color: var(--btg-rentals-muted, rgba(232, 228, 220, 0.62));
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.btg-compare__takes {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    max-width: 100%;
    padding: 3px;
    border: 1px solid var(--btg-rentals-line, rgba(232, 228, 220, 0.13));
    border-radius: 18px;
}

.btg-compare__takes button {
    padding: 0.35rem 0.85rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.3;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
}

.btg-compare__takes button:hover,
.btg-compare__takes button:focus-visible {
    background: var(--btg-raised, #1f1e1c);
    color: inherit;
}

.btg-compare__takes button[aria-pressed="true"] {
    background: var(--btg-strong, #f6f3ed);
    color: var(--btg-on-strong, #161514);
}

.btg-compare__note {
    margin-top: 0.6rem;
    color: var(--btg-muted, rgba(232, 228, 220, 0.62));
    font-size: 0.78rem;
    line-height: 1.5;
}

/* Phones: one line of buttons (Tobacco has seven), scrolling sideways if it must */
@media (max-width: 640px) {
    .btg-compare__takes {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .btg-compare__takes::-webkit-scrollbar {
        display: none;
    }

    .btg-compare__takes button {
        padding: 0.35rem 0.6rem;
    }
}
