/*
  Jon Milton Music site styles: the "Blue hour" look.

  This is XpressiVox's look turned inside out, so the two sites read as
  siblings. XpressiVox is warm parchment with black ink and one blue accent.
  Here its blue (darkened) is the page, its parchment is the text, and warm
  brass is the accent. The typefaces, square corners, hairline rules and the
  five staff lines under the header are the same. The mark's two chevrons
  point outward here; on XpressiVox they point inward.

  To restyle the whole site, change the values in :root below.

  Contents: 1. Tokens  2. Page basics  3. Header and menu  4. Text
            5. Buttons  6. Boxes  7. Forms  8. Store  9. The XpressiVox band
            10. Footer
*/

/* 1. Tokens ------------------------------------------------------------- */

:root {
  --page: #17284a;
  --raised: #1f3360;
  --sunk: #12203c;
  --text: #f2e9d6;
  --soft: #d9d2c0;
  --muted: #b8b6ad;
  --line: #364870;
  --line-strong: #8f9bb5;
  --accent: #e3b96b;
  --accent-hover: #f2d59a;
  --on-accent: #17284a;
  --focus: #f2d59a;

  /* Status colours, each with a soft background */
  --ok: #9fd8ae;
  --ok-soft: #1c3d3a;
  --warn: #f0cd84;
  --warn-soft: #3d3524;
  --bad: #f4a9a2;
  --bad-soft: #472a36;

  /* XpressiVox's own colours, for the band that links across to it */
  --xv-paper: #f2e9d6;
  --xv-ink: #1a1916;
  --xv-muted: #5a554a;
  --xv-line: #d3c5a8;
  --xv-accent: #27477f;
  --xv-on-accent: #fbf5e8;

  --font-body: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-head: Baskerville, "Baskerville Old Face", "Libre Baskerville", "Hoefler Text", Garamond, "Times New Roman", serif;

  --frame: 980px;
  --measure: 40rem;
  --pad: clamp(16px, 4.5vw, 28px);
  --gap: clamp(14px, 3.2vw, 22px);
  color-scheme: dark;
}

/* 2. Page basics -------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; font-size: 17.5px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
}

.wrap { width: 100%; max-width: var(--frame); margin: 0 auto; padding: 0 var(--pad); }

img, svg { max-width: 100%; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip {
  position: absolute; left: -999px; top: 0.5rem; z-index: 10;
  background: var(--raised); color: var(--text);
  padding: 0.5rem 0.75rem; border: 2px solid var(--focus);
}
.skip:focus { left: 0.5rem; }

/* 3. Header and menu ----------------------------------------------------- */

.site-header .bar {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 0 0.9rem; padding-top: 1.5rem;
}

.brand {
  display: inline-flex; align-items: baseline; gap: 0.6rem;
  font-family: var(--font-head); font-size: 1.7rem; line-height: 1;
  color: var(--text); text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand .mark { flex: none; align-self: center; height: 34px; width: auto; }
.brand .wordmark { white-space: nowrap; }

.site-header .tagline { margin: 0; color: var(--muted); font-style: italic; font-size: 0.92rem; line-height: 1.2; }

.site-nav { flex: 0 0 100%; margin-top: 0.8rem; }

/* The five staff lines */
.site-nav::before {
  content: ""; display: block; height: 9px; opacity: 0.5;
  background: repeating-linear-gradient(to bottom, var(--text) 0 1px, transparent 1px 2px);
}

.site-nav ul {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 1.6rem;
  margin: 0; padding: 0.35rem 0 0; list-style: none;
  border-bottom: 1px solid var(--line);
}
.site-nav li { margin: 0 0 -1px; }
.site-nav a, .site-nav button {
  display: block; color: var(--text); text-decoration: none;
  font-family: var(--font-head); font-size: 1.08rem; line-height: 1.3;
  padding: 0.5rem 0.1rem; border: 0; border-bottom: 2px solid transparent;
  background: none; cursor: pointer;
}
.site-nav a:hover, .site-nav button:hover { border-bottom-color: var(--line-strong); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.site-nav li.nav-account { margin-left: auto; }
.site-nav li.nav-account ~ li.nav-account { margin-left: 0; }
.site-nav li.nav-account form { margin: 0; }
.site-nav li.nav-account > a, .site-nav li.nav-account button { color: var(--accent); }

/* 4. Text ---------------------------------------------------------------- */

main { flex: 1 0 auto; padding: 2.25rem 0 3.5rem; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 400; line-height: 1.15; margin: 2rem 0 0.75rem; }
h1 { font-size: clamp(1.9rem, 5vw, 2.5rem); margin-top: 0.25rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.22rem; line-height: 1.25; }

p, ul, ol, dl { margin: 0 0 1rem; }
main :where(h1, h2, h3, p, ul, ol, dl) { max-width: var(--measure); }

.lead { font-size: 1.12rem; color: var(--soft); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.eyebrow { margin: 0 0 0.4rem; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.crumbs { font-size: 0.9rem; color: var(--muted); }
.narrow { max-width: 30rem; }
.rule-heading { border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; max-width: none; }

/* 5. Buttons ------------------------------------------------------------- */

.button {
  display: inline-block; min-height: 44px; padding: 0.6rem 1.25rem;
  background: var(--accent); color: var(--on-accent);
  border: 1px solid var(--accent); border-radius: 0;
  font-family: var(--font-head); font-size: 1.08rem; line-height: 1.3;
  text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.button.secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.button.secondary:hover { background: var(--raised); color: var(--text); }
.button.wide { display: block; width: 100%; text-align: center; font-size: 1.2rem; }
.button[disabled] { opacity: 0.55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.25rem 0; }

/* 6. Boxes --------------------------------------------------------------- */

.card { background: var(--raised); border: 1px solid var(--line); padding: clamp(16px, 4vw, 24px); }
.card > :last-child { margin-bottom: 0; }
.card > :first-child { margin-top: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }

.notice { border: 1px solid var(--line-strong); background: var(--raised); padding: 0.8rem 1rem; margin: 0 0 1.25rem; }
.notice > :last-child { margin-bottom: 0; }
.notice.ok { border-color: var(--ok); background: var(--ok-soft); }
.notice.warn { border-color: var(--warn); background: var(--warn-soft); }
.notice.bad { border-color: var(--bad); background: var(--bad-soft); }

/* 7. Forms --------------------------------------------------------------- */

.form .field { margin: 0 0 1rem; }
.form label { display: block; margin: 0 0 0.3rem; }
.form input[type="text"], .form input[type="email"], .form input[type="password"] {
  width: 100%; min-height: 44px; padding: 0.5rem 0.65rem;
  background: var(--sunk); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 0;
  font: inherit;
}
.form .help { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.9rem; }
.errorlist { margin: 0.35rem 0 0; padding: 0; list-style: none; color: var(--bad); }

/* 8. Store --------------------------------------------------------------- */

.piece-card h2, .piece-card h3 { margin-top: 0; font-size: 1.3rem; }
.piece-card h2 a, .piece-card h3 a { color: var(--text); }
.piece-card .price { color: var(--soft); }

/* The category links above the list of pieces. */
.filters { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 1.25rem 0 1.5rem; }
.filters a {
  display: inline-block; padding: 6px 14px;
  border: 1px solid var(--line-strong); color: var(--text); text-decoration: none;
}
.filters a:hover { border-color: var(--accent); color: var(--accent-hover); }
.filters a[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.piece-layout { display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 40px); align-items: flex-start; margin-top: 1.75rem; }
.piece-layout > * { flex: 1 1 340px; min-width: 0; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1.25rem; padding: 0.9rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.licences { border: 0; padding: 0; margin: 0 0 1rem; }
.licences legend { font-family: var(--font-head); font-size: 1.45rem; padding: 0; margin-bottom: 0.75rem; }
.licence {
  display: flex; align-items: center; gap: 0.8rem; min-height: 44px;
  padding: 0.8rem 1rem; margin-bottom: 0.7rem;
  background: var(--raised); border: 1px solid var(--line); cursor: pointer;
}
.licence:has(input:checked) { border-color: var(--accent); }
.licence input { accent-color: var(--accent); width: 20px; height: 20px; margin: 0; flex: none; }
.licence .what { flex: 1 1 auto; }
.licence .name { display: block; font-family: var(--font-head); font-size: 1.15rem; }
.licence .about { display: block; color: var(--muted); font-size: 0.9rem; }
.licence .price { font-size: 1.15rem; white-space: nowrap; }

.order-facts { margin-top: 1rem; }

/* 9. The XpressiVox band --------------------------------------------------
   Drawn in XpressiVox's own colours, as a window onto the sister site. */

.xv-band {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.1rem 1.8rem;
  margin-top: 3rem; padding: clamp(18px, 4vw, 28px);
  background: var(--xv-paper); color: var(--xv-ink); border: 1px solid var(--xv-line);
}
.xv-band .mark { flex: none; height: 52px; width: auto; color: var(--xv-ink); }
.xv-band .words { flex: 999 1 300px; min-width: 0; }
.xv-band h2 { margin: 0 0 0.3rem; font-size: 1.5rem; }
.xv-band p { margin: 0; color: var(--xv-muted); }
.xv-band .button { background: var(--xv-accent); border-color: var(--xv-accent); color: var(--xv-on-accent); }
.xv-band .button:hover { background: #1c3563; border-color: #1c3563; color: var(--xv-on-accent); }

/* 10. Footer ------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--line); padding: 1.4rem 0 2.2rem; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 1.6rem; }
.site-footer p { margin: 0; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.35rem 1.3rem; margin: 0; padding: 0; list-style: none; }
