/* Minimal: black on white, IBM Plex Mono, plain text. */

/* IBM Plex Mono (SIL Open Font License), served from this server. */
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/vendor/plex/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: italic; font-weight: 400; font-display: swap; src: url("/vendor/plex/IBMPlexMono-Italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("/vendor/plex/IBMPlexMono-Bold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: italic; font-weight: 700; font-display: swap; src: url("/vendor/plex/IBMPlexMono-BoldItalic.woff2") format("woff2"); }

:root {
  --fg: #000;
  --bg: #fff;
  --muted: #666;
  --line: #000;
  --faint: #ddd;
  --font: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { font-size: 15px; }
body {
  margin: 0 auto; padding: 1.5rem 1rem 3rem; max-width: 60rem;
  background: var(--bg); color: var(--fg);
  font-family: var(--font); line-height: 1.55;
}

h1, h2, h3 { font-size: 1rem; font-weight: bold; margin: 1.75rem 0 .5rem; }
h1 { font-size: 1.15rem; text-transform: uppercase; letter-spacing: .03em; margin-top: 0; }
h2 { text-transform: uppercase; letter-spacing: .03em; }
p { margin: 0 0 .75rem; }
a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
a:hover { background: var(--fg); color: var(--bg); text-decoration: none; }
a[aria-current="page"] { font-weight: bold; text-decoration: none; }
a[aria-current="page"]::before { content: "> "; }
strong { font-weight: bold; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
img { max-width: 100%; display: block; }
ul { padding-left: 1.25rem; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.muted { color: var(--muted); }
.prose { white-space: pre-line; overflow-wrap: anywhere; margin-bottom: 1rem; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.scroll { overflow-x: auto; }

/* ---- Header & footer ---- */
header.site {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: baseline;
  border-bottom: 1px solid var(--line); padding-bottom: .75rem; margin-bottom: 1.5rem;
}
header.site .brand { font-weight: bold; text-decoration: none; margin-right: auto; }
header.site nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; }
footer.site { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: .75rem; color: var(--muted); font-size: .85rem; }

.flash { border: 1px solid var(--line); padding: .5rem .75rem; }
.flash::before { content: "* "; }
.flash-error::before { content: "! "; }

/* ---- Forms ---- */
form { margin: 0 0 1rem; }
form.inline { display: inline; margin: 0; }
label { display: block; margin-bottom: .9rem; }
label small, fieldset small { display: block; color: var(--muted); }
input, select, textarea, button, [role="button"] {
  font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 0;
}
input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea {
  display: block; width: 100%; padding: .4rem .5rem; margin-top: .2rem;
}
input[type="file"] { border: 0; padding: .3rem 0; display: block; margin-bottom: .5rem; }
input[type="checkbox"], input[type="radio"] { margin: 0 .5rem 0 0; accent-color: var(--fg); }
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { display: flex; align-items: baseline; flex-wrap: wrap; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); padding: .75rem 1rem .25rem; margin: 0 0 1rem; }
legend { padding: 0 .4rem; }

button, [role="button"] {
  display: inline-block; padding: .35rem .9rem; cursor: pointer;
  text-decoration: none; line-height: 1.4; margin: 0 .5rem .5rem 0;
}
button:hover, [role="button"]:hover { background: var(--fg); color: var(--bg); }
/* Main submit buttons are filled; .plain ones (secondary, destructive) are outlined */
button[type="submit"]:not(.link-button, .plain) { background: var(--fg); color: var(--bg); }
button[type="submit"]:not(.link-button, .plain):hover { background: var(--bg); color: var(--fg); }
.link-button {
  border: 0; background: none; padding: 0; margin: 0; color: var(--fg);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.link-button:hover { background: var(--fg); color: var(--bg); text-decoration: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 1.5rem; }
[role="group"] { display: flex; gap: .5rem; align-items: stretch; }
[role="group"] input { margin: 0; }
[role="group"] button { margin: 0; white-space: nowrap; }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-bottom: 1.5rem; }
.filters select { width: auto; margin: 0; }
.filters button { margin: 0; }

/* Sections that used to be "cards" are just blocks separated by rules */
main > article, .narrow > article, .narrow-wide > article, form > article {
  border-top: 1px solid var(--line); padding-top: .25rem; margin-bottom: 1.5rem;
}

/* ---- Page layouts ---- */
.narrow { max-width: 30rem; }
.narrow-wide { max-width: 44rem; }
.page-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.page-head [role="button"] { margin: 0; }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 2.5rem; align-items: start; }
.detail-side > article { border: 1px solid var(--line); padding: .75rem 1rem .25rem; margin-bottom: 1rem; }
.detail-side h3 { margin-top: 0; }
.detail-side [role="button"], .detail-side button { width: 100%; text-align: center; margin-right: 0; }
.detail-side form { margin-bottom: .5rem; }
@media (max-width: 760px) { .detail { grid-template-columns: 1fr; gap: 1rem; } }

/* ---- Lists of actions and people ---- */
.items { margin-bottom: 1.5rem; }
.item { border-top: 1px solid var(--faint); padding: .75rem 0 .25rem; }
.item:first-child { border-top: 1px solid var(--line); }
.item h3 { margin: 0 0 .25rem; }
.item p { margin-bottom: .25rem; }
.item.is-cancelled h3 a { text-decoration: line-through; }
.person-card header { display: flex; gap: .75rem; align-items: center; }
.skills::before { content: "skills: "; color: var(--muted); }

.avatar { object-fit: cover; flex: none; border: 1px solid var(--line); filter: grayscale(1); }
.avatar-xs { width: 1.5rem; height: 1.5rem; }
.avatar-sm { width: 2.5rem; height: 2.5rem; }
.avatar-md { width: 3rem; height: 3rem; }
.avatar-lg { width: 6rem; height: 6rem; }
.profile-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.profile-head h1 { margin: 0; }
.profile-head [role="button"] { margin: .5rem 0 0; }
.host-head { display: flex; gap: .75rem; align-items: center; margin-bottom: .75rem; }
.avatar-edit { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.avatar-edit form { flex: 1; min-width: 14rem; }

.people-list { list-style: none; padding: 0; }
.people-list li { display: flex; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--faint); }
.people-list .skills { margin: 0; }
.note { font-style: italic; margin: .25rem 0; }
.contact-inline { margin: .25rem 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.contact { margin: 0 0 .75rem; }
.contact dt { color: var(--muted); }
.contact dd { margin: 0 0 .5rem; overflow-wrap: anywhere; }
.simple-list { padding-left: 1.25rem; }

/* ---- Gallery ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); }
.gallery figcaption { font-size: .85rem; color: var(--muted); }

/* ---- Tables ---- */
table { border-collapse: collapse; width: 100%; margin-bottom: 1rem; }
th, td { text-align: left; vertical-align: top; padding: .4rem .75rem .4rem 0; border-bottom: 1px solid var(--faint); }
th { border-bottom: 1px solid var(--line); font-weight: bold; }
.admin-users select { width: auto; margin: 0; padding: .1rem .25rem; }
.admin-users tr.is-disabled td { color: var(--muted); }
.manage form { margin: .4rem 0; }
.manage button { margin: 0; }
.manage input { margin-bottom: .25rem; }
.new-link { border: 2px solid var(--line) !important; padding: .75rem 1rem !important; }
.danger-zone { border-top: 2px solid var(--line) !important; }

/* ---- Maps: colour tiles, black & white markers ---- */
.map { border: 1px solid var(--line); z-index: 0; }
.map-full { height: calc(100vh - 13rem); min-height: 22rem; }
.map-picker { height: 18rem; margin-bottom: .5rem; }
.map-detail { height: 14rem; margin-bottom: 1rem; }
.leaflet-container { font-family: var(--font); font-size: .85rem; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { border-radius: 0; box-shadow: none; border: 1px solid var(--line); }
.leaflet-bar, .leaflet-bar a { border-radius: 0 !important; }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: none !important; }
.leaflet-bar a { color: var(--fg); border-bottom-color: var(--line); }
.leaflet-control-attribution { background: rgba(255, 255, 255, .85) !important; }
.leaflet-control-attribution a, .leaflet-container a.leaflet-popup-close-button { color: var(--fg); }
.leaflet-popup-content a { color: var(--fg); }
.map-legend { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.map-legend label { margin: 0; display: flex; align-items: center; gap: .4rem; }
.dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; border: 2px solid var(--fg); }
.dot-action { background: var(--fg); }
.dot-host { background: var(--bg); }
.map-popup strong { display: block; margin-bottom: .25rem; }
.geocode-results { list-style: none; padding: 0; margin: .5rem 0; }
.geocode-results li { padding: .15rem 0; }
.geocode-results .link-button { text-align: left; }
.leaflet-marker-shadow { display: none; }
input[type="file"]::file-selector-button {
  font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 0; padding: .3rem .8rem; margin-right: .75rem; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--fg); color: var(--bg); }
.links { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.links a::after { content: " ↗"; }

/* Full-screen maps */
.map-fullscreen { position: fixed !important; inset: 0; z-index: 1000; height: 100vh !important; height: 100dvh !important; border: 0; margin: 0; }
body.has-fullscreen-map { overflow: hidden; }
.map-fs-button {
  font: inherit; font-size: .8rem; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); padding: .25rem .6rem; margin: 0; cursor: pointer;
}
.map-fs-button:hover { background: var(--fg); color: var(--bg); }
.map-detail { cursor: zoom-in; }
.map-detail.map-fullscreen { cursor: grab; }
/* Leaflet's zoom links carry role="button": undo the site's button styling for them */
.leaflet-bar a[role="button"] { margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--line); line-height: 30px; }
.leaflet-bar a[role="button"]:last-child { border-bottom: 0; }
.contact ol.prefs { margin: 0; padding-left: 1.4rem; }
.pronouns { font-weight: normal; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: .9em; }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-bottom: .75rem; }
.checks label { margin: 0; }
.food-summary { border: 1px solid var(--line); padding: .5rem 1rem; margin: 1rem 0; }
.food-summary h3 { margin-top: .25rem; }
.food-summary p { margin-bottom: .25rem; }
.org-edit { display: flex; gap: .5rem; margin: 0; flex-wrap: wrap; }
.org-edit input { width: auto; flex: 1; min-width: 10rem; margin: 0; }
.org-edit button { margin: 0; }
.filters input:not([type="checkbox"]) { width: auto; flex: 1; min-width: 12rem; margin: 0; }

/* How it works (/docs) */
.docs pre { overflow-x: auto; padding: .5rem 0 .5rem 1rem; border-left: 2px solid currentColor; font: inherit; font-size: .85rem; line-height: 1.4; }
.docs code { font: inherit; }
.docs h2 { margin-top: 2rem; }
.docs li { margin-bottom: .35rem; }

/* Admin → Sync */
.sync-setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.sync-setup textarea { width: 100%; font-family: inherit; }
.sync-page .stick { border: 1px solid var(--line); padding: .25rem .75rem .75rem; margin-bottom: 1rem; }
.sync-page .stick h3 { margin-bottom: 0; }
.sync-result { border-left: 3px solid var(--fg); padding-left: .75rem; margin: .5rem 0 1rem; }
.sync-result ul { margin: .25rem 0; }
.peer-actions { margin-top: .25rem; }
.peer-actions form + form { margin-left: .75rem; }
.network-secret { font-size: 1.25rem; letter-spacing: .05em; line-height: 1.6; }
