/* Maul Haven brand: gold #ba9442 · black #000000 · white #ffffff · crimson #ab0633
   Contrast rules: gold text only on dark backgrounds (7.4:1 on black, 2.8:1 on white).
   Crimson text only on white (7.5:1; 2.8:1 on black). White text on crimson is 7.5:1. */
:root {
  --mh-gold: #ba9442;
  --mh-black: #000000;
  --mh-white: #ffffff;
  --mh-crimson: #ab0633;
  --mh-crimson-dark: #8a0529;

  --bg: var(--mh-white);
  --surface: var(--mh-white);
  --ink: #111111;
  --muted: #555555;
  --line: #e4e0d8;
  --link: var(--mh-crimson);
  --img-ph: #efece6;
  --radius: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Arial Black", "Segoe UI Black", Impact, var(--font);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--mh-black); --surface: #111111; --ink: var(--mh-white); --muted: #b5b5b5;
    --line: #2a2a2a; --link: var(--mh-gold); --img-ph: #1a1a1a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.55; }
a { color: var(--link); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--mh-gold); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--mh-white); color: var(--mh-black); padding: 8px; z-index: 10; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.site-header { background: var(--mh-black); color: var(--mh-white); border-bottom: 3px solid var(--mh-gold); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 8px 16px; flex-wrap: wrap; }
.brand img { height: 76px; width: auto; }
@media (max-width: 560px) { .brand img { height: 60px; } }
.nav { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--mh-white); text-decoration: none; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .9rem; }
.nav a:hover { color: var(--mh-gold); }
.badge { background: var(--mh-crimson); color: var(--mh-white); border-radius: 999px; padding: 1px 8px; font-size: .75rem; }

/* Hero (full-bleed black band) */
.hero { overflow: hidden; background: var(--mh-black); color: var(--mh-white); border-bottom: 3px solid var(--mh-crimson); }
.hero-row { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center; padding: 48px 16px; }
@media (min-width: 820px) { .hero-row { grid-template-columns: 1.4fr 1fr; padding: 64px 16px; } }
.hero-mark img { width: min(300px, 45vw); margin: 0 auto; }
@media (max-width: 819px) { .hero-mark { display: none; } .hero-row { padding: 28px 16px 40px; } }
.eyebrow { text-transform: uppercase; letter-spacing: .25em; font-size: .8rem; color: var(--mh-gold); font-weight: 700; margin: 0; }
.eyebrow-brand { display: none; }
/* Phones/tablets: no big emblem; the eyebrow becomes "MAUL HAVEN – RUGBY APPAREL"
   on one line, sized to the screen (refined by js/fit-text.js). */
@media (max-width: 819px) {
  .eyebrow-brand { display: inline; }
  .hero .eyebrow[data-fit] { white-space: nowrap; letter-spacing: .12em; font-size: min(30px, calc((100vw - 32px) / 22)); margin-bottom: .35em; }
}
.hero h1 { font-family: var(--display); font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: 1; margin: .2em 0; text-transform: uppercase; color: var(--mh-white); }
.hero-copy { min-width: 0; }
/* Phones/tablets: keep the tagline on ONE line. The vw size is a close first
   guess (no flash of a wrapped line); js/fit-text.js then measures the real
   rendered width and fine-tunes it, since fonts differ between devices. */
@media (max-width: 819px) {
  .hero h1[data-fit] { white-space: nowrap; font-size: calc((100vw - 32px) / 13); }
}
.lede { font-size: 1.15rem; max-width: 40ch; color: #d6d6d6; }

main.wrap { padding-top: 32px; padding-bottom: 56px; min-height: 50vh; }
.page-title, .section-title { font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; }
.section-title { border-left: 6px solid var(--mh-crimson); padding-left: 12px; }

/* Buttons */
.btn, .auth button, .auth input[type=submit] {
  display: inline-block; background: var(--mh-crimson); color: var(--mh-white); border: 0;
  border-radius: var(--radius); padding: 12px 24px; font-weight: 800; font-size: 1rem;
  text-transform: uppercase; letter-spacing: .06em; text-decoration: none; cursor: pointer;
}
.btn:hover, .auth button:hover { background: var(--mh-crimson-dark); }
.btn-link { background: none; border: 0; color: var(--link); cursor: pointer; font: inherit; text-decoration: underline; }
.muted { color: var(--muted); }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr 1fr; gap: 12px; } .card { padding: 8px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s; }
.card:hover { border-color: var(--mh-gold); }
.card img, .img-ph { aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: var(--img-ph); width: 100%; }
.card-title { font-weight: 800; }
.price { color: var(--muted); }

/* Product detail */
.product { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 820px) { .product { grid-template-columns: 1.1fr 1fr; } }
.gallery { display: grid; gap: 12px; }
.gallery img { border-radius: var(--radius); background: var(--img-ph); }
.details h1 { font-family: var(--display); text-transform: uppercase; line-height: 1.1; }
.buy { display: grid; gap: 8px; max-width: 360px; margin: 16px 0 24px; }
select, input[type=number], input[type=email], input[type=password], input[type=text] {
  font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); width: 100%;
}

/* Panels / account pages */
.panel { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--mh-gold); border-radius: var(--radius); padding: 24px; }
.auth { max-width: 520px; }
.auth form p, .auth form div { margin-bottom: 12px; }
/* Authenticator QR code: allauth draws black modules on a transparent SVG,
   which vanishes on the dark panel. Phones need dark-on-light with a quiet zone. */
.auth img[src^="data:image/svg+xml"] {
  background: #ffffff; padding: 16px; border-radius: var(--radius);
  width: 240px; max-width: 100%; height: auto; image-rendering: pixelated; margin: 8px 0 16px;
}
.subnav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; font-weight: 700; }
.prose { max-width: 70ch; }

/* Tables */
table.cart { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); margin-bottom: 16px; }
.cart thead th { background: var(--mh-black); color: var(--mh-white); text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; }
.cart th, .cart td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cart .num { text-align: right; }
.qty { display: flex; gap: 8px; align-items: center; }
.qty input { width: 72px; }
@media (max-width: 560px) { .cart th:nth-child(2), .cart td:nth-child(2) { display: none; } }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.msg { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); border-left-width: 6px; background: var(--surface); margin-bottom: 8px; }
.msg-error { border-left-color: var(--mh-crimson); }
.msg-success { border-left-color: #2e7d32; }
.msg-warning, .msg-info { border-left-color: var(--mh-gold); }

/* Footer */
.site-footer { background: var(--mh-black); color: #cfcfcf; padding: 24px 0; border-top: 3px solid var(--mh-gold); }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { width: 40px; height: auto; }
.site-footer p { margin: 0; }
.site-footer nav a { color: var(--mh-gold); margin-right: 16px; }
