/* ---------------------------------------------------------------------
   The Quirk — "Curiosity, Curated."
   Warm, earthy, artisanal: kraft, hessian, jute twine, black tissue paper,
   black-and-white brand palette. Curious, slightly eccentric, honest,
   humorous without trying too hard.
--------------------------------------------------------------------- */

:root {
  --ink: #1a1613;
  --ink-soft: #3a332c;
  --kraft: #c8a77c;
  --kraft-dark: #a9835a;
  --kraft-light: #ede2cf;
  --paper: #faf6ee;
  --cream: #f3ecdd;
  --white: #ffffff;
  --line: #d9cbb0;
  --line-strong: #b6a17a;
  --accent: #1a1613;
  --success: #3f6b3f;
  --warning: #a9651e;
  --danger: #a3312a;
  --radius: 4px;
  --radius-lg: 10px;
  --shadow-card: 0 1px 0 rgba(26,22,19,0.06);
  --font-display: 'Caveat', 'Segoe Script', cursive;
  --font-heading: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Jost', 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(26,22,19,0.035) 1px, transparent 0);
  background-size: 22px 22px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

.script {
  font-family: var(--font-display);
  font-weight: 600;
}

p { margin: 0 0 1em; }

.btn {
  display: inline-block;
  padding: 12px 24px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
  text-align: center;
}
.btn:hover { background: var(--ink-soft); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-outline {
  background: transparent;
  color: var(--ink);
}
.btn-outline:hover { background: var(--kraft-light); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-danger:hover { background: #fbe9e7; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------- Announcement bar ---------------- */
.announcement {
  background: var(--ink);
  color: var(--kraft-light);
  text-align: center;
  font-size: 13px;
  padding: 8px 16px;
  letter-spacing: 0.02em;
}

/* ---------------- Header ---------------- */
.site-header {
  background: var(--paper);
  border-bottom: 1.5px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 24px;
}
.brand-mark {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.brand-mark .wordmark {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-mark .tagline {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--kraft-dark);
  display: none;
}
@media (min-width: 640px) {
  .brand-mark .tagline { display: inline; }
}
.main-nav {
  display: flex;
  gap: 22px;
  font-size: 14.5px;
  font-weight: 500;
  flex-wrap: wrap;
}
.main-nav a { padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { border-color: var(--kraft-dark); }

.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-search {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}
.nav-search input {
  border: none;
  padding: 8px 10px;
  font-size: 13.5px;
  width: 140px;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
}
.nav-search button {
  border: none;
  background: var(--kraft-light);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}
.cart-link {
  position: relative;
  font-weight: 600;
  font-size: 14.5px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 8px 14px;
}
.cart-count {
  display: inline-block;
  margin-left: 6px;
  background: var(--kraft-dark);
  color: var(--white);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 12px;
}

/* ---------------- Flash messages ---------------- */
.flashes { max-width: 1180px; margin: 16px auto 0; padding: 0 24px; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  font-size: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
}
.flash-success { border-color: var(--success); color: var(--success); }
.flash-warning { border-color: var(--warning); color: var(--warning); }
.flash-danger { border-color: var(--danger); color: var(--danger); }
.flash-info { border-color: var(--line-strong); }

/* ---------------- Hero ---------------- */
.hero {
  padding: 64px 24px 56px;
  border-bottom: 1.5px solid var(--line);
  background:
    linear-gradient(180deg, var(--kraft-light) 0%, var(--paper) 100%);
}
.hero-flex {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
}
.hero-mascot {
  width: 200px;
  height: auto;
  flex-shrink: 0;
}
.hero-copy { text-align: left; max-width: 620px; }
.hero .eyebrow {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--kraft-dark);
  margin-bottom: 4px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  margin-bottom: 14px;
}
.hero .lede {
  margin: 0 0 28px;
  font-size: 17px;
  color: var(--ink-soft);
}
/* page_content fields are rendered through the |md filter, which always
   wraps its output in <p> — zero out that inner margin so it doesn't add
   to the .lede/.section-blurb container's own spacing. */
.hero .lede p, .section-blurb p { margin: 0; }
.hero-actions { display: flex; gap: 14px; justify-content: flex-start; flex-wrap: wrap; }
@media (max-width: 720px) {
  .hero-flex { flex-direction: column; gap: 24px; text-align: center; }
  .hero-mascot { width: 150px; }
  .hero-copy { text-align: center; }
  .hero-actions { justify-content: center; }
}

/* ---------------- Sections ---------------- */
.section { padding: 56px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 10px;
}
.section-head h2 { font-size: 28px; margin: 0; }
.section-head .view-all { font-size: 14px; font-weight: 600; border-bottom: 1.5px solid var(--ink); }
.section-blurb { color: var(--ink-soft); max-width: 620px; margin: -14px 0 26px; }

.section-alt { background: var(--kraft-light); border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); }

/* ---------------- Product grid & cards ---------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 26px;
}
.product-card {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(26,22,19,0.09); }
.product-card .thumb {
  aspect-ratio: 4 / 3;
  background: var(--white);
  position: relative;
  overflow: hidden;
}
/* Uploaded product photos come from all kinds of sources — phone snaps,
   auction-house listings, studio shots — with no guaranteed consistent
   aspect ratio. object-fit: cover used to center-crop every photo to fill
   a fixed 4:3 box, which silently chopped the top/bottom off anything
   that wasn't shot in that ratio (e.g. a mug or notebook photographed
   portrait-style). object-fit: contain shows the whole photo instead,
   letterboxed on a white background rather than cropped — nothing is
   ever cut off, whatever shape the source photo is. (Previously this was
   scoped to just info-only categories via a special-case class; changed
   4 Sep 2026 to apply everywhere after mugs/notebooks were seen cropping
   too.) */
.product-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-soldout { background: var(--danger); }
.badge-soon { background: var(--kraft-dark); }
.product-card .body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.product-card .category-tag {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--kraft-dark);
  font-weight: 600;
  margin-bottom: 4px;
}
.product-card h3 { font-size: 18px; margin-bottom: 6px; }
.product-card .desc { font-size: 13.5px; color: var(--ink-soft); flex: 1; margin-bottom: 12px; }
.product-card .price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.price { font-family: var(--font-heading); font-weight: 700; font-size: 19px; }

/* ---------------- Product detail ---------------- */
.product-detail { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; padding: 48px 0; }
@media (max-width: 860px) { .product-detail { grid-template-columns: 1fr; gap: 28px; } }
.gallery-main {
  aspect-ratio: 4/3;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--line);
  overflow: hidden;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumbs img {
  width: 68px; height: 68px; object-fit: contain; border-radius: var(--radius);
  border: 1.5px solid var(--line); cursor: pointer; background: var(--white);
}
.product-info .occasion { font-family: var(--font-display); font-size: 20px; color: var(--kraft-dark); }
.product-info h1 { font-size: 32px; margin: 4px 0 12px; }
.product-info .price { font-size: 26px; display: block; margin-bottom: 18px; }
.stock-line { font-size: 14px; margin-bottom: 18px; font-weight: 600; }
.stock-in { color: var(--success); }
.stock-low { color: var(--warning); }
.stock-out { color: var(--danger); }

.qty-form { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.qty-form input[type="number"] {
  width: 66px; padding: 10px; border: 1.5px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 15px;
}

.field-note-card, .insert-card {
  background: var(--kraft-light);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-top: 22px;
}
.field-note-card h4, .insert-card h4 {
  font-family: var(--font-display); font-size: 20px; margin-bottom: 6px; color: var(--ink-soft);
}
.kit-contents { margin-top: 26px; }
.kit-contents ul { list-style: none; padding: 0; margin: 0; }
.kit-contents li {
  padding: 12px 0; border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.kit-contents li .item-name { font-weight: 600; }
.kit-contents li .swing-tag { font-family: var(--font-display); font-size: 16px; color: var(--kraft-dark); }
.role-pill {
  display: inline-block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--ink); color: var(--paper); padding: 2px 7px; border-radius: 999px; margin-left: 8px;
}

/* ---------------- Cart & checkout ---------------- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.cart-table th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); padding-bottom: 10px; border-bottom: 1.5px solid var(--line); }
.cart-table td { padding: 16px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-row-item { display: flex; gap: 14px; align-items: center; }
.cart-thumb { width: 64px; height: 64px; border-radius: var(--radius); background: var(--white); overflow: hidden; flex-shrink: 0; }
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-qty { width: 56px; padding: 6px; border: 1.5px solid var(--line); border-radius: var(--radius); font-family: var(--font-body); }

.totals-box {
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px 24px; max-width: 380px; margin-left: auto;
}
.totals-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14.5px; }
.totals-row.grand { font-size: 19px; font-weight: 700; border-top: 1.5px solid var(--line); padding-top: 12px; margin-top: 12px; }

.checkout-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; padding: 40px 0; }
@media (max-width: 860px) { .checkout-grid { grid-template-columns: 1fr; } }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 15px; background: var(--white);
}
.form-field textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 4px; }

.order-summary-list { border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; background: var(--white); }
.order-summary-list .line { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--ink);
  color: var(--kraft-light);
  padding: 48px 0 28px;
  margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { color: var(--paper); font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.site-footer a { display: block; font-size: 14px; color: #c9bfa8; padding: 4px 0; }
.site-footer a:hover { color: var(--paper); }
.footer-bottom {
  margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 12.5px; color: #9c9080; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.footer-note { font-family: var(--font-display); font-size: 15px; color: #c9bfa8; }

/* ---------------- Category chips / filters ---------------- */
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.chip {
  padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 13.5px; font-weight: 500;
  background: var(--white);
}
.chip.active, .chip:hover { border-color: var(--ink); background: var(--kraft-light); }

/* ---------------- Misc pages ---------------- */
.page-header { padding: 48px 0 20px; text-align: center; }
.page-header h1 { font-size: 36px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }

.quirk-test-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 30px 0; }
@media (max-width: 720px) { .quirk-test-grid { grid-template-columns: 1fr; } }
.quirk-test-card {
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 22px;
}
.quirk-test-card h3 { font-family: var(--font-display); font-size: 24px; color: var(--kraft-dark); }

.prose { max-width: 720px; margin: 0 auto; }
.prose p { color: var(--ink-soft); }
.prose h2 { margin-top: 2em; }
.prose h3 { font-size: 17px; margin-top: 1.4em; }
.prose ol, .prose ul { color: var(--ink-soft); padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.5em; }
.legal-meta {
  font-size: 13px; color: var(--kraft-dark); text-align: center;
  margin-bottom: 2em; font-weight: 500;
}
.legal-notice {
  background: var(--kraft-light); border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg); padding: 16px 20px; font-size: 13.5px;
  color: var(--ink-soft); margin: 1.5em 0 2.5em;
}

/* ---------------- Admin ---------------- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
@media (max-width: 800px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-sidebar { background: var(--ink); color: var(--kraft-light); padding: 24px 18px; }
.admin-sidebar .wordmark { color: var(--paper); font-family: var(--font-heading); font-size: 22px; margin-bottom: 4px; }
.admin-sidebar .sub { font-size: 12px; color: #9c9080; margin-bottom: 26px; }
.admin-sidebar nav a {
  display: block; padding: 10px 12px; border-radius: var(--radius); font-size: 14.5px; margin-bottom: 4px; color: #d9cbb0;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,0.08); color: var(--paper); }
.admin-main { padding: 32px 36px; background: var(--paper); }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.admin-topbar h1 { font-size: 26px; margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; }
.stat-card .label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.stat-card .value { font-family: var(--font-heading); font-size: 28px; font-weight: 700; margin-top: 4px; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.admin-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); padding: 12px 14px; background: var(--kraft-light); }
.admin-table td { padding: 12px 14px; border-top: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.status-pill { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; }
.status-pending_payment { background: #f6e6c8; color: var(--warning); }
.status-paid { background: #dcecdc; color: var(--success); }
.status-fulfilled { background: #dde7f5; color: #2b4f8c; }
.status-cancelled, .status-failed { background: #f6d9d6; color: var(--danger); }
.status-draft { background: #eee; color: #777; }
.status-published { background: #dcecdc; color: var(--success); }

.admin-form-card { background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 28px; max-width: 760px; }
.admin-form-card fieldset { border: none; padding: 0; margin: 0 0 24px; }
.admin-form-card legend { font-family: var(--font-heading); font-size: 16px; margin-bottom: 12px; padding: 0; }
.checkbox-field { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.checkbox-field input { width: auto; }
.image-thumb-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.image-thumb-card { width: 96px; }
.image-thumb { position: relative; width: 96px; height: 96px; border-radius: var(--radius); overflow: hidden; border: 1.5px solid var(--line); background: var(--white); }
.image-thumb img { width: 100%; height: 100%; object-fit: contain; }
.image-thumb .remove-form { position: absolute; top: 2px; right: 2px; margin: 0; }
.image-thumb .remove-btn { background: rgba(0,0,0,0.65); color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; cursor: pointer; }
.hero-badge {
  position: absolute; top: 2px; left: 2px; background: var(--ink); color: #fff;
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; z-index: 1;
}
.image-thumb-actions { display: flex; gap: 4px; margin-top: 4px; }
.image-thumb-actions button {
  flex: 1; background: var(--kraft-light); border: 1px solid var(--line); border-radius: 4px;
  font-size: 12px; padding: 3px 0; cursor: pointer; color: var(--ink);
}
.image-thumb-actions button:disabled { opacity: 0.3; cursor: default; }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--kraft-light); }
.login-card { background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 380px; }
.login-card h1 { text-align: center; }
.login-card .sub { text-align: center; color: var(--ink-soft); margin-bottom: 26px; }

.help-text { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }
