/* Foundation
 * The building blocks this site is made from: spacing, type, layout, buttons, cards and forms.
 * Everything here reads its colours, typefaces, corners and shadows from theme.css,
 * so changing the theme restyles the whole site. Page-specific styles live in site.css.
 */

/* 1. A clean starting point ---------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
    html:focus-within {
        scroll-behavior: smooth;
    }
}

body {
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
picture,
svg,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* 2. Spacing: sizes grow smoothly between phone and desktop ------------------------- */

:root {
    --space-3xs: clamp(0.25rem, 0.2244rem + 0.1136vw, 0.3125rem);
    --space-2xs: clamp(0.5rem, 0.4744rem + 0.1136vw, 0.5625rem);
    --space-xs: clamp(0.75rem, 0.6989rem + 0.2273vw, 0.875rem);
    --space-s: clamp(1rem, 0.9489rem + 0.2273vw, 1.125rem);
    --space-m: clamp(1.5rem, 1.4233rem + 0.3409vw, 1.6875rem);
    --space-l: clamp(2rem, 1.8977rem + 0.4545vw, 2.25rem);
    --space-xl: clamp(3rem, 2.8466rem + 0.6818vw, 3.375rem);
    --space-2xl: clamp(4.5rem, 3.8864rem + 2.7273vw, 6rem);
    --space-3xl: clamp(6rem, 4.7727rem + 5.4545vw, 9rem);
    --gutter: var(--space-m);
    --container: 72rem;
}

/* 3. Type ------------------------------------------------------------------------------ */

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: var(--heading-weight);
    letter-spacing: var(--heading-tracking);
    text-transform: var(--heading-case);
    line-height: 1.08;
    text-wrap: balance;
}

h1 {
    font-size: var(--step-5);
}

h2 {
    font-size: var(--step-4);
}

h3 {
    font-size: var(--step-2);
    line-height: 1.15;
}

h4 {
    font-size: var(--step-1);
    line-height: 1.2;
}

p,
li,
dd,
figcaption {
    text-wrap: pretty;
}

p {
    max-width: 68ch;
}

a {
    color: inherit;
    text-decoration-color: var(--color-accent);
    text-decoration-thickness: 0.12em;
    text-underline-offset: 0.2em;
}

a:hover {
    text-decoration-thickness: 0.2em;
}

:focus-visible {
    outline: 3px solid var(--color-text);
    outline-offset: 3px;
}

::selection {
    background: var(--color-accent);
    color: var(--color-accent-text);
}

/* A small label above a heading. */
.eyebrow {
    display: block;
    font-family: var(--font-body);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-muted);
}

/* An introduction paragraph, a size up from body text. */
.lead {
    font-size: var(--step-1);
    line-height: 1.5;
}

/* Extra-large type for a hero headline or a statement. */
.display {
    font-size: var(--step-6);
    line-height: 0.98;
}

.muted {
    color: var(--color-muted);
}

.big-number {
    font-family: var(--font-heading);
    font-weight: var(--heading-weight);
    font-size: var(--step-5);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.quote {
    font-family: var(--font-heading);
    font-size: var(--step-2);
    line-height: 1.3;
}

.prose > * + * {
    margin-block-start: 1em;
}

.prose > h2,
.prose > h3 {
    margin-block-start: 1.6em;
}

/* 4. Layout ---------------------------------------------------------------------------- */

/* Centres content with comfortable side margins. */
.container {
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
}

.container--narrow {
    --container: 46rem;
}

.container--wide {
    --container: 84rem;
}

/* Vertical rhythm: space between each child. Set --stack-space to change it. */
.stack > * + * {
    margin-block-start: var(--stack-space, var(--space-s));
}

.stack--tight {
    --stack-space: var(--space-2xs);
}

.stack--loose {
    --stack-space: var(--space-l);
}

/* A row of things that wraps onto new lines when space runs out. */
.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cluster-space, var(--space-s));
}

/* As many columns as fit, each at least --grid-min wide. */
.grid {
    display: grid;
    gap: var(--grid-gap, var(--space-m));
    grid-template-columns: repeat(auto-fit, minmax(min(var(--grid-min, 16rem), 100%), 1fr));
}

/* Two columns side by side on wider screens, stacked on phones. */
.split {
    display: grid;
    gap: var(--space-xl);
    align-items: center;
}

@media (min-width: 56rem) {
    .split {
        grid-template-columns: 1fr 1fr;
    }

    .split--wide-left {
        grid-template-columns: 3fr 2fr;
    }

    .split--wide-right {
        grid-template-columns: 2fr 3fr;
    }

    .split--reverse > :first-child {
        order: 2;
    }
}

.text-center {
    text-align: center;
}

.text-center p {
    margin-inline: auto;
}

/* 5. Sections: alternate them so the page has rhythm ----------------------------------- */

.section {
    padding-block: var(--space-2xl);
}

.section--tight {
    padding-block: var(--space-xl);
}

.section--surface {
    background: var(--color-surface);
}

/* Colours swapped: light text on the main text colour. */
.section--inverse {
    background: var(--color-text);
    color: var(--color-bg);
}

/* The accent colour as a full band. */
.section--accent {
    background: var(--color-accent);
    color: var(--color-accent-text);
}

.section--inverse :is(.eyebrow, .muted, .lead),
.section--accent :is(.eyebrow, .muted, .lead),
.site-footer :is(.eyebrow, .muted) {
    color: inherit;
}

.section--inverse a,
.section--accent a,
.site-footer a {
    text-decoration-color: currentColor;
}

/* Cards keep their own colours inside coloured sections. */
.section--inverse .card,
.section--accent .card {
    color: var(--color-text);
}

.section--surface .card {
    background: var(--color-bg);
}

/* 6. Header and navigation ------------------------------------------------------------- */

.skip-link {
    position: absolute;
    left: var(--space-s);
    top: -100px;
    z-index: 100;
    padding: var(--space-2xs) var(--space-s);
    background: var(--color-accent);
    color: var(--color-accent-text);
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.skip-link:focus {
    top: var(--space-s);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--color-bg) 94%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: max(var(--border-width), 1px) solid color-mix(in srgb, var(--color-text) 12%, transparent);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2xs) var(--space-m);
    min-height: 4.25rem;
    padding-block: var(--space-2xs);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: var(--heading-weight);
    font-size: var(--step-1);
    letter-spacing: var(--heading-tracking);
    text-transform: var(--heading-case);
    line-height: 1;
    text-decoration: none;
}

.nav__list {
    display: flex;
    gap: var(--space-3xs) var(--space-s);
    list-style: none;
    padding: 0;
}

.nav__list a {
    display: inline-block;
    padding: 0.5rem 0.25rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.nav__list a:hover,
.nav__list a[aria-current='page'] {
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-decoration-thickness: 0.16em;
    text-underline-offset: 0.4em;
}

/* On phones the links sit in their own row, which scrolls sideways if it has to. */
@media (max-width: 47.99rem) {
    .nav {
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nav__list {
        padding-bottom: var(--space-3xs);
    }
}

/* 7. Buttons --------------------------------------------------------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: 48px;
    padding: 0.8em 1.4em;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-button);
    background: var(--color-accent);
    color: var(--color-accent-text);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-body);
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.button--secondary {
    background: transparent;
    color: var(--color-text);
    border: 2px solid currentColor;
    box-shadow: none;
}

.button--large {
    font-size: var(--step-1);
}

.section--accent .button {
    background: var(--color-accent-text);
    color: var(--color-accent);
}

.section--accent .button--secondary,
.section--inverse .button--secondary,
.site-footer .button--secondary {
    background: transparent;
    color: inherit;
}

/* 8. Cards ----------------------------------------------------------------------------- */

.card {
    padding: var(--space-m);
    background: var(--color-surface);
    color: var(--color-text);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card--link {
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.card--link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* A picture filling the top of a card, edge to edge. */
.card__media {
    margin: calc(-1 * var(--space-m)) calc(-1 * var(--space-m)) var(--space-s);
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
}

.tag {
    display: inline-block;
    padding: 0.3em 0.8em;
    border: var(--border-width) solid var(--border-color);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--step--1);
    font-weight: 700;
    line-height: 1.2;
}

/* 9. Lists: prices, opening times and details ------------------------------------------ */

/* Name ........ price, with an optional description underneath. */
.price-list {
    display: grid;
    gap: var(--space-s);
    padding: 0;
    list-style: none;
}

.price-list__item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 0.15rem 0.75rem;
}

.price-list__name {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-weight: var(--heading-weight);
    font-size: var(--step-1);
    line-height: 1.25;
}

.price-list__name::after {
    content: '';
    flex: 1;
    min-width: 1.5rem;
    border-bottom: 2px dotted color-mix(in srgb, currentColor 40%, transparent);
    transform: translateY(-0.3em);
}

.price-list__price {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.price-list__desc {
    grid-column: 1 / -1;
    max-width: 60ch;
    color: var(--color-muted);
}

/* Label and value pairs, such as opening times. */
.details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-2xs) var(--space-m);
}

.details dt {
    font-weight: 700;
}

.details dd {
    font-variant-numeric: tabular-nums;
}

/* 10. Forms ---------------------------------------------------------------------------- */

.form {
    display: grid;
    gap: var(--space-m);
}

.field {
    display: grid;
    gap: 0.4rem;
}

label,
legend {
    font-weight: 700;
}

.hint {
    color: var(--color-muted);
    font-size: var(--step--1);
}

input:not([type='checkbox'], [type='radio'], [type='submit'], [type='button']),
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.7em 0.9em;
    background: var(--color-bg);
    color: var(--color-text);
    border: 2px solid var(--color-muted);
    border-radius: var(--radius-sm);
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

input[type='checkbox'],
input[type='radio'] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--color-accent);
}

[aria-invalid='true'] {
    border-color: #d92d20 !important;
    border-width: 3px !important;
}

/* Error messages: a red dot plus bold text, so they don't rely on colour alone. */
.field-error {
    display: flex;
    gap: 0.5em;
    font-weight: 700;
    font-size: var(--step--1);
}

.field-error::before {
    content: '';
    flex: none;
    width: 0.75em;
    height: 0.75em;
    margin-top: 0.35em;
    border-radius: 50%;
    background: #d92d20;
}

.field-error:empty {
    display: none;
}

/* 11. Footer --------------------------------------------------------------------------- */

.site-footer {
    padding-block: var(--space-xl) var(--space-l);
    background: var(--color-text);
    color: var(--color-bg);
}

/* 12. Decoration: shapes and patterns in the pop colour -------------------------------- */

.blob {
    border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
    background: var(--color-pop);
}

.pattern-dots {
    background-image: radial-gradient(var(--color-pop) 2px, transparent 2.5px);
    background-size: 18px 18px;
}

.pattern-stripes {
    background-image: repeating-linear-gradient(-45deg, var(--color-pop) 0 10px, transparent 10px 22px);
}

.pattern-grid {
    background-image: linear-gradient(var(--color-pop) 1.5px, transparent 1.5px), linear-gradient(90deg, var(--color-pop) 1.5px, transparent 1.5px);
    background-size: 28px 28px;
}

.rule {
    width: 4rem;
    height: 6px;
    border: 0;
    border-radius: 99px;
    background: var(--color-pop);
}

/* A picture with the theme's corners, border and shadow. */
.frame {
    overflow: hidden;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* A space for the owner's own photo, styled so it looks intentional until they add one. */
.photo-frame {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    padding: var(--space-m);
    background-color: var(--color-surface);
    color: var(--color-muted);
    font-size: var(--step--1);
    font-weight: 700;
    text-align: center;
}

/* 13. Helpers -------------------------------------------------------------------------- */

.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;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 14. Showcase: real photos, depth and motion (ADR-014) --------------------------------
 * Photos are hotlinked from the photo library and always credited (see .photo-credits).
 * Motion is pure CSS, driven by scrolling, and only when the visitor hasn't asked for less
 * motion and the browser supports it; otherwise everything simply shows, still and complete. */

.photo-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: min(88vh, 52rem);
    display: grid;
    align-items: end;
    padding-block: var(--space-2xl, 6rem) var(--space-xl, 4rem);
    color: #ffffff;
}

.photo-hero > .photo-hero__image {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* A dark wash from the bottom, so the headline always reads on top of any photo. */
.photo-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgb(0 0 0 / 0.72), rgb(0 0 0 / 0.25) 55%, rgb(0 0 0 / 0.1));
}

.photo-hero h1,
.photo-hero p {
    color: #ffffff;
    text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
}

.photo-band {
    position: relative;
    overflow: hidden;
    height: clamp(16rem, 45vw, 32rem);
}

.photo-band > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-credits {
    font-size: 0.8125rem;
    color: var(--color-muted);
}

.photo-credits a {
    color: inherit;
}

@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        /* Parallax: the photo drifts slower than the page. Put it on the hero or band image. */
        .parallax {
            scale: 1.18;
            animation: vm-parallax linear both;
            animation-timeline: view();
        }

        /* Reveal: sections and cards rise gently into place as they scroll into view. */
        .reveal {
            animation: vm-reveal ease-out both;
            animation-timeline: view();
            animation-range: entry 0% cover 28%;
        }
    }
}

@keyframes vm-parallax {
    from {
        transform: translateY(-7%);
    }
    to {
        transform: translateY(7%);
    }
}

@keyframes vm-reveal {
    from {
        opacity: 0;
        transform: translateY(1.5rem);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
