/* ==========================================================================
   base.css, reset, document defaults, typography
   ========================================================================== */

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

html,
body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd,
ul, ol, fieldset, legend { margin: 0; padding: 0; }

ul[class],
ol[class] { list-style: none; }

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

body {
  min-height: 100dvh;
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-snug);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Stops iOS rubber-banding revealing white behind the dark hero. */
  overscroll-behavior-y: none;
}

/* --- Headings ------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: var(--fw-black);
  line-height: var(--lh-tight);
}

h1 { font-size: var(--fs-h1);  letter-spacing: var(--ls-h1); }
h2 { font-size: var(--fs-h2);  letter-spacing: var(--ls-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4);  letter-spacing: var(--ls-h4); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md);  font-weight: var(--fw-bold); }

p { line-height: var(--lh-normal); text-wrap: pretty; }

small { font-size: var(--fs-meta); }

strong, b { font-weight: var(--fw-bold); }

/* --- Links --------------------------------------------------------------- */

a {
  color: var(--violet);
  font-weight: var(--fw-bold);
  text-decoration: none;
  transition: opacity var(--dur-fast) var(--ease);
}

a:hover { opacity: 0.75; }

a:where(.is-plain) { color: inherit; font-weight: inherit; }

/* --- Media --------------------------------------------------------------- */

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

svg { flex-shrink: 0; }

/* --- Forms --------------------------------------------------------------- */

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

button {
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled { cursor: not-allowed; }

textarea { resize: vertical; }

/* Hide the ugly native number spinners, quantity uses its own stepper. */
input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; }

::placeholder { color: var(--text-soft); opacity: 1; }

/* --- Tables -------------------------------------------------------------- */

table { border-collapse: collapse; border-spacing: 0; width: 100%; }
th { text-align: left; font-weight: var(--fw-bold); }

/* --- Focus --------------------------------------------------------------- */

:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* --- Selection ----------------------------------------------------------- */

::selection {
  background: var(--violet-soft);
  color: var(--violet-deep);
}

/* --- Utilities ----------------------------------------------------------- */

[hidden] { display: none !important; }

.u-hidden { display: none !important; }

.u-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.u-truncate {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.u-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.u-nowrap { white-space: nowrap; }

/* Photo placeholder, every image slot renders this until a real photo lands. */
.u-hatch {
  background: var(--hatch);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
}

.u-hatch--sm { background: var(--hatch-sm); font-size: 8.5px; }

/* --- Motion preferences -------------------------------------------------- */

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

/* --- Print --------------------------------------------------------------- */

@media print {
  .bottom-nav,
  .actionbar,
  .admin__sidebar { display: none !important; }
  body { background: #fff; }
}
