/*
 * Shared mobile components — spec: docs/mobile-design/01-design-system.md §5.
 * Compose these in page CSS; don't restyle them per page.
 */

/* Chip (filters, type chips). Rows scroll horizontally. */
.m-chip-row {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  overflow-x: auto;
  scrollbar-width: none;
}
.m-chip-row::-webkit-scrollbar { display: none; }
.m-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  color: var(--ink-2);
  font: 600 13px/1 var(--font-ui);
  white-space: nowrap;
  background: var(--surface-2);
  border: 0;
  border-radius: 999px;
}
.m-chip b { font-weight: 700; opacity: 0.75; }
.m-chip.is-active { color: var(--accent-ink); background: var(--accent-soft); }

/* Underline tabs */
.m-tabs {
  display: flex;
  gap: var(--space-6);
  padding: 0 var(--space-4);
  overflow-x: auto;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.m-tabs::-webkit-scrollbar { display: none; }
.m-tab {
  flex: none;
  height: 49px;
  padding: 0;
  color: var(--ink-3);
  font: 650 15px/49px var(--font-ui);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
}
.m-tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }

/* Floating action button (Timeline “+”). Hides on scroll down via shell.js. */
.m-fab {
  position: fixed;
  z-index: 640;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(var(--m-bottom-nav-height) + env(safe-area-inset-bottom) + 16px);
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 50%;
  box-shadow: var(--shadow-float);
  transition: transform 200ms ease, opacity 200ms ease;
}
.m-fab svg { width: 26px; height: 26px; stroke-width: 2.6; }
.m-fab.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(0.9);
}

/* Bottom sheet (generic) */
.m-sheet {
  position: fixed;
  z-index: 900;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 88vh;
  padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  box-shadow: var(--shadow-float);
}
.m-sheet-grab {
  width: 40px;
  height: 4px;
  margin: 0 auto var(--space-3);
  background: var(--line-strong);
  border-radius: 2px;
}

/* Buttons */
.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-5);
  color: var(--ink);
  font: 650 15px/1 var(--font-ui);
  background: var(--surface-2);
  border: 0;
  border-radius: var(--radius-input);
}
.m-btn-primary { color: var(--on-accent); background: var(--accent); }
.m-btn-soft { color: var(--accent-ink); background: var(--accent-soft); }
.m-btn-ghost { background: transparent; border: 1px solid var(--line-strong); }
.m-btn-danger { color: var(--danger); background: transparent; border: 1px solid var(--danger); }

/* Counter badge over photos ("1/12") */
.m-counter {
  padding: 4px 9px;
  color: #fff;
  font: 650 12px/1 var(--font-ui);
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
}

.m-eyebrow {
  color: var(--ink-3);
  font: 650 11px/1.2 var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* "Install app" row (PWA). Shown by shell.js only when the browser offers installation. */
.m-sheet-links > .m-install-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  min-height: 68px;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: start;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.m-install-link > svg:first-child { color: var(--accent); }
.m-install-link > svg:last-child { width: 16px; color: var(--ink-3); }

/* app.css sizes every <svg> to 20px (icons); Leaflet's vector renderer must keep its own width/height. */
.leaflet-overlay-pane svg { width: auto; height: auto; }

/* gate sheet (guest taps "I've been here", "Add yours", Follow, …) */
.gate-sheet { z-index: 940; text-align: center; transform: translateY(100%); transition: transform 220ms ease; padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom)); }
.gate-sheet[hidden] { display: none; }
.gate-sheet.is-visible { transform: none; }
.gate-sheet h2 { margin: var(--space-2) 0 var(--space-2); font: 700 22px/1.2 var(--font-ui); }
.gate-sheet p { margin: 0 0 var(--space-5); color: var(--ink-2); line-height: 1.5; }
.gate-sheet .m-btn { width: 100%; margin-bottom: var(--space-2); }

/* Tap targets: keep the designed sizes but extend the hit area to ≥ 44px. */
.m-chip, .mp-toggle { position: relative; }
.m-chip::after, .mp-toggle::after { position: absolute; inset: -6px -2px; content: ""; }
.m-brand { padding: 12px 10px 12px 0; }
