/* SPDX-License-Identifier: AGPL-3.0-or-later
 *
 * Samklang's whole stylesheet. No framework, no third-party assets (spec §9):
 * the type stack is the reader's own system fonts, so there is nothing to
 * self-host and nothing to fetch from anyone else.
 */

:root {
  color-scheme: light dark;

  --ink: #1a1a1c;
  --ink-soft: #55555c;
  --paper: #fbfaf7;
  --paper-raised: #ffffff;
  --rule: #dedcd5;
  --accent: #7a3b2e;
  --accent-soft: #f0e6e2;

  --measure: 38rem;
  --step: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eceae5;
    --ink-soft: #a7a49d;
    --paper: #16161a;
    --paper-raised: #1e1e23;
    --rule: #34343c;
    --accent: #e0a08c;
    --accent-soft: #2a2126;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper-raised);
  padding: 0.5rem 1rem;
  border: 1px solid var(--rule);
}

.skip-link:focus {
  left: 0;
  z-index: 10;
}

.site-header {
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.25rem calc(var(--step) * 1.5);
}

.wordmark {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink);
}

.site-header nav {
  display: flex;
  gap: 1.25rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9375rem;
}

main {
  flex: 1;
  padding: calc(var(--step) * 2) calc(var(--step) * 1.5);
}

.prose {
  max-width: var(--measure);
  margin: 0 auto;
}

.prose h1 {
  font-size: 2.25rem;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

.prose h2 {
  font-size: 1.3rem;
  margin: 2em 0 0.4em;
}

.prose .lead {
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin-top: 0;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.25rem calc(var(--step) * 1.5);
  color: var(--ink-soft);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875rem;
}

.site-footer p {
  max-width: var(--measure);
  margin: 0 auto;
}

@media (max-width: 30rem) {
  .prose h1 {
    font-size: 1.75rem;
  }
}

/* ─── forms, listings and the review queue ─────────────────────────────────── */

.stack {
  max-width: var(--measure);
  margin: 0 auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0 0 1.1rem;
}

.field label,
.hint {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875rem;
}

.hint {
  color: var(--ink-soft);
}

input,
select,
textarea,
button {
  font: inherit;
  font-family: ui-sans-serif, system-ui, sans-serif;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper-raised);
  color: var(--ink);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button,
.button {
  background: var(--accent);
  color: var(--paper-raised);
  border-color: transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

/* A button that has to sit in a nav and read as a link. */
.linklike {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

form.inline {
  display: inline;
  margin: 0;
}

.notice {
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9375rem;
}

.listing,
.lineup,
.setlist,
.history {
  padding-left: 1.2rem;
}

.listing {
  list-style: none;
  padding-left: 0;
}

.listing li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--rule);
}

.empty,
.role,
.when,
.who,
.summary {
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.badge {
  display: inline-block;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.75rem;
  padding: 0.05rem 0.4rem;
  margin-left: 0.4rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.2rem 1rem;
  font-size: 0.9375rem;
}

.facts dt {
  color: var(--ink-soft);
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.facts dd {
  margin: 0;
}

.review-item {
  border: 1px solid var(--rule);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}

.diff {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  display: block;
  overflow-x: auto;
}

.diff th,
.diff td {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.diff .before {
  color: var(--ink-soft);
  text-decoration: line-through;
}

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

.narrow {
  max-width: 26rem;
}

/* ─── attendance ──────────────────────────────────────────────────────────── */

.rsvp {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* The RSVP buttons are a toggle group: the active one reads as pressed. */
.rsvp button[aria-pressed="true"] {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.photo {
  margin: 1.2rem 0;
}

.photo img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  display: block;
}

.photo figcaption {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-top: 0.3rem;
}

.photo-upload {
  border: 1px solid var(--rule);
  padding: 0.8rem 1rem;
  margin: 0 0 1rem;
}

.photo-upload legend {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* A content warning hides the review until the reader opens it. */
.cw summary {
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif;
  padding: 0.5rem 0.7rem;
  background: var(--accent-soft);
  border-radius: 3px;
}

.nudges {
  border: 1px solid var(--rule);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}

.nudges form {
  display: block;
  margin: 0.35rem 0;
}

/* ── profile ─────────────────────────────────────────────────────────────── */

.profile-banner {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  border-radius: 3px;
  margin-bottom: 1rem;
}

/* The avatar sits beside the name, and drops under it on a narrow screen. */
.profile-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.profile-identity h1,
.profile-identity .lead {
  margin: 0;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--rule);
}

/* Long URLs must wrap rather than push the page sideways on a phone. */
.profile-links dd a {
  overflow-wrap: anywhere;
}

.preview-avatar {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 0.5rem;
}

.preview-banner {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

fieldset {
  border: 1px solid var(--rule);
  padding: 0.8rem 1rem;
  margin: 1.2rem 0;
}

legend {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  padding: 0 0.4rem;
}
