/* Wijn (template-parts/shows/wijn.php).
   A wine list on cream paper, set like the flyer: Marcellus in wine red,
   hairline rules, a watercolour splash. Going down, the paper takes on the
   wine. The photos are phone photos: prints on the card, never full screen. */

.wn {
    --cream: #f8f2ea;
    --blush: #f2dcd8;
    --rose: #d99aa6;
    --wine: #7a1630;
    --wine-deep: #3a0a16;
    --wine-ink: #4a0f1f;

    /* The fixed block takes the wine as its accent. */
    --show-accent: var(--wine);
    --show-accent-ink: var(--paper);
    --show-accent-text: var(--wine);

    /* Outline buttons fill with cream on hover, not the house gold. */
    --ghost-hover: var(--cream);
    --ghost-hover-ink: var(--wine-deep);

    color: var(--wine-ink);
}

/* On the cream paper the header is wine red until the page scrolls. The
   colour is written out: the header sits outside .wn and its variables.
   Without the dark gradient, also once scrolled: it would appear at once
   while the ink fades in. */
body:has(.wn) .site-header {
    background-image: none;
}

body:has(.wn) .site-header:not(.scrolled) {
    color: #7a1630;
}

/* ---------- Hero: the flyer ---------- */

.wn-hero {
    position: relative;
    z-index: 1; /* The seam splash runs over the top of the card. */
    overflow-x: clip;
    padding: calc(var(--header-height) + var(--space-xl)) 0 var(--space-3xl);
    background-color: var(--cream);
}

.wn-splash {
    position: absolute;
    pointer-events: none;
}

/* Bottom left, as on the flyer, spilling over the seam into the card. */
.wn-splash--seam {
    left: -2rem;
    bottom: -4rem;
    width: 12rem;
}

/* The toast lies in a spill on the table, running off the right edge. */
.wn-hero-print {
    position: relative;
    justify-self: end;
    width: min(80%, 22rem);
}

.wn-pool {
    position: absolute;
    z-index: 0;
    top: -8%;
    right: -30%;
    width: 140%;
    pointer-events: none;
}

.wn-hero-inner {
    position: relative;
    display: grid;
    gap: var(--space-xl);
}

.wn-dateline {
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--wine);
    font-family: 'Marcellus SC', var(--font-serif);
    font-size: var(--text-base);
    letter-spacing: 0.04em;
    color: var(--wine);
}

.wn-title {
    padding: var(--space-xs) 0 var(--space-sm);
    border-bottom: 1px solid var(--wine);
    font-family: 'Marcellus', var(--font-serif);
    font-size: clamp(5rem, 22vw, 11rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    color: var(--wine);
}

.wn-hero-meta {
    margin-top: var(--space-md);
    font-size: var(--text-sm);
    line-height: 1.6;
}

/* ---------- Prints: photos laid on the card ---------- */

.wn-print {
    position: relative;
    display: block;
    padding: 0.5rem;
    border: 0;
    background: #fff;
    box-shadow: 0 0.6rem 1.4rem rgb(58 10 22 / 0.18);
    cursor: zoom-in;
    transition: transform var(--duration-normal) ease;
}

.wn-print img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wn-print:hover {
    transform: rotate(0deg) scale(1.01);
}

.wn-print--hero {
    z-index: 1;
    width: 100%;
    aspect-ratio: 3 / 4;
    transform: rotate(3deg);
}

/* ---------- The card: cream turning to wine ---------- */

.wn-card {
    position: relative;
    /* Room for the splash that spills over from the hero. */
    padding-top: 5.5rem;
    background: linear-gradient(to bottom,
            var(--cream) 0%,
            var(--blush) 30%,
            var(--rose) 55%,
            var(--wine) 78%,
            var(--wine-deep) 100%);
}

.wn-story-text {
    max-width: 40rem;
    font-style: italic;
}

.wn-story-text p {
    margin-bottom: var(--space-md);
    line-height: 1.7;
}

.wn-story-text p:first-child {
    font-size: var(--text-lg);
    line-height: 1.45;
}

/* ---------- The wine list ---------- */

.wn-list {
    margin-top: var(--space-3xl);
}

.wn-list-heading {
    margin-bottom: var(--space-xl);
    padding: var(--space-xs) 0;
    border-block: 1px solid var(--wine);
    font-family: 'Marcellus SC', var(--font-serif);
    font-size: var(--text-lg);
    font-weight: 400;
    letter-spacing: 0.2em;
    text-align: center;
    color: var(--wine);
}

/* minmax(0, 1fr): Safari sizes an auto column to the line's full width, so
   the tasting term would run past the screen instead of wrapping. */
.wn-glass {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
}

.wn-glass + .wn-glass {
    margin-top: var(--space-3xl);
}

/* A line of the list: name, dotted leader, tasting term. */
.wn-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-xs);
    font-family: 'Marcellus SC', var(--font-serif);
    font-size: var(--text-lg);
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--wine);
}

.wn-line-dots {
    flex: 1;
    min-width: 1.5rem;
    border-bottom: 2px dotted currentColor;
    opacity: 0.5;
    transform: translateY(-0.3em);
}

.wn-line-name,
.wn-line-term {
    white-space: nowrap;
}

.wn-line-term {
    margin-left: auto;
    font-family: 'Marcellus', var(--font-serif);
    text-align: right;
}

.wn-note {
    position: relative;
    max-width: 30rem;
    margin-top: var(--space-sm);
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    font-style: italic;
    line-height: 1.45;
}

/* ---------- Stains left by the evening: light, few, in corners ---------- */

.wn-glass,
.wn-glass-text,
.wn-list-heading {
    position: relative;
}

.wn-glass > *:not(.wn-mark) {
    position: relative;
    z-index: 1;
}

.wn-mark {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

/* Half under the first print, as if a glass stood there. */
.wn-mark--ring-under {
    right: -1rem;
    bottom: -2.5rem;
    width: 6rem;
}

.wn-glass-text > .wn-mark {
    z-index: -1;
}

.wn-mark--ring {
    right: -0.5rem;
    bottom: -2rem;
    width: 5rem;
}

.wn-mark--rings {
    right: 1rem;
    top: -5.5rem;
    width: 7.5rem;
    transform: rotate(-12deg);
}

.wn-mark--drops {
    right: 0.5rem;
    top: 100%;
    width: 1.75rem;
}

.wn-mark--splatter {
    right: -0.5rem;
    top: -1.5rem;
    width: 4.5rem;
}

.wn-print--large {
    aspect-ratio: 4 / 3;
    transform: rotate(-1deg);
}

.wn-print--small {
    justify-self: end;
    width: 60%;
    aspect-ratio: 3 / 4;
    margin-top: -4rem;
    transform: rotate(2.5deg);
}

/* Once the paper is deep red, the ink turns light. */
.wn-glass--dark,
.wn-glass--dark .wn-line {
    color: var(--cream);
}

.wn-glass--dark .wn-print {
    box-shadow: 0 0.8rem 2rem rgb(0 0 0 / 0.4);
}

/* ---------- Credits, as on the flyer ---------- */

.wn-about {
    display: grid;
    gap: var(--space-lg);
    margin-top: var(--space-3xl);
    color: var(--cream);
}

.wn-credits {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs) var(--space-md);
    font-family: 'Marcellus SC', var(--font-serif);
    font-size: var(--text-sm);
    letter-spacing: 0.04em;
}

.wn-credits strong {
    font-family: 'Marcellus', var(--font-serif);
    font-weight: 400;
    text-transform: uppercase;
}

.wn-all .btn--ghost {
    color: var(--cream);
}

.wn-all .btn--ghost:hover {
    color: var(--ghost-hover-ink);
}

/* ---------- The fixed block, rising into the foyer ---------- */

.wn-info {
    position: relative;
    z-index: 1;
    margin-top: var(--space-2xl);
    margin-bottom: calc(-1 * var(--space-2xl));
}

.wn-info .show-info {
    box-shadow: 0 1.5rem 3rem rgb(0 0 0 / 0.35);
    border-top: 4px solid var(--wine);
}

.show-design + .foyer {
    padding-top: calc(var(--space-2xl) + var(--space-lg));
}

/* ---------- Desktop ---------- */

@media (min-width: 1024px) {
    .wn-splash--seam {
        width: 20rem;
        bottom: -6rem;
    }

    .wn-card {
        padding-top: 8rem;
    }

    .wn-hero-inner {
        grid-template-columns: 7fr 5fr;
        align-items: center;
        gap: var(--space-2xl);
    }

    .wn-hero-print {
        width: min(100%, 24rem);
    }


    .wn-story-text p:first-child {
        font-size: var(--text-xl);
    }

    .wn-glass {
        grid-template-columns: repeat(12, 1fr);
        column-gap: var(--space-md);
        align-items: start;
    }

    .wn-glass + .wn-glass {
        margin-top: var(--space-4xl);
    }

    .wn-glass-text {
        grid-column: 1 / 6;
        grid-row: 1;
        align-self: center;
    }

    .wn-print--large {
        grid-column: 7 / 13;
        grid-row: 1;
    }

    /* The small print lies over the large one's bottom corner, away from the text. */
    .wn-print--small {
        grid-column: 10 / 13;
        grid-row: 1;
        align-self: end;
        justify-self: stretch;
        width: auto;
        margin: 0 calc(-1 * var(--space-lg)) -4rem 0;
    }

    /* Every other glass the other way round. */
    .wn-glass--left .wn-glass-text {
        grid-column: 8 / 13;
    }

    .wn-glass--left .wn-print--large {
        grid-column: 1 / 7;
        transform: rotate(1deg);
    }

    .wn-glass--left .wn-print--small {
        grid-column: 1 / 4;
        margin: 0 0 -4rem calc(-1 * var(--space-lg));
        transform: rotate(-2.5deg);
    }

    .wn-line {
        font-size: var(--text-lg);
    }

    .wn-mark--ring {
        right: -2rem;
        bottom: -3rem;
        width: 6rem;
    }

    .wn-mark--ring-under {
        right: auto;
        left: calc(50% + 0.5rem);
        bottom: auto;
        top: -2.5rem;
        width: 7rem;
    }

    .wn-mark--drops {
        right: auto;
        left: 75%;
        top: 60%;
        width: 2rem;
    }

    .wn-pool {
        right: calc(-1 * var(--bleed) - 3rem);
        width: 150%;
    }


    .wn-note {
        font-size: var(--text-xl);
    }
}
