/* Math Kangaroo shirt shop. Mobile first; desktop from 1024px. */

/* ---------- fonts (self-hosted, OFL; licenses in /assets/fonts) ---------- */
@font-face {
  font-family: "DM Sans";
  src: url("/mathkangaroo/assets/fonts/dm-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/mathkangaroo/assets/fonts/dm-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/mathkangaroo/assets/fonts/dm-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/mathkangaroo/assets/fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/mathkangaroo/assets/fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- test shop notice ---------- */
.test-notice {
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
  padding: 10px 0;
  background: #FFF4DD;
  color: #382A12;
  border-bottom: 2px solid #8A6424;
  font-size: 16px;
  line-height: 1.5;
}
.test-notice strong { font-weight: 700; }

/* ---------- tokens ---------- */
:root {
  --green: #14532D;
  --green-hover: #0E3D21;
  --ground: #F1F6F2;
  --ink: #13241A;
  --muted: #44574B;
  --hero-muted: #D5E8DB;
  --divider: #DCE6DE;
  --white: #FFFFFF;
  --art-green: #30A150; /* background of the art closeup, used when it is shown whole */

  --radius-card: 16px;
  --font-head: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --focus: var(--green);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--font-head); line-height: 1.1; font-weight: 700; text-wrap: balance; }
.nobr { white-space: nowrap; }
p { margin: 0; }
a { color: var(--green); text-underline-offset: 3px; }
button { font: inherit; }

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

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

.icon { flex-shrink: 0; }

.wrap {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- hero and brand (shared) ---------- */
.hero {
  --focus: var(--white);
  background: var(--green);
  color: var(--white);
}
.hero a { color: var(--white); }
.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 24px;
  padding-bottom: 56px;
}
.brand {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.brand-logo {
  width: 150px; height: 150px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--white);
  display: grid;
  place-items: center;
}
.brand-logo img { width: 138px; height: 138px; }
.brand-text { display: flex; flex-direction: column; gap: 12px; }
.brand-name { font-size: 39px; line-height: 1.1; font-weight: 700; }
.brand-sub { font-size: 18px; line-height: 1.3; color: var(--hero-muted); }

.hero h1 { margin-top: 8px; font-size: 38px; line-height: 1.05; }
.hero-sub { font-size: 17px; line-height: 1.5; color: var(--hero-muted); }

.photo-caption { font-size: 13px; line-height: 1.4; color: var(--muted); }
.hero .photo-caption { color: var(--hero-muted); }

/* ---------- sheet: the light panel under the hero ---------- */
.sheet {
  position: relative;
  flex: 1 0 auto;
  margin-top: -28px;
  padding-top: 24px;
  background: var(--ground);
  border-radius: 28px 28px 0 0;
}
.sheet .wrap { padding: 0 16px; }

.card {
  background: var(--white);
  border-radius: var(--radius-card);
}

/* ---------- buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-hover); }
.btn-primary:disabled {
  background: var(--divider);
  color: var(--muted);
  cursor: not-allowed;
}
.btn-primary[aria-busy="true"]:disabled { background: var(--green); color: var(--white); cursor: progress; opacity: .85; }

/* ---------- footer (shared) ---------- */
.site-footer {
  --focus: var(--white);
  background: var(--green);
  color: var(--white);
  padding: 28px 0 32px;
  font-size: 15px;
  line-height: 1.5;
}
.site-footer a { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.site-footer p { margin: 0; }
.footer-inner { display: flex; flex-direction: column; gap: 18px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-logo { flex: none; width: 37px; height: 56px; }
@media (min-width: 1024px) {
  .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; gap: 32px; }
}

/* ---------- home ---------- */
.hero-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1400 / 1360;
  border-radius: 16px;
}
.hero-figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }

.choices { display: grid; gap: 14px; }
.choice { display: flex; flex-direction: column; overflow: hidden; }
.choice-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  /* The photos' backgrounds are 253-254, not 255; lift them to pure white so no edge shows on the white card. */
  filter: brightness(1.02);
}
.choice .photo-caption { padding: 8px 16px 0; }
.choice-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.choice-head { display: flex; flex-direction: column; gap: 6px; }
.choice h2 { font-size: 28px; }
.choice-meta { font-size: 17px; color: var(--muted); }
.pick-line {
  margin: 20px 0 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  text-align: center;
}
.family-note {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.ship-note {
  margin: 12px 0 36px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
  text-align: center;
}

/* ---------- tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  flex: 1 1 0;
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 8px;
  border: 2px solid var(--white);
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}
.hero .tab { color: var(--white); }
.hero .tab:hover { background: rgba(255, 255, 255, .14); }
.hero .tab[aria-current="page"] { background: var(--white); color: var(--green); }

/* ---------- gallery ---------- */
.hero-shop { display: flex; flex-direction: column; gap: 18px; }
.hero-text { display: flex; flex-direction: column; gap: 18px; }

.gallery-block { display: flex; flex-direction: column; gap: 8px; }
.gallery { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 350px; }
.gallery-main {
  width: 100%;
  aspect-ratio: 350 / 440;
  border-radius: 16px;
  overflow: hidden;
  background: var(--white);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.gallery-main[data-fit="contain"] img { object-fit: contain; object-position: center; }
.gallery-main[data-fit="art"] { background: var(--art-green); }
.gallery-main[data-fit="art"] img { object-fit: contain; object-position: center; }

.thumbs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  cursor: pointer;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.thumb[data-fit="art"] img, .thumb[data-fit="contain"] img { object-position: center; }
.thumb:hover img { opacity: .9; }

/* ---------- shop: sizes and order ---------- */
.shop-grid { display: grid; gap: 12px; }
.sizes, .order { padding: 16px; }
.sizes h2 { font-size: 22px; margin-bottom: 6px; }
.order h2 { font-size: 22px; margin-bottom: 4px; }

.size-list { list-style: none; margin: 0; padding: 0; }
.size-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--divider);
}
.size-text { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.size-name { font-size: 17px; font-weight: 500; }
.size-price { font-size: 15px; color: var(--muted); }
.size-loading, .size-error { padding: 12px 0; color: var(--muted); border-top: 1px solid var(--divider); }

.stepper { display: flex; align-items: center; gap: 8px; }
.step {
  width: 44px; height: 44px;
  min-width: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid var(--green);
  border-radius: 12px;
  cursor: pointer;
}
.step-minus { background: var(--white); color: var(--green); }
.step-plus { background: var(--green); color: var(--white); }
.step-minus:hover { background: var(--ground); }
.step-plus:hover { background: var(--green-hover); border-color: var(--green-hover); }
.step[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.step-minus[aria-disabled="true"]:hover { background: var(--white); }
.step-plus[aria-disabled="true"]:hover { background: var(--green); border-color: var(--green); }
.qty {
  width: 32px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cap-note { margin-top: 10px; font-size: 15px; color: var(--muted); }

.family-card {
  margin-top: 14px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--ground);
  display: flex;
  flex-direction: column;
}
.family-card img { width: 100%; height: auto; aspect-ratio: 3 / 2; }
.family-card .photo-caption { padding: 8px 16px 0; }
.family-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.family-title { font-size: 17px; font-weight: 700; }
.family-text { font-size: 16px; line-height: 1.4; color: var(--muted); }
.family-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  min-height: 44px;
  font-size: 16px;
  font-weight: 700;
}

.order { display: flex; flex-direction: column; gap: 10px; }
.order-empty { color: var(--muted); }
.order-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.order-lines li, .order-row { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; }
.amount, .order-row dd { font-variant-numeric: tabular-nums; white-space: nowrap; }
.order-totals { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.order-row dt, .order-row dd { margin: 0; }
.order-row-first { border-top: 1px solid var(--divider); padding-top: 10px; }
.order-row-total {
  border-top: 2px solid var(--ink);
  padding-top: 10px;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
}
.btn-checkout { margin-top: 8px; min-height: 58px; border-radius: 16px; width: 100%; }
.checkout-error {
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--ground);
  font-size: 15px;
  line-height: 1.45;
}
.stripe-badge { display: flex; align-items: center; justify-content: center; align-self: center; min-height: 44px; border-radius: 4px; }
.stripe-badge img { width: 150px; height: 34px; }
.pay-note { font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; }
.ship-start { font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--ink); text-align: center; }

/* ---------- thanks ---------- */
.thanks-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; font-size: 17px; }
.thanks-card p { margin: 0; }
.thanks-ship { font-weight: 700; }
.thanks-card .btn { align-self: stretch; }

/* ---------- tablet ---------- */
@media (min-width: 640px) {
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-photo { aspect-ratio: 4 / 5; }
  .choice-body { flex: 1; justify-content: space-between; }
}

/* ---------- tablet only: gallery as a row, large photo beside the thumbnails ---------- */
@media (min-width: 640px) and (max-width: 1023.98px) {
  .gallery { flex-direction: row; align-items: flex-start; gap: 12px; max-width: none; }
  .gallery-main { flex: 1 1 auto; width: auto; height: 420px; aspect-ratio: auto; }
  .thumbs { flex: 0 0 132px; grid-template-columns: 132px; grid-auto-rows: 132px; gap: 12px; }
}

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  :root { --radius-card: 20px; }

  .wrap, .sheet .wrap { max-width: 1120px; padding: 0 24px; }

  .hero-inner { gap: 28px; padding-top: 24px; padding-bottom: 80px; }
  .brand { flex-direction: row; text-align: left; gap: 24px; }
  .brand-logo { width: 168px; height: 168px; }
  .brand-logo img { width: 156px; height: 156px; }
  .brand-text { gap: 4px; }
  .brand-name { font-size: 45px; }
  .brand-sub { font-size: 21px; }
  .hero h1 { margin-top: 0; font-size: 60px; line-height: 1; }
  .hero-sub { font-size: 20px; max-width: 480px; }

  .sheet { margin-top: -44px; padding-top: 0; background: transparent; border-radius: 0; }

  /* home */
  .hero-row { display: flex; align-items: center; gap: 40px; }
  .hero-row .hero-text { flex: 1 1 380px; min-width: 0; }
  .hero-figure { flex: 0 1 560px; min-width: 0; }
  .hero-photo { border-radius: 20px; }
  .choices { gap: 24px; }
  .choice { flex-direction: row; }
  .choice-media { flex: 0 0 220px; display: flex; flex-direction: column; }
  .choice-photo { width: 220px; height: 100%; min-height: 330px; aspect-ratio: auto; }
  .choice-body { padding: 24px; justify-content: center; gap: 18px; }
  .pick-line { margin-top: 28px; font-size: 20px; }
  .family-note { text-align: center; margin-top: 8px; }

  /* youth and adult */
  .hero-shop { flex-direction: row; align-items: center; gap: 40px; }
  .gallery-block { flex: 0 0 auto; }
  .hero-shop .hero-text { flex: 1 1 380px; min-width: 0; }
  .tabs { max-width: 380px; }
  .hero-shop h1 { margin-top: 12px; }
  .gallery { flex-direction: row; align-items: flex-start; gap: 12px; width: auto; max-width: none; flex: 0 0 auto; }
  .gallery-main { width: 320px; height: 420px; aspect-ratio: auto; border-radius: 20px; }
  .thumbs { grid-template-columns: 132px; grid-auto-rows: 132px; gap: 12px; }
  .thumb { border-radius: 16px; }

  .shop-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; padding-bottom: 16px; }
  .sizes, .order { padding: 24px; }
  .sizes h2 { font-size: 24px; margin-bottom: 8px; }
  .order { position: sticky; top: 96px; }
  .order-row-total { font-size: 22px; }

  .family-card { flex-direction: row; align-items: stretch; }
  .family-media { flex: 0 0 280px; display: flex; flex-direction: column; }
  .family-card img { width: 280px; }
  .family-body { justify-content: center; padding: 16px 20px; }

  .thanks-card { padding: 32px; max-width: 640px; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .step, .tab { transition: background-color .15s ease, color .15s ease; }
}

.storage-warning { padding: 0.8rem; border: 2px solid #7c5318; background: #fff4dd; color: #382a12; line-height: 1.5; }
