/* ==========================================================================
   Base: reset-lite, typography, layout primitives, a11y.
   ========================================================================== */

/* Druk Wide Bold — the WOBBI wordmark face (Commercial Type, licensed webfont).
   Self-hosted, which the CSP already permits via font-src 'self'. Drop the two files into
   assets/fonts/ and the wordmark picks them up with no other change: until they exist the
   src fails, this @font-face never resolves, and --font-wordmark falls through to Archivo
   Expanded Black — the stand-in with the same wide, ultra-bold proportions. See
   assets/fonts/README.md. size-adjust is deliberately not set: it would need re-measuring
   against whichever fallback is in play, and the wordmark is the only consumer. */
@font-face {
  font-family: "Druk Wide";
  src: url("../fonts/druk-wide-bold.woff2") format("woff2"),
       url("../fonts/druk-wide-bold.woff")  format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  margin: 0 0 var(--sp-4);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(var(--text-2xl), 5vw, var(--text-3xl)); }
h2 { font-size: clamp(var(--text-xl), 3.5vw, var(--text-2xl)); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

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

ul, ol { padding-left: 1.2em; margin: 0 0 var(--sp-4); }

small, .text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-6) 0; }
/* ----- Long-form prose: calmer type (policies + articles) ----- */
.policy-body, .article-body { overflow-wrap: break-word; }

/* Legal pages keep the justified block: it reads as a formal document, and the copy is short
   enough that the stretched word-spacing never runs for long. */
.policy-body {
  text-align: justify;
  hyphens: auto; -webkit-hyphens: auto;
}

/* Articles read ragged-right. Justification stretches word-spacing to force a hard right edge
   and turns on mid-word breaks to do it - that is where "dedic-ated" came from. Left-aligned,
   unhyphenated text lets each sentence run to its natural length; text-wrap: pretty keeps the
   last line of a paragraph off a lone orphan word. */
.article-body {
  text-align: left;
  hyphens: manual; -webkit-hyphens: manual;
  text-wrap: pretty;
}
/* Policy/legal pages: smaller, professional — dial back the "WOAH" headings */
.policy-page h1 {
  font-size: clamp(var(--text-lg), 3vw, var(--text-xl));
  letter-spacing: -0.005em; margin-bottom: var(--sp-2);
}
.policy-body { font-size: 0.925rem; line-height: 1.75; }
.policy-body p, .policy-body li { color: var(--ink-soft); }
.policy-body h2 {
  font-size: var(--text-md); font-weight: 700; color: var(--ink);
  margin-top: var(--sp-6); margin-bottom: var(--sp-3);
}
.policy-body h3 { font-size: var(--text-base); color: var(--ink); margin-top: var(--sp-5); }
.policy-body ul, .policy-body ol { margin-bottom: var(--sp-4); }
.policy-body li { margin-bottom: var(--sp-2); }
.policy-body li:last-child { margin-bottom: 0; }
/* Friendly intro line + collapsible full legal text (keeps the page from reading like a contract) */
.policy-body .lead {
  font-size: var(--text-md); line-height: 1.6; color: var(--ink); text-align: left;
  margin-bottom: var(--sp-4);
}
.policy-body details.legal-full {
  margin-top: var(--sp-6); border-top: 1px solid var(--line); padding-top: var(--sp-4);
}
.policy-body details.legal-full > summary {
  cursor: pointer; font-family: var(--font-display); font-weight: 700;
  color: var(--ink); font-size: var(--text-base); list-style: none; padding: var(--sp-2) 0;
}
.policy-body details.legal-full > summary::-webkit-details-marker { display: none; }
.policy-body details.legal-full > summary::before { content: "▸ "; color: var(--ink-faint); }
.policy-body details.legal-full[open] > summary::before { content: "▾ "; }
.policy-body details.legal-full > summary:hover { color: var(--ink); }
.policy-body details.legal-full h3 { font-size: var(--text-base); margin-top: var(--sp-5); }
.policy-body details.legal-full > p:first-of-type { margin-top: var(--sp-3); }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: var(--sp-3); border-bottom: 1px solid var(--line); }

/* Any content table scrolls horizontally on small screens instead of clipping/cramming. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: var(--sp-4); }
@media (max-width: 700px) {
  .article-body table, .policy-body table, .accordion-body table, .table-wrap table {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; max-width: 100%;
  }
}

/* ----- Layout primitives ----- */
/* Fluid side padding: stays at --sp-4 on phones (current behaviour), grows to ~4vw
   on desktop so content runs to ~92% of the viewport before the max-width caps in. */
.container { max-width: var(--container); margin-inline: auto; padding-inline: max(var(--sp-4), 4vw); }
.container-wide { max-width: var(--container-wide); margin-inline: auto; padding-inline: max(var(--sp-4), 4vw); }
.section { padding-block: var(--sp-8); }
.section-tight { padding-block: var(--sp-6); }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.stack > * + * { margin-top: var(--sp-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.center { text-align: center; }

/* ----- Accessibility ----- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: var(--sp-3) var(--sp-4);
  z-index: 200; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

/* Responsive images are wrapped in <picture> by helpers.php picture(). The wrapper is a new
   element in the box tree, and several product images are flex or grid children whose layout
   assumed the <img> was the direct child. display:contents removes the wrapper from layout
   entirely, so the <img> lays out exactly as it did before the wrapper existed.
   Every rule that targets these images keeps applying, because the classes stay on the <img>
   and none of those selectors use a child combinator. (The pre-launch teaser blur, removed
   2026-08-28, relied on exactly that: it matched img.pouch-img and .pdp-media img through
   the wrapper.) */
picture {
    display: contents;
}
