:root {
  --bg: #f3ecdf;
  --bg-warm: #f7efe3;
  --panel: #fffaf1;
  --panel-soft: rgba(255, 250, 241, 0.72);
  --panel-muted: rgba(255, 250, 241, 0.52);
  --text: #17333b;
  --muted: #60706d;
  --line: rgba(23, 51, 59, 0.10);
  --line-soft: rgba(23, 51, 59, 0.06);
  --accent: #e2331f;
  --accent-dark: #ba3621;
  --soft: #eadbc4;
  --shadow-soft: 0 10px 24px rgba(23, 51, 59, 0.05);
  --shadow-panel: 0 14px 30px rgba(23, 51, 59, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(197, 96, 47, 0.10), transparent 24%),
    linear-gradient(180deg, var(--bg-warm) 0%, var(--bg) 100%);
}

body.drawer-open {
  overflow: hidden;
}

body:has(.sign-shell) {
  background: #efe6d6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.45rem, 8vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
}

h2 {
  font-size: 1.55rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

h3 {
  font-size: 1.06rem;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

/* =========================================
   2. Global Layout
   ========================================= */

.page-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.75rem 0 calc(7.5rem + env(safe-area-inset-bottom, 0px));
}

.board-shell {
  width: min(720px, calc(100% - 1.25rem));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.stack {
  display: grid;
  gap: 0.95rem;
}

.location-grid,
.item-list {
  display: grid;
  gap: 1rem;
}

.compact {
  max-width: 28rem;
}

.hero-actions,
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* =========================================
   3. Board Pages
   ========================================= */

.board-page-content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================================
   4. Board Cards / Search / Buttons
   ========================================= */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.82rem 1.1rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  transition: background 120ms ease, transform 120ms ease, color 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-block {
  width: 100%;
}

.button-primary {
  background: var(--accent);
  color: #fff8f1;
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-secondary {
  background: #f2e6d3;
  color: var(--text);
  border: 1px solid rgba(23, 51, 59, 0.10);
}

.panel {
  padding: 0.9rem;
}

.section-heading {
  margin-bottom: 0.45rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span {
  font-weight: 700;
  font-size: 0.94rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(23, 51, 59, 0.12);
  border-radius: 14px;
  background: #fffdf8;
  padding: 0.88rem 0.95rem;
  font: inherit;
  color: var(--text);
}

.field input[type="file"] {
  padding: 0.72rem;
  background: #f8efe1;
}

.field select {
  appearance: none;
}

.error-text {
  color: #8a2f19;
}

.error-list {
  display: grid;
  gap: 0.25rem;
}

.muted {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.report-link {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

.report-link:hover {
  color: var(--text);
}

.item-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.2rem;
  border-top: 1px solid rgba(23, 51, 59, 0.06);
}

.board-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.65rem;
  padding: 0 0.85rem;
  border: 1px solid rgba(23, 51, 59, 0.1);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.board-search-icon {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
}

.board-search {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  padding: 0;
  font: inherit;
  color: var(--text);
}

.board-search::placeholder {
  color: rgba(96, 112, 109, 0.82);
}

.board-search-wrap:focus-within {
  border-color: rgba(197, 96, 47, 0.36);
  box-shadow: 0 0 0 3px rgba(197, 96, 47, 0.08);
  background: rgba(255, 253, 248, 0.98);
}

.board-empty-state {
  background: rgba(255, 250, 241, 0.62);
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(23, 51, 59, 0.06);
  box-shadow: none;
}

.board-empty-state h3 {
  font-size: 0.98rem;
  margin-bottom: 0.22rem;
}

.board-empty-state p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.38;
}

/* =========================================
   5. Shop Pickup Pages
   ========================================= */

/* shop-specific styles extracted to static/styles/shop_pickup.css */

/* =========================================
   6. Drawers / Forms / Alerts
   ========================================= */

.alert {
  background: #fce2d9;
  color: #7d2e15;
  border: 1px solid #ebbea9;
  border-radius: 14px;
  padding: 0.82rem 1rem;
}

.alert.success {
  background: #e5f4e8;
  color: #1d5a33;
  border-color: #b7d8bf;
}

.post-panel {
  border: 1px solid rgba(23, 51, 59, 0.08);
  background: rgba(255, 250, 241, 0.96);
  border-radius: 18px;
  box-shadow: var(--shadow-panel);
}

.post-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.post-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.post-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(23, 51, 59, 0.54);
  cursor: pointer;
}

.post-drawer-panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  margin: 0 auto;
  background: #fffaf1;
  border-radius: 28px 28px 0 0;
  border: 1px solid rgba(23, 51, 59, 0.12);
  box-shadow: 0 -18px 40px rgba(23, 51, 59, 0.18);
  padding: 0.9rem 1rem 1.15rem;
  max-height: min(86vh, 760px);
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 220ms ease;
}

.post-drawer.is-open .post-drawer-panel {
  transform: translateY(0);
}

.post-drawer-handle {
  width: 54px;
  height: 5px;
  border-radius: 999px;
  background: rgba(96, 112, 109, 0.28);
  margin: 0 auto 0.9rem;
}

.post-drawer-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.post-drawer-header h2 {
  margin-bottom: 0.25rem;
}

.post-drawer-header p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.post-drawer-close {
  border: 0;
  background: transparent;
  padding: 0.25rem 0;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.post-drawer-close:hover {
  color: var(--text);
}

/* =========================================
   7. Legal / Terms
   ========================================= */

/* terms-specific styles extracted to static/styles/legal.css */

/* =========================================
   8. Signs
   ========================================= */

/* sign and print styles extracted to static/styles/signs.css */

/* =========================================
   9. Mobile overrides
   ========================================= */

@media (max-width: 719px) {
  .page-shell {
    width: min(1120px, calc(100% - 1rem));
    padding-bottom: calc(8rem + env(safe-area-inset-bottom, 0px));
  }

  .board-shell {
    width: min(720px, calc(100% - 1rem));
  }

  h1 {
    font-size: clamp(2.2rem, 7.8vw, 3.8rem);
  }

  .panel,
  .board-empty-state {
    padding: 0.8rem;
  }

  .post-panel {
    border-radius: 18px;
    box-shadow: 0 16px 28px rgba(23, 51, 59, 0.10);
  }
}

/* =========================================
   10. Desktop overrides
   ========================================= */

@media (min-width: 720px) {
  .page-shell {
    width: min(1120px, calc(100% - 2rem));
    padding: 0.75rem 0 calc(7.5rem + env(safe-area-inset-bottom, 0px));
  }

  .board-shell {
    width: min(720px, calc(100% - 1.25rem));
  }

  .post-drawer {
    align-items: center;
    justify-items: center;
  }

  .post-drawer-panel {
    width: min(640px, calc(100% - 2rem));
    max-height: min(82vh, 760px);
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(23, 51, 59, 0.24);
    transform: translateY(24px);
  }

  .post-drawer.is-open .post-drawer-panel {
    transform: translateY(0);
  }
}
