/* Counterhoop storefront redesign — loaded after site.css (2026-11-18).
   Scope: theme tokens + masthead/footer globally, catalog presentation on
   browse corpora. The old site.css remains the structural base. */

:root {
  color-scheme: light;
  --paper: #f6f3ed;
  --paper-raised: #fffdf9;
  --paper-sunken: #efe9df;
  --ink: #1d1915;
  --ink-muted: #6e665c;
  --ink-faint: #9b9185;
  --rule: #ded6c9;
  --rule-strong: #c8bdae;
  --brass: #94631e;
  --brass-weak: #f5e8cd;
  --brass-line: #d1a44f;
  --focus: #a86400;
  --shadow: 0 10px 30px rgba(48, 35, 18, .07);
  --shadow-lift: 0 16px 38px rgba(48, 35, 18, .13);
  --radius: 16px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #14110e;
  --paper-raised: #1d1915;
  --paper-sunken: #0f0c0a;
  --ink: #f6efe3;
  --ink-muted: #b9ad9e;
  --ink-faint: #8d8275;
  --rule: #332b23;
  --rule-strong: #504438;
  --brass: #e2b762;
  --brass-weak: #342a18;
  --brass-line: #c39a45;
  --focus: #f0c778;
  --shadow: 0 10px 30px rgba(0, 0, 0, .28);
  --shadow-lift: 0 16px 38px rgba(0, 0, 0, .4);
}

html { background: var(--paper); }
body { font-size: 15px; line-height: 1.55; }

/* ── masthead ───────────────────────────────────────────────────────────── */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper-raised);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
}
.masthead-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "brand nav theme cart" "search search search search";
  align-items: center;
  gap: 10px 22px;
  max-width: 1500px;
  padding: 12px 28px 14px;
}
.wordmark { grid-area: brand; }
.wordmark .rule { display: none; }
.brand-mark {
  display: block;
  width: 210px;
  height: 76px;
  max-width: 34vw;
  background-color: var(--ink);
  -webkit-mask: url("/assets/brand/counterhoop-script.svg") center / contain no-repeat;
  mask: url("/assets/brand/counterhoop-script.svg") center / contain no-repeat;
}
html[data-theme="dark"] .brand-mark { background-color: var(--brass-line); }

.corpus {
  grid-area: nav;
  display: flex;
  justify-self: center;
  gap: 4px;
  border: 0;
  overflow: visible;
}
.corpus a {
  min-height: 38px;
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.corpus a + a { border-left: 0; }
.corpus a:hover { background: var(--paper-sunken); color: var(--ink); }
.corpus a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}
.corpus a .n { color: var(--ink-faint); font-size: 11.5px; }
.corpus a[aria-current="page"] .n { color: var(--brass-line); }

.masthead-inner > .search {
  grid-area: search;
  order: initial;
  flex-basis: auto;
  min-height: 42px;
  border-radius: 999px;
  border-color: var(--rule);
  background: var(--paper-sunken);
  padding: 0 14px;
}
.search input { font-size: 14px; }
.search kbd { border-color: var(--rule-strong); }

.cart-link {
  grid-area: cart;
  justify-self: end;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: var(--paper-raised);
  font-family: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.cart-link:hover { border-color: var(--brass-line); color: var(--brass); }
.cart-link .n { color: var(--brass); }

.theme-toggle {
  grid-area: theme;
  justify-self: end;
  width: 38px;
  height: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: var(--paper-raised);
  color: var(--ink);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}
.theme-toggle:hover { border-color: var(--brass-line); color: var(--brass); }
.theme-icon { font-family: Georgia, serif; transform: translateY(-1px); }

/* ── catalog shell ──────────────────────────────────────────────────────── */

body[data-corpus="shop"] .shell,
body[data-corpus="new"] .shell,
body[data-corpus="archive"] .shell {
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 28px;
  max-width: 1500px;
  padding: 24px 28px 64px;
}

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

/* image-only hero band; no marketing paragraph, no "In stock", no loader */
.hero-band {
  position: relative;
  height: 208px;
  margin: 0 0 22px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-sunken);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.hero-band picture, .hero-band img {
  display: block;
  width: 100%; height: 100%;
}
.hero-band img {
  object-fit: cover;
  object-position: 50% 42%;
}
.hero-band::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(18, 13, 8, .52), rgba(18, 13, 8, .06) 62%, rgba(18, 13, 8, .22));
  pointer-events: none;
}
.hero-location {
  position: absolute;
  left: 20px; bottom: 18px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 249, .92);
  color: #241d15;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
html[data-theme="dark"] .hero-location {
  background: rgba(29, 25, 21, .9);
  color: #f6efe3;
}
.hero-location::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #b58332;
}

/* ── filter rail ────────────────────────────────────────────────────────── */

.rail {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 128px);
  padding: 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  box-shadow: var(--shadow);
  overflow: hidden auto;
}
.rail-body { position: relative; z-index: 1; }
.rail-body::before {
  content: "";
  position: absolute;
  inset: -18px -18px auto -18px;
  height: 120px;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255, 253, 249, .92), rgba(255, 253, 249, 0)),
              url("/assets/brand/onesheet-detail.webp") center 42% / cover no-repeat;
  opacity: .34;
  pointer-events: none;
}
html[data-theme="dark"] .rail-body::before {
  background: linear-gradient(180deg, rgba(29, 25, 21, .94), rgba(29, 25, 21, 0)),
              url("/assets/brand/onesheet-detail.webp") center 42% / cover no-repeat;
}
.rail-head { margin: 12px 0 14px; }
.rail-head h2 {
  font-family: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}
fieldset.facet { border-top: 1px solid var(--rule); padding: 14px 0 12px; }
fieldset.facet:first-of-type { border-top: 0; padding-top: 0; }
fieldset.facet legend {
  font-family: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.facet-list { max-height: 240px; margin: 0 -6px; padding: 0 6px; }
.facet-list.tall { max-height: 320px; }
#facet-type, #facet-make, #facet-grade, #facet-price, #facet-prov, #facet-era { min-height: 0; }
.opt {
  min-height: 31px;
  padding: 5px 7px;
  border-radius: 8px;
  font-size: 13px;
}
.opt:hover { background: var(--paper-sunken); }
.opt .count {
  font-family: var(--text);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--paper-sunken);
  color: var(--ink-muted);
}
.opt input:checked + .label { color: var(--brass); font-weight: 700; }

/* ── toolbar + grid ─────────────────────────────────────────────────────── */

.toolbar {
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--rule);
}
.count-line { font-family: var(--text); font-size: 13px; color: var(--ink-muted); }
.count-line b { font-size: 15px; }
.sort {
  border-radius: 999px;
  border-color: var(--rule);
  background: var(--paper-raised);
  font-family: var(--text);
  font-size: 13px;
  padding: 0 12px;
}
.chip { border-radius: 999px; font-family: var(--text); font-size: 12px; }

.grid-window {
  --card-min: 170px;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
}
.card {
  border-radius: var(--radius);
  border-color: var(--rule);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--brass-line);
  box-shadow: var(--shadow-lift);
}
.thumb { border-bottom: 0; }
.stamp {
  border-radius: 0 10px 0 0;
  border-top-right-radius: 10px;
  background: var(--paper-raised);
}
.card-body { padding: 13px 14px 8px; gap: 4px; }
.make { font-family: var(--text); font-size: 10.5px; letter-spacing: .08em; }
.title { font-size: 13.5px; line-height: 1.4; }
.leaf { font-size: 11.5px; }
.card-foot { padding-top: 8px; }
.card-body .price.big { font-size: 18px; color: var(--brass); }
.card-actions { padding: 4px 14px 14px; }
.card-buy, .card-add {
  border-radius: 10px;
  font-family: var(--text);
  font-size: 11.5px;
  letter-spacing: .03em;
  text-transform: none;
}
.card-buy { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card-buy:hover { background: var(--brass); border-color: var(--brass); color: #fff; }
.card-add:hover { border-color: var(--brass-line); color: var(--brass); }

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

.foot {
  display: flex;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 48px;
  padding: 24px 20px 36px;
  border-top: 1px solid var(--rule);
  font-family: var(--text);
  font-size: 12.5px;
  color: var(--ink-faint);
}
.foot-seo { display: none; }
.foot a { color: var(--ink-muted); text-decoration: none; }
.foot a:hover { color: var(--brass); text-decoration: underline; }
.foot-location { color: var(--ink-muted); font-weight: 600; }

/* ── responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .masthead-inner { grid-template-columns: auto 1fr auto auto; padding: 12px 20px; }
  .corpus { justify-self: end; }
  .corpus a { padding: 8px 10px; font-size: 12.5px; }
}

@media (max-width: 1024px) {
  body[data-corpus="shop"] .shell,
  body[data-corpus="new"] .shell,
  body[data-corpus="archive"] .shell { grid-template-columns: 1fr; }
  .rail {
    top: auto;
    max-height: none;
    padding: 14px;
    border-radius: 14px;
  }
  .rail[data-collapsed="true"] .rail-body { display: none; }
  .rail-toggle {
    display: flex;
    width: 100%;
    font-family: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    min-height: 38px;
  }
  .facet-list { max-height: 180px; }
}

@media (max-width: 700px) {
  .masthead-inner {
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas: "brand nav theme cart" "search search search search";
    padding: 10px 14px 12px;
    gap: 8px 10px;
  }
  .brand-mark { width: 130px; height: 48px; max-width: 36vw; }
  .corpus { justify-self: end; overflow-x: auto; }
  .corpus a { padding: 7px 8px; font-size: 11.5px; }
  .corpus a .n { display: none; }
  .cart-link { padding: 7px 9px; font-size: 12px; }
  .theme-toggle { width: 34px; height: 34px; min-height: 34px; font-size: 15px; }
  body[data-corpus="shop"] .shell,
  body[data-corpus="new"] .shell,
  body[data-corpus="archive"] .shell { padding: 16px 14px 48px; gap: 16px; }
  /* Mobile skips the photographic band entirely: the first product photo is
     the LCP, so the grid starts immediately instead of waiting on a banner. */
  .hero-band { display: none; }
  .hero-location { display: none; }
  .grid-window { gap: 12px; }
  .card-body { padding: 10px 10px 6px; }
  .card-actions { padding: 2px 10px 10px; }
  .card-buy, .card-add { min-height: 38px; padding: 7px 6px; }
  .title { font-size: 12.5px; }
  .foot { font-size: 11.5px; }
}
