/* Photocache. Light and dark themes from the same tokens; every text colour meets WCAG 2.2 AA on its background. */
:root {
  --bg: #f3f1ea; --card: #ffffff; --ink: #1c2530; --muted: #55606b; --line: #d9d4c7;
  --brand: #1f6f5c; --brand-ink: #ffffff; --link: #17594a; --head: #173d36; --head-ink: #ffffff; --head-soft: #cfe8df;
  --danger: #b42318; --danger-ink: #ffffff; --focus: #b45309;
  --ok-bg: #e2f3eb; --ok-ink: #12482f; --warn-bg: #fff3d4; --warn-ink: #5e4100; --err-bg: #fde8e6; --err-ink: #8a1c12;
  --tag-bg: #ece8de; --pin: #2563a8; --pin-found: #1f6f5c; --pin-pending: #b45309;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1514; --card: #172120; --ink: #e5ece9; --muted: #a8b4af; --line: #2b3835;
    --brand: #5cc4a5; --brand-ink: #0b1a15; --link: #7fd8bd; --head: #0b2621; --head-ink: #ffffff; --head-soft: #b5dccf;
    --danger: #ff8f80; --danger-ink: #2a0905; --focus: #fbbf24;
    --ok-bg: #143a2b; --ok-ink: #c4f0dc; --warn-bg: #3a2e0c; --warn-ink: #ffe3a3; --err-bg: #3d1611; --err-ink: #ffd2cb;
    --tag-bg: #26322f; --pin: #6aa8f0; --pin-found: #5cc4a5; --pin-pending: #fbbf24;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
a { color: var(--link); text-underline-offset: 2px; }
img { max-width: 100%; height: auto; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 .6rem; }
h2 { font-size: 1.25rem; line-height: 1.25; margin: 1.2rem 0 .6rem; }
.card > h2:first-child, .card > h1:first-child { margin-top: 0; }
p { margin: 0 0 .8rem; }
:is(a, button, input, select, textarea, summary, label.btn, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--card); color: var(--ink); padding: 8px 12px; z-index: 2000; }
.skip:focus { left: 8px; top: 8px; }
.visually-hidden, .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 16px; }
main:focus { outline: none; }

/* Header */
.site-header { background: var(--head); color: var(--head-ink); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { color: var(--head-ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; padding: 8px 0; }
.brand span, .hero h1 span { margin-right: .3em; }
.nav-out { color: var(--head-soft); padding: 8px 0; }
.site-header .btn.small { background: var(--head-ink); color: var(--head); }
.menu { border-top: 1px solid rgba(255,255,255,.12); }
.menu-row { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.menu a { color: var(--head-soft); text-decoration: none; padding: 10px 0; display: inline-block; border-bottom: 3px solid transparent; min-height: 24px; }
.menu a:hover { color: var(--head-ink); }
.menu a.active { color: var(--head-ink); border-bottom-color: var(--head-soft); font-weight: 600; }

/* Blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 16px; }
.card.narrow { max-width: 560px; margin: 24px auto; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid.two { grid-template-columns: 1fr 1fr; } }
.grid.two.tight { grid-template-columns: 1fr 1fr; gap: 12px; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.wrap-row { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.hint { color: var(--muted); font-size: .9rem; margin: .3rem 0 .6rem; }
.center { text-align: center; }
.plain { list-style: none; padding: 0; margin: 0 0 1rem; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); justify-content: space-between; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--tag-bg); color: var(--muted); vertical-align: middle; }
.tag.ok { background: var(--ok-bg); color: var(--ok-ink); }
.kicker { text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; font-weight: 700; color: var(--muted); margin: 0 0 .2rem; }
.found-badge { color: var(--ok-ink); background: var(--ok-bg); display: inline-block; padding: 4px 10px; border-radius: 8px; font-weight: 600; }
.stat strong { font-size: 2rem; }

/* Alerts */
.alert, .flash { padding: 12px 14px; border-radius: 8px; margin: 0 0 14px; }
.alert.ok, .flash.ok { background: var(--ok-bg); color: var(--ok-ink); }
.alert.warn { background: var(--warn-bg); color: var(--warn-ink); }
.alert.error, .flash.error { background: var(--err-bg); color: var(--err-ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: var(--brand-ink); border: 2px solid var(--brand);
  border-radius: 10px; padding: 9px 16px; min-height: 44px; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--link); }
.btn.big { font-size: 1.1rem; padding: 12px 22px; min-height: 52px; }
.btn.small { min-height: 34px; padding: 5px 12px; font-size: .92rem; }
.btn.wide { width: 100%; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-ink); }
.linkish { background: none; border: 0; padding: 4px 0; min-height: 24px; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }
.linkish.danger { color: var(--danger); }
form { margin: 0; }

/* Forms */
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 750; font-size: 1.1rem; margin-bottom: 8px; padding: 0; }
.field { margin: 0 0 14px; }
.field > label, .field > .label { display: block; font-weight: 650; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=file], select, textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--muted);
  border-radius: 8px; background: var(--card); color: var(--ink); }
input[type=file] { padding: 8px; }
textarea { resize: vertical; }
.check label { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; }
.check input { width: 22px; height: 22px; margin-top: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.preview { display: block; max-height: 280px; width: auto; border-radius: 10px; margin-top: 10px; }
.inline-form .field { max-width: 420px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

/* Home */
.hero { padding: 16px 0 8px; }
.hero h1 { font-size: 2.2rem; }
.lead { font-size: 1.3rem; font-weight: 600; }
.steps { padding-left: 1.3rem; margin: 0 0 1rem; }
.steps li { margin-bottom: .6rem; }

/* Landmark lists */
.lm-list { list-style: none; padding: 0; margin: 0 0 .8rem; }
.lm-list li + li { border-top: 1px solid var(--line); }
.lm { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--ink); text-decoration: none; }
.lm:hover strong { text-decoration: underline; }
.lm > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.lm img, .noimg { width: 72px; height: 72px; flex: 0 0 72px; object-fit: cover; border-radius: 8px; background: var(--tag-bg); }
.noimg { display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.lm .meta { color: var(--muted); font-size: .9rem; }
.lm-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }

/* What's here? */
.readings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.readings div { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.readings dt { font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.readings dd { margin: 0; font-weight: 600; }
.compass { position: relative; width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--line); margin: 0 0 12px; }
.compass .needle { position: absolute; left: 50%; top: 6px; width: 4px; height: 26px; margin-left: -2px; background: var(--danger); border-radius: 2px; transform-origin: 50% 26px; transition: transform .2s; }
.compass .n { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: .75rem; font-weight: 700; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; }
.result-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.result-head img { width: 140px; height: 140px; object-fit: cover; border-radius: 10px; }
.result-head .noimg { width: 140px; height: 140px; flex-basis: 140px; }
.shot { max-width: 220px; border-radius: 10px; display: block; margin: 0 0 12px; }
.logbox { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.checked { background: var(--ok-bg); color: var(--ok-ink); padding: 8px 12px; border-radius: 8px; }

/* Landmark page */
.lm-head { margin: 4px 0 14px; }
.cover { margin: 0 0 16px; }
.cover img { width: 100%; max-height: 72vh; object-fit: contain; border-radius: var(--radius); background: #000; display: block; }
.inscription { margin: 0; padding: 12px 16px; border-left: 4px solid var(--brand); background: var(--bg); border-radius: 0 8px 8px 0; font-family: Georgia, 'Iowan Old Style', serif; font-size: 1.12rem; line-height: 1.6; }
.facts { display: grid; gap: 4px 16px; grid-template-columns: 1fr; margin: 12px 0 0; }
@media (min-width: 640px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts dt { font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 0 0 8px; }
.gallery { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery li { display: flex; flex-direction: column; gap: 4px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }

/* Maps */
.minimap { height: 240px; border-radius: 10px; border: 1px solid var(--line); background: var(--tag-bg); }
.minimap.edit { height: 320px; margin-bottom: 6px; }
.bigmap { height: 62vh; min-height: 320px; border-radius: 10px; border: 1px solid var(--line); background: var(--tag-bg); }
.legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--pin); margin: 0 4px 0 10px; vertical-align: -1px; }
.legend .dot:first-child { margin-left: 0; }
.legend .dot.found { background: var(--pin-found); }
.legend .dot.pending { background: var(--pin-pending); }
.leaflet-container { font: inherit; }
.leaflet-container a { color: #17594a; }

/* My finds, review */
.finds, .review { list-style: none; padding: 0; margin: 0; }
.finds li, .review li { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.finds li:first-child, .review li:first-child { border-top: 0; }
.finds img, .review img, .finds .noimg, .review .noimg { width: 96px; height: 96px; flex: 0 0 96px; object-fit: cover; border-radius: 8px; }
.finds p, .review p { margin: 0 0 4px; }

.site-footer { margin-top: 24px; color: var(--ink); }   /* the shared footer fades its own text */
.site-footer a { color: var(--ink); }
@media print { .site-header, .site-footer, .actions, .btn { display: none !important; } body { background: #fff; } .card { border: 0; } }

/* Dashboard (admins) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0 0 14px; }
.tile { background: var(--bg); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tile .lbl { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tile .num { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile .num.good { color: var(--ok-ink); }
.tile .num.bad { color: var(--danger); }
.tile .sub { font-size: .85rem; color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 0 0 16px; }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data caption { text-align: left; font-weight: 700; padding: 6px 0; }
table.data th, table.data td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.data tbody th { font-weight: 600; }
table.data .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
