/* Design tokens + raw HTML element styling. Everything else is built on this. */
:root {
  --bg: #faf8f4;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e3ddd2;
  --accent: #c2410c;
  --accent-soft: #fde7d8;
  --good: #166534;
  --warn: #92400e;
  --bad: #991b1b;
  --card: #fff;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Global site header (nav, user switcher). Not to be confused with .page-header
   which is the listing page's title row. */
header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}
header .brand { font-weight: 700; font-size: 1.1rem; color: var(--fg); }
header nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; row-gap: 0.5rem; }
header nav a { color: var(--muted); font-size: 0.9rem; }
header nav a.active { color: var(--fg); font-weight: 600; }
header .mod-badge {
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.4rem;
  background: var(--accent); color: #fff;
  border-radius: 4px;
  cursor: help;
}
header .spacer { flex: 1; }
header .user-switch { display: flex; gap: 0.5rem; align-items: center; font-size: 0.85rem; }

/* Sign-out form: small, lives on the right side of the header. The form
   itself uses margin-left:auto to claim the empty space between the nav
   and the right edge. */
header .signout-form {
  margin-left: auto;
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.85rem;
}
header .signout-who { color: var(--muted); }
header .signout-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
}
header .signout-btn:hover { background: #fee2e2; color: var(--bad); border-color: var(--bad); }

/* Sign-in CTA shown to anonymous visitors in the same right-edge slot. */
header .signin-link {
  margin-left: auto;
  padding: 0.3rem 0.85rem;
  background: var(--accent);
  color: #fff;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
}
header .signin-link:hover { background: #9a3209; text-decoration: none; }

/* On phones, drop the username to save space; just show the button.
   Tighten gaps and shrink nav links so the row count stays low. */
@media (max-width: 680px) {
  header .signout-who { display: none; }
  header .signout-form { gap: 0; }
  header { gap: 0.75rem; padding: 0.6rem 1rem; }
  header nav { gap: 0.6rem; }
  header nav a { font-size: 0.85rem; }
}
header .user-switch select { padding: 0.25rem 0.5rem; font-size: 0.85rem; }

main { max-width: 1400px; margin: 0 auto; padding: 0.85rem 1.5rem 1.5rem; }

h1 { margin: 0 0 0.25rem 0; font-size: 1.5rem; }
h2 { margin: 1.5rem 0 0.5rem 0; font-size: 1.2rem; }
.muted { color: var(--muted); font-size: 0.9rem; }

button, .btn {
  background: var(--accent);
  color: white;
  border: 0;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 500;
}
button.secondary, .btn.secondary { background: #e5e1d5; color: var(--fg); }
button:hover, .btn:hover { opacity: 0.9; }

.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.reason { font-size: 0.8rem; color: var(--good); margin-top: 0.3rem; }

.site-footer { max-width: 1400px; margin: 2rem auto 0; padding: 1.5rem 1.5rem 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }
.site-footer nav a { color: var(--muted); }
.site-footer nav a:hover { color: var(--fg); }
.site-footer .sep { color: var(--line); }
.site-footer .small { font-size: 0.78rem; margin: 0; }

.legal-doc { max-width: 720px; margin: 0 auto; padding: 1rem 0 2rem; line-height: 1.55; }
.legal-doc h1 { font-size: 1.8rem; }
.legal-doc h2 { font-size: 1.2rem; margin-top: 1.8rem; }
.legal-doc h3 { font-size: 1rem; margin-top: 1rem; }
.legal-doc p, .legal-doc ul { font-size: 0.95rem; }
.legal-doc ul { padding-left: 1.4rem; }
.legal-doc code { background: var(--card); padding: 0.05rem 0.3rem; border-radius: 3px; font-size: 0.88em; }

/* `display: flex` would normally override the HTML [hidden] attribute,
   so re-state the hide rule with higher specificity. */
.cookie-notice[hidden] { display: none; }
.cookie-notice {
  position: fixed;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 720px;
  width: calc(100% - 1.5rem);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  padding: 0.8rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  z-index: 10000;
  font-size: 0.85rem;
}
.cookie-notice p { margin: 0; flex: 1 1 280px; line-height: 1.4; }
.cookie-notice code { background: rgba(0,0,0,0.06); padding: 0.05rem 0.3rem; border-radius: 3px; font-size: 0.85em; }
.cookie-notice-ok {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 5px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.cookie-notice-ok:hover { background: #9a3209; }
