/*
 * Meridian storefront design system.
 *
 * A softer register than a wide-tracked editorial theme: sentence-case
 * headings, a small rounded button radius, grey body copy against near-black
 * headings, and alternating white / off-white section grounds.
 */

:root {
    --mr-page: 1480px;
    --mr-reading: 720px;
    --mr-gutter: 1.25rem;
    --mr-section: 2rem;

    --mr-text: #676869;
    --mr-heading: #171717;
    --mr-line: #e2e2e2;
    --mr-muted: #8b8c8d;
    --mr-btn: #232323;
    --mr-btn-hover: #000000;
    --mr-sale: #c0392b;
    --mr-tint: #f7f7f8;
    --mr-radius: 3px;
}

body {
    font-family: Arimo, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: var(--mr-text);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .mr-heading {
    color: var(--mr-heading);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: normal;
    text-transform: none;
}

.mr-h1 { font-size: 30px; }
.mr-h2 { font-size: 22px; }
.mr-h3 { font-size: 16px; }
.mr-eyebrow { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mr-muted); }

@media (min-width: 768px) {
    .mr-h1 { font-size: 38px; }
    .mr-h2 { font-size: 30px; }

    /* Section rhythm scales with the page: 3.25rem of padding above and below
       every band reads as air on a wide screen and as a void between two
       stacked rails on a phone. */
    :root { --mr-section: 3.25rem; }
}

.mr-shell {
    max-width: var(--mr-page);
    margin-inline: auto;
    padding-inline: var(--mr-gutter);
}

.mr-reading { max-width: var(--mr-reading); margin-inline: auto; }
.mr-section { padding-block: var(--mr-section); }
.mr-tint { background: var(--mr-tint); }

/* Buttons: small radius, sentence case, no tracking. */
.mr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.7rem 1.6rem;
    font-size: 14px;
    border-radius: var(--mr-radius);
    border: 1px solid var(--mr-btn);
    background: var(--mr-btn);
    color: #fff;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mr-btn:hover:not(:disabled) { background: var(--mr-btn-hover); border-color: var(--mr-btn-hover); }
.mr-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.mr-btn--alt { background: #fff; color: #000; border-color: #000; }
.mr-btn--alt:hover:not(:disabled) { background: #000; color: #fff; }

.mr-btn--ter { background: #ebebeb; color: #343536; border-color: #ebebeb; }
.mr-btn--ter:hover:not(:disabled) { background: var(--mr-btn); color: #fff; border-color: var(--mr-btn); }

.mr-field {
    width: 100%;
    min-height: 44px;
    padding: 0.7rem 0.9rem;
    font-size: 16px;
    color: var(--mr-heading);
    background: #fff;
    border: 1px solid var(--mr-line);
    border-radius: var(--mr-radius);
}

.mr-field:focus { outline: none; border-color: var(--mr-heading); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--mr-heading);
    outline-offset: 2px;
}

.mr-skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 90;
    background: var(--mr-btn);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--mr-radius);
    transition: top 0.2s ease;
}

.mr-skip:focus { top: 1rem; }

/* Media: a second image fades in on hover where one exists. */
.mr-media { position: relative; overflow: hidden; background: var(--mr-tint); border-radius: var(--mr-radius); }
.mr-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.mr-media__hover {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

@media (hover: hover) {
    .mr-card:hover .mr-media__hover,
    .mr-card:focus-within .mr-media__hover { opacity: 1; }
}

.aspect-portrait { aspect-ratio: 3 / 4; }
.aspect-wide { aspect-ratio: 16 / 9; }

.mr-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background:
        repeating-linear-gradient(45deg, rgba(23, 23, 23, 0.03) 0 10px, transparent 10px 20px),
        var(--mr-tint);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mr-muted);
}

/* Option swatches are labels bound to visually hidden radios. */
.mr-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 40px;
    padding: 0 0.85rem;
    border: 1px solid var(--mr-line);
    border-radius: var(--mr-radius);
    font-size: 14px;
    color: var(--mr-heading);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.mr-swatch:hover { border-color: var(--mr-heading); }
input:checked + .mr-swatch { border-color: var(--mr-heading); box-shadow: inset 0 0 0 1px var(--mr-heading); }
input:focus-visible + .mr-swatch { outline: 2px solid var(--mr-heading); outline-offset: 2px; }

input:disabled + .mr-swatch {
    color: #c2c3c4;
    cursor: not-allowed;
    background: linear-gradient(to top left, transparent calc(50% - 1px), var(--mr-line) 50%, transparent calc(50% + 1px));
}

/* Header: sticky, solid. Legibility does not depend on the artwork behind it. */
.mr-header { background: #fff; border-bottom: 1px solid var(--mr-line); }

/* The desktop row and the menu button are one decision, so it is made here
   rather than left to two utilities: if the utility stylesheet is late or
   missing, both evaluate to nothing and the bar becomes a menu button with
   no row behind it. */
.mr-header [data-nav] { display: none; }
.mr-header [data-nav-toggle] { display: inline-flex; }

@media (min-width: 1024px) {
    .mr-header [data-nav] { display: flex; }
    .mr-header [data-nav-toggle] { display: none; }
}

/* The wordmark is the storefront's one piece of display type: caps, heavy,
   and widely tracked, standing alone on the centre line. */
.mr-wordmark {
    font-weight: 700;
    font-size: 1.375rem;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    /* Tracking is applied to the right of every glyph, including the last,
       which would push the word off centre. */
    text-indent: 0.32em;
    white-space: nowrap;
}

.mr-drawer { transition: transform 0.32s ease; }
.mr-scrim { transition: opacity 0.32s ease; opacity: 1; }

[data-overlay][data-state="closed"] .mr-scrim { opacity: 0; }
[data-overlay][data-state="closed"] .mr-drawer--left { transform: translateX(-100%); }
[data-overlay][data-state="closed"] .mr-drawer--right { transform: translateX(100%); }
[data-overlay][data-state="closed"] .mr-drawer--top { transform: translateY(-100%); }

.mr-prose { line-height: 1.8; }
.mr-prose > * + * { margin-top: 1rem; }
.mr-prose ul { list-style: disc; padding-left: 1.25rem; }
.mr-prose ol { list-style: decimal; padding-left: 1.25rem; }
.mr-prose a { text-decoration: underline; text-underline-offset: 3px; }
.mr-prose h2, .mr-prose h3 { margin-top: 2rem; color: var(--mr-heading); }

.mr-hero-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mr-hero-track::-webkit-scrollbar { display: none; }
.mr-hero-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }

.mr-hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--mr-radius);
    color: var(--mr-heading);
    background: rgba(255, 255, 255, 0.85);
    transition: background 0.2s ease;
}
.mr-hero-nav:hover { background: #fff; }

@media (min-width: 640px) {
    .mr-hero-nav { width: 2.5rem; height: 2.5rem; }
}

.mr-hero-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
    transition: background 0.2s ease, width 0.2s ease;
}
.mr-hero-dot[aria-current="true"] { width: 1.25rem; background: #fff; }

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

    /* Durations do not reach smooth scrolling: any scroll the scripts do
       not drive — an anchor jump, scrollIntoView, the browser restoring a
       position — keeps animating unless the behaviour itself is reset. */
    * { scroll-behavior: auto !important; }
}
