/* The cellar covers the viewport at its original 3:2 aspect ratio. */
body.is-subpage {
    --cellar: url('../img/ufc-addams/cellar-assembled.webp');
    background-image: linear-gradient(rgb(0 0 0 / 12%), rgb(0 0 0 / 12%)), var(--cellar);
    background-position: center top;
}

@media (max-width: 3840px) and (max-height: 2560px) and (max-resolution: 1dppx),
       (max-width: 2560px) and (max-height: 1707px) and (max-resolution: 1.5dppx),
       (max-width: 1920px) and (max-height: 1280px) and (max-resolution: 2dppx),
       (max-width: 1280px) and (max-height: 854px) and (max-resolution: 3dppx) {
    body.is-subpage { --cellar: url('../img/display/cellar-assembled.webp-3840.webp'); }
}
@media (max-width: 2560px) and (max-height: 1707px) and (max-resolution: 1dppx),
       (max-width: 1706px) and (max-height: 1138px) and (max-resolution: 1.5dppx),
       (max-width: 1280px) and (max-height: 854px) and (max-resolution: 2dppx),
       (max-width: 900px) and (max-height: 1200px) {
    body.is-subpage { --cellar: url('../img/display/cellar-assembled.webp-2560.webp'); }
}

/* UFC1 navigation uses the original gold links and dark menu background. */
.addams-menu__desktop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(8px, 1.1vw, 16px);
}

.addams-menu__desktop > a,
.addams-menu__desktop .participants-menu-trigger,
.addams-menu__account > summary {
    font-size: clamp(15px, 1.35vw, 18px);
    white-space: nowrap;
}

.addams-menu__account {
    height: 50px;
    max-width: 150px;
}

.addams-menu__account > summary {
    overflow: hidden;
    color: #ffe1a6;
    text-overflow: ellipsis;
    cursor: pointer;
}

.addams-menu__account[open] .sp-dropdown {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
}

.addams-menu [aria-current="page"] {
    text-decoration: underline;
    text-decoration-color: #cfb68e;
    text-underline-offset: 5px;
}

.addams-menu :is(a, summary):focus-visible {
    outline: 2px solid #ffe1a6;
    outline-offset: 3px;
}

.addams-menu :is(.participants-dropdown-item, .sp-dropdown-item):is(:hover, :focus-visible) {
    border-radius: 6px;
    background: #ffe1a6;
    color: #26190f;
    text-shadow: none;
    animation: none;
    transition: none;
}

.addams-menu__mobile {
    display: none;
}

@media (max-width: 1050px) {
    .addams-menu__desktop {
        display: none;
    }

    .addams-menu__mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 52px;
        padding-inline: 42px;
    }

    .addams-menu__mobile .addams-menu__home {
        display: block;
        font-size: clamp(16px, 4.4vw, 24px);
        text-align: center;
        line-height: 1.15;
    }

    .addams-menu__mobile .menu__btn {
        display: flex;
        z-index: 11;
        list-style: none;
    }

    .addams-menu__mobile .menu__btn::-webkit-details-marker {
        display: none;
    }

    .addams-menu__mobile .menu-wrapper {
        top: 52px;
        width: min(300px, 100vw);
        height: calc(100dvh - 52px);
        padding: 16px 24px;
        overflow-y: auto;
    }

    .addams-menu__mobile .menu-wrapper ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .addams-menu__mobile .menu-wrapper li {
        margin: 0;
    }

    .addams-menu__mobile .menu-wrapper a {
        display: block;
        padding-block: 10px;
    }

    .addams-menu__mobile .addams-menu__sections {
        margin-left: 12px;
        padding-left: 10px;
        border-left: 1px solid #a6795d;
    }

    .addams-menu__mobile .addams-menu__sections a {
        font-size: 16px;
    }

    .addams-menu__mobile details[open] .menu-wrapper {
        visibility: visible;
        right: 0;
    }

    .addams-menu__mobile details[open] .menu__btn > span {
        transform: rotate(45deg);
    }

    .addams-menu__mobile details[open] .menu__btn > span::before {
        top: 0;
    }

    .addams-menu__mobile details[open] .menu__btn > span::after {
        top: 0;
        transform: rotate(90deg);
    }
}

.addams-story {
    max-width: 1160px;
    margin: 0 auto;
    padding: 82px 28px 44px;
    color: #34251e;
}

.addams-story__header {
    text-align: center;
    color: #ffe1a6;
    padding-bottom: 16px;
}

.addams-story a {
    color: #ffe1a6;
    text-underline-offset: 5px;
}

.addams-story a:hover {
    color: #fff3d9;
}

.addams-story a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 6px;
}

.addams-story__eyebrow {
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.6;
}

.addams-story h1 {
    color: #ffe1a6;
    margin: 16px 0 10px;
    font-family: 'TwilightC', 'Alice', serif;
    font-size: clamp(38px, 6vw, 86px);
    text-wrap: balance;
    font-weight: 400;
    line-height: 1.1;
    text-shadow: 0 3px 28px #000;
}

.addams-story__subtitle {
    font-size: 23px;
    line-height: 1.5;
}

.addams-story .addams-story__paper {
    margin-top: 24px;
    padding: 68px 65px 92px;
}

.addams-story__paper > .addams-story__text {
    max-width: 850px;
    margin: 0 auto;
}

.addams-story__date {
    position: absolute;
    right: 7%;
    bottom: clamp(18px, 4vw, 54px);
    z-index: 2;
    width: clamp(134px, 13vw, 162px);
    height: auto;
    transform: rotate(-3deg);
}

.addams-story__text p {
    margin: 0 0 18px;
    font-size: 20px;
    line-height: 1.8;
    overflow-wrap: break-word;
    orphans: 3;
    widows: 3;
}

.addams-story h2 {
    margin: 8px 0 24px;
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 400;
    line-height: 1.25;
    text-align: left;
    text-wrap: balance;
    color: #4b3025;
}

.addams-story__opening::first-letter {
    float: left;
    margin: 8px 10px 0 0;
    font-size: 76px;
    line-height: .85;
    color: #75452d;
}

.addams-story__quote {
    font-size: inherit;
    color: #75452d;
}

.addams-narrator {
    color: #513526;
    padding-bottom: 12px;
    margin-bottom: clamp(20px, 3vw, 32px);
    border-bottom: 1px solid rgb(110 74 43 / 27%);
}
.addams-narrator > audio { max-width: 100%; }
.addams-narrator__player {
    display: grid;
    grid-template-columns: clamp(60px, 8vw, 86px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(12px, 2vw, 22px);
}
.addams-narrator__player[hidden] { display: none; }
.addams-narrator__button {
    position: relative;
    display: block;
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    cursor: pointer;
}
.addams-narrator__button img {
    display: block; width: 100%; height: auto;
    filter: grayscale(1);
    opacity: .64;
}
.addams-narrator__mark {
    position: absolute; right: -2px; bottom: 0;
    display: grid; place-items: center; box-sizing: border-box;
    width: clamp(23px, 2.5vw, 30px); aspect-ratio: 1;
    border: 3px double currentColor; border-radius: 48% 52% 45% 54%;
    background: #efdbb3;
}
.addams-narrator__mark::after {
    content: ""; margin-left: 2px;
    border-block: 4px solid transparent; border-left: 7px solid currentColor;
}
.addams-narrator__button[data-pause] .addams-narrator__mark::after {
    box-sizing: content-box; width: 3px; height: 10px; margin: 0;
    border: 0; border-inline: 2px solid currentColor;
}
.addams-narrator__transport { min-width: 0; }
.addams-narrator__transport label { font: italic clamp(17px, 2vw, 21px)/1.25 'Alice', Georgia, serif; cursor: pointer; }
.addams-narrator__button:hover, .addams-narrator__transport label:hover { color: #784722; }
.addams-narrator__timeline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(7px, 1vw, 12px);
    font: 14px/1 'Alice', Georgia, serif;
    font-variant-numeric: tabular-nums;
    direction: ltr;
}
.addams-narrator__timeline input {
    appearance: none;
    width: 100%; min-width: 0; height: 36px; margin: 0; border: 0; padding: 0;
    color: #67452f;
    background: linear-gradient(to right, currentColor var(--played, 0%), #977b56 var(--played, 0%)) center / 100% 2px no-repeat;
    cursor: pointer;
}
.addams-narrator__timeline input::-webkit-slider-thumb {
    appearance: none; width: 13px; height: 13px; border: 2px solid #67452f; border-radius: 50%; background: #eed4a8;
}
.addams-narrator__timeline input::-moz-range-thumb {
    box-sizing: border-box; width: 13px; height: 13px; border: 2px solid #67452f; border-radius: 50%; background: #eed4a8;
}
.addams-narrator__timeline input:disabled { opacity: .55; cursor: default; }
.addams-narrator :focus-visible { outline: 2px dashed currentColor; outline-offset: 3px; }
.addams-narrator__error { display: block; font: 14px/1.3 'Alice', Georgia, serif; }
button.channel-control.addams-music-toggle { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 148px); }
button.addams-music-toggle[aria-pressed="true"] { background: #f2d294; }
@media screen and (width < 500px) {
    /* Keep the floating controls out of the narrow reading column. */
    html:has(.addams-music-toggle:not([hidden])) { scroll-padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
    body:has(.addams-music-toggle:not([hidden])) {
        --addams-dock-right: max(12px, env(safe-area-inset-right));
        padding-bottom: calc(62px + env(safe-area-inset-bottom));
    }
    body:has(.addams-music-toggle):has(iframe[src*="/debug-kit/toolbar/"]) { --addams-dock-right: max(54px, env(safe-area-inset-right)); }
    body:has(.addams-music-toggle:not([hidden]))::after {
        content: "";
        position: fixed; z-index: 999; inset: auto 0 0; height: calc(60px + env(safe-area-inset-bottom));
        border-top: 1px solid #776041;
        background: #1b1216; pointer-events: none;
    }
    body:has(.addams-music-toggle) button.channel-control { bottom: calc(8px + env(safe-area-inset-bottom)); }
    body:has(.addams-music-toggle) .channel-control.channel-sound { right: var(--addams-dock-right); }
    body:has(.addams-music-toggle) .channel-control.channel-tv { right: calc(var(--addams-dock-right) + 52px); }
    body:has(.addams-music-toggle) .channel-control.addams-music-toggle { right: calc(var(--addams-dock-right) + 104px); }
}
.addams-sound-prompt {
    box-sizing: border-box;
    color: #ffe6bb;
    background: radial-gradient(ellipse at top left, #503a2e, #28201e 72%);
    border: 1px solid #9f7a47;
    border-radius: 5px;
    box-shadow: inset 0 0 0 4px #271f1d, inset 0 0 0 5px #93744480, 0 3px 9px #33201638;
    position: fixed; inset: 0; margin: auto; width: min(390px, calc(100% - 32px));
    padding: 35px 28px 29px; text-align: center;
}
.addams-sound-prompt::backdrop { background: rgb(18 13 12 / 74%); }
.addams-sound-prompt h2 {
    margin: 0 0 22px; color: #ffe1a6; font: 400 clamp(26px, 5vw, 34px)/1.15 'Alice', Georgia, serif;
    text-wrap: balance; text-shadow: none;
}
.addams-sound-prompt__choices { display: flex; justify-content: center; gap: 12px; }
.addams-sound-prompt button {
    min-width: 86px; min-height: 44px; padding: 6px 20px; cursor: pointer;
    font: 18px/1.3 'Alice', Georgia, serif; border-radius: 3px; border: 1px solid #bd9964;
    background: transparent; color: #ffe1a6;
}
.addams-sound-prompt [data-music="on"] { background: #edcc94; color: #30221d; }
.addams-sound-prompt button:hover { border-color: #fff0cc; filter: brightness(1.12); }
.addams-sound-prompt :focus-visible { outline: 2px solid #ffdf9d; outline-offset: 3px; }

.addams-story__text section,
.addams-story__beat {
    display: flow-root;
}

.addams-story__text section {
    margin-bottom: 38px;
}

.addams-story__text section:last-child {
    margin-bottom: 0;
}

.addams-story__sketch {
    display: block;
    width: clamp(178px, 24vw, 260px);
    max-width: 38%;
    height: auto;
    margin: 0 0 8px 26px;
    float: right;
}

.addams-story__beat--left .addams-story__sketch {
    float: left;
    margin: 0 26px 8px 0;
}

.addams-story__beat--vignette .addams-story__sketch {
    width: clamp(130px, 17vw, 180px);
}

.addams-story__beat--end .addams-story__sketch {
    float: none;
    width: min(73%, 405px);
    max-width: 100%;
    margin: 0 auto;
}

.addams-story__footer {
    margin-top: 28px;
    text-align: center;
    color: #ffe1a6;
}

.addams-story__credits {
    margin: 0 0 14px;
    color: #c7b8a6;
    font-size: 14px;
    line-height: 1.6;
}

.addams-album {
    margin: 56px auto 0;
    padding: clamp(24px, 4.5vw, 56px);
    border: 1px solid #8c6e42;
    border-radius: 5px;
    background-color: #27201e;
    background-image:
        repeating-linear-gradient(4deg, transparent 0 2px, #e7c89909 2px 3px),
        repeating-linear-gradient(94deg, transparent 0 2px, #07050930 2px 3px),
        radial-gradient(ellipse at top left, #523d35, transparent 75%);
    box-shadow: inset 0 0 0 5px #201a19, inset 0 0 0 6px #8c6e4280, 0 12px 28px #0007;
    color: #ebd6b0;
}

.addams-album__heading {
    border-bottom: 1px solid #a183504f;
    padding-bottom: 17px;
    margin-bottom: 22px;
}

.addams-album__heading h2 {
    margin: 0;
    color: #f5deb5;
    font-family: 'TwilightC', 'Alice', serif;
    font-size: clamp(29px, 4vw, 49px);
    line-height: 1.16;
}

.addams-viewer__number {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: #ebd6b0;
}

.addams-album__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(6px, 1vw, 14px);
}

.addams-album__tile,
.addams-album__tile img {
    display: block;
    width: 100%;
    height: auto;
}

.addams-album__tile {
    background: #1f1917;
    aspect-ratio: 4 / 3;
}

.addams-album--ready .addams-album__tile:not([data-visible]),
.addams-album__more[hidden] {
    display: none;
}

.addams-album__more,
.addams-viewer__control {
    background: #262021;
    color: #ffe6bb;
    border: 1px solid #b18e58;
    cursor: pointer;
    font-family: inherit;
}

.addams-album__more {
    display: block;
    margin: 25px auto 0;
    padding: 9px 28px;
    min-height: 44px;
    border-radius: 3px;
    font-size: 18px;
}

.addams-album__more:hover,
.addams-viewer__control:hover {
    background: #4b3930;
}

.addams-album__more:focus-visible,
.addams-viewer__control:focus-visible {
    outline: 2px solid #ffe6bb;
    outline-offset: 3px;
}

.addams-viewer {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(95vw, 1540px);
    max-width: 100vw;
    max-height: 98dvh;
    border: 0;
    padding: 0;
    background: transparent;
    color: #f5dfba;
    overflow: visible;
}

.addams-viewer::backdrop { background: #100e10f7; }
body:has(.addams-viewer[open]) { overflow: hidden; }

.addams-viewer__bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px;
    margin-bottom: 8px;
}

.addams-viewer__stage {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 10px;
    align-items: center;
    touch-action: pan-y pinch-zoom;
}

.addams-viewer__image {
    display: block;
    width: 100%;
    height: min(82dvh, calc(100dvh - 84px), 950px);
    object-fit: contain;
}

.addams-viewer__control {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
}

.addams-viewer__control svg {
    display: block;
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

@media (max-width: 760px) {
    .addams-story { padding: 72px 14px 32px; }
    .addams-story .addams-story__paper { padding: 44px 20px 62px; }
    .addams-story__text p { font-size: 18px; line-height: 1.7; }
    .addams-story__text section { margin-bottom: 24px; }
    .addams-story__beat { display: flex; flex-direction: column; }
    .addams-story__beat p { order: -1; }
    .addams-story__beat .addams-story__sketch {
        float: none;
        width: min(64%, 228px);
        max-width: 100%;
        margin: 0 auto 16px;
    }
    .addams-story__beat--end .addams-story__sketch { width: 85%; margin-bottom: 0; }
    .addams-story__beat--vignette .addams-story__sketch { width: min(52%, 175px); }
    .addams-album { margin-top: 30px; padding: 22px 14px; }
    .addams-album__heading { padding-bottom: 12px; margin-bottom: 14px; }
    .addams-album__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .addams-viewer { width: calc(100% - 18px); }
    .addams-viewer__stage { grid-template-columns: 1fr 1fr; gap: 12px; }
    .addams-viewer__image { grid-column: 1 / -1; grid-row: 1; height: min(70dvh, calc(100dvh - 138px), 680px); }
    .addams-viewer__stage [data-step] { justify-self: center; }
}
