/* Helderberg Social — site styles. No build step; plain CSS with custom properties. */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #efece4;
  --text: #1c2431;
  --muted: #5b6573;
  --line: #e2ddd2;
  --brand: #0f4c5c;         /* deep sea */
  --brand-2: #1c7c8c;
  --accent: #f26b3a;        /* Helderberg sunset */
  --accent-2: #ffb35c;
  --green: #4f8a3c;         /* fynbos */
  --ok: #2e7d4f;
  --warn: #b35c00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 8px 24px -12px rgba(20, 30, 40, .18);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f151c; --surface: #171f28; --surface-2: #1f2933; --text: #e8edf2; --muted: #9aa7b5;
    --line: #2a3542; --brand: #5ec2d6; --brand-2: #8ad8e6; --accent: #ff8a5b; --accent-2: #ffc27a;
    --green: #7cc36a; --ok: #6fd39a; --warn: #f0a04b;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f151c; --surface: #171f28; --surface-2: #1f2933; --text: #e8edf2; --muted: #9aa7b5;
  --line: #2a3542; --brand: #5ec2d6; --brand-2: #8ad8e6; --accent: #ff8a5b; --accent-2: #ffc27a;
  --green: #7cc36a; --ok: #6fd39a; --warn: #f0a04b;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { width: min(1200px, 100% - 2rem); margin-inline: auto; }
.wrap-narrow { width: min(820px, 100% - 2rem); margin-inline: auto; }
section { padding: 2.5rem 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 60px; }
.logo { display: flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(145deg, var(--brand), var(--brand-2) 60%, var(--accent)); position: relative; flex: none; }
.logo-mark::after { content: ""; position: absolute; inset: 9px 7px 7px 7px; border-radius: 3px 3px 12px 12px; background: var(--bg); clip-path: polygon(0 100%, 35% 30%, 55% 60%, 75% 15%, 100% 100%); }
.nav { display: flex; gap: .15rem; margin-left: auto; align-items: center; }
.nav a { padding: .45rem .7rem; border-radius: 8px; color: var(--text); font-weight: 500; font-size: .93rem; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; }
.nav a.cta { background: var(--accent); color: #fff; margin-left: .35rem; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; color: var(--text); font-size: 1.1rem; cursor: pointer; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 60px; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; padding: .6rem 1rem 1rem; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { width: 100%; }
}

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1.05rem; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: .95rem; cursor: pointer; background: var(--brand); color: #fff; line-height: 1.2; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.accent { background: var(--accent); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: .4rem .7rem; font-size: .85rem; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 50%, transparent); outline-offset: 1px; border-color: var(--brand); }
label { font-weight: 600; font-size: .88rem; display: block; margin-bottom: .3rem; }
.field { margin-bottom: 1rem; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.field.error input, .field.error select, .field.error textarea { border-color: #c0392b; }
.field .err { color: #c0392b; font-size: .8rem; margin-top: .3rem; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 4.5rem 0 3.5rem; color: #fff;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(255,179,92,.45), transparent 60%),
    radial-gradient(900px 400px at 10% 110%, rgba(242,107,58,.35), transparent 60%),
    linear-gradient(160deg, #0b3a47, #0f4c5c 45%, #1c7c8c);
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 90px; background: var(--bg);
  clip-path: polygon(0 100%, 0 70%, 12% 55%, 22% 65%, 33% 35%, 42% 50%, 52% 20%, 60% 45%, 70% 30%, 80% 60%, 90% 40%, 100% 65%, 100% 100%); opacity: .95; }
.hero h1 { color: #fff; max-width: 14ch; }
.hero .lead { font-size: 1.15rem; max-width: 52ch; color: rgba(255,255,255,.88); }
.hero .wrap { position: relative; z-index: 1; }
.searchbar { display: flex; gap: .5rem; max-width: 640px; background: rgba(255,255,255,.14); padding: .45rem; border-radius: 14px; border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(6px); }
.searchbar input { background: #fff; color: #1c2431; border: none; }
.searchbar .btn { flex: none; }
.hero-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.6rem; font-size: .9rem; color: rgba(255,255,255,.85); }
.hero-stats b { font-size: 1.35rem; display: block; font-family: var(--font-display); color: #fff; }

/* Category tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.tile { display: flex; flex-direction: column; gap: .35rem; padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s; }
.tile:hover { transform: translateY(-2px); border-color: var(--brand); text-decoration: none; }
.tile .ic { font-size: 1.6rem; line-height: 1; }
.tile b { font-size: .92rem; }
.tile span { font-size: .78rem; color: var(--muted); }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: var(--text); transition: transform .12s ease, border-color .12s; }
.card:hover { transform: translateY(-2px); border-color: var(--brand); text-decoration: none; }
.card-art { height: 110px; position: relative; display: flex; align-items: end; padding: .7rem .9rem; color: #fff; font-size: 1.9rem; }
.card-art .type { position: absolute; top: .6rem; right: .7rem; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: rgba(0,0,0,.35); padding: .2rem .5rem; border-radius: 999px; }
.card-body { padding: .9rem .95rem 1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card h3 { margin: 0; font-size: 1.08rem; }
.card .meta { font-size: .82rem; color: var(--muted); display: flex; gap: .6rem; flex-wrap: wrap; }
.card .summary { font-size: .9rem; color: var(--text); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { margin-top: auto; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; padding-top: .3rem; }
.pill { display: inline-block; font-size: .74rem; padding: .2rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.free { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); border-color: transparent; }
.pill.verified { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); border-color: transparent; }
.pill.unverified { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); border-color: transparent; }

/* Filters */
.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: .6rem; margin-bottom: .8rem; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr 1fr; } }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: .35rem .75rem; font-size: .85rem; cursor: pointer; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar .count { color: var(--muted); font-size: .9rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: none; background: var(--surface); color: var(--text); padding: .45rem .8rem; cursor: pointer; font: inherit; font-size: .88rem; }
.seg button.on { background: var(--brand); color: #fff; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Map */
.map { height: 460px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--surface-2); }
.map.small { height: 280px; }
.leaflet-popup-content { font: 13px/1.4 var(--font-body); }
.leaflet-popup-content a { font-weight: 600; }

/* Events */
.event-list { display: flex; flex-direction: column; gap: .7rem; }
.event { display: grid; grid-template-columns: 74px 1fr auto; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); }
.event .date { text-align: center; background: var(--surface-2); border-radius: 10px; padding: .4rem .2rem; line-height: 1.1; }
.event .date b { display: block; font-size: 1.5rem; font-family: var(--font-display); }
.event .date span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.event h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.event .meta { font-size: .82rem; color: var(--muted); }
.event .actions { display: flex; gap: .4rem; }
@media (max-width: 600px) { .event { grid-template-columns: 64px 1fr; } .event .actions { grid-column: 1 / -1; } }
.month-head { margin: 1.6rem 0 .6rem; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-body); font-weight: 700; }

/* Listing detail */
.detail-hero { padding: 2.5rem 0 1.5rem; }
.detail-hero .kicker { font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.panel h3 { margin-top: 0; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: .4rem .8rem; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.notice { border-left: 4px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); padding: .7rem .9rem; border-radius: 8px; font-size: .88rem; }
.notice.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }

/* Towns */
.town { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: center; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.town:nth-child(even) .town-art { order: 2; }
@media (max-width: 760px) { .town { grid-template-columns: 1fr; } .town:nth-child(even) .town-art { order: 0; } }
.town-art { height: 200px; border-radius: var(--radius); background: linear-gradient(135deg, var(--brand), var(--brand-2)); position: relative; overflow: hidden; }
.town-art::after { content: ""; position: absolute; inset: auto 0 0 0; height: 55%; background: rgba(255,255,255,.12); clip-path: polygon(0 100%, 0 60%, 15% 40%, 30% 55%, 45% 20%, 60% 45%, 75% 30%, 90% 50%, 100% 35%, 100% 100%); }
.town ul { padding-left: 1.1rem; margin: .5rem 0 1rem; color: var(--muted); font-size: .92rem; }

/* CTA band */
.band { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-radius: var(--radius); padding: 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.band h2 { color: #fff; margin: 0 0 .2rem; }
.band p { margin: 0; color: rgba(255,255,255,.88); }
.band .btn { background: #fff; color: var(--brand); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; margin-top: 2rem; color: var(--muted); font-size: .88rem; }
.site-footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem; }
@media (max-width: 700px) { .site-footer .wrap { grid-template-columns: 1fr; } }
.site-footer h4 { font-family: var(--font-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.site-footer a { color: var(--muted); }

/* Utilities */
.stack { display: grid; gap: .8rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: .5rem .8rem; z-index: 100; }
.skip:focus { left: .5rem; top: .5rem; }
