/* Kolonikön — Artisan Ledger design language borrowed from baker-bot:
   warm flour neutrals, ink-block shadows, chunky borders. Accent swapped
   from Södermalm brick to allotment green. */

:root {
  color-scheme: light; /* keep native form controls/scrollbars light even in a dark-mode browser */
  --paper: #f7f5f0;   /* flour & cloud */
  --card:  #fffdf9;
  --ink:   #2b2b2a;   /* charcoal & cast iron */
  --mute:  #6b6656;   /* WCAG AA 5.3:1 on --paper — the old #8a8578 was only 3.4:1 */
  --line:  #e4e0d5;
  --acc:   #40694e;   /* kolonilott green */
  --acc-2: #345741;
  --bad:   #a65e44;   /* the brick stays for danger */
  --shadow: 4px 4px 0 0 var(--ink), 0 1px 3px rgba(0,0,0,.05);
  --r: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

/* Visible, on-brand keyboard focus everywhere interactive — never rely on
   the browser default, which looks out of place against the chunky-border
   system and can be suppressed by other UA styles. */
a:focus-visible, button:focus-visible, .card:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--acc) 45%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Top nav — sticky brand + board entry points, present via layout.html on
   every page. The "nav" block is overridden to just a comment (see
   admin.html/import_preview.html) on pages that are already an
   authenticated board screen and have their own in-page logout/back
   controls — the brand mark stays, since going home is always safe there
   too. */
.nav { position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 2px solid var(--ink); }
.nav-inner {
  max-width: 960px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.nav-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 17px; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
  transition: color .15s;
}
.nav-brand:hover { color: var(--acc); }
.nav-brand img { display: block; border-radius: 6px; }
.nav-acts { display: flex; align-items: center; gap: 14px; }
/* Nav-scoped override of the prose .link style (permanent underline, body
   font size) — chrome reads as chrome, not as a link inside a paragraph.
   Underline comes back on hover as the click affordance instead. */
.nav-acts a.link {
  font-size: 14px; text-decoration: none;
  transition: text-decoration-color .15s;
}
.nav-acts a.link:hover { text-decoration: underline; }

.wrap { max-width: 960px; margin: 0 auto; padding: 32px 20px 24px; }

/* Footer — plain centered text by default (see layout.html's "footer"
   block). home.html overrides it with the richer brand+links version below
   — real routes/anchors only, nothing invented. */
.foot { padding: 32px 20px 24px; border-top: 2px solid var(--ink); background: var(--card); text-align: center; color: var(--mute); font-size: 13px; }
.foot-inner {
  max-width: 960px; margin: 0 auto; text-align: left;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; flex-wrap: wrap;
}
.foot-brand { display: flex; flex-direction: column; gap: 6px; max-width: 320px; }
.foot-logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 15px; color: var(--ink); text-decoration: none;
  transition: color .15s;
}
.foot-logo:hover { color: var(--acc); }
.foot-logo img { display: block; border-radius: 6px; }
.foot-tag { margin: 0; color: var(--mute); font-size: 13px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a { color: var(--mute); font-size: 13px; text-decoration: none; }
.foot-links a:hover { color: var(--acc); text-decoration: underline; }
.foot-copy {
  max-width: 960px; margin: 24px auto 0; padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center; color: var(--mute); font-size: 12px;
}

h1 { font-size: 28px; margin: 0 0 8px; letter-spacing: -0.02em; }
.hero { margin-bottom: 24px; }
.hero p { color: var(--mute); margin: 0; font-size: 17px; }

.muted { color: var(--mute); }
.fine  { color: var(--mute); font-size: 13px; }
.center { text-align: center; }
.narrow { max-width: 420px; margin: 48px auto; }

/* Cards — chunky border + solid block shadow */
.card {
  display: block;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}
.pad { padding: 28px; }

/* Tactile press-down (baker-bot .press) */
.press { transition: transform .15s cubic-bezier(.22,1,.36,1), box-shadow .15s; }
.press:hover  { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 0 var(--ink), 0 1px 3px rgba(0,0,0,.05); }
.press:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 0 var(--ink); }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--acc);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 12px 22px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--acc-2); }
.btn.small { padding: 5px 12px; font-size: 13px; box-shadow: 2px 2px 0 0 var(--ink); }
/* .press:hover's 5px lift assumes the full-size 4px resting shadow — on a
   small button's 2px base that reads as a lurch, not a lift, so scale it
   down to the same +1px delta the large buttons get. */
.btn.small.press:hover { box-shadow: 3px 3px 0 0 var(--ink), 0 1px 3px rgba(0,0,0,.05); }
.btn.ghost { background: var(--card); color: var(--ink); }
.btn.ghost:hover { background: var(--paper); }
.btn.danger { background: var(--card); color: var(--bad); }
.btn.danger:hover { background: #f9ede8; }
.link { background: none; border: 0; color: var(--acc); font: inherit; font-weight: 600;
        cursor: pointer; text-decoration: underline; padding: 0; }
.back { display: inline-block; color: var(--acc); font-weight: 600; margin-bottom: 16px; }

/* Inputs */
label { display: block; margin: 0 0 6px; font-weight: 600; }
label .muted { font-weight: 400; }
.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font: inherit;
  border: 2px solid var(--ink);
  border-radius: var(--r);
  background: var(--card);
  margin-bottom: 16px;
}
.input:focus { outline: 3px solid color-mix(in srgb, var(--acc) 35%, transparent); }

/* Hero photo — framed like every other card, so a real photograph still
   reads as part of the flat, chunky-border system rather than a bolted-on
   stock image. */
.hero-photo {
  margin: 0 0 32px;
  border: 2px solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Fork — "join a queue" vs "I'm on a board" */
.fork { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 40px; }
.fork-card { display: flex; flex-direction: column; gap: 4px; }
.fork-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fork-head strong { font-size: 18px; }
.fork-arrow { color: var(--acc); font-weight: 700; transition: transform .15s cubic-bezier(.22,1,.36,1); }
.fork-card:hover .fork-arrow { transform: translateX(3px); }

section { margin-bottom: 40px; scroll-margin-top: 76px; }
section h2 { font-size: 20px; margin: 0 0 12px; }
#styrelse p { margin: 0 0 12px; }

/* Checklist — short, scannable facts (board section) */
.checks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 26px; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--acc); font-weight: 700; }

/* CTA fallback — mailto: fails silently with no client configured, so the
   address is always readable and copyable too. */
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }

/* Disclosure widgets — native <details>/<summary>, no JS. One shared marker
   language (hidden native triangle, "+"/"–" instead) so a collapsible FAQ
   answer and a collapsible admin-toolbar panel read as the same control. */
summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--acc); font-weight: 700; flex: none; }
details[open] > summary::after { content: "–"; }

/* FAQ — the same summary, dressed as a full-width card row. */
.faq-item {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.faq-item summary { font-weight: 600; justify-content: space-between; gap: 12px; }
.faq-item summary::after { font-size: 20px; }
.faq-item p { margin: 12px 0 0; color: var(--mute); }

/* Association list */
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
/* center, not baseline: a long name can wrap the org-name block to two
   lines (esp. on narrow screens with a plot-type badge alongside it) —
   baseline would then strand the muni text against just the first line,
   leaving it looking disconnected from the row it belongs to. */
.list a { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; }
.org-name { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Steps */
.steps { padding-left: 20px; margin: 20px 0 24px; }
.steps li { margin-bottom: 8px; }

/* Mina köplatser — one card per queue spot */
.spots { display: grid; gap: 16px; margin: 0 0 18px; }
.spots h2 { margin: 0 0 10px; }

/* Result pages */
.mark {
  width: 56px; height: 56px; margin: 8px auto 16px;
  display: grid; place-items: center;
  background: var(--acc); color: #fff;
  border: 2px solid var(--ink); border-radius: 50%;
  box-shadow: var(--shadow); font-size: 26px;
}
.mark.bad { background: var(--bad); }

/* Board screen */
.bar { display: flex; justify-content: space-between; align-items: flex-start;
       gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.bar-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Toolbar row — three-plus peer controls (export/toggle, import, board
   list) that should flow left-to-right and wrap onto a new line as a
   whole, unlike .bar's default space-between (built for exactly two
   zones: label + action, or actions + a single disclosure). With 3+
   children space-between drifts one control into the middle of the row
   with no visual relation to its neighbours. */
.bar.tools { justify-content: flex-start; }
.note { background: var(--card); border: 2px solid var(--acc); border-radius: var(--r);
        padding: 10px 16px; font-weight: 600; }
.note.bad { border-color: var(--bad); color: var(--bad); }
.import { margin-top: 12px; max-width: 480px; }
.import-history { margin-top: 20px; }

/* Queue filter bar — plain GET form, works with zero JS (Enter or the
   button submits it). */
.filter { align-items: center; }
.filter .input { width: auto; flex: 1 1 240px; margin-bottom: 0; }
/* Match the input's 44px min-height — .btn.small's own padding alone stops
   well short of it, which reads as two mismatched control heights in one row. */
.filter .btn { min-height: 44px; }

.queue { width: 100%; border-collapse: collapse;
         background: var(--card); border: 2px solid var(--ink);
         border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.queue th { text-align: left; font-size: 12px; text-transform: uppercase;
            letter-spacing: .06em; color: var(--mute);
            padding: 12px 14px; border-bottom: 2px solid var(--ink); }
.queue th a.sort { color: inherit; text-decoration: none; }
.queue th a.sort:hover { text-decoration: underline; }
.queue td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.queue tr:last-child td { border-bottom: 0; }
.nr { font-variant-numeric: tabular-nums; font-weight: 700; }
.contact { font-size: 13px; color: var(--mute); }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.acts form { margin: 0; }

/* Editable queue cells (import review) — look like plain table text until
   touched, so the table reads as data first and a form second. */
.queue.edit td { padding: 4px 8px; }
.queue.edit input.cell {
  width: 100%; min-width: 0;
  border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: inherit; font: inherit;
  padding: 6px 6px;
}
.queue.edit input.cell:hover { border-color: var(--line); }
.queue.edit input.cell:focus { border-color: var(--acc); background: var(--paper); outline: none; }
.fine.bad { color: var(--bad); font-weight: 600; }

/* Status badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px;
         font-size: 12px; font-weight: 700; border: 1.5px solid var(--ink); }
.badge.active   { background: #dcebe0; color: var(--acc-2); }
.badge.paused   { background: #f1eee6; color: var(--mute); }
.badge.imported { background: #fbf3d9; color: #8c6d1f; }
.badge.offered  { background: #e4ecf7; color: #2f4f7a; }

/* Plot type — shown wherever an applicant or board sees an association, so
   nobody confuses a short odlingslott queue with a decades-long
   koloniträdgård one. */
.badge.soil    { background: #eef1e4; color: #57633c; }
.badge.cottage { background: #f1e6d8; color: #8a5a34; }
.badge.closed  { background: #f9ede8; color: var(--bad); }

/* Plot-type filter chips on the home list — the clickable twins of the
   badges above. Pure client-side convenience, same as the search box: with
   JS off the buttons are inert and the full list simply stays visible. */
.filter-type { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.filter-type .chip {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 5px 14px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--card); color: var(--mute);
}
.filter-type .chip[aria-pressed="true"] { background: var(--acc); color: #fff; }

/* Radio groups on signup step 2 and the settings page (residency rule,
   urval). Plain fieldsets, no chrome — the legend does the grouping. */
fieldset.opts { border: 0; padding: 0; margin: 18px 0 0; }
fieldset.opts legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.radio { display: flex; gap: 8px; align-items: baseline; margin: 4px 0; font-weight: 400; cursor: pointer; }
.radio input { accent-color: var(--acc); }
fieldset.opts textarea.input { margin: 4px 0 4px 24px; width: calc(100% - 24px); }

/* Inline contact editing inside the queue table (admin.html) — the one
   entry-maintenance tool: email/phone only, kötid untouched. */
.edit-contact { margin-top: 4px; }
.edit-contact form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-width: 260px; }

@media (max-width: 720px) {
  .queue thead { display: none; }
  .queue tr { display: block; border-bottom: 2px solid var(--line); padding: 8px 0; }
  .queue td { display: block; border: 0; padding: 4px 14px; }
  .fork { grid-template-columns: 1fr; }
  .foot-inner { flex-direction: column; gap: 20px; }
}
