/* Tidbit Trivia website: shared chrome and components.
   Deliberately minimal: this is the shell every page inherits. Page-specific
   design lives in its own file under assets/css/. */

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-dur-ui) var(--ease);
}
.site-header[data-scrolled] { border-bottom-color: var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.wordmark img {
  width: auto;
  height: 2.85rem;
}

.nav { display: flex; align-items: center; gap: var(--s-1); }

.nav__link {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color var(--t-dur-micro) var(--ease),
              background var(--t-dur-micro) var(--ease);
}
.nav__link:hover { color: var(--text); background: var(--surface-2); }
.nav__link[aria-current="page"] { color: var(--text); }

/* Nav collapses to the essentials on small screens; the full menu is a later
   decision, so for now the secondary links simply drop out. */
@media (max-width: 34rem) {
  .nav__link[data-optional] { display: none; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.7em 1.25em;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-dur-micro) var(--ease),
              border-color var(--t-dur-micro) var(--ease),
              transform var(--t-dur-micro) var(--ease);
}
.btn:hover { background: var(--line); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.btn--ghost:hover { background: var(--surface); color: var(--text); }

.btn--lg { padding: 0.85em 1.6em; font-size: var(--text-base); }

/* ---------- theme toggle ---------- */

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--t-dur-micro) var(--ease),
              background var(--t-dur-micro) var(--ease);
}
.theme-toggle:hover { color: var(--text); background: var(--surface-2); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }

/* Show the icon for the theme you would switch *to*. */
.theme-toggle .icon-sun  { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle .icon-sun  { display: none; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: block; }
}

/* ---------- surfaces ---------- */

.card {
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: var(--section-y);
  padding-block: var(--s-6);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-sm);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--s-4); }

.footer-wordmark {
  display: inline-flex;
  align-items: center;
}
.footer-wordmark img {
  width: auto;
  height: 2.35rem;
}

/* ---------- scaffold marker ----------
   Every placeholder block on the site carries this, so nothing ships by
   accident. Delete the class and the rule together when a page is real. */

.scaffold {
  padding: var(--s-5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--muted);
}
.scaffold::before {
  content: "scaffold";
  display: block;
  margin-bottom: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent);
}
