/* ============================================================
   Ace the Yarnbender: public site styles.
   Colours are tokens on :root; season colours and the banner art are in
   scene.css. Mobile first; wider layouts below.
   ============================================================ */

:root {
  /* base: greens + warm cream */
  --bg: #fbf8f1;
  --surface: #ffffff;
  --surface-2: #f2efe4;
  --ink: #1f2a26;
  --ink-2: #4a5a53;
  --muted: #6b7a73;
  --line: #e2ddcf;
  --primary: #2f5d50;        /* forest green */
  --primary-ink: #ffffff;
  --primary-soft: #dfe9df;   /* sage wash */
  --sage: #a7c4a0;
  --ok: #2f7a4f;

  /* seasonal colours (--accent, --sky1, ...) live in scene.css */

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(31 42 38 / 6%), 0 6px 20px rgb(31 42 38 / 7%);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 16px;
  --max: 1180px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 100, "WONK" 0;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 720px; }
.section { padding-top: 32px; padding-bottom: 32px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--ink-2); }
.fine { font-size: 0.875rem; color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.site-header { background: var(--bg); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; font-variation-settings: "SOFT" 100; }
.brand img { border-radius: 50%; }
.brand span { white-space: nowrap; }
@media (max-width: 380px) { .brand { font-size: 1.05rem; } .brand img { width: 36px; height: 36px; } }
.header-actions { display: flex; align-items: center; gap: 6px; }
.lang, .cart-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 999px;
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: 0.9rem;
}
.lang:hover, .cart-link:hover { background: var(--primary-soft); color: var(--ink); }
.cart-link { position: relative; }
.cart-count {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.72rem; line-height: 18px; text-align: center;
}
.main-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  flex: none; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  color: var(--ink-2); font-weight: 700; font-size: 0.95rem;
}
.main-nav a:hover { background: var(--primary-soft); color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--primary); color: var(--primary-ink); }

/* ---------- season strip (pages other than home) ---------- */
.season-banner { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--sky1), var(--sky2)); min-height: 52px; display: flex; align-items: center; }
.season-banner .wrap { position: relative; padding-top: 10px; padding-bottom: 10px; }
.strip-text {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 5px 14px; border-radius: 999px;
  background: rgb(255 255 255 / 90%); color: var(--ink); font-weight: 700; font-size: 0.92rem; line-height: 1.35;
}
.strip-text a { font-weight: 800; }

/* ---------- admin preview bar ---------- */
.preview-bar { background: #fbefcf; color: #5a4106; font-weight: 800; font-size: 0.9rem; }
.preview-bar .wrap { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; align-items: center; padding-top: 8px; padding-bottom: 8px; }
.preview-bar a { color: #5a4106; }

/* ---------- buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 2px solid transparent;
  font: 800 1rem var(--font-body); text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 85%, black); color: var(--primary-ink); }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-wide { width: 100%; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.875rem; padding: 4px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 0.92rem;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.toggle {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 0.92rem;
}
.toggle::before {
  content: ""; width: 40px; height: 24px; border-radius: 999px; background: var(--line);
  box-shadow: inset 0 0 0 2px var(--line); transition: background 0.2s;
  background-image: radial-gradient(circle at 12px 12px, #fff 9px, transparent 10px);
}
.toggle[aria-checked="true"]::before { background-color: var(--primary); background-image: radial-gradient(circle at 28px 12px, #fff 9px, transparent 10px); }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 800;
  background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 75%, black);
}
.badge-ok { background: var(--primary-soft); color: var(--primary); }
.badge-muted { background: var(--surface-2); color: var(--muted); }

/* ---------- gallery tiles ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tile { display: block; text-decoration: none; color: var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; transition: transform 0.15s ease; }
.tile:hover { transform: translateY(-3px); color: var(--ink); }
.tile-img { display: block; aspect-ratio: 4 / 5; background: var(--surface-2); overflow: hidden; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
.tile-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 14px; }
.tile-name { font-weight: 800; line-height: 1.25; }
.tile-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.price { font-weight: 800; color: var(--primary); }
.price small { font-weight: 600; color: var(--muted); }

.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.category-tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; text-decoration: none; background: var(--surface-2); }
.category-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.category-tile:hover img { transform: scale(1.04); }
.category-tile span {
  position: absolute; left: 10px; bottom: 10px; right: 10px; padding: 6px 12px; border-radius: 999px;
  background: rgb(255 255 255 / 92%); color: var(--ink); font-weight: 800; font-size: 0.95rem; text-align: center;
}

/* ---------- hero (home page): drawn landscape from src/views/scene.ts ---------- */
.hero {
  position: relative; overflow: hidden; background: linear-gradient(180deg, var(--sky1), var(--sky2)); color: var(--hero-ink);
  --garland-h: clamp(56px, 7.5vw, 80px); --sun-size: clamp(80px, 9vw, 128px);
}
.hero-inner { position: relative; display: grid; gap: 18px; padding-top: calc(var(--garland-h) + 8px); padding-bottom: 120px; } /* room for the garland above and the hills below */
.hero-text { display: grid; gap: 14px; justify-items: start; }
.hero-id { display: flex; align-items: center; gap: 12px; margin: 0; font: 600 1.05rem var(--font-display); font-variation-settings: "SOFT" 100; }
.hero-id img { width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 2px 8px rgb(0 0 0 / 18%); }
.hero h1 { margin: 0; text-wrap: balance; color: inherit; }
.hero-msg { margin: 0; font-weight: 700; max-width: 42ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn-ghost { background: rgb(255 255 255 / 60%); }
/* Christmas: light text on a night sky, with a warm fairy-light glow so it stays readable over the snow. */
[data-season="christmas"] .hero-id, [data-season="christmas"] .hero h1, [data-season="christmas"] .hero-msg {
  text-shadow: 0 0 1px rgb(60 40 0 / 70%), 0 0 10px rgb(255 196 90 / 80%), 0 0 26px rgb(255 170 60 / 50%);
}
[data-season="christmas"] .hero .btn-ghost { background: rgb(255 255 255 / 10%); color: #fff8ec; border-color: #fff8ec; }
.hero-pics { position: relative; height: 200px; order: 3; } /* phones: below the market card, standing on the hill */
.hero-inner:has(.hero-pics) { padding-bottom: 36px; }
.hero-window {
  position: absolute; width: 32%; max-width: 230px; aspect-ratio: 4 / 5; overflow: hidden;
  border: 5px solid #fff; border-radius: 999px 999px 18px 18px; background: var(--accent-soft); box-shadow: 0 8px 22px rgb(0 0 0 / 18%);
}
.hero-window img { width: 100%; height: 100%; object-fit: cover; }
.hero-window-0 { left: 38%; top: 22px; transform: rotate(-4deg); }
.hero-window-1 { left: 66%; top: 0; transform: rotate(3deg); }
.hero-ticket {
  justify-self: start; display: inline-flex; align-items: center; gap: 12px; max-width: 100%;
  background: var(--surface); color: var(--ink); text-decoration: none; border-radius: 16px; padding: 8px 16px 8px 8px; box-shadow: var(--shadow);
}
.hero-ticket:hover { color: var(--ink); transform: translateY(-1px); }
.hero-ticket .market-date { width: 52px; height: 52px; border-radius: 12px; }
.hero-ticket .market-date .d { font-size: 1.3rem; }
.hero-ticket span.tx { display: grid; line-height: 1.3; min-width: 0; }
.hero-ticket .kicker { margin: 0; font-size: 0.7rem; }
.hero-ticket strong { font-size: 0.98rem; }
.hero-ticket small { color: var(--muted); font-size: 0.85rem; }

.split { display: grid; gap: 24px; }
.about-teaser { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }

/* ---------- markets ---------- */
.market-list { display: grid; gap: 12px; margin-bottom: 24px; }
.market-card { display: flex; gap: 16px; background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.market-card h3 { margin-bottom: 4px; }
.market-card p { margin: 0; }
.market-date {
  flex: none; width: 64px; height: 64px; border-radius: 14px; background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, black);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05;
}
.market-date .d { font: 700 1.6rem var(--font-display); }
.market-date .m { font-weight: 800; font-size: 0.8rem; text-transform: uppercase; }
.kicker { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.past summary { cursor: pointer; font-weight: 800; }

/* ---------- product page ---------- */
.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 14px; }
.product-grid { display: grid; gap: 24px; }
.gallery-main {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius);
  background: var(--surface-2); scrollbar-width: none;
}
.gallery-main::-webkit-scrollbar { display: none; }
.gallery-main img { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery-thumbs button { flex: none; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: none; cursor: pointer; width: 64px; }
.gallery-thumbs button:hover { border-color: var(--primary); }
.price-big { font: 700 1.8rem var(--font-display); color: var(--primary); margin-bottom: 4px; }
.price-big .from { font: 700 1rem var(--font-body); color: var(--muted); }
.showcase { border-top: 1px solid var(--line); }
.avail { font-weight: 700; color: var(--muted); }
.avail.is-ok { color: var(--ok); }
.buy { margin: 18px 0; }
.variants { border: 0; padding: 0; margin: 0 0 16px; }
.variants legend { font-weight: 800; margin-bottom: 8px; }
.variant-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-chip {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px;
  border: 2px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 700;
}
.variant-chip input { position: absolute; opacity: 0; pointer-events: none; }
.variant-chip:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.variant-chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.variant-chip.is-disabled { opacity: 0.45; cursor: not-allowed; text-decoration: line-through; }
.swatch { width: 20px; height: 20px; border-radius: 50%; background: var(--swatch, #ccc); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 15%); }
.buy-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); }
.qty button { width: 44px; height: 44px; border: 0; background: none; font-size: 1.3rem; cursor: pointer; color: var(--primary); border-radius: 999px; }
.qty button:hover { background: var(--primary-soft); }
.qty input { width: 44px; text-align: center; border: 0; font: 800 1rem var(--font-body); background: none; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { display: none; }
.qty-n { min-width: 28px; text-align: center; font-weight: 800; }
.added { min-height: 1.6em; margin-top: 8px; font-weight: 700; }
.desc { margin: 20px 0; }
.specs { margin: 0; border-top: 1px solid var(--line); }
.specs div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.specs dt { font-weight: 800; color: var(--ink-2); }
.specs dd { margin: 0; }

/* ---------- forms & cart ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 700; font-size: 0.95rem; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); font: inherit; color: var(--ink);
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--primary); outline: none; }
.form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.form legend { font-weight: 800; margin-bottom: 6px; }
.form .radio, .form .check { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; }
.form .radio input, .form .check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--primary); flex: none; }
.two { display: grid; gap: 14px; align-items: start; }
.note { background: var(--primary-soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.95rem; margin: 0; }
.lead + .note { margin: -4px 0 18px; }
.error { color: #a12a2a; font-weight: 700; margin: 0; }
.field-error { color: #a12a2a; font-weight: 700; font-size: 0.875rem; }
.field-error:empty { display: none; }
.form [aria-invalid="true"] { border-color: #a12a2a !important; }
.address { display: grid; gap: 14px; }
.totals { margin: 0; display: grid; gap: 4px; }
.totals div { display: flex; justify-content: space-between; }
.totals dt { color: var(--ink-2); }
.totals dd { margin: 0; font-weight: 700; }
.totals .grand { border-top: 1px solid var(--line); padding-top: 6px; font-size: 1.15rem; }
.cart-lines { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 12px; }
.cart-line {
  display: grid; grid-template-columns: 64px 1fr auto; grid-template-areas: "img info price" "img qty rm";
  gap: 6px 12px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow);
}
.cart-line img { grid-area: img; width: 64px; height: 80px; object-fit: cover; border-radius: 10px; }
.cart-info { grid-area: info; display: flex; flex-direction: column; gap: 2px; }
.cart-name { font-weight: 800; text-decoration: none; color: var(--ink); }
.cart-line .qty { grid-area: qty; justify-self: start; }
.cart-price { grid-area: price; font-weight: 800; text-align: right; }
.cart-line .link-btn { grid-area: rm; justify-self: end; }
.cart-line.is-unavailable { opacity: 0.6; }

/* ---------- about ---------- */
.about-photo { border-radius: var(--radius); margin-bottom: 20px; box-shadow: var(--shadow); }
.prose p { font-size: 1.1rem; }

/* ---------- footer ---------- */
.site-footer { margin-top: 48px; background: var(--primary); color: var(--primary-ink); padding: 32px 0 16px; }
.site-footer a { color: var(--primary-ink); }
.site-footer a:hover { color: var(--sage); }
.footer-grid { display: grid; gap: 20px; }
.footer-brand { font: 600 1.3rem var(--font-display); margin-bottom: 4px; }
.footer-h { font-weight: 800; margin-bottom: 6px; }
.socials, .footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.copyright { font-size: 0.85rem; opacity: 0.8; margin: 20px auto 0; }

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .two { grid-template-columns: 1fr 1fr; }
  .filters { flex-direction: row; align-items: center; justify-content: space-between; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
@media (min-width: 900px) {
  :root { --gutter: 24px; }
  .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: 1.05fr 1fr; grid-template-areas: "text pics" "ticket pics"; column-gap: 32px; align-items: center; align-content: center; min-height: 460px; padding-top: calc(var(--garland-h) + 4px); padding-bottom: 64px; }
  .hero-text { grid-area: text; align-self: end; }
  .hero-pics { grid-area: pics; height: 340px; align-self: end; }
  .hero-inner:has(.hero-pics) { padding-bottom: 64px; }
  .hero-ticket { grid-area: ticket; align-self: start; }
  .hero-id img { width: 76px; height: 76px; }
  .hero-window { width: 46%; }
  .hero-window-0 { left: 4%; top: 56px; }
  .hero-window-1 { left: 46%; top: 16px; }
  .split { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
  .product .gallery { position: sticky; top: 120px; }
  .header-row { padding-top: 14px; }
  .site-header { position: static; }
  .main-nav { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
