/* ============================================================
   Pé na Rua — style.css
   Mobile-first, breakpoints: 640px (tablet), 1024px (desktop)
   ============================================================ */

/* ============================================================
   1. CSS Tokens
   ============================================================ */
:root {
  --sage: #4d6b4d;
  --sage-light: #7b9c7b;
  --sage-dark: #2d4a2d;
  --sage-deep: #1c3320;
  --paper: #f4efe6;
  --cream: #f7f4ef;
  --warm-white: #fdfbf8;
  --terra: #b56638;
  --terra-light: #e8b98a;
  --rust: #9c4a1f;
  --ink: #1a1f1c;
  --ink-mid: #485248;
  --ink-soft: #6f7a6f;
  --mist: #e0dfd5;
  --mist-soft: #ecebe2;
  --gold: #d4a843;
  --sky: #5b9bb5;
  --rose: #c4736a;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-label: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --shadow-paper: 0 1px 2px rgba(45,74,45,.04), 0 8px 24px rgba(45,74,45,.08);
  --shadow-paper-lg: 0 2px 6px rgba(45,74,45,.06), 0 16px 48px rgba(45,74,45,.12);
  --header-h: 48px;
  --tab-bar-h: 56px;
  --filter-bar-h: 48px;
}

/* ============================================================
   2. Reset + base
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  /* Fundo igual ao da app para a faixa revelada quando a barra do Chrome
     colapsa no scroll não aparecer a branco. */
  background-color: var(--paper);
}

body {
  font-family: var(--font-body);
  background-color: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh; /* viewport dinâmico: acompanha a barra do browser */
  overflow-x: hidden;
  overscroll-behavior-y: none; /* evita o bounce que revela a faixa branca */
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   3. Utilities
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  padding: .5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--sage-deep);
  color: #fff;
  z-index: 9999;
}

/* ============================================================
   4. Main container offset
   ============================================================ */
#main-content {
  padding-top: var(--header-h);
}

/* ============================================================
   4b. Header (48px, fixed top)
   ============================================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background-color: var(--sage-deep);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  padding: 0 1rem;
}

.header-logo {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--terra-light);
  text-decoration: none;
}

.header-back {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
  display: flex;
  align-items: center;
}
.header-back[hidden] { display: none; }

/* Mobile: mostra só o "+ Local" no header (Mapa/Lista ficam no bottom-bar). */
.header-nav {
  display: flex;
  align-items: center;
}

.header-tab {
  display: none;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: .8rem;
  font-weight: 500;
  transition: background .2s, color .2s;
}

.header-tab:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.header-tab.active {
  background: var(--terra);
  color: #fff;
}

/* + Local: CTA pill accent no header, destaque ao lado dos tabs */
.header-action-add {
  background: var(--terra);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 5px 14px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  transition: background .2s, color .2s;
}
.header-action-add:hover { background: var(--rust); color: #fff; }
.header-action-add.active { background: var(--rust); }

/* "Os meus locais" no header — só em desktop (no mobile vai na barra de baixo) */
.header-mine {
  display: none;
  align-items: center; gap: 5px;
  background: transparent; border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.85); cursor: pointer;
  padding: 5px 12px; border-radius: 999px; margin-left: 6px;
  font-family: var(--font-label); font-size: .8rem; font-weight: 500;
  transition: background .2s, border-color .2s, color .2s;
}
.header-mine:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); color: #fff; }
.header-mine.active { background: var(--terra); border-color: var(--terra); color: #fff; }

.header-logo { text-decoration: none; }

.header-search-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

/* ============================================================
   5. Search overlay
   ============================================================ */
.search-overlay {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 1100; /* acima dos controlos Leaflet (~1000) para o ✕ ser clicável */
  background: var(--sage-deep);
  padding: 8px 1rem;
}
/* Com a pesquisa aberta, esconde o zoom +/- do mapa para não tapar o ✕. */
body.search-open .leaflet-top.leaflet-right { display: none; }

.search-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.search-input {
  flex: 1;
  border: none;
  border-radius: 4px;
  padding: .7rem 1rem;
  font-family: var(--font-body);
  font-size: .9rem;
  background: var(--warm-white);
  color: var(--ink);
  outline: none;
}

.search-input:focus {
  box-shadow: 0 0 0 3px rgba(77,107,77,.2);
}

.search-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
}

/* ============================================================
   6. Tab bar (mobile bottom nav)
   ============================================================ */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--sage-deep);
  height: var(--tab-bar-h);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  border-top: 1px solid rgba(255,255,255,.1);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  font-family: var(--font-label);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 6px 10px;
}

.tab svg {
  stroke: currentColor;
}

.tab.active {
  color: var(--terra-light);
}

.tab span {
  display: block;
}

/* ============================================================
   7. Views
   ============================================================ */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* ============================================================
   8. Map view
   ============================================================ */
#map-view {
  display: none;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - var(--tab-bar-h));
  height: calc(100dvh - var(--header-h) - var(--tab-bar-h));
  position: relative;
}

#map-view.active {
  display: flex;
}

#map {
  width: 100%;
  flex: 1;
}

.map-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 800;
  background: var(--warm-white);
  border-radius: 12px;
  box-shadow: var(--shadow-paper-lg);
  border: 1px solid var(--mist);
  max-width: calc(100vw - 24px);
  overflow: hidden;
}

.map-controls-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: .88rem;
  color: var(--sage-deep);
  transition: background .15s;
}
.map-controls-toggle:hover { background: var(--mist); }
.map-controls-toggle::after {
  content: '▾';
  margin-left: auto;
  font-size: .75rem;
  color: var(--ink-mid);
  transition: transform .2s;
}
.map-controls-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
.map-controls.collapsed .map-controls-toggle::after { transform: none; }

.map-controls-toggle-icon {
  color: var(--terra);
}

.map-controls.collapsed .map-controls-body {
  display: none;
}

.map-controls-body {
  padding: 12px 14px;
  min-width: 200px;
}

.map-controls h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--sage-deep);
  margin-bottom: 10px;
}

.map-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .8rem;
  color: var(--ink-mid);
}

.map-toggle input {
  accent-color: var(--sage);
}

.map-panel-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--mist-soft);
}

.map-panel-btn {
  flex: 1;
  background: var(--mist-soft);
  color: var(--sage-deep);
  border: 1px solid var(--mist);
  padding: .35rem .5rem;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: .62rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.map-panel-btn:hover {
  background: var(--terra);
  color: #fff;
  border-color: var(--terra);
}

.map-locate-btn {
  position: absolute;
  bottom: calc(var(--tab-bar-h) + 16px);
  right: 12px;
  z-index: 800;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--warm-white);
  border: none;
  box-shadow: var(--shadow-paper);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sage-deep);
  transition: box-shadow .2s;
}

.map-locate-btn:hover {
  box-shadow: var(--shadow-paper-lg);
}

.map-locate-btn.locating {
  animation: pulse 2s infinite;
}

.map-proximity-chip {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  background: var(--sage-deep);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: .7rem;
  box-shadow: var(--shadow-paper);
}

/* ============================================================
   9. Filter bar
   ============================================================ */
.filter-bar {
  display: flex;
  gap: 8px;
  padding: 10px 1rem;
  flex-wrap: wrap; /* embrulha em vez de scroll horizontal */
  position: sticky;
  top: var(--header-h);
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--mist);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--mist);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: transparent;
  color: var(--ink-mid);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .2s, color .2s;
}

.filter-chip:hover {
  border-color: var(--sage);
  color: var(--sage-deep);
}

.filter-chip.active {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: var(--paper);
}

.filter-chip--more {
  border-color: rgba(77,107,77,.35);
  color: var(--sage-deep);
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--terra);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  margin-left: 4px;
}

/* ============================================================
   10. Bottom sheets
   ============================================================ */
.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: flex-end;
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s;
}

.bottom-sheet.open {
  visibility: visible;
  opacity: 1;
}

.bottom-sheet[hidden] {
  display: none;
}

.bottom-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28,51,32,.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.bottom-sheet-panel {
  position: relative;
  width: 100%;
  max-height: 70vh;
  background: var(--warm-white);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.2,.9,.3,1);
}

.bottom-sheet.open .bottom-sheet-panel {
  transform: translateY(0);
}

.bottom-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--mist);
}

.bottom-sheet-header h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--sage-deep);
}

.bottom-sheet-close {
  background: none;
  border: 1px solid var(--mist);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--mist-soft);
  cursor: pointer;
  color: var(--ink-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s, border-color .2s;
}

.bottom-sheet-close:hover {
  background: var(--terra);
  color: #fff;
  border-color: var(--terra);
}

.bottom-sheet-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.bottom-sheet-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--mist);
  display: flex;
  gap: 8px;
}

.bottom-sheet-clear {
  flex: 1;
  background: transparent;
  border: 1px solid var(--mist);
  border-radius: 999px;
  padding: .6rem;
  font-family: var(--font-label);
  font-size: .75rem;
  color: var(--ink-mid);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.bottom-sheet-clear:hover {
  background: var(--mist-soft);
  border-color: var(--mist);
}

.bottom-sheet-apply {
  flex: 1;
  background: var(--sage-deep);
  border: none;
  border-radius: 999px;
  padding: .6rem;
  font-family: var(--font-label);
  font-size: .75rem;
  color: #fff;
  cursor: pointer;
  transition: background .2s;
}

.bottom-sheet-apply:hover {
  background: var(--terra);
}

.sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sheet-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--mist);
  font-family: var(--font-body);
  font-size: .85rem;
  color: var(--ink-mid);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.sheet-chip:hover {
  border-color: var(--sage);
  background: var(--mist-soft);
}

.sheet-chip.active {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: var(--paper);
}

.sheet-section-label {
  font-family: var(--font-label);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin: 16px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--mist-soft);
}

/* ============================================================
   11. List view
   ============================================================ */
#list-view.active {
  display: block;
  padding: 0 1rem 1rem;
}

.list-header {
  margin: 1.5rem 0 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--mist);
}

.list-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--sage-deep);
  line-height: 1.1;
  letter-spacing: -.015em;
}

.list-title em {
  color: var(--terra);
  font-style: italic;
}

.list-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.list-subtitle {
  font-family: var(--font-label);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
}

.result-count {
  font-family: var(--font-label);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.parks-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--ink-soft);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: .8rem;
  opacity: .6;
}

.empty-state p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-mid);
}

/* ============================================================
   12. Park cards
   ============================================================ */
.park-card {
  background: var(--warm-white);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--mist);
  box-shadow: var(--shadow-paper);
  cursor: pointer;
  transition: box-shadow .3s, transform .3s, border-color .3s;
  animation: fadeIn .4s cubic-bezier(.2,.9,.3,1) both;
}

.park-card:hover {
  box-shadow: var(--shadow-paper-lg);
  transform: translateY(-3px);
  border-color: var(--sage-light);
}

.card-img-wrap {
  position: relative;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.card-placeholder {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: var(--mist-soft);
}

.card-price-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(253,251,248,.92);
  color: var(--sage-deep);
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-size: .7rem;
  font-weight: 600;
  box-shadow: var(--shadow-paper);
}

.card-body {
  padding: 14px 16px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.card-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--sage-deep);
  line-height: 1.2;
  letter-spacing: -.005em;
}

.card-distance {
  font-family: var(--font-label);
  font-size: .7rem;
  color: var(--terra);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.card-location {
  font-family: var(--font-body);
  font-size: .78rem;
  color: var(--ink-soft);
  margin-bottom: 10px;
  /* Freguesias unidas têm nomes longos ("Oeiras e São Julião da Barra, Paço de
     Arcos e Caxias"); o nome completo fica na ficha e na pesquisa. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.chip-age {
  font-family: var(--font-label);
  font-size: .62rem;
  background: rgba(91,155,181,.12);
  color: #2c5f78;
  padding: 3px 8px;
  border-radius: 999px;
}

.chip-feat {
  font-family: var(--font-body);
  font-size: .75rem;
  background: rgba(77,107,77,.08);
  color: var(--sage-deep);
  padding: 3px 8px;
  border-radius: 999px;
}

.card-kids {
  font-family: var(--font-body);
  font-size: .72rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ============================================================
   13. Detail view
   ============================================================ */
.detail-hero {
  width: 100%;
  height: 240px;
  position: relative;
  overflow: hidden;
  background: var(--sage-deep);
}

.detail-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28,51,32,.85) 0%, rgba(28,51,32,.2) 50%, transparent 75%);
}

.detail-hero-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  opacity: .5;
}

.detail-hero-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 1rem;
  z-index: 1;
  color: #fff;
}

.detail-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: -.015em;
  line-height: 1.05;
  text-shadow: 0 2px 16px rgba(0,0,0,.4);
}

.detail-loc {
  font-family: var(--font-body);
  font-size: .8rem;
  opacity: .8;
  margin-top: 4px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.detail-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.15);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
  transition: background .2s;
}

.detail-action:hover {
  background: rgba(255,255,255,.25);
}

.detail-action--primary {
  background: var(--terra);
  border-color: var(--terra);
  flex: 1;
  font-weight: 600;
}

.detail-action--primary:hover {
  background: var(--rust);
  border-color: var(--rust);
}

.detail-body {
  padding: 1.5rem 1rem;
}

.info-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1rem;
}

.info-chip {
  font-family: var(--font-label);
  font-size: .72rem;
  background: var(--mist-soft);
  color: var(--sage-deep);
  padding: 5px 12px;
  border-radius: 999px;
}

.detail-verified {
  font-family: var(--font-label);
  font-size: .65rem;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.detail-verified--pending {
  color: #a06b15;
}

.detail-section {
  margin-bottom: 2rem;
}

.detail-section h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--sage-deep);
  margin-bottom: 1rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--mist);
}

.detail-description {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink-mid);
  line-height: 1.7;
}

.practical-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.practical-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--warm-white);
  border: 1px solid var(--mist);
  border-radius: 4px;
}

.practical-icon {
  font-size: 1.2rem;
}

.practical-label {
  font-family: var(--font-label);
  font-size: .58rem;
  text-transform: uppercase;
  color: var(--ink-soft);
  letter-spacing: .05em;
}

.practical-val {
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  color: var(--sage-deep);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 4px;
  background: var(--warm-white);
  border: 1px solid var(--mist);
  font-family: var(--font-body);
  font-size: .82rem;
  color: var(--sage-deep);
  font-weight: 500;
}

.detail-fontes {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--mist);
  font-family: var(--font-label);
  font-size: .65rem;
  color: var(--ink-soft);
}

.detail-fontes a {
  color: var(--sage-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-fontes a:hover {
  color: var(--terra);
}

.report-area {
  margin-top: 2rem;
  padding: 1.2rem;
  border: 1px dashed var(--mist);
  border-radius: 4px;
  text-align: center;
}

.report-area p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: .95rem;
  color: var(--ink-mid);
  margin-bottom: 12px;
}

.report-btn {
  background: transparent;
  border: 1px solid var(--terra);
  color: var(--terra);
  padding: .5rem 1.2rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.report-btn:hover {
  background: var(--terra);
  color: #fff;
}

/* ============================================================
   14. Modals
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28,51,32,.5);
  z-index: 2000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--warm-white);
  border-radius: 6px;
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.8rem 1.5rem 1.5rem;
  position: relative;
  box-shadow: var(--shadow-paper-lg);
  border: 1px solid var(--mist);
  animation: modal-slide-up .3s cubic-bezier(.2,.9,.3,1);
}

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: .8rem;
  right: .8rem;
  background: var(--mist-soft);
  border: 1px solid var(--mist);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-mid);
  transition: background .2s, color .2s, border-color .2s;
}

.modal-close:hover {
  background: var(--terra);
  color: #fff;
  border-color: var(--terra);
}

.modal h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--sage-deep);
  margin-bottom: 1rem;
  line-height: 1.1;
}

.modal-desc {
  font-family: var(--font-body);
  font-size: .88rem;
  color: var(--ink-mid);
  line-height: 1.6;
  margin-bottom: 10px;
}

.modal-place-name {
  font-family: var(--font-body);
  font-size: .88rem;
  color: var(--sage-dark);
  font-weight: 600;
  margin-bottom: 1rem;
}

.modal-hint {
  font-family: var(--font-body);
  font-size: .75rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-top: 8px;
}

.form-row {
  margin-bottom: 14px;
}

.form-row label {
  display: block;
  font-family: var(--font-label);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: .65rem .9rem;
  border: 1px solid var(--mist);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: .88rem;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color .2s;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--sage-dark);
  box-shadow: 0 0 0 3px rgba(77,107,77,.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: .85rem;
  color: var(--ink-mid);
  cursor: pointer;
  padding: 5px 6px;
  border-radius: 4px;
  transition: background .15s;
}

.radio-group label:hover {
  background: var(--mist-soft);
}

.radio-group input {
  accent-color: var(--terra);
}

.submit-btn {
  width: 100%;
  background: var(--sage-deep);
  color: var(--paper);
  border: none;
  padding: .8rem;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  transition: background .2s, transform .1s;
}

.submit-btn:hover {
  background: var(--terra);
}

.submit-btn:active {
  transform: scale(.99);
}

.submit-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.modal-success {
  text-align: center;
  padding: 2rem 1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--sage-deep);
}

.modal-success::before {
  content: "✓";
  display: block;
  font-size: 3rem;
  color: var(--terra);
  margin-bottom: 10px;
  font-style: normal;
}

.modal-error {
  padding: 10px 14px;
  background: #faebe7;
  color: #8b3a30;
  border: 1px solid #e8c8c0;
  border-radius: 4px;
  margin-top: 10px;
  font-size: .82rem;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.credit-item {
  margin-bottom: 6px;
  font-family: var(--font-body);
  font-size: .78rem;
  color: var(--ink-mid);
  line-height: 1.5;
}

.credit-item a {
  color: var(--sage-dark);
  text-decoration: underline;
}

.credit-item a:hover {
  color: var(--terra);
}

/* ============================================================
   15. Legal links no fim da lista
   ============================================================ */
.list-legal {
  margin: 3rem auto 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--sage-light, #d9d1bf);
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft, #5a6b60);
}
.list-legal button,
.list-legal a {
  background: transparent; border: none; padding: 0;
  color: inherit; text-decoration: none; cursor: pointer;
  font: inherit;
}
.list-legal button:hover,
.list-legal a:hover { color: var(--terra, #c16c46); text-decoration: underline; }
.list-legal span { margin: 0 0.4rem; opacity: 0.5; }

.list-attrib {
  margin: 0.6rem auto 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink-soft, #5a6b60);
  opacity: 0.75;
}
.list-attrib a { color: inherit; text-decoration: underline; }

/* Alvo do IntersectionObserver que alimenta a lista por lotes. */
.list-sentinel {
  min-height: 1px;
  padding: 1.2rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft, #5a6b60);
  opacity: 0.6;
}

/* ============================================================
   16. Cluster bubble + Leaflet popup overrides
   ============================================================ */
.cluster-bubble {
  background: linear-gradient(135deg, var(--sage), var(--sage-deep));
  color: var(--paper);
  border: 3px solid var(--paper);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9rem;
  box-shadow: 0 4px 14px rgba(28,51,32,.35);
}

.leaflet-popup-content-wrapper {
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: .85rem;
  color: var(--ink);
  box-shadow: var(--shadow-paper-lg);
  border: 1px solid var(--mist);
}

.leaflet-popup-tip {
  background: var(--warm-white);
}

.popup-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--sage-deep);
  margin-bottom: 4px;
}

.popup-loc {
  font-family: var(--font-label);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.popup-tag {
  font-family: var(--font-body);
  font-size: .65rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--mist-soft);
  color: var(--sage-deep);
}

.popup-btn {
  background: var(--terra);
  color: #fff;
  border: none;
  padding: .4rem .9rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.popup-btn:hover {
  background: var(--rust);
}

.popup-img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 8px;
}

/* ============================================================
   17. Keyframes — pulse (locate btn)
   ============================================================ */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(66,133,244,.4); }
  70%  { box-shadow: 0 0 0 12px rgba(66,133,244,0); }
  100% { box-shadow: 0 0 0 0 rgba(66,133,244,0); }
}

/* ============================================================
   18. Keyframes — fadeIn (cards)
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   19. Focus-visible
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   20. @media (min-width: 640px) — Tablet
   ============================================================ */
@media (min-width: 640px) {
  .tab-bar { display: none; }

  .header-nav {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,.06);
    padding: 3px;
    border-radius: 999px;
  }
  .header-tab { display: inline-flex; }
  .header-mine { display: inline-flex; }

  #map-view { height: calc(100vh - var(--header-h)); }

  .map-locate-btn { bottom: 16px; }

  .filter-bar {
    position: static;
    border-bottom: none;
    padding: 1rem 0 0;
    justify-content: flex-start;
  }

  #list-view.active {
    padding: 0 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
  }

  .list-title { font-size: 2rem; }

  .parks-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.4rem;
  }

  .detail-hero { height: 320px; }

  .detail-body { padding: 2rem 1.5rem; }

  .detail-name { font-size: 2.2rem; }
}

/* ============================================================
   21. @media (min-width: 1024px) — Desktop
   ============================================================ */
@media (min-width: 1024px) {
  .parks-grid { grid-template-columns: repeat(3, 1fr); }

  .detail-hero { height: 380px; }

  .detail-body {
    padding: 2.5rem 2rem;
    max-width: 900px;
    margin: 0 auto;
  }

  .detail-name { font-size: 2.6rem; }

  .card-img,
  .card-placeholder { height: 200px; }
}

/* ============================================================
   22. @media (prefers-reduced-motion: reduce)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .park-card,
  .modal,
  .modal-overlay,
  .bottom-sheet-panel { animation: none; }

  * { transition: none !important; }
}

/* ─── COMMUNITY VOTES ─── */
.vote-section h3 { margin: 0 0 0.5rem; }
.vote-empty { color: var(--sage-deep, #5c7a5c); font-size: 0.9rem; margin: 0 0 0.75rem; opacity: 0.8; }
.vote-list { display: flex; flex-direction: column; gap: 0.4rem; }
.vote-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; padding: 0.6rem 0.75rem;
  background: #fff; border: 1px solid #e4e4e4; border-radius: 12px;
}
.vote-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; flex: 1; min-width: 0; }
.vote-emoji { font-size: 1.1rem; flex-shrink: 0; }
.vote-buttons { display: flex; gap: 0.35rem; flex-shrink: 0; }
.vote-btn {
  border: 1px solid #d4d4d4; background: #f7f7f7; color: #333;
  padding: 0.35rem 0.6rem; border-radius: 8px; font-size: 0.85rem;
  cursor: pointer; min-width: 52px; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.vote-btn:hover { background: #eee; }
.vote-btn.lean.vote-yes { background: #e6f3e3; border-color: #b7d7ad; color: #2e5c2a; }
.vote-btn.lean.vote-no  { background: #f6e2e0; border-color: #d8a9a3; color: #7a2f27; }
.vote-btn.voted { border-width: 2px; font-weight: 600; }
.vote-btn.voted.vote-yes { border-color: #4a8a3a; background: #d3eccd; color: #1e4a19; }
.vote-btn.voted.vote-no  { border-color: #8a3a2e; background: #f1cdc8; color: #5a1f17; }
.vote-count { font-variant-numeric: tabular-nums; margin-left: 0.2rem; }

.vote-drawer-open {
  margin-top: 0.75rem; width: 100%;
  background: var(--sage-deep, #5c7a5c); color: #fff;
  border: none; padding: 0.75rem 1rem; border-radius: 10px;
  font-size: 0.95rem; cursor: pointer;
}
.vote-drawer-open:hover { opacity: 0.92; }

/* ─── DRAWER ─── */
#vote-drawer { position: fixed; inset: 0; z-index: 1100; pointer-events: none; }
#vote-drawer .drawer-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45);
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
#vote-drawer.open { pointer-events: auto; }
#vote-drawer.open .drawer-backdrop { opacity: 1; pointer-events: auto; }

#vote-drawer .drawer-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fafaf7;
  border-top-left-radius: 18px; border-top-right-radius: 18px;
  height: 88vh; max-height: 88vh;
  transform: translateY(100%); transition: transform 0.28s ease-out;
  display: flex; flex-direction: column;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.18);
}
#vote-drawer.open .drawer-panel { transform: translateY(0); }
.drawer-header { padding: 1rem 1.1rem 0.75rem; border-bottom: 1px solid #e8e8e8; position: relative; }
.drawer-header h2 { margin: 0 0 0.25rem; font-size: 1.15rem; }
.drawer-sub { margin: 0; font-size: 0.85rem; color: #555; padding-right: 2rem; }
.drawer-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: transparent; border: none; font-size: 1.6rem; line-height: 1;
  cursor: pointer; color: #555; padding: 0.2rem 0.4rem;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 0.75rem 1.1rem 1rem; }
.drawer-section { margin-bottom: 1.25rem; }
.drawer-section h3 {
  margin: 0 0 0.5rem; font-size: 0.85rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--sage-deep, #5c7a5c);
}
.drawer-footer { padding: 0.6rem 1.1rem; border-top: 1px solid #e8e8e8; }
.drawer-footer small { color: #777; font-size: 0.78rem; }
body.drawer-open { overflow: hidden; }

@media (min-width: 720px) {
  #vote-drawer .drawer-panel {
    left: auto; right: 0; top: 0; bottom: 0;
    width: 440px; max-width: 90vw; height: 100vh; max-height: 100vh;
    border-radius: 0; border-top-left-radius: 18px; border-bottom-left-radius: 18px;
    transform: translateX(100%); box-shadow: -8px 0 24px rgba(0,0,0,0.18);
  }
  #vote-drawer.open .drawer-panel { transform: translateX(0); }
}

/* ─── TOAST ─── */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1.2rem);
  background: rgba(30,30,30,0.95); color: #fff;
  padding: 0.65rem 1rem; border-radius: 10px;
  font-size: 0.88rem; max-width: 90vw;
  opacity: 0; pointer-events: none; z-index: 1200;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ─── FAVORITOS ─── */
.card-fav {
  position: absolute; top: 0.5rem; right: 0.5rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: none;
  font-size: 1.1rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #888;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.12s, color 0.12s, background 0.12s;
  z-index: 2;
}
.card-fav:hover { transform: scale(1.08); background: #fff; }
.card-fav.is-fav { color: #e8b325; background: #fff; }

.detail-fav {
  min-width: 2.5rem; padding-left: 0.6rem; padding-right: 0.6rem;
  font-size: 1.15rem; line-height: 1;
}
.detail-fav.is-fav { color: #e8b325; }

/* Grab handle no drawer (só mobile, sinaliza swipe-down) */
@media (max-width: 719px) {
  #vote-drawer .drawer-panel::before {
    content: ""; position: absolute; top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 2px;
    background: #d4d4d4;
  }
  #vote-drawer .drawer-header { padding-top: 1.3rem; }
}

/* ─── IDENTITY ─── */
.about-actions { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.modal-desc--small { font-size: 0.82rem; color: #666; margin: 0; }
.text-btn {
  background: transparent; border: none; color: #a33; cursor: pointer;
  font-size: 0.85rem; padding: 0.4rem 0; text-decoration: underline;
}
.text-btn:hover { color: #7a1818; }

/* ─── SUGGEST VIEW ─── */
#suggest-view { padding: 0 1rem 6rem; max-width: 720px; margin: 0 auto; }
.suggest-header { padding: 1rem 0 0.25rem; }
.suggest-header h1 { margin: 0 0 0.35rem; font-size: 1.45rem; }
.suggest-lead { margin: 0; color: #555; font-size: 0.9rem; line-height: 1.45; }
.suggest-lead .thumb-inline { display: inline-block; filter: grayscale(0.1); }
.suggest-compose { margin: 0.9rem 0 1.2rem; }
.suggest-compose .submit-btn { width: 100%; }
.suggest-list { display: flex; flex-direction: column; gap: 0.6rem; }
.suggest-loading, .suggest-empty {
  padding: 1.5rem 1rem; text-align: center;
  color: #777; background: #f7f7f4; border-radius: 12px;
}
.suggest-card {
  display: flex; align-items: stretch; gap: 0.6rem;
  background: #fff; border: 1px solid #e4e4e4; border-radius: 14px;
  padding: 0.85rem 0.9rem;
}
.suggest-card-body { flex: 1; min-width: 0; }
.suggest-name { margin: 0 0 0.2rem; font-size: 1rem; line-height: 1.25; }
.suggest-local { font-size: 0.82rem; color: #666; margin-bottom: 0.35rem; }
.suggest-porque { margin: 0; font-size: 0.92rem; line-height: 1.45; color: #333; }
.suggest-author { display: block; font-size: 0.78rem; color: #888; margin-top: 0.45rem; }
.suggest-upvote {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 3.2rem; gap: 0.2rem;
  background: #f7f7f4; border: 1px solid #d8d8d8; border-radius: 10px;
  cursor: pointer; padding: 0.3rem 0;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.suggest-upvote:hover { background: #eee; }
.suggest-upvote:active { transform: scale(0.96); }
.suggest-upvote.is-up {
  background: #dcefd2; border-color: #8dbd72; color: #235917;
}
.suggest-thumb { font-size: 1.1rem; line-height: 1; }
.suggest-count { font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ─── COMENTÁRIOS ─── */
.comments-section h3 { margin-bottom: 0.5rem; }
.comments-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.9rem; }
.comments-loading, .comments-empty {
  padding: 0.75rem 1rem; text-align: center;
  color: #888; font-size: 0.9rem; background: #f7f7f4; border-radius: 10px;
}
.comment {
  background: #fff; border: 1px solid #e4e4e4; border-radius: 12px;
  padding: 0.7rem 0.85rem;
}
.comment-meta { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.3rem; }
.comment-author { font-size: 0.92rem; }
.comment-date { font-size: 0.78rem; color: #888; }
.comment-text { margin: 0; font-size: 0.92rem; line-height: 1.45; color: #333; white-space: pre-wrap; }
.comment-form { margin-top: 0.35rem; }
.comment-form textarea { width: 100%; min-height: 5rem; margin-bottom: 0.5rem; }
.comment-form-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.comment-form-row .submit-btn { flex-shrink: 0; width: auto; padding: 0.5rem 1rem; }
.comment-form-row .modal-error { flex: 1; margin: 0; }
.comments-note { margin: 0.5rem 0 0; font-size: 0.78rem; color: #888; }

/* ─── FOTOGRAFIAS ─── */
.photos-section h3 { margin-bottom: 0.5rem; }
.photos-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.4rem; margin-bottom: 0.75rem;
}
.photos-loading, .photos-empty {
  grid-column: 1 / -1;
  padding: 0.75rem 1rem; text-align: center;
  color: #888; font-size: 0.9rem; background: #f7f7f4; border-radius: 10px;
}
.photo-tile {
  display: block; aspect-ratio: 1/1; overflow: hidden;
  border-radius: 10px; background: #eee;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.photo-tile:hover img { transform: scale(1.04); }

.photo-upload { margin-top: 0.35rem; }
.photo-upload .submit-btn { width: 100%; }
.photo-note { margin: 0.4rem 0 0; font-size: 0.78rem; color: #888; }

/* ─── PHOTO MODAL (lightbox) ─── */
.photo-modal { position: fixed; inset: 0; z-index: 1300; }
.photo-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.92);
}
.photo-modal-stage {
  position: absolute; inset: 4rem 1rem 4rem 1rem;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.photo-modal-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; display: block;
  border-radius: 6px; box-shadow: 0 6px 32px rgba(0,0,0,0.5);
  pointer-events: auto;
}
.photo-modal-close,
.photo-modal-prev,
.photo-modal-next {
  position: absolute; background: rgba(0,0,0,0.55); color: #fff;
  border: none; cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.photo-modal-close:hover,
.photo-modal-prev:hover,
.photo-modal-next:hover { background: rgba(0,0,0,0.85); }
.photo-modal-close {
  top: 0.75rem; right: 0.75rem;
  width: 2.5rem; height: 2.5rem; font-size: 1.4rem; line-height: 1;
}
.photo-modal-prev,
.photo-modal-next {
  top: 50%; transform: translateY(-50%);
  width: 3rem; height: 3rem; font-size: 2rem; line-height: 1; padding-bottom: 0.2rem;
}
.photo-modal-prev { left: 0.5rem; }
.photo-modal-next { right: 0.5rem; }
.photo-modal-caption {
  position: absolute; bottom: 1rem; left: 0; right: 0;
  text-align: center; color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  display: flex; gap: 0.75rem; justify-content: center; align-items: baseline;
  padding: 0 1rem;
}
.photo-modal-count { color: rgba(255,255,255,0.55); font-variant-numeric: tabular-nums; }
body.photo-modal-open { overflow: hidden; }

/* photo-tile como botão (não anchor) */
button.photo-tile {
  display: block; width: 100%; aspect-ratio: 1/1; overflow: hidden;
  border-radius: 10px; background: #eee;
  border: none; padding: 0; cursor: pointer;
}
button.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
button.photo-tile:hover img { transform: scale(1.04); }

/* ─── Form helpers (sugerir modal) ─── */
.form-author {
  border: 1px solid var(--mist);
  border-radius: 10px;
  padding: 0.75rem 1rem 0.5rem;
  margin: 0.75rem 0;
}
.form-author legend {
  padding: 0 0.4rem;
  font-size: 0.8rem;
  color: var(--ink-mid);
}
.form-hint {
  font-size: 0.8rem;
  color: var(--ink-mid);
  margin: 4px 0 0;
}

/* ─── ADICIONAR LOCAL ─── */
.addlocal-form { padding: 1rem 0 0; }
.addlocal-header { margin-bottom: 1.25rem; }
.addlocal-header h1 { margin: 0 0 0.35rem; font-size: 1.45rem; }
.addlocal-lead { margin: 0; color: #555; font-size: 0.9rem; line-height: 1.45; }

.form-file {
  display: block; width: 100%; padding: 0.5rem 0; font-size: 0.92rem;
}
.addlocal-foto-preview { margin-top: 0.6rem; }
.addlocal-preview-img {
  max-width: 100%; max-height: 220px; border-radius: 10px;
  object-fit: cover; display: block;
}
.addlocal-foto-remove {
  margin-top: 0.5rem; padding: 0.4rem 0.85rem; font: inherit; font-size: 0.82rem;
  color: var(--rust); background: transparent; border: 1px solid var(--mist);
  border-radius: 8px; cursor: pointer;
}
.addlocal-foto-remove:hover { border-color: var(--rust); background: rgba(156,74,31,.06); }

/* Grelha de miniaturas (até 5 fotos no adicionar) */
.addlocal-foto-grid {
  margin-top: 0.6rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 0.5rem;
}
.addlocal-thumb { position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; }
.addlocal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.addlocal-thumb-remove {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px;
  border: none; border-radius: 50%; background: rgba(26,31,28,.7); color: #fff;
  font-size: 0.85rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.addlocal-thumb-remove:hover { background: var(--rust); }

/* Dropzone de foto (arrastar para importar) */
.addlocal-dropzone {
  border: 2px dashed var(--sage-light);
  border-radius: 12px;
  background: var(--warm-white);
  padding: 1.4rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  outline: none;
}
.addlocal-dropzone:hover,
.addlocal-dropzone:focus-visible { border-color: var(--sage); background: var(--cream); }
.addlocal-dropzone.dragover { border-color: var(--terra); background: rgba(181,102,56,.08); }
.addlocal-dropzone.has-file { border-style: solid; border-color: var(--sage); }
.addlocal-dropzone-inner {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  pointer-events: none;
}
.addlocal-dropzone-icon { font-size: 1.6rem; line-height: 1; }
.addlocal-dropzone-text { font-size: 0.9rem; color: var(--ink-mid); line-height: 1.4; }
.addlocal-dropzone-link { color: var(--sage-dark); text-decoration: underline; font-weight: 600; }

/* ─── OS MEUS LOCAIS ─── */
#mine-view { padding: 1.25rem 1rem 3rem; max-width: 720px; margin: 0 auto; }
.mine-head { margin-bottom: 1.25rem; }
.mine-head h1 { margin: 0 0 .35rem; font-size: 1.45rem; }
.mine-sub { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.mine-link {
  background: none; border: none; color: var(--sage-dark); font: inherit;
  font-size: .85rem; text-decoration: underline; cursor: pointer; padding: 0; margin-top: .4rem;
}
.mine-gate { max-width: 360px; display: flex; flex-direction: column; gap: .6rem; }
.mine-loading, .mine-empty { color: var(--ink-soft); padding: 1.5rem 0; text-align: center; line-height: 1.5; }
.mine-card {
  border: 1px solid var(--mist); border-radius: 14px; background: var(--warm-white);
  padding: 1rem; margin-bottom: 1rem;
}
.mine-card .form-row { margin-bottom: .6rem; }
.mine-fotos { margin: .4rem 0 .8rem; }
.mine-fotos > label { display: block; font-size: .8rem; color: var(--ink-soft); margin-bottom: .3rem; }
.mine-fotos-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; margin-bottom: .6rem;
}
.mine-meta { color: var(--ink-soft); font-size: .85rem; }
.mine-foto { position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; }
.mine-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mine-foto-del {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px;
  border: none; border-radius: 50%; background: rgba(26,31,28,.7); color: #fff;
  font-size: .85rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.mine-foto-del:hover { background: var(--rust); }
.mine-dropzone { padding: .8rem 1rem; }
.mine-foto-status { margin: .4rem 0 0; font-size: .82rem; color: var(--ink-soft); }
.mine-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .4rem; }
.mine-actions .submit-btn { flex: 0 0 auto; width: auto; }
.mine-del-btn {
  background: transparent; border: 1px solid var(--rust); color: var(--rust);
  border-radius: 10px; padding: .55rem 1rem; font: inherit; font-size: .88rem; cursor: pointer;
}
.mine-del-btn:hover { background: var(--rust); color: #fff; }
.mine-card-msg { margin: .6rem 0 0; font-size: .85rem; color: var(--sage-dark); }
.mine-card-msg.error { color: var(--rust); }

/* Ecrãs maiores: nome/tipo lado a lado, resto a toda a largura (menos "mobile"). */
@media (min-width: 640px) {
  .mine-card {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; align-items: start;
  }
  .mine-card > .form-row:nth-child(3),
  .mine-card > .form-row:nth-child(4),
  .mine-card > .mine-fotos,
  .mine-card > .mine-actions,
  .mine-card > .mine-card-msg { grid-column: 1 / -1; }
}

.addlocal-characteristics { margin: 1.5rem 0; }
.addlocal-section-title { margin: 0 0 0.2rem; font-size: 1rem; }
.addlocal-section-sub { margin: 0 0 1rem; font-size: 0.85rem; color: #666; }

.addlocal-category { margin-bottom: 1.1rem; }
.addlocal-category-title {
  font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #888; margin: 0 0 0.5rem;
}
.addlocal-field-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; padding: 0.45rem 0;
  border-bottom: 1px solid #f0f0ec;
}
.addlocal-field-row:last-child { border-bottom: none; }
.addlocal-field-label { font-size: 0.92rem; flex: 1; min-width: 0; }
.addlocal-field-btns { display: flex; gap: 0.35rem; flex-shrink: 0; }
.addlocal-vote-btn {
  width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 2px solid #e0e0e0;
  background: #fafaf8; cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.addlocal-vote-btn:hover { border-color: #aaa; background: #f2f2ee; }
.addlocal-vote-yes.active { border-color: #3a7a3a; background: #e8f4e8; }
.addlocal-vote-no.active { border-color: #a03030; background: #f9e8e8; }
