@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Nunito:wght@400;600;700&display=swap');

:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --text: #1f1a2e;
  --muted: #6b6578;
  --line: #e8e2d8;
  --accent: #7c3aed;
  --accent-dark: #5b21b6;
  --accent-soft: #f1eafe;
  --ok: #15803d;
  --warn: #b45309;
  --no: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31,26,46,.06), 0 4px 16px rgba(31,26,46,.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 'Nunito', system-ui, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 520px; }
.medium { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.section { padding: 40px 0; }
.hidden, [hidden] { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- navigatie ---------- */
#site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.3rem; color: var(--text); text-decoration: none; display: flex; gap: 6px; align-items: center; }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { color: var(--text); text-decoration: none; font-weight: 600; }
.nav-links a.active, .nav-links a:hover { color: var(--accent); }
.nav-links a.btn { color: #fff; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; }
.count { background: var(--accent); color: #fff; border-radius: 99px; font-size: .75rem; padding: 1px 7px; margin-left: 2px; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); flex-direction: column; align-items: stretch; padding: 12px 20px 20px; border-bottom: 1px solid var(--line); gap: 14px; }
  #site-header.open .nav-links { display: flex; }
}

/* ---------- knoppen & formulieren ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: #fff; border: 2px solid var(--accent);
  border-radius: 999px; padding: 10px 22px; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: background .15s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); color: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: #f3efe8; border-color: var(--line); }
.btn-danger { background: transparent; border-color: #f3c4c4; color: var(--no); }
.btn-danger:hover { background: #fdeeee; border-color: #f3c4c4; }
.btn-small { padding: 6px 14px; font-size: .9rem; }
.btn-block { width: 100%; }

form .field { margin-bottom: 16px; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 100px; resize: vertical; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.check input { width: 18px; height: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- kaarten ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(31,26,46,.1); }
.card-photo { aspect-ratio: 4/3; background: var(--accent-soft); position: relative; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.no-photo { width: 100%; height: 100%; display: grid; place-items: center; font-size: 3rem; }
.card-body { padding: 14px 16px 16px; }
.card-body h3 { margin-bottom: 4px; }
.card-body p { margin: 0; }
.badge { position: absolute; top: 10px; left: 10px; background: #fff; border-radius: 99px; padding: 2px 10px; font-size: .8rem; font-weight: 700; }
.badge-gereserveerd { color: var(--warn); }
.badge-geruild { color: var(--muted); }
.badge-verborgen { color: var(--muted); }

/* ---------- filters ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 14px; font: inherit; font-size: .9rem; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.filters { display: grid; gap: 14px; margin-bottom: 24px; }
.filters .label { font-size: .85rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.tabs { display: inline-flex; border: 1.5px solid var(--line); border-radius: 99px; padding: 3px; background: #fff; }
.tabs button { border: 0; background: none; padding: 6px 16px; border-radius: 99px; font: inherit; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--accent-soft); color: var(--accent-dark); }
#map { height: 520px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 1; }
.map-popup img { width: 160px; border-radius: 8px; margin-bottom: 6px; }

/* ---------- home ---------- */
.hero { padding: 64px 0 40px; text-align: center; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 560px; margin: 0 auto 28px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; margin-bottom: 10px; }
.donate { background: var(--accent-soft); border-radius: var(--radius); padding: 32px; text-align: center; }

/* ---------- puzzel detail ---------- */
.detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: start; }
.detail-photo { border-radius: var(--radius); overflow: hidden; background: var(--accent-soft); aspect-ratio: 4/3; }
.detail-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 16px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
@media (max-width: 760px) { .detail { grid-template-columns: 1fr; } }

/* ---------- swaps ---------- */
.swap-item { display: flex; gap: 14px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; margin-bottom: 10px; }
.swap-item:hover { border-color: var(--accent); }
.swap-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--accent-soft); display: grid; place-items: center; flex-shrink: 0; }
.status { font-size: .8rem; font-weight: 700; border-radius: 99px; padding: 2px 10px; white-space: nowrap; }
.st-wait { background: #fef3c7; color: var(--warn); }
.st-ok { background: #dcfce7; color: var(--ok); }
.st-no { background: #f3f4f6; color: var(--muted); }
.st-done { background: var(--accent-soft); color: var(--accent-dark); }

.swap-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .swap-layout { grid-template-columns: 1fr; } }
.swap-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; text-align: center; }
.swap-pair img, .swap-pair .no-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--accent-soft); font-size: 2rem; }
.swap-pair .arrow { font-size: 1.4rem; color: var(--muted); }
.meeting { background: #dcfce7; border-radius: 10px; padding: 12px 14px; margin: 14px 0; }

.chat { display: flex; flex-direction: column; height: min(70vh, 640px); padding: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; padding: 9px 14px; border-radius: 16px; background: #f3efe8; align-self: flex-start; white-space: pre-wrap; word-wrap: break-word; }
.msg.mine { background: var(--accent); color: #fff; align-self: flex-end; }
.msg .time { display: block; font-size: .72rem; opacity: .7; margin-top: 2px; }
.msg-system { align-self: center; font-size: .85rem; color: var(--muted); text-align: center; padding: 2px 10px; }
.msg-location { align-self: stretch; max-width: none; background: #fff; border: 2px dashed var(--accent); color: var(--text); border-radius: 14px; padding: 14px; }
.msg-location.accepted { border-style: solid; border-color: var(--ok); }
.msg-location.replaced { opacity: .55; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { min-height: 44px; height: 44px; max-height: 140px; border-radius: 22px; padding: 10px 16px; }
.chat-closed { padding: 14px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- dialoog ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 24px; width: min(480px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(31,26,46,.45); }
.pick-list { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; margin: 12px 0; }
.pick { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; }
.pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pick img, .pick .no-photo { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; font-size: 1.4rem; }

/* ---------- meldingen ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; }
.toast-error { background: var(--no); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .big { font-size: 3rem; }
.alert { background: #fef3c7; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }

/* ---------- voet ---------- */
#site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 32px 0 12px; margin-top: 48px; }
#site-footer a { color: var(--text); text-decoration: none; line-height: 2; }
#site-footer a:hover { color: var(--accent); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }

/* FAQ */
details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
summary { font-weight: 700; cursor: pointer; }
details p { margin: 10px 0 0; }
