/* ============================================================
   Moving Sale — hand-written CSS, no framework.

   Font strategy: system font stacks for now (no @font-face).
   At deploy time, add subsetted WOFF2 files for Fraunces and
   Inter using pyftsubset (Latin + Latin-Ext, target ≤ 80 KB
   total). Until then the browser falls back gracefully to the
   platform's native serif / sans-serif.
   ============================================================ */

/* ---- Design tokens ---------------------------------------- */
:root {
  --bg:           #FBF8F3;
  --text:         #1A1A17;
  --text-muted:   #5A5A55;
  --accent:       #3A6B4F;
  --accent-soft:  #E8EFE9;
  --sold:         #B91C1C;
  --reserved:     #D97706;
  --radius-card:  8px;
  --radius-btn:   6px;
  --shadow-card:  0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --shadow-hover: 0 2px 4px rgba(0,0,0,.06), 0 12px 32px rgba(0,0,0,.08);
}

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

html {
  background: var(--bg);
  color: var(--text);
  /* Fraunces (variable, serif) loaded self-hosted at deploy time;
     falls back to Georgia / platform serif. */
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body { margin: 0; line-height: 1.5; }

/* ---- Accessibility: skip link ----------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 999;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-btn) 0;
  transition: top .15s;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ---- Focus-visible (global) ------------------------------- */
/* Applies to keyboard navigation only; mouse clicks don't trigger
   focus-visible so there's no distracting outline on click. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Remove default outline where we've deliberately styled :focus-visible */
:focus:not(:focus-visible) { outline: none; }

/* ---- Layout ----------------------------------------------- */
.container { max-width: 1100px; margin: 0 auto; padding: 16px; }

/* ---- Header ----------------------------------------------- */
.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.brand {
  font-family: "Fraunces", Georgia, ui-serif, serif;
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -.02em;
  white-space: nowrap;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  justify-content: center;
}
.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9375rem;
  padding: 8px 4px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.site-header nav a:hover { color: var(--text); }

/* Lang toggle — segmented control */
.lang-toggle {
  display: inline-flex;
  gap: 0;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  padding: 2px;
  background: #fff;
}
.lang-toggle button {
  background: none;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  font-size: .8125rem;
  border-radius: 999px;
  min-height: 28px;
  min-width: 36px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color .15s, background .15s;
}
.lang-toggle button[aria-current="true"] {
  background: var(--accent);
  color: #fff;
}
.lang-toggle button:hover:not([aria-current="true"]) { color: var(--text); }

/* Mobile: stack header */
@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    padding: 12px 16px;
  }
  .brand { grid-column: 1; grid-row: 1; font-size: 20px; }
  .lang-toggle { grid-column: 2; grid-row: 1; }
  .site-header nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    margin-top: 4px;
    font-size: .875rem;
  }
  .site-header nav a { padding: 6px 0; font-size: .875rem; }
}

/* ---- Footer ----------------------------------------------- */
.site-footer {
  padding: 32px 16px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid rgba(0,0,0,.06);
  font-size: .875rem;
}

/* ---- Display headings (Fraunces) -------------------------- */
h1, h2, h3 {
  font-family: "Fraunces", Georgia, ui-serif, serif;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(1.6rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h3 { font-size: 1.125rem; }

/* ---- Hero (home) ------------------------------------------ */
.hero {
  padding: 32px 0 16px;
  text-align: left;
  max-width: 640px;
}
.hero h1 { margin-bottom: 8px; }
.hero p {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.55;
}
@media (max-width: 640px) {
  .hero { padding: 20px 0 12px; }
  .hero p { font-size: 1rem; }
}

/* ---- Items grid ------------------------------------------- */
/* 2 cols (mobile) → 3 cols (≥ 768px) → 4 cols (≥ 1280px)    */
.items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 24px;
}

@media (min-width: 768px) {
  .items-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

@media (min-width: 1280px) {
  .items-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; }
}

/* ---- Item card -------------------------------------------- */
.card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0,0,0,.07);
  box-shadow: var(--shadow-card);
  transition: box-shadow .2s ease, transform .2s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* Photo wrapper enforces 4:5 aspect ratio */
.card-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f0ede8;  /* warm grey placeholder */
}

.card-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: opacity .2s, transform .35s ease;
}
.card:hover .card-photo img {
  transform: scale(1.03);
}

.card-body { padding: 14px 14px 16px; }
.card-title {
  font-size: .9375rem;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.3;
  color: var(--text);
  /* Clamp to two lines so cards stay aligned vertically */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price {
  font-size: 1.0625rem;
  color: var(--accent);
  font-weight: 700;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.card-body .badge { margin-top: 8px; }

/* Muted meta (date, etc.) */
.card-meta {
  font-size: .8125rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* Status modifier — sold */
.card--sold .card-photo img { opacity: 0.5; }
.card--sold { opacity: 0.85; }

/* Status modifier — reserved */
.card--reserved .card-photo img { opacity: 0.8; }

/* ---- Status overlay: SOLD stamp --------------------------- */
.stamp--sold {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  /* Semi-opaque red background */
  background: rgba(185, 28, 28, 0.88);
  color: #fff;
  /* Dashed double-border visual trick using box-shadow + outline */
  outline: 2px dashed rgba(255,255,255,.7);
  outline-offset: 4px;
  font-family: "Fraunces", Georgia, ui-serif, serif;
  font-weight: 900;
  font-size: clamp(1.2rem, 4vw, 1.75rem);
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  white-space: nowrap;
}

/* ---- Status overlay: RESERVED ribbon ---------------------- */
/* Classic top-left corner ribbon */
.card-photo-wrap {
  position: relative;
  overflow: hidden;
}

.ribbon--reserved {
  position: absolute;
  top: 14px;
  left: -28px;
  width: 110px;
  background: var(--reserved);
  color: #fff;
  font-weight: 700;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  padding: 5px 0;
  transform: rotate(-45deg);
  transform-origin: center center;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

/* ---- Badge / status pill ---------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.badge--available { background: var(--accent-soft); color: var(--accent); }
.badge--reserved  { background: #FEF3C7; color: #92400E; }
.badge--sold      { background: #FEE2E2; color: var(--sold); }

/* ---- Item detail ------------------------------------------ */
.item-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  margin-top: 24px;
}

@media (max-width: 640px) {
  .item-detail { grid-template-columns: 1fr; gap: 24px; }
}

.item-detail img {
  width: 100%;
  border-radius: var(--radius-card);
  object-fit: cover;
}

.item-title {
  font-family: "Fraunces", Georgia, ui-serif, serif;
  font-size: clamp(1.6rem, 5vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.15;
}
.item-price {
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 12px;
}
.item-description {
  color: var(--text-muted);
  line-height: 1.7;
  white-space: pre-line;  /* preserve paragraphs */
}

/* ---- Sticky CTA on mobile (item-detail reserve button) ---- */
.detail-cta {
  /* Default: inline flow on desktop */
}

@media (max-width: 640px) {
  .detail-cta {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 12px 16px;
    background: var(--bg);
    border-top: 1px solid rgba(0,0,0,.08);
    margin: 0 -16px;  /* bleed to container edges */
    display: flex;
    justify-content: stretch;
  }
  .detail-cta .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
  }
}

/* ---- Slot picker ------------------------------------------ */
.slot-picker { margin-top: 24px; }
.slot-picker h3 { margin-bottom: 12px; }
.slot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.slot-list li { display: flex; }
.slot-list input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.slot-list label {
  display: block;
  padding: 9px 16px;
  border: 2px solid var(--accent-soft);
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-size: .9rem;
  transition: border-color .15s, background .15s;
  min-height: 44px;          /* tap-target */
  display: flex;
  align-items: center;
}
.slot-list label:hover { border-color: var(--accent); }
.slot-list input[type=radio]:checked + label {
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}
.slot-list input[type=radio]:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Forms ------------------------------------------------ */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: .9rem;
  color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d9d5ce;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  min-height: 44px;          /* tap-target */
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58, 107, 79, .15);
  outline: none;
}
.form-group textarea { min-height: 110px; resize: vertical; }

/* Inline field error */
.field-error {
  color: var(--sold);
  font-size: .85rem;
  margin: 4px 0 0;
}

/* ---- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;          /* tap-target */
  transition: opacity .15s, transform .1s;
  letter-spacing: .01em;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(.98); }

.btn--secondary {
  background: var(--accent-soft);
  color: var(--accent);
}
.btn--danger {
  background: #FEE2E2;
  color: var(--sold);
}

/* ---- Alerts / error banners ------------------------------- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-btn);
  margin-bottom: 20px;
  font-size: .9375rem;
  border-left: 4px solid transparent;
}
.alert--success {
  background: var(--accent-soft);
  color: #1a4030;
  border-left-color: var(--accent);
}
.alert--error {
  background: #FEE2E2;
  color: #7f1d1d;
  border-left-color: var(--sold);
}
.alert--warning {
  background: #FEF3C7;
  color: #78350f;
  border-left-color: var(--reserved);
}

/* ---- Pickup page ------------------------------------------ */
.pickup-section { max-width: 720px; margin: 32px 0; }
.pickup-section h2 { margin-bottom: 8px; }
.pickup-row { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 640px) {
  .pickup-row { grid-template-columns: 1fr 240px; }
}
.pickup-col { min-width: 0; }
.pickup-contact p { margin: 4px 0; }
.pickup-paynow-qr img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.copy-btn {
  margin-left: 8px;
  padding: 6px 14px;
  font-size: .85rem;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-family: inherit;
  min-height: 36px;
  font-weight: 500;
  transition: background .15s;
}
.copy-btn:hover { background: #d0e4d6; }
.pickup-map {
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-card);
  margin-top: 16px;
  display: block;
}

/* ---- Reservation status page ------------------------------ */
.reservation-card {
  max-width: 560px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--radius-card);
  padding: 28px 32px;
  box-shadow: var(--shadow-card);
  margin: 32px 0;
}

/* ---- Disclosure (optional fields on reserve form) --------- */
.reserve-optional {
  margin: 0 0 20px;
  border-top: 1px solid rgba(0,0,0,.08);
  padding-top: 12px;
}
.reserve-optional > summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: .9rem;
  padding: 6px 0;
  list-style: none;
  font-weight: 500;
}
.reserve-optional > summary::before {
  content: "+ ";
  color: var(--accent);
  font-weight: 700;
}
.reserve-optional[open] > summary::before { content: "− "; }
.reserve-optional > summary:hover { color: var(--text); }

/* ---- Lightbox ---------------------------------------------- */
.zoomable { cursor: zoom-in; }
.lightbox-dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  margin: auto;
}
.lightbox-dialog::backdrop {
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(4px);
}
.lightbox-dialog img {
  display: block;
  max-width: 95vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0,0,0,.5);
}
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.lightbox-close:hover { background: #fff; }

/* ---- Slot select (grouped <select>) ----------------------- */
.slot-select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d9d5ce;
  border-radius: var(--radius-btn);
  background: #fff;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  min-height: 48px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%235A5A55' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.slot-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58,107,79,.15);
  outline: none;
}
.slot-select optgroup {
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
}
.slot-select option { font-weight: 400; color: var(--text); padding: 6px; }

/* ---- Favorite heart button on cards ----------------------- */
.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.9);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: background .15s, transform .15s;
  z-index: 3;
}
.fav-btn:hover { background: #fff; transform: scale(1.06); }
.fav-btn .fav-heart { color: var(--text-muted); transition: color .15s, fill .15s; }
.fav-btn--on { background: #fff; }
.fav-btn--on .fav-heart {
  color: var(--sold);
  fill: var(--sold);
}
.card { position: relative; }
