/* photocoup — design tokens + layout (S1 shell). AA contrast on text pairs. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #17202b;         /* 13.9:1 on --surface */
  --ink-muted: #4c5866;   /* 6.5:1 on --surface  */
  --line: #d6dbe2;
  --brand: #0f6b4f;       /* deep green; 5.9:1 on white */
  --brand-strong: #0b513c;
  --accent-contrast: #ffffff;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(23, 32, 43, .10);
  --header-h: 58px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--brand-strong); color: var(--accent-contrast);
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 1200;
}
.skip-link:focus { left: 0; }

/* ---------- header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1100;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: 1440px; margin: 0 auto; padding: 0 20px;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--brand-strong); text-decoration: none; font-weight: 800; font-size: 1.15rem;
}
.brand__logo { stroke: currentColor; }
.site-nav__link {
  color: var(--brand-strong); font-weight: 700; text-decoration: none; padding: 8px 10px; border-radius: 8px;
}
.site-nav__link:hover { text-decoration: underline; }

.site-footer {
  background: var(--surface); border-top: 1px solid var(--line);
  color: var(--ink-muted); font-size: .9rem;
}
.site-footer__inner {
  max-width: 1440px; margin: 0 auto; padding: 14px 20px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.site-footer a { color: var(--brand-strong); }

/* ---------- landing layout: sidebar left, map right ---------- */
.site-main { flex: 1; display: flex; flex-direction: column; }
.landing {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 0;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  min-height: 0;
}

.filter-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px;
  overflow-y: auto;
}
.filter-sidebar__head { display: flex; align-items: center; justify-content: space-between; }
.filter-sidebar h2 { margin: 0 0 12px; font-size: 1.2rem; }
.filter-sidebar h3 { margin: 22px 0 6px; font-size: 1rem; }

.filter-placeholder { color: var(--ink-muted); margin: 0 0 10px; }
.filter-placeholder-list {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 8px;
}
.filter-placeholder-list li {
  border: 1px dashed var(--line); border-radius: 8px;
  padding: 10px 12px; color: var(--ink-muted); font-weight: 600;
}
.results-placeholder p { color: var(--ink-muted); margin: 4px 0 0; }

.map-area { position: relative; min-height: 320px; }
.map { position: absolute; inset: 0; z-index: 0; }
.leaflet-container { background: #dfe7ee; font: inherit; }
.noscript-note {
  position: absolute; z-index: 500; left: 12px; right: 12px; bottom: 12px;
  background: var(--surface); padding: 12px; border-radius: 8px; box-shadow: var(--shadow);
}

/* Drawer toggle: mobile only */
.filter-drawer-toggle {
  display: none;
  position: absolute; z-index: 1000; top: 12px; left: 12px;
  align-items: center; gap: 8px;
  padding: 10px 14px;
  font: inherit; font-weight: 700;
  color: var(--accent-contrast);
  background: var(--brand-strong);
  border: 0; border-radius: 10px; box-shadow: var(--shadow);
  cursor: pointer;
}
.filter-drawer-close {
  border: 0; background: transparent; font-size: 1.2rem; cursor: pointer;
  color: var(--ink); padding: 6px 10px; border-radius: 8px;
}
.filter-drawer-close:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- skeleton pages ---------- */
.skeleton-page { max-width: 860px; margin: 0 auto; padding: 28px 20px; }
.skeleton-page h1 { margin: 8px 0 12px; }
.skeleton-page code { background: #eef1f5; padding: 2px 6px; border-radius: 6px; }
.skeleton-page__nav { display: flex; gap: 16px; margin-top: 18px; }
.crumbs { margin: 0 0 6px; }
.link { color: var(--brand-strong); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- focus visibility ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- mobile (<=800px): map full-bleed, sidebar as drawer ---------- */
@media (max-width: 800px) {
  .landing { grid-template-columns: 1fr; }
  .filter-drawer-toggle { display: inline-flex; }
  .filter-sidebar {
    position: fixed; z-index: 1050; top: 0; bottom: 0; left: 0; width: min(86vw, 360px);
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
    border-right: 1px solid var(--line);
  }
  .filter-sidebar.is-open { transform: translateX(0); }
  .filter-drawer-close { display: inline-block; }
  .map-area { position: absolute; inset: var(--header-h) 0 0 0; }
  .site-main { position: relative; }
}
/* map area needs real height on mobile without grid rows */
@media (max-width: 800px) {
  .landing { min-height: calc(100svh - var(--header-h)); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
