/* Hlaupahópar.is — "Leiðin" design system
   Warm-paper daylight cartography: one typeface, spaced-caps labels,
   hairline rules, trail-orange accent, deep moss green support. */

:root {
  --paper: #fbfaf5;
  --paper-2: #f5f3ea;
  --ink: #22261f;
  --mut: #55604f;
  --faint: #79806d;
  --line: #e8e6da;
  --line-2: #ddd9c8;
  --land: #f0eee1;
  --contour: #e3e0cf;
  --orange: #e8500a;
  --orange-2: #ff7a3d;
  --green: #2e5343;
  --green-soft: #e7eee4;
  --green-line: #dde5d6;
  --green-paper: #f0f4ec;
  --amber-soft: #f3ead6;
  --amber-ink: #7a4b12;
  --sans: "Helvetica Neue", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  font-size: 16px;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.lab {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- nav ---------- */
.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px clamp(18px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  flex-wrap: wrap;
}
.nav .logo { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; text-decoration: none; }
.nav .logo i { font-style: normal; color: var(--orange); }
.nav a:not(.logo) { font-size: 14px; font-weight: 500; text-decoration: none; }
.nav a[aria-current="page"] { font-weight: 700; }
.nav .add {
  margin-left: auto;
  background: var(--orange);
  color: #fff;
  padding: 8px 15px;
  border-radius: 6px;
  font-weight: 600 !important;
}

/* ---------- ticker ---------- */
.ticker {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: var(--paper-2);
}
.ticker__label {
  flex: none;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--green);
  color: var(--paper);
  padding: 0 14px;
}
.ticker__items {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: var(--mut);
  padding: 10px 0;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.ticker__items > span { display: inline-block; padding-left: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .ticker__items.is-rolling > span { animation: roll 45s linear infinite; }
}
@keyframes roll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker__items b { color: var(--ink); font-weight: 600; }
.ticker__items em { font-style: normal; color: var(--orange); font-weight: 700; }
.ticker__items a { text-decoration: none; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.hero__copy {
  padding: clamp(28px, 4.5vw, 56px) clamp(18px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.hero h1 {
  font-size: clamp(30px, 4.2vw, 46px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.06;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--green); }
.hero__copy p { font-size: 16.5px; color: var(--mut); max-width: 46ch; }
.hero__map { border-left: 1px solid var(--line); position: relative; min-height: 300px; }
.hero__map svg { width: 100%; height: 100%; }
.hero__map .open-map {
  position: absolute;
  right: 14px;
  bottom: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: 6px;
  text-decoration: none;
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero__map { border-left: none; border-top: 1px solid var(--line); min-height: 240px; }
}
.mini-land { fill: var(--land); stroke: var(--ink); stroke-width: 1.2; }
.mini-contour { fill: none; stroke: var(--contour); stroke-width: 1; }
.mini-mk { fill: var(--orange); stroke: var(--paper); stroke-width: 1.4; }

/* ---------- filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  border: 1.5px solid var(--line-2);
  border-radius: 6px;
  padding: 8px 15px;
  color: var(--mut);
  background: #fff;
  cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- list ---------- */
.listwrap { padding: clamp(20px, 3.5vw, 36px) clamp(18px, 4vw, 40px); }
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.list-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.list-head .count { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }
table.clubs { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.clubs th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: left;
  padding: 12px 10px 8px;
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}
.clubs td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.clubs td.nm { font-weight: 600; }
.clubs td.nm a { text-decoration: none; }
.clubs td.nm a:hover { color: var(--orange); }
.clubs td.pl, .clubs td.tm { color: var(--mut); }
.clubs td.tm { font-variant-numeric: tabular-nums; font-size: 13.5px; }
.clubs tr.is-hidden { display: none; }
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 5px;
  padding: 4px 9px;
  white-space: nowrap;
}
.badge--all { color: var(--amber-ink); background: var(--amber-soft); }
.badge--dim {
  font-weight: 500;
  font-size: 12px;
  color: var(--faint);
  background: none;
  border: 1px dashed var(--line-2);
}

/* ---------- welcome block ---------- */
.welcome {
  margin: 0 clamp(18px, 4vw, 40px) clamp(20px, 3.5vw, 36px);
  padding: 18px 20px;
  background: var(--green-paper);
  border: 1px solid var(--green-line);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
}
.welcome b { font-size: 15px; color: var(--green); }
.welcome p { font-size: 14px; color: var(--mut); max-width: 64ch; }

/* ---------- footer ---------- */
.foot {
  padding: 22px clamp(18px, 4vw, 40px) 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 13px;
  border-top: 1px solid var(--line);
}
.foot a { color: var(--mut); font-weight: 600; text-decoration: none; }

/* ---------- map page ---------- */
.map-page { display: flex; flex-direction: column; height: 100dvh; }
.map-page .nav { flex: none; }
#map { flex: 1; min-height: 0; }
.maplibregl-popup-content { font-family: var(--sans); }
.map-panel {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 5;
  width: min(320px, calc(100vw - 28px));
  max-height: calc(100% - 28px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 3px 12px rgba(34, 38, 31, 0.09);
}
.map-panel[hidden] { display: none; }
.map-panel .close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--faint);
  cursor: pointer;
  padding: 6px;
}
.map-panel .k { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange); }
.map-panel h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 5px 0 3px; }
.map-panel .desc { font-size: 13.5px; color: var(--mut); margin: 8px 0 10px; }
.map-panel .row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  border-top: 1px solid var(--land);
  padding: 7px 0 3px;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}
.map-panel .row span { color: var(--faint); flex: none; }
.map-panel .row b { text-align: right; }
.map-panel .links { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.map-panel .links a { font-size: 13px; font-weight: 700; color: var(--orange); text-decoration: none; }
.map-panel .fix { margin-top: 12px; font-size: 12px; }
.map-panel .fix a { color: var(--faint); }
.map-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid var(--paper);
  box-shadow: 0 1px 3px rgba(34, 38, 31, 0.35);
  cursor: pointer;
}
.map-marker--town { background: var(--orange-2); }
.map-nofix {
  position: absolute;
  right: 14px;
  bottom: 34px;
  z-index: 5;
  background: #fff;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--mut);
  max-width: 260px;
}
.map-nofix b { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.map-nofix a { font-weight: 600; }

/* ---------- club page ---------- */
.club-page { max-width: 760px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) 20px 64px; }
.club-page .crumb { font-size: 13px; margin-bottom: 18px; }
.club-page .crumb a { color: var(--faint); text-decoration: none; }
.club-page h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.02em; }
.club-page .sub { font-size: 15px; color: var(--mut); margin: 4px 0 20px; }
.club-page .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.club-page .desc { font-size: 16px; max-width: 65ch; margin-bottom: 26px; }
.club-page dl { border-top: 2px solid var(--ink); max-width: 560px; }
.club-page dl > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.club-page dt { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); padding-top: 3px; }
.club-page dd { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.club-page dd a { color: var(--orange); font-weight: 600; text-decoration: none; }
.club-page .stale {
  margin-top: 26px;
  padding: 14px 16px;
  background: var(--amber-soft);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--amber-ink);
  max-width: 560px;
}
.club-page .stale a { font-weight: 700; color: inherit; }
.club-page .actions { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: var(--sans);
}
.btn--primary { background: var(--orange); color: #fff; }
.btn--ghost { border-color: var(--line-2); color: var(--mut); background: #fff; }

/* ---------- form ---------- */
.form-page { max-width: 640px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) 20px 64px; }
.form-page h1 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.form-page .lede { color: var(--mut); margin-bottom: 28px; max-width: 56ch; }
.form-page form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; }
.field .hint { font-size: 12.5px; color: var(--faint); }
.field input, .field textarea, .field select {
  font-family: var(--sans);
  font-size: 15px;
  padding: 10px 12px;
  border: 1.5px solid var(--line-2);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green); outline: none; }
.sched-rows { display: grid; gap: 8px; }
.sched-row { display: grid; grid-template-columns: 1fr 110px 1fr auto; gap: 8px; }
.sched-row .rm { border: none; background: none; color: var(--faint); font-size: 18px; cursor: pointer; }
@media (max-width: 560px) { .sched-row { grid-template-columns: 1fr 100px; } }
.form-msg { padding: 14px 16px; border-radius: 8px; font-size: 14.5px; }
.form-msg--ok { background: var(--green-paper); border: 1px solid var(--green-line); color: var(--green); }
.form-msg--err { background: #f9e9e3; border: 1px solid #eccdc0; color: #8c3315; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
