/* =============================================================================================
   Meridian storefront design system
   Linen, ink and terracotta. Fraunces (display) + Inter (UI). No framework; tokens drive everything.
   ============================================================================================= */

:root {
    --c-bg: #f6f2ec;
    --c-surface: #ffffff;
    --c-surface-2: #efe9e0;
    --c-ink: #1e1b18;
    --c-ink-2: #3d3833;
    --c-muted: #6f675e;
    --c-line: #e3dbcf;
    /* Borders that identify a control (inputs, selects): at least 3:1 against every surface (WCAG 1.4.11). */
    --c-field-border: #857c72;
    /* Text colours below are at least 4.5:1 on --c-bg, --c-surface and --c-surface-2 (WCAG 1.4.3). */
    --c-accent: #a54a24;
    --c-accent-ink: #8f3f1d;
    --c-accent-soft: #f3e1d6;
    --c-sage: #7c8b6f;
    --c-sage-soft: #e5eadf;
    --c-success: #2f6b3b;
    --c-warning: #8a5508;
    --c-danger: #b42318;
    --c-focus: #1e1b18; /* focus ring; white on dark backgrounds */

    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --radius-s: 6px;
    --radius-m: 12px;
    --radius-l: 20px;
    --shadow-s: 0 1px 2px rgba(30, 27, 24, .06);
    --shadow-m: 0 10px 30px -14px rgba(30, 27, 24, .25);

    --container: 1280px;
    --gutter: clamp(1rem, 3vw, 2rem);
    --header-h: 72px;
}

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

/* scroll-padding keeps targets of in-page links and keyboard focus clear of the sticky header (WCAG 2.4.11). */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
    margin: 0;
    background: var(--c-bg);
    color: var(--c-ink);
    font-family: var(--font-ui);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--c-accent-ink); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; }

/* One focus indicator everywhere (WCAG 2.4.7): a 3px ring in ink, white on dark backgrounds. Controls never remove it. */
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.hero-block--dark { --c-focus: #fff; }
/* Elements focused by script (headings, error summaries) are not controls: no ring. */
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

.skip-link {
    position: absolute; left: -999px; top: .5rem; z-index: 100;
    background: var(--c-ink); color: #fff; padding: .5rem .9rem; border-radius: var(--radius-s);
}
.skip-link:focus { left: .5rem; }
#main:focus { outline: none; }

/* Respect a reduced-motion preference: no smooth scrolling, transitions or entrance animations. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- Layout primitives ---------------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.page-pad { padding-top: clamp(2rem, 6vw, 4.5rem); padding-bottom: clamp(2rem, 6vw, 4.5rem); }
.site-main { flex: 1; }
.stack > * + * { margin-top: 1rem; }

.eyebrow { font-family: var(--font-ui); font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--c-accent); margin-bottom: .75rem; }
.display { font-size: clamp(2.4rem, 5.5vw, 4.2rem); line-height: 1.05; letter-spacing: -.025em; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--c-ink-2); max-width: 40rem; }
.muted { color: var(--c-muted); }
.small { font-size: .85rem; }

/* ---- Buttons -------------------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .8rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
    font: 600 .95rem/1 var(--font-ui); text-decoration: none; cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--c-ink); color: #fff; }
.btn--primary:hover { background: var(--c-accent-ink); color: #fff; }
.btn--accent { background: var(--c-accent); color: #fff; }
.btn--accent:hover { background: var(--c-accent-ink); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--c-line); color: var(--c-ink); }
.btn--ghost:hover { border-color: var(--c-ink); color: var(--c-ink); }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }

/* ---- Header --------------------------------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(246, 242, 236, .88);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--c-line);
}
.site-header__inner { display: flex; align-items: center; gap: 2rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--font-display); font-size: 1.45rem; letter-spacing: -.01em; }
.site-nav { flex: 1; display: flex; gap: 1.5rem; }
.site-nav a { text-decoration: none; font-weight: 500; font-size: .95rem; color: var(--c-ink-2); padding: .4rem 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--c-ink); border-color: var(--c-ink); }
.site-header__actions { display: flex; align-items: center; gap: .75rem; }

/* ---- Footer --------------------------------------------------------------------------------- */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--c-line); background: var(--c-surface-2); }
.site-footer__inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-top: 2.5rem; padding-bottom: 2.5rem; }
.site-footer__brand { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: .25rem; }

/* ---- Hero ----------------------------------------------------------------------------------- */
.hero { padding: clamp(3rem, 10vw, 7rem) 0; }
.hero--placeholder {
    background:
        radial-gradient(circle at 85% 20%, var(--c-accent-soft), transparent 45%),
        radial-gradient(circle at 10% 90%, var(--c-sage-soft), transparent 40%);
}

@media (max-width: 720px) {
    .site-nav { display: none; }
}

/* ---- Utilities ------------------------------------------------------------------------------ */
/* Fallback controls for visitors without scripts (scripts apply the change themselves). */
.js [data-no-js] { display: none !important; }
.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; }
.section-title { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-bottom: 1.25rem; }
.link-arrow { font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: .1rem; }
.btn--light { background: #fff; color: var(--c-ink); }
.btn--light:hover { background: var(--c-accent-soft); color: var(--c-ink); }

/* ---- Images & placeholders ------------------------------------------------------------------- */
.img-placeholder {
    display: flex; align-items: center; justify-content: center;
    width: 100%; aspect-ratio: 4 / 3;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,.55), transparent 55%),
        linear-gradient(135deg, var(--c-surface-2), #e4dccf);
    color: #b9ad9c;
}
.img-placeholder svg { width: 18%; max-width: 64px; min-width: 28px; }

/* ---- Breadcrumbs ----------------------------------------------------------------------------- */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1.25rem; font-size: .85rem; color: var(--c-muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: .4rem; opacity: .6; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ---- Pages & prose --------------------------------------------------------------------------- */
.page { padding-bottom: 3rem; }
.page__header { padding-top: clamp(2rem, 6vw, 4rem); padding-bottom: 1.5rem; }
.page__hero { margin: 1rem auto 2.5rem; }
/* Body with a sidebar block area: two columns on wide screens, stacked on phones. Blocks are built for full-width
   sections, so inside the sidebar their containers drop the page gutter and they stack with a smaller rhythm. */
.page__columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; margin-bottom: 2.5rem; }
@media (min-width: 960px) { .page__columns { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.page__main { max-width: 760px; }
.page__sidebar { display: grid; gap: 1.5rem; }
.page__sidebar .container { padding: 0; max-width: none; }
.page__sidebar .block { margin: 0; padding: 1.5rem; border-radius: var(--radius-l); background: var(--c-surface-2); }
.page__hero-img, .page__hero .img-placeholder { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: var(--radius-l); }
.article__byline { display: flex; gap: 1rem; font-size: .9rem; margin-top: -.25rem; }

.prose { font-size: 1.05rem; line-height: 1.75; color: var(--c-ink-2); }
.prose h2 { margin-top: 2rem; font-size: 1.6rem; color: var(--c-ink); }
.prose h3 { margin-top: 1.5rem; color: var(--c-ink); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin: .35rem 0; }
.prose blockquote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 2px solid var(--c-accent); font-family: var(--font-display); font-size: 1.25rem; color: var(--c-ink); }
.prose img { border-radius: var(--radius-m); margin: 1.5rem 0; }
.prose a { color: var(--c-accent-ink); }

.subpages { margin-top: 3rem; }
.subpages ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
.subpages a { display: block; padding: .9rem 1.1rem; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-m); text-decoration: none; font-weight: 500; }
.subpages a:hover { border-color: var(--c-ink); }

.landing-header { padding-top: clamp(2rem, 6vw, 4rem); }

/* ---- Blocks ---------------------------------------------------------------------------------- */
.block { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.block + .block { padding-top: 0; }

.hero-block { position: relative; padding: 0; min-height: min(78vh, 720px); display: grid; overflow: hidden; }
.hero-block__media { position: absolute; inset: 0; }
.hero-block__img, .hero-block__media .img-placeholder { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; }
.hero-block__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(246,242,236,.94) 0%, rgba(246,242,236,.88) 48%, rgba(246,242,236,0) 72%); }
.hero-block--dark .hero-block__media::after { background: linear-gradient(90deg, rgba(20,18,16,.85) 0%, rgba(20,18,16,.8) 48%, rgba(20,18,16,0) 75%); }
.hero-block__inner { position: relative; display: flex; align-items: center; padding-top: 4rem; padding-bottom: 4rem; }
.hero-block__copy { max-width: 34rem; }
.hero-block--dark .hero-block__copy { color: #fff; }
.hero-block--dark .lead { color: rgba(255,255,255,.92); }
.hero-block--dark .eyebrow { color: #f3c9b3; }
.display--section { font-size: clamp(2rem, 4vw, 3rem); }
.hero-block + .block { padding-top: clamp(2.5rem, 6vw, 4.5rem); }

.usp-strip { padding: 1.75rem 0 !important; border-bottom: 1px solid var(--c-line); }
.usp-strip__inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.usp__title { font-weight: 600; margin: 0; }
.usp__text { margin: 0; color: var(--c-muted); font-size: .92rem; }

.image-text { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4.5rem); align-items: center; }
.image-text--reverse .image-text__media { order: 2; }
.image-text__img, .image-text__media .img-placeholder { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-l); }

.quote blockquote { margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.3; text-align: center; }
.quote figcaption { margin-top: 1rem; text-align: center; color: var(--c-muted); }

.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.article-card { display: block; text-decoration: none; background: var(--c-surface); border-radius: var(--radius-l); overflow: hidden; border: 1px solid var(--c-line); transition: transform .2s, box-shadow .2s; }
.article-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); color: inherit; }
.article-card__img, .article-card .img-placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.article-card__body { padding: 1.1rem 1.25rem 1.4rem; }
.article-card__body h3 { margin-bottom: .35rem; }
.article-card__body p:last-child { margin: 0; font-size: .92rem; }

.newsletter__inner { text-align: center; background: var(--c-sage-soft); border-radius: var(--radius-l); padding: clamp(2rem, 5vw, 3.5rem); }
.newsletter__form { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.25rem; }
.newsletter__form input { flex: 1 1 240px; max-width: 340px; padding: .8rem 1.1rem; border-radius: 999px; border: 1px solid var(--c-field-border); font: inherit; background: #fff; }
.newsletter__thanks { flex-basis: 100%; color: var(--c-success); margin: .5rem 0 0; }
.newsletter__thanks:empty { margin: 0; } /* stays rendered: a hidden live region is not announced when it appears */

/* ---- Footer ---------------------------------------------------------------------------------- */
.site-footer__about { max-width: 22rem; }
.site-footer__heading { font-weight: 600; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .5rem; }
.site-footer__links ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.site-footer__links a { text-decoration: none; color: var(--c-ink-2); }
.site-footer__links a:hover { text-decoration: underline; }
.site-footer__base { border-top: 1px solid var(--c-line); padding-top: 1rem; padding-bottom: 1.5rem; }

@media (max-width: 800px) {
    .image-text { grid-template-columns: 1fr; }
    .image-text--reverse .image-text__media { order: 0; }
    .hero-block__media::after { background: linear-gradient(0deg, rgba(246,242,236,.95) 55%, rgba(246,242,236,.6) 85%, rgba(246,242,236,.2)); }
    .hero-block--dark .hero-block__media::after { background: linear-gradient(0deg, rgba(20,18,16,.85) 55%, rgba(20,18,16,.55) 85%, rgba(20,18,16,.2)); }
    .hero-block__inner { align-items: flex-end; }
}
.hero-block__media .img-placeholder svg { display: none; }

/* ---- Product detail -------------------------------------------------------------------------- */
.pdp { padding-top: 1.5rem; padding-bottom: 3rem; }
.pdp__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.pdp__gallery { position: sticky; top: calc(var(--header-h) + 1rem); }
.pdp__main-img, .pdp__gallery > .img-placeholder { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-l); background: var(--c-surface-2); }
.pdp__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .6rem; margin-top: .75rem; }
.pdp__thumb, .pdp__thumbs .img-placeholder { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-m); }
.pdp__title { font-size: clamp(1.9rem, 3.5vw, 2.7rem); margin-bottom: .5rem; }
.pdp__price { display: flex; align-items: baseline; gap: .6rem; margin-bottom: 1.25rem; }
.price { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.price--sale { color: var(--c-accent); }
.price--was { text-decoration: line-through; color: var(--c-muted); font-weight: 400; font-size: 1rem; }
.pdp__options { border: 0; padding: 0; margin: 0 0 1.25rem; }
.pdp__options legend { font-size: .9rem; margin-bottom: .5rem; color: var(--c-ink-2); }
.option-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.option { padding: .5rem 1rem; border: 1px solid var(--c-line); border-radius: 999px; text-decoration: none; font-size: .9rem; background: var(--c-surface); }
.option:hover { border-color: var(--c-ink); }
.option--selected { border-color: var(--c-ink); background: var(--c-ink); color: #fff; }
.option--selected:hover { color: #fff; }
.option--unavailable { color: var(--c-muted); text-decoration: line-through; }
.option--selected.option--unavailable { color: #fff; }
.stock { display: flex; align-items: center; gap: .5rem; font-size: .92rem; margin: 0 0 1rem; }
.stock::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--c-success); }
.stock--lowstock::before { background: var(--c-warning); }
.stock--backorder::before { background: #2563eb; }
.stock--outofstock::before { background: var(--c-danger); }
.pdp__buy { margin-bottom: 2rem; }
.pdp__description { margin-top: 1rem; }
.pdp__subtitle { font-size: 1.3rem; margin-top: 2rem; }
.spec-list { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.5rem; margin: 0; padding: 1.25rem 0 0; border-top: 1px solid var(--c-line); font-size: .95rem; }
.spec-list dt { color: var(--c-muted); }
.spec-list dd { margin: 0; }

@media (max-width: 860px) {
    .pdp__grid { grid-template-columns: 1fr; }
    .pdp__gallery { position: static; }
}
