/* Elements and shared pieces every page uses: type, links, form controls, buttons, pills,
   notices. Layout lives in shell.css; page-specific rules in admin.css and map.css. */

* { box-sizing: border-box; }

/* The hidden attribute always hides, whatever display a class or element rule gives the element
   (a select's display: block would otherwise show a dropdown the page hid). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--milk);
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.25rem); line-height: 1.08; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; line-height: 1.2; font-weight: 600; }
h3 { font-size: 1.05rem; line-height: 1.25; font-weight: 600; }
p { margin: 0; }

a { color: var(--pasture); text-underline-offset: 2px; }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---- form controls ---- */
label { display: block; font-size: 0.875rem; font-weight: 700; }

input[type="email"], input[type="text"], input[type="date"], select, textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--field-line);
  border-radius: var(--radius-m);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--pasture); outline-offset: 1px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.check { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: 1rem; font-weight: 400; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--pasture); }
.facts { color: var(--spot); font-size: 0.9rem; }

/* ---- buttons ---- */
button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  background: var(--pasture);
  border: 1.5px solid var(--pasture);
  border-radius: var(--pill);
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button-link:hover { color: #fff; background: var(--pasture-dark); border-color: var(--pasture-dark); }
button.wide { width: 100%; }
button.secondary { color: var(--ink); background: var(--card); border-color: var(--ink); font-weight: 500; }
button.secondary:hover { background: var(--wash); color: var(--ink); }
.button-link.outline { min-height: 36px; padding: 6px 16px; color: var(--ink); background: var(--card); border-color: var(--ink); font-size: 0.875rem; font-weight: 500; }
.button-link.outline:hover { color: var(--ink); background: var(--wash); border-color: var(--ink); }
button.danger { background: var(--removed-ink); border-color: var(--removed-ink); }
button.danger:hover { background: var(--removed-ink-dark); border-color: var(--removed-ink-dark); }

/* ---- pills ---- */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--pill);
  white-space: nowrap;
}
.pill-live { background: var(--live-bg); color: var(--live-ink); }
.pill-upcoming { background: var(--upcoming-bg); color: var(--upcoming-ink); }
.pill-finished { background: var(--finished-bg); color: var(--finished-ink); }
.pill-simulated { background: var(--simulated-bg); color: var(--simulated-ink); }
.pill-removed { background: var(--removed-bg); color: var(--removed-ink); }

/* ---- messages ---- */
.notice, .error, .banner {
  padding: 12px 16px;
  border-radius: var(--radius-m);
  font-weight: 600;
}
.notice { background: var(--notice-bg); border: 1px solid var(--notice-line); }
.error { background: var(--error-bg); border: 1px solid var(--error-line); color: var(--error-ink); }
.banner { background: var(--buttercup-pale); border: 1px solid var(--buttercup); }
.callout { padding: 14px 16px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-m); font-size: 0.95rem; }
.callout > * + * { margin-top: 8px; }
.empty { padding: 24px; background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius-l); color: var(--spot); }

/* Read by screen readers, not shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
