/* Shmo Leads core: structure only, no brand look.
   Every page loads this first, then its look. A look themes the shared pieces by setting
   these variables on :root (or on body.lk-<name>):

   --sl-font-body, --sl-font-display     fonts
   --sl-bg, --sl-ink, --sl-muted          page colors
   --sl-surface, --sl-surface-ink         dialog panel colors
   --sl-field-bg, --sl-field-ink          form field colors inside dialogs
   --sl-line                              dialog border (e.g. 2px solid #123)
   --sl-radius                            dialog corner radius
   --sl-shadow                            dialog shadow
   --sl-accent, --sl-accent-ink           primary button fill and text
   --sl-good, --sl-warn                   market open / taken colors
   --sl-focus                             focus ring color
   --sl-backdrop                          dialog backdrop

   Buttons: .btn .btn-primary and .btn .btn-ghost exist in every look; this file only
   gives them a sane base. The look decides everything visual. */

:root {
  --sl-font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --sl-font-display: var(--sl-font-body);
  --sl-bg: #fff;
  --sl-ink: #111;
  --sl-muted: #555;
  --sl-surface: #fff;
  --sl-surface-ink: #111;
  --sl-field-bg: #fff;
  --sl-field-ink: #111;
  --sl-line: 2px solid #111;
  --sl-radius: 18px;
  --sl-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --sl-accent: #ff5a1f;
  --sl-accent-ink: #111;
  --sl-good: #1f7a3a;
  --sl-warn: #b45309;
  --sl-focus: #ff5a1f;
  --sl-backdrop: rgba(12, 10, 20, 0.62);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; }
img, svg, video { max-width: 100%; }
img { height: auto; }

:focus-visible { outline: 3px solid var(--sl-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;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding: 0 1.4em; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 700; line-height: 1.1; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- reveal: hidden only when JS confirmed it can show them ---------- */
html.reveal-on .reveal:not(.in) { opacity: 0; transform: translateY(18px); }
.reveal { transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }

/* ---------- iOS ghost-tap guard for any closed mobile drawer ---------- */
@media (max-width: 1080px) {
  .nav-links:not(.open), .nav-links:not(.open) * { visibility: hidden !important; pointer-events: none !important; }
}

/* ---------- market form: base structure (each look styles it) ---------- */
.market-form select, .market-form input { font: inherit; }
.market-form select { -webkit-appearance: none; appearance: none; }
.market-err { margin: 0.5em 0 0; font-size: 0.9rem; font-weight: 600; color: var(--sl-warn); flex-basis: 100%; }
.market-err[hidden] { display: none; }

/* ---------- dialogs (booking, market check, lightbox) ---------- */
dialog.book-modal, dialog.market-modal, dialog.wall-lb {
  border: 0; padding: 0; margin: auto; background: transparent; color: var(--sl-surface-ink);
  max-width: none; max-height: none; overflow: visible;
}
dialog.book-modal::backdrop, dialog.market-modal::backdrop, dialog.wall-lb::backdrop {
  background: var(--sl-backdrop);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

.book-panel {
  width: min(760px, calc(100vw - 24px)); height: min(820px, calc(100dvh - 24px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--sl-surface); border: var(--sl-line); border-radius: var(--sl-radius);
  box-shadow: var(--sl-shadow); font-family: var(--sl-font-body);
}
.book-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px 12px 20px; border-bottom: var(--sl-line);
  font-family: var(--sl-font-display); font-size: 1.1rem;
}
.book-x, .market-x, .lb-x {
  width: 44px; height: 44px; border-radius: 999px; border: var(--sl-line); cursor: pointer;
  background: var(--sl-surface); color: var(--sl-surface-ink); font-size: 1.1rem; line-height: 1;
  display: grid; place-items: center; flex: none;
}
.book-frame { position: relative; flex: 1; background: #fff; }
.book-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.book-status {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px;
  padding: 24px; text-align: center; background: #fff; color: #333; z-index: 1;
}
.book-status[hidden] { display: none; }
.book-status p { margin: 0; max-width: 34ch; }
.book-spinner {
  width: 34px; height: 34px; border-radius: 50%; border: 4px solid #e5e5e5;
  border-top-color: var(--sl-accent); animation: sl-spin 0.9s linear infinite;
}
.book-status.slow .book-spinner { display: none; }
.book-help {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 20px;
  padding: 10px 16px; border-top: var(--sl-line); font-size: 0.9rem;
}
.book-help button, .book-help a {
  background: none; border: 0; padding: 6px 0; cursor: pointer; font: inherit;
  color: inherit; text-decoration: underline; text-underline-offset: 3px;
}
@keyframes sl-spin { to { transform: rotate(360deg); } }

.market-panel {
  position: relative; width: min(540px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  padding: 36px 28px 28px; background: var(--sl-surface); color: var(--sl-surface-ink);
  border: var(--sl-line); border-radius: var(--sl-radius); box-shadow: var(--sl-shadow);
  font-family: var(--sl-font-body);
}
.market-x { position: absolute; top: 12px; right: 12px; }
.market-step[hidden] { display: none; }
dialog.market-modal .market-panel h2 {
  margin: 0.2em 0 0.5em; padding-right: 40px; font-family: var(--sl-font-display);
  font-size: clamp(1.6rem, 5vw, 2.1rem); line-height: 1.1;
}
.market-panel h2:focus { outline: none; }
dialog.market-modal .market-kicker { margin: 0; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.market-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; opacity: 1; color: #fff; background: var(--sl-good); }
.market-modal.is-taken .market-badge { background: var(--sl-warn); }
dialog.market-modal .market-chip {
  display: inline-block; margin: 10px 0 0 8px; padding: 4px 10px; border-radius: 999px;
  border: var(--sl-line); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em;
}
.market-chip:empty { display: none; }
.market-form-modal { display: grid; gap: 14px; }
.market-form-modal label { display: block; font-weight: 700; margin-bottom: 6px; }
.market-form-modal select, .market-form-modal input {
  width: 100%; min-height: 52px; padding: 0 16px; font-size: 1.05rem;
  border: var(--sl-line); border-radius: calc(var(--sl-radius) * 0.6);
  background: var(--sl-field-bg); color: var(--sl-field-ink);
}
.market-form-modal select {
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
.market-form-modal input { letter-spacing: 0.08em; }
.market-form-modal .btn { width: 100%; }
dialog.market-modal .market-note { margin: 4px 0 0; font-size: 0.92rem; line-height: 1.45; opacity: 0.85; }
dialog.market-modal .market-body { margin: 0 0 20px; font-size: 1.05rem; line-height: 1.5; }
.market-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.market-again {
  background: none; border: 0; padding: 8px 0; cursor: pointer; font: inherit; font-weight: 600;
  color: inherit; text-decoration: underline; text-underline-offset: 3px;
}
.market-again, .book-help button, .book-help a { min-height: 44px; display: inline-flex; align-items: center; }

dialog.wall-lb { width: 100vw; height: 100dvh; display: none; place-items: center; }
dialog.wall-lb[open] { display: grid; align-content: center; justify-items: center; gap: 14px; }
dialog.wall-lb img { max-width: min(92vw, 720px); max-height: 86dvh; width: auto; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
dialog.wall-lb:has(.lb-cap:not([hidden])) img { max-height: calc(86dvh - 60px); }
dialog.wall-lb .lb-cap {
  max-width: min(92vw, 720px); margin: 0; padding: 6px 14px; border-radius: 999px; text-align: center;
  background: var(--sl-surface); color: var(--sl-surface-ink); font-family: var(--sl-font-body); font-weight: 700; font-size: 0.9rem;
}
dialog.wall-lb .lb-x { position: fixed; top: 16px; right: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
    /* delays too: a staggered scene never waits half-drawn before it snaps to done */
    animation-delay: 0s !important; transition-delay: 0s !important;
  }
  html.reveal-on .reveal:not(.in) { opacity: 1; transform: none; }
}
