:root {
  --stone: #6b5f52;
  --stone-dark: #453d34;
  --moss: #4c7a5e;
  --moss-dark: #375c46;
  --sand: #f4efe6;
  --sand-dark: #e6ddcc;
  --ink: #2b2620;
  --ink-soft: #6b6255;
  --white: #ffffff;
  --error: #b3413a;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(43, 38, 32, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--sand);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--moss-dark); }

/* ─── Header ─────────────────────────────────────────────────────────── */

.site-header {
  background: linear-gradient(135deg, var(--moss-dark), var(--moss));
  color: var(--white);
  padding: 1.1rem 1.25rem 0.9rem;
  flex-shrink: 0;
}

.header-inner h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.tagline {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

.stats-bar {
  display: flex;
  gap: 1.75rem;
  margin-top: 0.75rem;
}

.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 1.3rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.8; margin-top: 0.2rem; }

/* ─── Main / map ─────────────────────────────────────────────────────── */

main {
  position: relative;
  flex: 1;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
}

.stone-marker {
  font-size: 22px;
  text-align: center;
  line-height: 30px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.35));
}

.fab {
  position: absolute;
  right: 1.25rem;
  bottom: 1.5rem;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--moss-dark);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.3rem;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.fab:hover { background: var(--moss); }
.fab-icon { font-size: 1.3rem; line-height: 1; }

/* ─── Footer ─────────────────────────────────────────────────────────── */

.site-footer {
  flex-shrink: 0;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: var(--sand-dark);
}

/* ─── Modals ─────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 38, 32, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  border: none;
  background: var(--sand);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink-soft);
}
.modal-close:hover { background: var(--sand-dark); }

.modal h2 { margin-top: 0; }

.step { margin-bottom: 1.5rem; }
.step h3 { margin: 0 0 0.6rem; font-size: 1rem; color: var(--moss-dark); }

/* ─── Locatie kiezen ─────────────────────────────────────────────────── */

.location-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.location-controls input[type="text"] {
  flex: 1 1 160px;
}

.search-results {
  border: 1px solid var(--sand-dark);
  border-radius: 8px;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
}
.search-results.hidden { display: none; }
.search-item {
  padding: 0.5rem 0.7rem;
  font-size: 0.88rem;
  cursor: pointer;
  border-bottom: 1px solid var(--sand);
}
.search-item:hover { background: var(--sand); }
.search-item:last-child { border-bottom: none; }

.hint {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 0.3rem 0 0.6rem;
}

#pickMap {
  height: 240px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--sand-dark);
}

.picked-location {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  background: var(--sand);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
}
.picked-location.hidden { display: none; }

/* ─── Formulier ──────────────────────────────────────────────────────── */

#stoneForm label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.9rem 0 0.3rem;
}
#stoneForm input[type="text"],
#stoneForm textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--sand-dark);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--sand);
}
#stoneForm input[type="text"]:focus,
#stoneForm textarea:focus {
  outline: 2px solid var(--moss);
  outline-offset: 1px;
}
#stoneForm input[type="file"] { margin-top: 0.2rem; width: 100%; }

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.photo-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--sand-dark);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(43,38,32,0.7);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1;
}

.form-error {
  color: var(--error);
  font-size: 0.85rem;
  margin: 0.8rem 0 0;
}
.form-error.hidden { display: none; }

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--moss-dark); color: var(--white); margin-top: 1.1rem; width: 100%; }
.btn-primary:hover { background: var(--moss); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-secondary { background: var(--sand-dark); color: var(--ink); }
.btn-secondary:hover { background: #d9cdb4; }

/* ─── Detail modal ───────────────────────────────────────────────────── */

.detail-gallery {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  margin: -0.2rem -0.2rem 1rem;
  padding: 0.2rem;
}
.detail-gallery img {
  height: 200px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
}

.detail-message {
  font-style: italic;
  color: var(--ink-soft);
  border-left: 3px solid var(--moss);
  padding-left: 0.7rem;
}

.detail-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.8rem;
  font-size: 0.9rem;
  margin: 1rem 0 0;
}
.detail-meta dt { color: var(--ink-soft); font-weight: 600; }
.detail-meta dd { margin: 0; }

/* ─── Toast ──────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--white);
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-size: 0.88rem;
  z-index: 3000;
  box-shadow: var(--shadow);
}
.toast.hidden { display: none; }
.toast.toast-error { background: var(--error); }

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 560px) {
  .modal { max-height: 100vh; height: 100%; border-radius: 0; }
  .fab-label { display: none; }
  .fab { padding: 0.85rem; }
}
