/* Kassandra — screen styles. "Warm linen & clay": creamy linen background, soft cream panels,
   espresso text, terracotta accent. Calm paper-case-file feel; layered like WRP, its own palette.
   No build step. Print (print.css) stays its own light document. */
:root {
  --bg: #ece7df;          /* warm linen — never stark white */
  --panel: #f7f4ee;       /* cream cards */
  --panel-2: #f1ece2;     /* a notch deeper than the cards — quiet fills (disclaimer, notices) */
  --ink: #2e2a25;         /* espresso */
  --muted: #6f675c;       /* warm grey */
  --line: #ddd5c8;        /* linen hairlines */
  --accent: #b0603f;      /* terracotta / clay */
  --accent-ink: #ffffff;
  --link: #3d6b8e;        /* calm steel blue */
  --ok: #4a7c59;          /* moss */
  --warn: #b06a12;        /* amber */
  --radius: 12px;
  --shadow: 0 1px 2px rgba(62, 50, 38, 0.06), 0 4px 16px rgba(62, 50, 38, 0.05);
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--panel);
  border-top: 3px solid var(--accent); /* the clay brand line */
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site .brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); }
header.site .brand .dog { margin-right: 0.25rem; }
header.site nav { display: flex; align-items: center; gap: 1rem; }
header.site nav .who { color: var(--muted); font-size: 0.85rem; }

main { max-width: 1120px; margin: 1.5rem auto; padding: 0 1.25rem; }
footer.site { max-width: 1120px; margin: 2rem auto 3rem; padding: 0 1.25rem; color: var(--muted); font-size: 0.85rem; }

.stack { display: flex; flex-direction: column; gap: 1.25rem; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.card.narrow { max-width: 420px; margin: 3rem auto; }

/* Request hero — a taller card with a faint terracotta sketch anchored along the bottom (the
   image's own paper tone is close to --panel, so it reads as part of the card, not an overlay). */
.hero { position: relative; overflow: hidden; min-height: 340px; padding: 3rem 2.5rem 7rem; display: block; }
.hero .hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("/hero-bg.jpg") bottom center / cover no-repeat;
}
.hero .hero-copy { position: relative; z-index: 1; max-width: 40rem; }
.hero .hero-copy h1 { font-size: 2.1rem; letter-spacing: -0.02em; margin: 0 0 0.6rem; }
.hero .hero-copy p.muted { max-width: 34rem; margin: 0.4rem 0 1.2rem; }
.hero .hero-copy form.row { max-width: 34rem; }

h1 { font-size: 1.5rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 0.4rem; }
p { margin: 0.4rem 0; }
.muted { color: var(--muted); }
.sub { display: block; color: var(--muted); font-size: 0.8rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; color: var(--muted); }

/* Forms */
label { display: block; margin: 0.75rem 0; font-size: 0.9rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"], select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fdfcf9;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

button, .btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
button:hover, .btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn.sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.btn.ghost, .btn.ghost:hover { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: transparent; color: #9a3b32; border-color: #d8b3ae; }
.btn.disabled { opacity: 0.4; cursor: default; pointer-events: none; }
button.link { background: none; border: none; color: var(--link); padding: 0; font-weight: 500; }
button.link:hover { text-decoration: underline; }
form.inline { display: inline; margin: 0; }

form.row { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
form.row input, form.row select { margin-top: 0; }

.pager { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem; }

.error { color: #a63d3d; background: #f7e6e1; border: 1px solid #e6c6bc; padding: 0.6rem 0.75rem; border-radius: 8px; }
.notice { color: var(--ok); background: #e4ecdf; border: 1px solid #c6d5be; padding: 0.6rem 0.75rem; border-radius: 8px; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; font-size: 0.92rem; }
table.requests th, table.requests td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.requests thead th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
table.facts th { text-align: left; color: var(--muted); font-weight: 500; padding: 0.35rem 1rem 0.35rem 0; white-space: nowrap; vertical-align: top; }
table.facts td { padding: 0.35rem 0; }

.pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.pill.s-queued { background: #e5e0d6; color: #6f675c; }
.pill.s-gathering { background: #f3e3c6; color: #8a5a10; }
.pill.s-pending { background: #dee7ed; color: #3d6b8e; }
.pill.s-done { background: #dfe9dc; color: #3f6b4d; }

/* Report */
.report { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; }
.report-actions { display: flex; justify-content: space-between; margin-bottom: 1.25rem; }
.report-head h1 { margin-bottom: 0.25rem; }
.report-head .stamp { color: var(--muted); font-size: 0.9rem; margin: 0; }
.disclaimer { color: var(--muted); font-size: 0.85rem; font-style: italic; border-left: 3px solid var(--accent); padding: 0.4rem 0.75rem; margin: 1rem 0 1.5rem; background: var(--panel-2); }
.tab-panel { margin: 1.75rem 0; }
.tab-label { border-bottom: 2px solid var(--line); padding-bottom: 0.3rem; }
.section { margin: 1rem 0; }
.section table { border: 1px solid var(--line); }
.section th, .section td { border: 1px solid var(--line); padding: 0.4rem 0.6rem; text-align: left; }
.section.caveat { background: #f3e8d4; border: 1px solid #e0cda6; border-radius: 8px; padding: 0.75rem 1rem; }
.caveat-title { color: var(--warn); }

/* Tab bar — a row of pills; the active one is inked. With JS on, the article gets .js-tabs and only
   the active panel shows; with JS off every panel stays visible (the bar's links just anchor-jump). */
.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.5rem 0 0.5rem; border-bottom: 1px solid var(--line); }
.tabs .tab {
  padding: 0.5rem 0.9rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-bottom: -1px;
}
.tabs .tab:hover { color: var(--ink); text-decoration: none; }
.tabs .tab.active { color: var(--accent); background: var(--panel); border-color: var(--line); border-bottom-color: var(--panel); }
.report.js-tabs .tab-panel { display: none; }
.report.js-tabs .tab-panel.active { display: block; }
.report.js-tabs .tab-panel .tab-label { display: none; } /* the bar already names it */

/* Documents tab */
.doc-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.doc-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; padding: 0.35rem 0; }
.doc-tr { font-size: 0.88rem; }
.page-tr { margin-top: 0.75rem; }

/* Report hero — media on the left half (main photo + a scrollable strip of the rest), the
   listing's key info on the right half. Stacks on narrow screens. */
.report-hero { display: flex; gap: 1.5rem; align-items: flex-start; margin-bottom: 1rem; }
.hero-media { flex: 1 1 50%; min-width: 0; }
.hero-info { flex: 1 1 50%; min-width: 0; }
.hero-media .thumb { padding: 0; border: none; background: none; cursor: pointer; border-radius: 8px; overflow: hidden; }
.hero-media .thumb:hover img { filter: brightness(1.04); }
.hero-main { display: block; width: 100%; }
.hero-main img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.hero-media .thumbs { display: flex; gap: 0.4rem; margin-top: 0.4rem; overflow-x: auto; padding-bottom: 0.25rem; }
.hero-media .thumbs .thumb { flex: 0 0 auto; }
.hero-media .thumbs img { display: block; width: 84px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.photo-note { font-size: 0.8rem; margin: 0.35rem 0 0; }
.hero-info .eyebrow { color: var(--muted); font-size: 0.88rem; margin: 0 0 0.1rem; }
.hero-info h1 { font-size: 1.7rem; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 0.75rem; }
.hero-info .stamp { color: var(--muted); font-size: 0.9rem; margin: 0.75rem 0 0.5rem; }
.hero-info .source { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-info .source a { font-weight: 600; }

/* KPI strip — the headline numbers as a boxed grid (hairline gaps via the background). */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 0 0 0.9rem; }
.kpi { background: var(--panel-2); padding: 0.5rem 0.7rem; }
.kpi span { display: block; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi b { font-size: 1rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Secondary facts — the rest, as a tight key/value list. */
.facts2 { margin: 0; display: grid; gap: 0.3rem; }
.fact2 { display: flex; gap: 0.6rem; font-size: 0.9rem; }
.fact2 dt { color: var(--accent); font-weight: 600; flex: none; min-width: 6.5rem; }
.fact2 dd { margin: 0; }
@media (max-width: 480px) { .kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .report-hero { flex-direction: column; } .hero-media, .hero-info { flex-basis: auto; width: 100%; } }

/* Lightbox overlay */
body.lb-open { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(32, 26, 21, 0.92); /* warm espresso dim, not cold navy */
}
.lightbox[hidden] { display: none; }
.lightbox .lb-img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 6px; }
.lightbox button {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}
.lightbox button:hover { background: rgba(255, 255, 255, 0.24); }
.lightbox .lb-close { top: 1rem; right: 1rem; }
.lightbox .lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-counter { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); color: #fff; font-size: 0.9rem; }

/* Photo grid — the print-only PDF version (hidden on screen; print.css shows it). */
.print-photos { display: none; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }

.notice-panel { background: var(--panel-2); }
.print-footer { display: none; }

@media (max-width: 560px) {
  form.row { flex-direction: column; }
  header.site nav .who { display: none; }
  .hero { min-height: 0; padding: 1.5rem 1.25rem 8rem; }
  .hero .hero-copy h1 { font-size: 1.6rem; }
}
