/* ==========================================================================
   Picklepot page (/picklepot/)
   Desktop: sticky scroll sequence driven by picklepot.js via CSS variables.
   <= 1000px or prefers-reduced-motion: plain stacked layout.
   ========================================================================== */

.picklepot-page {
    --pp-red: #BD1720;
    --pp-navy: #000D3C;
    --pp-font-hand: "Caveat", cursive;

    /* Jar size measured from the design (542px of 1920 wide, ~52% of the viewport height) */
    --pp-jar-w: min(28.2vw, 50vh);
    /* Annotation artwork is 2.387x the jar width and centred on the jar */
    --pp-ring-w: calc(var(--pp-jar-w) * 2.387);
}

.pp-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Desktop scroll sequence
   -------------------------------------------------------------------------- */

.pp-sequence {
    position: relative;
    height: 420vh;
    /* pull the stage up under the sticky nav so the hero fills the screen */
    margin-top: -110px;
}

.pp-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Values below are defaults (state 1); picklepot.js overrides them while scrolling */
.pp-stage {
    --pp-logo-o: 1;
    --pp-logo-y: 0vh;
    --pp-jar-x: 50vw;
    --pp-jar-y: 97vh;
    --pp-ring-o: 0;
    --pp-ring-s: 0.96;
    --pp-story-o: 0;
    --pp-story-x: -3vw;
}

.pp-logo {
    position: absolute;
    left: 50%;
    top: 50vh;
    width: clamp(260px, 31vw, 640px);
    margin: 0;
    line-height: 0;
    opacity: var(--pp-logo-o);
    transform: translate(-50%, calc(-50% + var(--pp-logo-y)));
    will-change: transform, opacity;
}

.pp-logo img {
    display: block;
    width: 100%;
    height: auto;
}

.pp-jar {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--pp-jar-w);
    z-index: 2;
    transform: translate(calc(var(--pp-jar-x) - 50%), calc(var(--pp-jar-y) - 50%));
    will-change: transform;
}

.pp-jar img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 28px 34px rgba(46, 0, 5, 0.18));
}

.pp-pairings {
    position: absolute;
    left: 50vw;
    top: 57vh;
    width: var(--pp-ring-w);
    z-index: 1;
    opacity: var(--pp-ring-o);
    transform: translate(-50%, -50%) scale(var(--pp-ring-s));
    pointer-events: none;
    will-change: transform, opacity;
}

.pp-pairings-art {
    display: block;
    width: 100%;
    height: auto;
}

/* The SVG carries the visual; the list is for screen readers / SEO on desktop */
.pp-pairings-list {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.pp-story {
    position: absolute;
    left: max(5vw, 10.3vw);
    top: 55vh;
    width: min(34vw, 680px);
    z-index: 3;
    display: flex;
    flex-flow: column;
    gap: 0.9rem;
    opacity: var(--pp-story-o);
    transform: translate(var(--pp-story-x), -50%);
    will-change: transform, opacity;
}

.pp-story-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 3.65vw, 4.6rem);
    line-height: 1.1em;
    color: var(--pp-red);
    margin-bottom: 1.5rem;
}

.pp-story p {
    font-size: clamp(1rem, 1.1vw, 1.3rem);
    line-height: 1.9em;
    color: var(--text);
}

/* --------------------------------------------------------------------------
   Recipe block (reuses .home-recipe-preview from style.css and the
   .recipe-mobile-media player from the recepten page on mobile)
   -------------------------------------------------------------------------- */

.pp-recipe .recipe-float h2 {
    color: var(--pp-red);
}

/* Arrows next to the pairings are only used in the static (mobile) layout */
.pp-arrow {
    display: none;
}

/* --------------------------------------------------------------------------
   Static layout: tablet / mobile / reduced motion
   Like the home page on mobile: the jar in the middle with the pairings
   around it, each with an arrow pointing at the jar.
   -------------------------------------------------------------------------- */

@media (max-width: 1000px), (prefers-reduced-motion: reduce) {
    .picklepot-page {
        --pp-m-jar: clamp(130px, 38vw, 340px);
    }

    .pp-sequence {
        height: auto;
        margin-top: 0;
        padding: 2.5rem 0 3rem;
    }

    .pp-stage {
        position: relative;
        height: auto;
        overflow: visible;
        width: min(90%, 900px);
        margin: auto;
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--pp-m-jar) minmax(0, 1fr);
        grid-template-areas:
            "logo  logo  logo"
            "l1    jar   r1"
            "l2    jar   r2"
            "l3    jar   r3"
            "story story story";
        column-gap: clamp(0.5rem, 2.5vw, 2rem);
        row-gap: clamp(1rem, 4vw, 2rem);
        align-items: center;
    }

    .pp-logo,
    .pp-jar,
    .pp-pairings,
    .pp-story {
        position: relative;
        left: auto;
        top: auto;
        opacity: 1;
        transform: none;
        will-change: auto;
    }

    .pp-logo {
        grid-area: logo;
        justify-self: center;
        width: min(460px, 70vw);
        margin-bottom: clamp(0.5rem, 3vw, 1.5rem);
    }

    .pp-jar {
        grid-area: jar;
        width: 100%;
    }

    .pp-jar img {
        filter: drop-shadow(0 16px 20px rgba(46, 0, 5, 0.18));
    }

    /* Flatten wrappers so the list items become grid cells around the jar */
    .pp-pairings,
    .pp-pairings-list {
        display: contents;
    }

    .pp-pairings-art {
        display: none;
    }

    .pp-pairings-list li {
        display: flex;
        flex-flow: column;
        align-items: center;
        gap: 0.15rem;
        min-width: 0;
        text-align: center;
        white-space: normal;
        overflow-wrap: break-word;
        color: var(--pp-navy);
    }

    .pp-pairings-list li:nth-child(1) { grid-area: l1; }
    .pp-pairings-list li:nth-child(2) { grid-area: r1; }
    .pp-pairings-list li:nth-child(3) { grid-area: l2; }
    .pp-pairings-list li:nth-child(4) { grid-area: r2; }
    .pp-pairings-list li:nth-child(5) { grid-area: l3; }
    .pp-pairings-list li:nth-child(6) { grid-area: r3; }

    .pp-pairings-list span {
        font-size: clamp(0.7rem, 2.6vw, 1rem);
        line-height: 1.25em;
    }

    .pp-pairings-list strong {
        font-family: var(--pp-font-hand);
        font-weight: 700;
        font-size: clamp(1.3rem, 5.2vw, 2.3rem);
        line-height: 1em;
    }

    .pp-pairings-list .pp-note {
        font-size: clamp(0.62rem, 2.2vw, 0.9rem);
        opacity: 0.85;
    }

    /* Arrows point towards the jar: left column on the right edge, right column on the left */
    .pp-arrow {
        display: block;
        width: clamp(26px, 7vw, 52px);
        height: auto;
        margin: 0.25rem 0;
    }

    .pp-pairings-list li:nth-child(odd) .pp-arrow {
        align-self: flex-end;
    }

    .pp-pairings-list li:nth-child(even) .pp-arrow {
        align-self: flex-start;
    }

    .pp-story {
        grid-area: story;
        justify-self: center;
        width: 100%;
        max-width: 640px;
        margin-top: clamp(2rem, 8vw, 4rem);
        text-align: center;
        gap: 0.75rem;
    }

    .pp-story-title {
        font-size: clamp(2.4rem, 6vw, 3.4rem);
        line-height: 1.15em;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 720px) {
    .pp-story-title {
        font-size: 2.4rem;
    }

    /* match the site's mobile body copy */
    .pp-story p {
        font-size: 0.9rem;
        line-height: 1.5em;
    }

    .pp-recipe.home-recipe-preview {
        min-height: 0;
        padding-top: 2rem;
        padding-bottom: 4rem;
    }
}
