/* Recycling program page: a shelf with seven empty bottles under the night sky, the two offers on cream paper, and the parts of the bottle on dark green. */

.recyclingPage,
.recyclingPage *,
.recyclingPage *::before,
.recyclingPage *::after {
    box-sizing: border-box;
}

/* Same column width as the search bar and the footer, so their left and right edges line up with this page. */
.recyclingPage {
    --recyclingColumn: min(100vw - 2 * var(--gutter), 1200px - 2 * var(--gutter));
}

.recyclingContainer {
    width: var(--recyclingColumn);
    margin-inline: auto;
}

/* ---------- First screen: night sky and title ---------- */

.recyclingShelfSection {
    --recyclingBottleGap: clamp(3px, 1.9vw, 24px);
    /* The seven bottles fill the column on phones and follow the height of the screen on computers. .433 is the width of the bottle divided by its height. */
    --recyclingBottleH: clamp(92px, min(35vh, calc((var(--recyclingColumn) - 6 * var(--recyclingBottleGap)) / 7 / .433)), 340px);

    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    padding-top: calc(var(--cord-y) + var(--search-h) / 2 + clamp(18px, 3.6vh, 44px));
    overflow: hidden;
    overflow: clip;
    background:
        radial-gradient(64% 42% at 50% 80%, rgba(235, 201, 91, .2), rgba(235, 201, 91, 0) 72%),
        linear-gradient(to bottom, rgb(4, 11, 32) 0, var(--night) 34%, rgb(18, 44, 86) 76%, rgb(27, 58, 102) 100%);
}

/* On wide screens the shelf sits at the bottom of the first screen. On tall screens that would leave an empty sky above it, so the section keeps its natural height. */
@media (orientation: landscape) {
    .recyclingShelfSection {
        min-height: 100vh;
        min-height: 100svh;
    }
}

/* The stars of the sky, fading out before they reach the shelf. */
.recyclingShelfSection::before {
    content: "";
    position: absolute;
    inset: 0 0 34%;
    z-index: -1;
    background-image:
        radial-gradient(1.5px 1.5px at 6% 22%, rgba(255, 255, 255, .95), transparent),
        radial-gradient(1px 1px at 14% 62%, rgba(245, 226, 168, .9), transparent),
        radial-gradient(1.2px 1.2px at 23% 12%, rgba(255, 255, 255, .8), transparent),
        radial-gradient(1px 1px at 31% 44%, rgba(255, 255, 255, .7), transparent),
        radial-gradient(1.6px 1.6px at 39% 78%, rgba(245, 226, 168, .9), transparent),
        radial-gradient(1px 1px at 48% 28%, rgba(255, 255, 255, .85), transparent),
        radial-gradient(1.3px 1.3px at 57% 58%, rgba(255, 255, 255, .75), transparent),
        radial-gradient(1px 1px at 66% 16%, rgba(245, 226, 168, .85), transparent),
        radial-gradient(1.5px 1.5px at 74% 70%, rgba(255, 255, 255, .9), transparent),
        radial-gradient(1px 1px at 83% 36%, rgba(255, 255, 255, .7), transparent),
        radial-gradient(1.2px 1.2px at 92% 84%, rgba(245, 226, 168, .8), transparent),
        radial-gradient(1px 1px at 97% 8%, rgba(255, 255, 255, .8), transparent);
    background-size: 560px 340px;
    -webkit-mask: linear-gradient(to bottom, rgb(0, 0, 0) 40%, transparent);
    mask: linear-gradient(to bottom, rgb(0, 0, 0) 40%, transparent);
    pointer-events: none;
}

.recyclingIntro {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: clamp(24px, 5vw, 80px);
    width: var(--recyclingColumn);
    margin-inline: auto;
}

.recyclingTitle {
    margin: 0;
    color: rgb(255, 255, 255);
    font-family: var(--serif);
    font-size: clamp(44px, min(6.2vw, 10.5vh), 92px);
    font-weight: 400;
    line-height: 1;
    user-select: text;
    cursor: text;
}

.recyclingTitleAccent {
    color: var(--sun);
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
}

.recyclingLead {
    flex: 0 1 25em;
    margin: 0 0 .3em;
    color: var(--sun-pale);
    font-family: var(--serif);
    font-size: clamp(18px, 1.75vw, 25px);
    line-height: 1.28;
    text-align: right;
    text-wrap: balance;
    user-select: text;
    cursor: text;
}

/* ---------- Shelf with the seven bottles ---------- */

.recyclingShelf {
    margin-top: auto;
    padding-top: clamp(14px, 2.6vh, 30px);
}

.recyclingShelfHint {
    margin: 0;
    padding-inline: var(--gutter);
    color: var(--sun-pale);
    font-family: var(--tea-bag-font);
    font-size: clamp(16px, 1.3vw, 20px);
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    user-select: text;
    cursor: text;
}

.recyclingBottles {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: var(--recyclingBottleGap);
    margin: 0;
    padding: clamp(34px, 5vh, 46px) var(--gutter) 0;
    list-style: none;
}

.recyclingBottleItem {
    position: relative;
    animation: recyclingBottleArrive .7s cubic-bezier(.2, .8, .3, 1) backwards;
}

.recyclingBottleItem:nth-child(2) {
    animation-delay: 60ms;
}

.recyclingBottleItem:nth-child(3) {
    animation-delay: 120ms;
}

.recyclingBottleItem:nth-child(4) {
    animation-delay: 180ms;
}

.recyclingBottleItem:nth-child(5) {
    animation-delay: 240ms;
}

.recyclingBottleItem:nth-child(6) {
    animation-delay: 300ms;
}

.recyclingBottleItem:nth-child(7) {
    animation-delay: 360ms;
}

@keyframes recyclingBottleArrive {
    from {
        opacity: 0;
        translate: 0 26px;
    }
}

/* Marks the seventh bottle, the one that gives the free extract. */
.recyclingBottleBadge {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    translate: -50% 0;
    padding: 2px 9px;
    border: 1px dashed var(--sun);
    border-radius: 999px;
    color: var(--sun);
    font-family: var(--tea-bag-font);
    font-size: clamp(12px, 1.1vw, 16px);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    user-select: text;
    cursor: text;
}

.recyclingBottle {
    position: relative;
    display: block;
    height: var(--recyclingBottleH);
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: none;
    cursor: pointer;
    transition: translate .3s ease;
}

.recyclingBottle:hover {
    translate: 0 -5px;
}

.recyclingBottle:focus-visible {
    outline: 2px solid var(--sun-pale);
    outline-offset: -2px;
}

/* Shadow of the bottle on the shelf. */
.recyclingBottle::after {
    content: "";
    position: absolute;
    inset: auto 2% -5px;
    height: 10px;
    background: radial-gradient(closest-side, rgba(3, 8, 24, .65), rgba(3, 8, 24, 0));
    transition: opacity .3s ease;
}

.recyclingBottle:hover::after {
    opacity: .55;
}

.recyclingBottleImage {
    position: relative;
    z-index: 2;
    display: block;
    width: auto;
    height: 100%;
    /* A bottle not counted yet is in the blue of the night. */
    filter: sepia(1) hue-rotate(178deg) saturate(.95) brightness(.42);
    transition: filter .35s ease;
}

.recyclingBottle:hover .recyclingBottleImage {
    filter: sepia(.7) hue-rotate(178deg) saturate(.9) brightness(.66);
}

.recyclingBottle[aria-pressed="true"] .recyclingBottleImage {
    filter: none;
}

/* The gold light behind a counted bottle, seen through its glass. */
.recyclingBottleGlow {
    position: absolute;
    z-index: 0;
    inset: -16% -46%;
    background: radial-gradient(closest-side, rgba(245, 190, 84, .95), rgba(235, 180, 70, .42) 58%, rgba(235, 201, 91, 0));
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
}

.recyclingBottle[aria-pressed="true"] .recyclingBottleGlow {
    opacity: 1;
}

/* The extract that rises inside the seventh bottle when all seven are counted. */
.recyclingBottleLiquid {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(100% 0 0 0);
    transition: clip-path 1s cubic-bezier(.3, .7, .3, 1);
}

.recyclingShelfIsFull .recyclingBottleLiquid {
    clip-path: inset(0 0 0 0);
}

.recyclingPlank {
    position: relative;
    z-index: 3;
    height: clamp(14px, 2.5vh, 26px);
    border-top: 1px solid rgba(245, 226, 168, .62);
    background: linear-gradient(to bottom, rgb(158, 101, 38) 0, rgb(126, 71, 18) 22%, rgb(111, 53, 3) 62%, rgb(70, 33, 4) 100%);
    box-shadow: 0 12px 24px rgba(3, 8, 24, .6);
}

/* ---------- Count of the bottles and WhatsApp button, under the shelf ---------- */

/* Raised above the bottles so the gold light behind them stops at the shelf. */
.recyclingTallyBand {
    position: relative;
    z-index: 3;
    background: var(--night);
}

.recyclingTally {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(16px, 3vw, 48px);
    width: var(--recyclingColumn);
    margin-inline: auto;
    padding-block: clamp(14px, 2.5vh, 28px);
}

.recyclingTallyCount {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 28px);
}

.recyclingTallyNumber {
    display: flex;
    align-items: baseline;
    gap: .22em;
    margin: 0;
    color: var(--sun);
    font-family: var(--serif);
    font-size: clamp(46px, 5vw, 68px);
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    user-select: text;
    cursor: text;
}

.recyclingTallyOf {
    color: var(--sun-pale);
    font-family: var(--serif);
    font-size: .42em;
    font-style: italic;
    font-weight: 400;
}

.recyclingTallyText {
    margin: 0;
    color: rgb(255, 255, 255);
    font-family: var(--serif);
    font-size: clamp(18px, 1.6vw, 23px);
    line-height: 1.25;
    user-select: text;
    cursor: text;
}

.recyclingButton {
    display: inline-flex;
    flex: none;
    justify-content: center;
    align-items: center;
    min-height: 52px;
    padding: 10px clamp(24px, 2.6vw, 38px);
    border-radius: 999px;
    background: var(--sun);
    color: var(--night);
    font-family: var(--search-font);
    font-size: clamp(17px, 1.35vw, 20px);
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: filter .25s ease;
}

.recyclingButton:hover {
    filter: brightness(1.1);
}

.recyclingButton:focus-visible {
    outline: 2px solid rgb(255, 255, 255);
    outline-offset: -2px;
}

/* ---------- Thin strips of a garden photo from edge to edge, between the sections ---------- */

.recyclingStrip {
    height: clamp(87px, 10.8vw, 177px);
    overflow: hidden;
    border-block: 2px solid var(--sun);
    background: var(--leaf);
}

.recyclingStripPicture {
    display: block;
    height: 100%;
}

.recyclingStripImage {
    --recyclingStripY: 22%;

    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% var(--recyclingStripY);
}

/* The second strip shows a lower band of the flowers and is mirrored, so the two strips don't look alike. */
.recyclingStripBand2 .recyclingStripImage {
    --recyclingStripY: 78%;

    transform: scaleX(-1);
}

/* The photo inside each strip moves slightly while the strip crosses the screen. */
@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        .recyclingStripImage {
            animation: recyclingStripDrift linear both;
            animation-timeline: view();
        }
    }
}

@keyframes recyclingStripDrift {
    from {
        object-position: 50% calc(var(--recyclingStripY) - 4%);
    }

    to {
        object-position: 50% calc(var(--recyclingStripY) + 4%);
    }
}

/* ---------- The two offers, like the lines of a price list ---------- */

.recyclingOffers {
    padding-block: clamp(56px, 7vw, 112px);
    background: var(--paper);
}

.recyclingHeading {
    margin: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(34px, 4.2vw, 60px);
    font-weight: 400;
    line-height: 1.08;
    text-wrap: balance;
    user-select: text;
    cursor: text;
}

.recyclingHeadingAccent {
    color: var(--search-button-color);
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
}

.recyclingOfferList {
    display: grid;
    grid-template-columns: clamp(84px, 9.5vw, 130px) auto minmax(36px, 1fr) auto;
    column-gap: clamp(12px, 2.2vw, 32px);
    margin: clamp(26px, 3.4vw, 48px) 0 0;
    padding: 0;
    list-style: none;
}

.recyclingOffer {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: center;
    padding-block: clamp(14px, 2.2vw, 30px);
    border-top: 1px solid rgba(184, 145, 74, .5);
}

.recyclingOffer:last-child {
    border-bottom: 1px solid rgba(184, 145, 74, .5);
}

.recyclingOfferNumber {
    margin: 0;
    color: var(--leaf);
    font-family: var(--serif);
    font-size: clamp(84px, 12vw, 172px);
    font-weight: 400;
    line-height: .86;
    user-select: text;
    cursor: text;
}

.recyclingOfferFrom {
    margin: 0;
    color: var(--ink-soft);
    font-family: var(--tea-bag-font);
    font-size: clamp(18px, 1.75vw, 25px);
    font-weight: 700;
    line-height: 1.15;
    user-select: text;
    cursor: text;
}

/* The arrow the catalog uses between a bottle and what it gives. */
.recyclingOfferArrow {
    position: relative;
    height: 1px;
    background: var(--brass);
}

.recyclingOfferArrow::after {
    content: "";
    position: absolute;
    top: -5px;
    right: 0;
    width: 11px;
    height: 11px;
    border-top: 1px solid var(--brass);
    border-right: 1px solid var(--brass);
    rotate: 45deg;
}

.recyclingOfferResult {
    margin: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(26px, 3.3vw, 48px);
    line-height: 1.08;
    user-select: text;
    cursor: text;
}

.recyclingOfferAccent {
    color: rgb(111, 53, 3);
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
}

.recyclingOfferNote {
    margin: clamp(18px, 2vw, 28px) 0 0;
    color: var(--ink-soft);
    font-family: var(--serif);
    font-size: clamp(18px, 1.5vw, 22px);
    line-height: 1.35;
    user-select: text;
    cursor: text;
}

.recyclingOfferLink {
    color: var(--leaf);
    font-family: var(--tea-bag-font);
    font-weight: 700;
    white-space: nowrap;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    cursor: pointer;
}

.recyclingOfferLink:focus-visible {
    outline: 2px solid var(--leaf);
    outline-offset: -2px;
}

/* ---------- The bottle with a gold line from each part to its description ---------- */

.recyclingParts {
    padding-block: clamp(56px, 7vw, 104px);
    background:
        radial-gradient(44% 46% at 50% 46%, rgba(46, 112, 58, .6), rgba(46, 112, 58, 0)),
        var(--leaf-deep);
}

.recyclingPartsHeading {
    color: rgb(255, 255, 255);
    text-align: center;
}

.recyclingPartsHeadingAccent {
    color: var(--sun);
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
}

.recyclingDiagram {
    /* Height of the large bottle, half of its width, and length of the gold lines. */
    --recyclingDiagramH: clamp(380px, 46vw, 640px);
    --recyclingDiagramHalf: calc(var(--recyclingDiagramH) * .215);
    --recyclingDiagramLine: clamp(56px, 7.5vw, 120px);

    position: relative;
    height: var(--recyclingDiagramH);
    margin-top: clamp(26px, 3.4vw, 48px);
}

.recyclingDiagramImage {
    position: absolute;
    top: 0;
    left: 50%;
    width: auto;
    height: 100%;
    translate: -50% 0;
}

.recyclingDiagramItem {
    /* Where the bottle's edge is at this height, as a share of its widest half. */
    --recyclingDiagramEdge: 1;

    position: absolute;
    top: var(--recyclingDiagramTop);
    width: min(27vw, 330px);
    margin: 0;
    translate: 0 -50%;
    color: rgb(255, 255, 255);
    font-family: var(--serif);
    font-size: clamp(20px, 2.05vw, 30px);
    line-height: 1.16;
    text-wrap: balance;
    user-select: text;
    cursor: text;
}

.recyclingDiagramItemLeft {
    right: calc(50% + var(--recyclingDiagramHalf) * var(--recyclingDiagramEdge) + var(--recyclingDiagramLine));
    text-align: right;
}

.recyclingDiagramItemRight {
    left: calc(50% + var(--recyclingDiagramHalf) * var(--recyclingDiagramEdge) + var(--recyclingDiagramLine));
    text-align: left;
}

.recyclingDiagramItemLid {
    --recyclingDiagramTop: 4%;
    --recyclingDiagramEdge: .62;
}

.recyclingDiagramItemGlass {
    --recyclingDiagramTop: 29%;
    --recyclingDiagramEdge: .96;
}

.recyclingDiagramItemLabel {
    --recyclingDiagramTop: 62%;
}

.recyclingDiagramItemSize {
    --recyclingDiagramTop: 92%;
}

/* The gold line. */
.recyclingDiagramItem::after {
    content: "";
    position: absolute;
    top: 50%;
    width: calc(var(--recyclingDiagramLine) - 6px);
    height: 1px;
    background: var(--sun);
}

/* The dot where the gold line touches the bottle. */
.recyclingDiagramItem::before {
    content: "";
    position: absolute;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sun);
    translate: 0 -50%;
}

.recyclingDiagramItemLeft::after {
    left: calc(100% + 12px);
}

.recyclingDiagramItemLeft::before {
    left: calc(100% + var(--recyclingDiagramLine) + 2px);
}

.recyclingDiagramItemRight::after {
    right: calc(100% + 12px);
}

.recyclingDiagramItemRight::before {
    right: calc(100% + var(--recyclingDiagramLine) + 2px);
}

.recyclingPartsClosing {
    max-width: 32em;
    margin: clamp(30px, 3.6vw, 52px) auto 0;
    color: var(--sun-pale);
    font-family: var(--serif);
    font-size: clamp(19px, 1.8vw, 26px);
    line-height: 1.3;
    text-align: center;
    text-wrap: balance;
    user-select: text;
    cursor: text;
}

.recyclingPartsAction {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: clamp(26px, 3vw, 44px);
}

.recyclingPartsQuestion {
    margin: 0;
    color: rgb(255, 255, 255);
    font-family: var(--tea-bag-font);
    font-size: clamp(18px, 1.5vw, 22px);
    font-weight: 700;
    line-height: 1.2;
    user-select: text;
    cursor: text;
}

@media (prefers-reduced-motion: reduce) {
    .recyclingBottleItem {
        animation: none;
    }

    .recyclingBottle,
    .recyclingBottleImage,
    .recyclingBottleGlow,
    .recyclingBottleLiquid {
        transition: none;
    }
}

@media only screen and (max-width: 600px) {
    .recyclingIntro {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .recyclingTitle {
        font-size: 44px;
    }

    .recyclingLead {
        flex: none;
        margin: 0;
        text-align: left;
    }

    .recyclingShelf {
        padding-top: 30px;
    }

    .recyclingTally {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding-block: 18px 24px;
    }

    .recyclingOfferList {
        display: block;
    }

    .recyclingOffer {
        grid-template-columns: 72px minmax(0, 1fr);
        grid-template-areas:
            "number from"
            "number result";
        column-gap: 12px;
        row-gap: 2px;
    }

    .recyclingOfferNumber {
        grid-area: number;
        font-size: 84px;
    }

    .recyclingOfferFrom {
        grid-area: from;
        align-self: end;
    }

    .recyclingOfferArrow {
        display: none;
    }

    .recyclingOfferResult {
        grid-area: result;
        align-self: start;
        font-size: 24px;
    }

    .recyclingDiagram {
        display: flex;
        flex-direction: column;
        align-items: center;
        height: auto;
    }

    .recyclingDiagramImage {
        position: static;
        height: 330px;
        translate: none;
        margin-bottom: 18px;
    }

    .recyclingDiagramItemLeft,
    .recyclingDiagramItemRight {
        position: static;
        width: 100%;
        padding-block: 12px;
        border-top: 1px solid rgba(245, 226, 168, .28);
        translate: none;
        text-align: center;
    }

    .recyclingDiagramItem::before,
    .recyclingDiagramItem::after {
        display: none;
    }

    .recyclingPartsAction .recyclingButton {
        width: 100%;
    }
}
