/* ─────────────────────────────────────────────────────────────────────────────
   #gribubehu — a screenprint on yellowed stock.

   The language is taken from the brand's print work: flat riso inks, halftone
   dot screens, hard outlines, cut-out plates with a cream keyline, condensed
   caps, and things offset a hair out of register. No gradients on components,
   no blur, nothing rounded.

   Type scale, colour and spacing live in custom properties at the top;
   components never use a literal colour.
   ───────────────────────────────────────────────────────────────────────────*/

/* Display: Barlow Condensed ExtraBold (upright + true italic). Text: Inter,
   variable weight. Both OFL — licences sit next to the files in /fonts.
   Each face is split into a Latin and a Latin Extended file; the browser only
   fetches the second when a page contains Latvian letters (ā č ē ģ ī ķ ļ ņ š ū ž).
   /fonts is served `immutable`, so a changed font must get a new filename. */
@font-face {
  font-family: "GB Display";
  src: url("/fonts/barlow-condensed-800-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "GB Display";
  src: url("/fonts/barlow-condensed-800-latin-ext.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "GB Display";
  src: url("/fonts/barlow-condensed-800-italic-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "GB Display";
  src: url("/fonts/barlow-condensed-800-italic-latin-ext.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "GB Text";
  src: url("/fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "GB Text";
  src: url("/fonts/inter-var-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Ink and stock.
 *
 * Four inks, as the prints use them: print black, riso orange-red, burgundy
 * and cream, with blueprint cyan reserved for technical/informational notes.
 * Every pairing that carries text was measured against the stock it sits on:
 * body ink 15.2:1, muted 5.1:1, accent as small text 6.4:1 on paper (AA for
 * small text is 4.5:1). */
:root {
  --paper: #F2EAD8;          /* cream stock */
  --paper-deep: #E6DCC5;     /* the same stock, one impression heavier */
  --ink: #191510;            /* print black, warm */
  --ink-soft: #3A332A;
  --ink-mute: #61584C;
  --rule: #191510;
  --rule-soft: #C4B69A;

  /* Riso orange-red: the accent. --orange is the ink itself (fills, tabs,
     rules); --on-accent is the cream printed on top of it. */
  --orange: #C43B16;
  --orange-dark: #A3300F;
  --on-accent: #FFF6E4;
  --accent-wash: #F6DCC8;
  /* Accent taken dark enough to read as 13px text on stock. */
  --accent-ink: #96300F;

  /* Second and third inks, for status and technical notes. */
  --blue: #1E6E96;
  --burgundy: #6B1F2A;
  --amber: #E8A21B;
  --amber-ink: #7E5200;

  /* Raised fields: inputs, panels, totals boxes. */
  --field: #FBF5E7;
  --field-strong: #FFFBF2;
  --field-stripe: #E0D4B9;

  --error: #8C2A1B;
  --success: #2E5540;

  --font-display: "GB Display", "Arial Narrow", "Helvetica Neue Condensed", sans-serif;
  --font-text: "GB Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --slant: italic;
  --display-case: uppercase;
  --display-weight: 800;
  /* Barlow Condensed is already tightly spaced; negative tracking collides. */
  --display-spacing: .005em;

  /* Geometry. Corners are square: a radius is a bug. Objects are outlined in
     ink and sit on the page with a hard offset shadow, like a pasted-up plate
     rather than a card with a soft edge. */
  --radius: 0;
  --radius-sm: 0;
  --hairline: 1px;
  --rule-weight: 3px;
  --outline: 2px solid var(--ink);
  --offset: 4px 4px 0 var(--ink);
  --offset-sm: 2px 2px 0 var(--ink);

  /* Halftone dot screen: a 5px black screen and a coarser 7px orange screen at
     paper-tooth strength. Two offset dot layers read as printed texture rather
     than a CSS pattern. */
  --page-texture:
    radial-gradient(circle at 1.5px 1.5px, color-mix(in srgb, var(--ink) 10%, transparent) 1px, transparent 1.1px),
    radial-gradient(circle at 3.5px 3.5px, color-mix(in srgb, var(--orange) 4%, transparent) 1.2px, transparent 1.3px);
  --page-texture-size: 5px 5px, 7px 7px;
  /* Photography is graded toward print ink, not screen colour. */
  --photo-filter: saturate(.86) contrast(1.08) sepia(.12);
  /* Display type gets a flat off-register plate behind it, never a soft shadow. */
  --display-shadow: 3px 3px 0 var(--accent-wash);

  --gutter: clamp(12px, 1.4vw, 22px);
  --gap: 10px;

  --h1: clamp(38px, 4.4vw, 68px);
  --h2: clamp(24px, 2.2vw, 34px);
  --h3: clamp(18px, 1.4vw, 22px);
  --body: 15px;
  --small: 13px;
  --micro: 11px;

  --header-h: 58px;
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink);
  --max-width: 1440px;
}

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

/* `hidden` must win over component display rules (.btn is inline-flex, etc.). */
[hidden] { display: none !important; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background-color: var(--paper);
  /* Faint engineering grid stops large fields looking like #FFF without
     competing with the photography. */
  background-image: var(--page-texture);
  background-size: var(--page-texture-size);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }
/* Themes can grade photography (sepia, contrast) through the filter token. */
img { height: auto; background: var(--paper-deep); filter: var(--photo-filter); }

/* Photography is matted: an ink frame from its parent, with a cream keyline
   inside it, as the cut-out plates are mounted in the prints. Large plates also
   take a halftone screen on top, so they read as printed photographs. The
   logotype is explicitly excluded — it is ink, not a photograph. */
.listing-card__media img,
.product-card__media img,
.story-card__media img,
.story-hero__media img,
.feature__image img {
  outline: 3px solid var(--paper);
  outline-offset: -3px;
}
.feature__media,
.story-hero__media,
.shop-banner { position: relative; }
.feature__media::after,
.story-hero__media::after,
.shop-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 55%, transparent) .9px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: multiply;
  opacity: .3;
}

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

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

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  outline: var(--outline);
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; color: var(--paper); }

/* ── Typography ────────────────────────────────────────────────────────────*/

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-style: var(--slant);
  font-weight: var(--display-weight);
  line-height: .92;
  letter-spacing: var(--display-spacing);
  text-transform: var(--display-case);
  margin: 0;
}

h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }

.eyebrow {
  font-family: var(--font-text);
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.lede { font-size: 17px; line-height: 1.45; color: var(--ink-soft); }
.muted { color: var(--ink-mute); }
.small { font-size: var(--small); }
.micro { font-size: var(--micro); }

.price {
  font-family: var(--font-display);
  font-style: var(--slant);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  white-space: nowrap;
}

/* ── Layout ────────────────────────────────────────────────────────────────*/

.shell { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); }
.rule-top { border-top: var(--hairline) solid var(--rule); }
.rule-bottom { border-bottom: var(--hairline) solid var(--rule); }

/* ── Header ────────────────────────────────────────────────────────────────*/

/* A slim warm-cream band, not a heavy tab bar: the wordmark is the weight and
   the nav is type on the same stock. The only ink plate on it is the current
   section, which reads as a printed tab stuck over the cream. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: var(--outline);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--ink) 12%, transparent);
}
.site-header__inner {
  display: flex;
  align-items: stretch;
  gap: calc(var(--gutter) + 4px);
  height: var(--header-h);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* The brand mark is a bitmap: the retro outlined logotype, cropped to its ink.
   It is sized by height so it always fits the header row at any width. `img`
   is excluded from the photographic matting and ink grading elsewhere — a
   logotype is ink, not a photograph, and a cream keyline would eat its hairline
   outline. Hover lifts it 1px, as the prints offset the mark off-register. */
.wordmark {
  display: inline-flex;
  align-items: center;
  align-self: center;
  padding: 0 10px 0 0;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark__img {
  display: block;
  width: auto;
  height: 34px;
  background: none;
  filter: none;
  transition: transform .12s ease;
}
.wordmark:hover .wordmark__img { transform: translate(1px, -1px); }
@media (prefers-reduced-motion: reduce) {
  .wordmark:hover .wordmark__img { transform: none; }
}

.main-nav {
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.main-nav__link {
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  /* The active tab's rule is drawn here, not with an outline: a 2px red line
     sitting under a black plate, like ink showing at the edge of a stamp. */
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.main-nav__link:hover { color: var(--ink); background: var(--accent-wash); }

/* Desktop hover: each section has its own ink. A halftone sticker in that ink
   stamps in behind the label, slightly askew, with a hard offset shadow, and
   the label lifts off-register. Keyboard focus gets the same treatment. Only
   on devices that really hover, and never on the current tab. */
.main-nav__link--sludinajumi { --nav-ink: var(--orange);   --nav-on: var(--on-accent); --nav-tilt: -2deg; }
.main-nav__link--garaza      { --nav-ink: var(--burgundy); --nav-on: var(--on-accent); --nav-tilt: 1.5deg; }
.main-nav__link--pasakumi    { --nav-ink: var(--blue);     --nav-on: var(--on-accent); --nav-tilt: -1.5deg; }
.main-nav__link--riki        { --nav-ink: #2f9e44;         --nav-on: var(--on-accent); --nav-tilt: 1deg; }
.main-nav__link--veikals     { --nav-ink: var(--amber);    --nav-on: var(--ink);       --nav-tilt: 2deg; --nav-shadow: color-mix(in srgb, var(--orange) 75%, transparent); }

@media (min-width: 941px) and (hover: hover) {
  .main-nav__link { position: relative; isolation: isolate; }
  .main-nav__label { display: inline-block; transition: transform .14s ease, text-shadow .14s ease; }
  .main-nav__link:not([aria-current="page"])::before {
    content: "";
    position: absolute;
    inset: 11px 2px;
    z-index: -1;
    background-color: var(--nav-ink);
    background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 30%, transparent) .9px, transparent 1px);
    background-size: 4px 4px;
    border: var(--outline);
    box-shadow: 3px 3px 0 var(--ink);
    opacity: 0;
    transform: translateY(8px) rotate(calc(var(--nav-tilt) * 3)) scale(.85);
    transition: opacity .1s ease, transform .16s cubic-bezier(.3, 1.6, .5, 1);
  }
  .main-nav__link:not([aria-current="page"]):is(:hover, :focus-visible) {
    background: transparent;
    color: var(--nav-on);
  }
  .main-nav__link:not([aria-current="page"]):is(:hover, :focus-visible)::before {
    opacity: 1;
    transform: rotate(var(--nav-tilt));
  }
  .main-nav__link:not([aria-current="page"]):is(:hover, :focus-visible) .main-nav__label {
    transform: translate(-1px, -1px) rotate(var(--nav-tilt));
    text-shadow: 2px 2px 0 var(--nav-shadow, color-mix(in srgb, var(--ink) 55%, transparent));
  }
  /* The current tab keeps its black plate; hover just nudges the ink rule. */
  .main-nav__link[aria-current="page"]:hover { background: var(--ink); color: var(--paper); border-bottom-color: var(--orange); }
}
@media (min-width: 941px) and (hover: hover) and (prefers-reduced-motion: reduce) {
  .main-nav__link::before,
  .main-nav__link .main-nav__label { transition: none; }
}
.main-nav__link--mobile { display: none; } /* shown only inside the phone nav panel */
/* The current section is a black plate with a thin red rule under it. */
.main-nav__link[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 2px solid var(--orange);
}

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.header-actions a { text-decoration: none; }

/* The cart is the header's fixed right-hand control on every page: the shop is
   the site's main part, so it never yields its place to a section action. The
   section action ("Ievietot sludinājumu") sits to its left and is the one that
   gives way when the bar gets tight — it moves into the phone nav panel. */
.cart-link { white-space: nowrap; }

.header-actions__secondary { display: none; }
@media (min-width: 1100px) {
  .header-actions__secondary { display: inline-flex; }
}

.account-link {
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 8px 2px;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  border: var(--outline);
  cursor: pointer;
}
.nav-toggle__bars { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor;
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

/* ── Buttons ───────────────────────────────────────────────────────────────*/

/* Buttons read as cut-out stickers: ink outline, hard offset shadow, and the
   shadow collapses on press so the control physically sits down on the page. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: var(--outline);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-text);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--offset-sm);
  transition: background-color .12s ease, color .12s ease, transform .1s ease, box-shadow .1s ease;
}
.btn:hover { background: var(--ink-soft); color: var(--paper); transform: translate(-1px, -1px); box-shadow: var(--offset); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn--orange { background: var(--orange); border-color: var(--ink); color: var(--on-accent); }
.btn--orange:hover { background: var(--orange-dark); border-color: var(--ink); color: var(--on-accent); }
.btn--ghost { background: var(--paper); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--sm { min-height: 36px; padding: 6px 12px; font-size: 11px; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }

.btn--danger { background: var(--paper); border-color: var(--ink); color: var(--error); border-radius: var(--radius-sm); }
.btn--danger:hover { background: var(--error); color: var(--paper); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-style: var(--slant);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .005em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--orange);
  border-bottom: 2px solid var(--orange);
  padding-bottom: 1px;
}
.text-link:hover { color: var(--accent-ink); border-bottom-color: var(--accent-ink); }

@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn:active { transform: none; }
}

/* ── Form controls ─────────────────────────────────────────────────────────*/

.field { display: grid; gap: 4px; }
.field > label,
.label {
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  background: var(--field);
  color: var(--ink);
  border: var(--hairline) solid var(--ink);
  border-radius: var(--radius-sm);
  font-size: 15px;
  appearance: none;
  box-shadow: inset 2px 2px 0 color-mix(in srgb, var(--ink) 8%, transparent);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-soft); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--error);
  border-width: 2px;
}
.select {
  background-image: linear-gradient(45deg, transparent 49%, var(--ink) 50%),
                    linear-gradient(-45deg, transparent 49%, var(--ink) 50%);
  background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-mute); opacity: 1; }

.error-text { color: var(--error); font-size: var(--small); font-weight: 600; }
.hint { color: var(--ink-mute); font-size: var(--small); }

.checkline { display: flex; align-items: flex-start; gap: 9px; font-size: var(--small); }
.checkline input[type="checkbox"], .checkline input[type="radio"] {
  width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); flex: none;
}

.form-grid { display: grid; gap: 14px; }
.form-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-section { border-top: var(--hairline) solid var(--rule); padding-top: 14px; margin-top: 6px; }
.form-section > h3 { margin-bottom: 12px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ── Flash / alerts ────────────────────────────────────────────────────────*/

.flash {
  border: var(--outline);
  border-left: 8px solid var(--ink);
  background: var(--field-strong);
  padding: 10px 14px;
  font-size: 14px;
  margin: 0 0 14px;
  box-shadow: var(--offset-sm);
}
.flash--success { border-left-color: var(--success); }
.flash--error { border-left-color: var(--error); }
.flash--info { border-left-color: var(--orange); }

/* ── Badges and tags (square, inked, never pill-shaped) ────────────────────*/

.tag {
  display: inline-block;
  padding: 2px 7px;
  border: var(--hairline) solid var(--ink);
  background: var(--field-strong);
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tag--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tag--orange { background: var(--orange); color: var(--on-accent); border-color: var(--ink); }
.tag--soft { border-color: var(--rule-soft); background: transparent; color: var(--ink-mute); }
.tag--blue { background: var(--blue); color: var(--on-accent); border-color: var(--ink); }
.tag--amber { background: var(--amber); color: var(--ink); border-color: var(--ink); }

.status { font-size: var(--micro); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.status--draft { color: var(--ink-mute); }
.status--pending { color: var(--amber-ink); }
.status--published { color: var(--success); }
.status--rejected { color: var(--error); }
.status--sold { color: var(--ink); }

/* ── Site footer ───────────────────────────────────────────────────────────*/

.site-footer {
  margin-top: 40px;
  border-top: var(--outline);
  background: var(--paper-deep);
  font-size: var(--small);
}
.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 26px var(--gutter) 34px;
  display: grid;
  gap: 20px;
  grid-template-columns: 1.4fr repeat(3, 1fr);
}
.site-footer h2 { font-size: 15px; margin-bottom: 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__seller {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px var(--gutter);
  border-top: var(--hairline) solid var(--rule-soft);
  color: var(--ink-soft);
  font-size: 13px;
}
.site-footer__bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px var(--gutter) 30px;
  border-top: var(--hairline) solid var(--rule-soft);
  color: var(--ink-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: space-between;
  font-size: var(--micro);
  letter-spacing: .04em;
}

/* ── Utilities ─────────────────────────────────────────────────────────────*/

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.stack { display: grid; gap: 12px; }
.cluster { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; justify-content: space-between; }
.divider { border: 0; border-top: var(--hairline) solid var(--rule-soft); margin: 16px 0; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* ── Responsive shell ──────────────────────────────────────────────────────
   The header collapses into a toggle at 940px; the footer stacks on phones.
   These rules are the only place the header/footer change shape. */

@media (max-width: 940px) {
  /* The header wraps into two rows: wordmark + actions, then the nav panel.
     Without JS the nav is simply visible; with JS it is collapsed. */
  .site-header__inner { flex-wrap: wrap; gap: 0; height: auto; padding-bottom: 0; }
  .site-header__inner > .wordmark { order: 1; height: var(--header-h); }
  .header-actions { order: 3; height: var(--header-h); gap: 6px; margin-left: 0; }
  .header-actions .btn--sm { padding: 8px 10px; font-size: 11px; }
  /* The toggle takes the spare space instead, so the row reads
     wordmark … menu | cart and the cart keeps the right-hand corner. */
  .nav-toggle { order: 2; display: inline-flex; margin-left: auto; margin-right: 6px; }

  .main-nav {
    order: 4;
    flex: 0 0 100%;
    display: grid;
    gap: 0;
    min-width: 0;
    border-top: var(--hairline) solid var(--rule-soft);
  }
  .main-nav[hidden] { display: none; }
  .main-nav__link {
    padding: 13px var(--gutter);
    border-bottom: var(--hairline) solid var(--rule-soft);
    border-left: 4px solid transparent;
    font-size: 14px;
  }
  .main-nav__link[aria-current="page"] { border-left: 4px solid var(--orange); border-bottom: 1px solid var(--rule-soft); }
  .main-nav__link--mobile { display: flex; }

  /* Wordmark and the cart/advert button keep the header usable at 320px. */
  .wordmark { padding-right: 4px; }
  .wordmark__img { height: 26px; }
  .account-link { display: none; } /* the nav panel carries the account entry instead */
}

@media (max-width: 640px) {
  .form-grid--two { grid-template-columns: minmax(0, 1fr); }
  .site-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .site-footer__inner > :first-child { grid-column: 1 / -1; }
  .site-footer__bottom { justify-content: flex-start; }
}

@media (max-width: 380px) {
  .header-actions .btn--sm { padding: 8px; font-size: 10px; letter-spacing: .04em; }
  .wordmark__img { height: 20px; }
}

/* Safety net: nothing may cause a horizontal scrollbar on a narrow viewport.
   Individual components still size themselves; this only clips genuine
   overflow rather than hiding layout mistakes on wide screens. */
@media (max-width: 700px) {
  html, body { overflow-x: hidden; }
  .shell, .site-header__inner, .site-footer__inner, .site-footer__bottom { max-width: 100%; }
  .data-table { font-size: 12.5px; }
  /* iOS Safari zooms the whole page when a focused field's text is under 16 px,
     and does not zoom back out on blur. The wheel's e-mail field and the
     checkout are exactly where that would happen, so on a phone the fields are
     16 px and the layout stops jumping on every tap. */
  .input, .select, .textarea { font-size: 16px; }
}

/* ── Cookie notice ─────────────────────────────────────────────────────────
   A notice, not a consent wall: fixed to the bottom so it never pushes the
   page, inked like everything else, and dismissed with one button. It is
   `hidden` by script after the POST, so no transition is needed for the
   no-JavaScript case. */

.cookie-notice {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--field-strong);
  border-top: var(--outline);
  box-shadow: 0 -4px 0 color-mix(in srgb, var(--ink) 10%, transparent);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
}
.cookie-notice[hidden] { display: none; }
.cookie-notice__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  justify-content: space-between;
}
.cookie-notice__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  max-width: 78ch;
  color: var(--ink);
}
.cookie-notice__text strong { font-weight: 700; }
.cookie-notice form { margin: 0; flex: none; }

@media (max-width: 640px) {
  .cookie-notice { padding: 9px 12px calc(9px + env(safe-area-inset-bottom, 0px)); }
  .cookie-notice__text { font-size: 12.5px; }
  .cookie-notice form, .cookie-notice .btn { width: 100%; }
}

/* Beta strip (config.beta): above the header on every page while Stripe runs on
   test keys. Amber like a work-in-progress tape, readable at phone width. */
.beta-bar { background: var(--amber); color: var(--ink); border-bottom: var(--outline); font-size: 13px; line-height: 1.35; }
.beta-bar__inner {
  max-width: var(--max-width); margin: 0 auto; padding: 6px var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
}
.beta-bar__tag {
  font-family: var(--font-display); font-style: var(--slant); text-transform: uppercase;
  font-size: 15px; letter-spacing: .02em;
}
.beta-bar__card { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-weight: 700; background: var(--field-strong); padding: 0 4px; border: var(--hairline) solid var(--ink); white-space: nowrap; user-select: all; }
.beta-bar__report { margin-left: auto; font-weight: 700; color: var(--ink); white-space: nowrap; }
.beta-bar__report:hover { color: var(--accent-ink); }
@media (max-width: 600px) {
  .beta-bar__hint { display: none; }
  .beta-bar__report { margin-left: 0; }
}
