.fall-offer {
    /* Height of header + footer + borders, used to size the card from the screen height */
    --offer-chrome: 150px;
    --offer-close-space: 0px;
    --offer-side-space: 120px;
    box-sizing: border-box;
    width: fit-content;
    height: fit-content;
    max-width: none;
    max-height: none;
    margin: auto;
    padding: var(--offer-close-space) 0 0;
    overflow: visible;
    border: 0;
    background: transparent;
    color: #2f2738;
}

.fall-offer[open] {
    display: block;
}

.fall-offer[open] .fall-offer-card {
    animation: fall-offer-enter 750ms cubic-bezier(.16, 1, .3, 1) both;
}

.fall-offer[open] .fall-offer-close {
    animation: fall-offer-fade-in 500ms ease 450ms both;
}

.fall-offer::backdrop {
    background: rgba(32, 21, 42, 0.78);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: fall-offer-backdrop 500ms ease-out both;
}

/* Exit: the card drops back and fades while the page behind un-blurs into view */
.fall-offer.is-closing .fall-offer-card {
    animation: fall-offer-exit 480ms cubic-bezier(.4, 0, .2, 1) both;
}

.fall-offer.is-closing .fall-offer-close {
    animation: fall-offer-fade-out 200ms ease both;
}

.fall-offer.is-closing::backdrop {
    animation: fall-offer-backdrop-out 520ms ease-in both;
}

/* The flyer is 1024x1318. Its height follows the screen; the card is wider than the
   flyer so the sides reach further across the screen, filled with a blurred copy of it. */
.fall-offer-card {
    --offer-ratio: 0.777;
    --offer-side-extra: 1.35;
    --offer-max-width: calc(100vw - 32px - var(--offer-side-space));
    --offer-art-height: min(calc(92vh - var(--offer-chrome) - var(--offer-close-space)), calc(var(--offer-max-width) / var(--offer-ratio)));
    --offer-art-height: min(calc(92dvh - var(--offer-chrome) - var(--offer-close-space)), calc(var(--offer-max-width) / var(--offer-ratio)));
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: min(var(--offer-max-width), calc(var(--offer-art-height) * var(--offer-ratio) * var(--offer-side-extra)));
    max-height: calc(100vh - 32px - var(--offer-close-space));
    max-height: calc(100dvh - 32px - var(--offer-close-space));
    overflow: hidden;
    border: 2px solid #564666;
    border-radius: 18px;
    background: #fff9f1;
    box-shadow: 0 28px 80px rgba(28, 17, 35, 0.5);
    outline: none;
}

.fall-offer-header,
.fall-offer-footer {
    position: relative;
    z-index: 2;
    flex: none;
    background: #fff9f1;
}

.fall-offer-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 62px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(86, 70, 102, 0.2);
    text-align: center;
}

.fall-offer-eyebrow {
    display: block;
    margin-bottom: 4px;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #cc1303;
}

.fall-offer-header h2 {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: clamp(16px, 4vw, 21px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.04em;
    color: #564666;
}

/* Sits outside the card, to the right of it on wide screens */
.fall-offer-close {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 14px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-family: Arial, sans-serif;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.fall-offer-close:hover {
    color: white;
    background: #cc1303;
    border-color: #cc1303;
    transform: rotate(90deg);
}

.fall-offer-close:focus-visible,
.fall-offer-book:focus-visible {
    outline: 3px solid #cc1303;
    outline-offset: 3px;
}

.fall-offer-art {
    position: relative;
    z-index: 0;
    flex: 0 1 auto;
    height: var(--offer-art-height);
    min-height: 0;
    overflow: hidden;
    background: #fff3df;
}

/* Blurred copy of the flyer filling the space beside it (--flyer is set by fall-offer.js) */
.fall-offer-art::before {
    content: "";
    position: absolute;
    inset: -30px;
    background: var(--flyer, none) center / cover no-repeat;
    filter: blur(22px) brightness(1.05) saturate(1.1);
    opacity: 0.85;
}

.fall-offer-art img {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(52, 19, 13, 0.25));
}

.fall-offer-footer {
    padding: 11px 16px 14px;
    border-top: 1px solid rgba(86, 70, 102, 0.18);
}

.fall-offer-book {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    padding: 10px 20px;
    border: 1px solid #cc1303;
    border-radius: 9px;
    background: #cc1303;
    color: white;
    font-family: 'Cinzel', serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(204, 19, 3, 0.24);
    transition: background 240ms ease, border-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

.fall-offer-book:hover {
    background: #564666;
    border-color: #564666;
    box-shadow: 0 9px 20px rgba(86, 70, 102, 0.32);
    transform: translateY(-2px);
}

.fall-offer-book-label {
    display: block;
    line-height: 1;
}

.fall-offer-arrows {
    display: inline-flex;
    align-items: center;
    height: 1em;
}

.fall-offer-arrows svg {
    display: block;
    width: 9px;
    height: 14px;
    margin-left: -1px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fall-offer-arrows svg:nth-child(2) { opacity: 0.55; }
.fall-offer-arrows svg:nth-child(3) { opacity: 0.25; }

/* While hovered, the chevrons light up one after another on a loop */
.fall-offer-book:hover .fall-offer-arrows svg,
.fall-offer-book:focus-visible .fall-offer-arrows svg {
    animation: fall-offer-chevron 1.1s ease-in-out infinite both;
}

.fall-offer-book:hover .fall-offer-arrows svg:nth-child(2),
.fall-offer-book:focus-visible .fall-offer-arrows svg:nth-child(2) {
    animation-delay: .18s;
}

.fall-offer-book:hover .fall-offer-arrows svg:nth-child(3),
.fall-offer-book:focus-visible .fall-offer-arrows svg:nth-child(3) {
    animation-delay: .36s;
}

/* Narrow screens: no room beside the card, so the X sits above its top-right corner */
@media (max-width: 640px) {
    .fall-offer {
        --offer-close-space: 54px;
        --offer-side-space: 0px;
    }

    .fall-offer-close {
        left: auto;
        right: 0;
        margin-left: 0;
    }
}

.fall-offer-leaves {
    position: absolute;
    z-index: 1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.fall-offer-leaves span {
    position: absolute;
    top: -48px;
    left: var(--leaf-left);
    font-family: 'Segoe UI Emoji', sans-serif;
    font-size: var(--leaf-size);
    line-height: 1;
    opacity: 0;
    filter: drop-shadow(0 3px 2px rgba(52, 19, 13, 0.22));
    animation: fall-offer-leaf var(--leaf-duration) ease-in var(--leaf-delay) both;
}

.fall-offer-leaves span:nth-child(1) { --leaf-left: 3%; --leaf-size: 31px; --leaf-delay: .15s; --leaf-duration: 3.1s; --leaf-drift: 45px; }
.fall-offer-leaves span:nth-child(2) { --leaf-left: 16%; --leaf-size: 23px; --leaf-delay: .75s; --leaf-duration: 3.6s; --leaf-drift: -28px; }
.fall-offer-leaves span:nth-child(3) { --leaf-left: 86%; --leaf-size: 29px; --leaf-delay: .35s; --leaf-duration: 3.3s; --leaf-drift: -48px; }
.fall-offer-leaves span:nth-child(4) { --leaf-left: 97%; --leaf-size: 22px; --leaf-delay: 1s; --leaf-duration: 3.8s; --leaf-drift: -35px; }
.fall-offer-leaves span:nth-child(5) { --leaf-left: 8%; --leaf-size: 21px; --leaf-delay: 1.45s; --leaf-duration: 3.4s; --leaf-drift: 26px; }
.fall-offer-leaves span:nth-child(6) { --leaf-left: 92%; --leaf-size: 27px; --leaf-delay: 1.75s; --leaf-duration: 3.2s; --leaf-drift: -25px; }

@keyframes fall-offer-enter {
    from { opacity: 0; transform: translateY(35px) scale(.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fall-offer-exit {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(24px) scale(.94); }
}

@keyframes fall-offer-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fall-offer-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fall-offer-backdrop {
    from { background: rgba(32, 21, 42, 0); backdrop-filter: blur(0); }
    to { background: rgba(32, 21, 42, 0.78); backdrop-filter: blur(6px); }
}

@keyframes fall-offer-backdrop-out {
    from { background: rgba(32, 21, 42, 0.78); backdrop-filter: blur(6px); }
    to { background: rgba(32, 21, 42, 0); backdrop-filter: blur(0); }
}

@keyframes fall-offer-chevron {
    0% { opacity: 0.25; transform: translateX(0); }
    35% { opacity: 1; transform: translateX(4px); }
    70%, 100% { opacity: 0.25; transform: translateX(0); }
}

@keyframes fall-offer-leaf {
    0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(-20deg); }
    12% { opacity: .9; }
    80% { opacity: .9; }
    100% { opacity: 0; transform: translate3d(var(--leaf-drift), 100dvh, 0) rotate(420deg); }
}

@media (prefers-reduced-motion: reduce) {
    .fall-offer[open] .fall-offer-card,
    .fall-offer[open] .fall-offer-close,
    .fall-offer::backdrop,
    .fall-offer-leaves span,
    .fall-offer-book:hover .fall-offer-arrows svg,
    .fall-offer-book:focus-visible .fall-offer-arrows svg {
        animation: none;
    }

    .fall-offer-close,
    .fall-offer-book {
        transition: none;
    }
}
