/*
 * main.css
 * All styles for the NYU Oral History Podcast Archive public site.
 *
 * TODO: Before launch, download Inter and Source Serif 4 font files and
 *       serve them from /fonts/ instead of loading from Google Fonts.
 *       Self-hosting avoids a third-party network request on every page load
 *       and removes a potential privacy concern.
 *       Steps: https://google-webfonts-helper.herokuapp.com/fonts
 */

/* ─────────────────────────────────────────────────────────────────────────────
   GOOGLE FONTS (replace with self-hosted files before launch)
   ───────────────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap');

/* ─────────────────────────────────────────────────────────────────────────────
   DESIGN TOKENS  (edit these to change the whole site's look)
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  /* Colours */
  --color-bg:        #151517;   /* charcoal background */
  --color-surface:   #1e1e21;   /* slightly lighter surface for cards, inputs */
  --color-border:    #2e2e33;   /* subtle border */
  --color-text:      #F5F2EB;   /* warm off-white body text */
  --color-text-muted:#9b9790;   /* secondary / meta text */
  --color-accent:    #FF6A4D;   /* coral accent — use for fills and large elements on off-white,
                                   safe for text on charcoal (passes 4.5:1 contrast) */
  --color-accent-hover: #e85a3d;
  --color-link:      #FF6A4D;
  --color-focus:     #FF6A4D;   /* visible focus outline colour */
  --color-error:     #f87171;
  --color-success:   #4ade80;

  /* Typography */
  --font-sans:   'Inter', system-ui, sans-serif;
  --font-serif:  'Source Serif 4', Georgia, serif;

  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */

  --leading-tight:  1.25;
  --leading-normal: 1.5;
  --leading-relaxed:1.7;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --max-width-content: 72rem;   /* 1152px — wide content, card grids */
  --max-width-prose:   42rem;   /* 672px  — comfortable reading column */
  --max-width-narrow:  56rem;   /* 896px  — interview page main column */

  /* Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;

  /* Shadows */
  --shadow-card:  0 1px 3px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.6);
}

/* ─────────────────────────────────────────────────────────────────────────────
   REDUCED MOTION — disable all transitions and animations
   ───────────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--leading-tight);
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────────────────
   FOCUS — always visible, uses accent colour
   ───────────────────────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Remove default focus ring for mouse users (browser handles this via :focus-visible) */
:focus:not(:focus-visible) {
  outline: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   SKIP LINK — visually hidden until focused; allows keyboard users to skip nav
   ───────────────────────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: var(--color-bg);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
  outline: 2px solid var(--color-bg);
  outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   LAYOUT HELPERS
   ───────────────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width-content);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.container--prose {
  max-width: var(--max-width-prose);
}

main {
  flex: 1;
}

/* visually hidden but announced to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--space-4);
  position: sticky;
  top: 0;
  background-color: var(--color-bg);
  z-index: 100;
}

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

.site-header__brand {
  text-decoration: none;
  color: var(--color-text);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.site-header__brand:hover {
  color: var(--color-accent);
}

.site-nav {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.site-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-text);
}

@media (max-width: 600px) {
  .site-header__brand {
    font-size: var(--text-base);
  }

  .site-nav {
    gap: var(--space-4);
  }

  .site-nav a {
    font-size: var(--text-xs);
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-8);
  margin-top: var(--space-16);
}

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

.site-footer__copy {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.site-footer__admin-link {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.site-footer__admin-link:hover {
  opacity: 1;
  color: var(--color-text-muted);
}

/* ─────────────────────────────────────────────────────────────────────────────
   HOME — HERO / SEARCH SECTION
   ───────────────────────────────────────────────────────────────────────────── */
.home-hero {
  padding-block: var(--space-16) var(--space-10);
  text-align: center;
}

.home-hero__title {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.home-hero__subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  max-width: 36rem;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

/* ─────────────────────────────────────────────────────────────────────────────
   SEARCH BAR
   ───────────────────────────────────────────────────────────────────────────── */
.search-form {
  max-width: 40rem;
  margin-inline: auto;
  position: relative;
}

.search-form__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
  text-align: left;
  color: var(--color-text-muted);
}

.search-form__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-form__icon {
  position: absolute;
  left: var(--space-4);
  width: 1.125rem;
  height: 1.125rem;
  color: var(--color-text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-form__input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) calc(var(--space-4) + 1.125rem + var(--space-2));
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-form__input::placeholder {
  color: var(--color-text-muted);
}

.search-form__input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 106, 77, 0.2);
}

.search-form__clear {
  position: absolute;
  right: var(--space-3);
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.search-form__clear:hover {
  color: var(--color-text);
  background: var(--color-border);
}

.search-form__clear.is-visible {
  display: flex;
}

/* ─────────────────────────────────────────────────────────────────────────────
   TOPIC CHIPS (filter row)
   ───────────────────────────────────────────────────────────────────────────── */
.topic-filters {
  padding-block: var(--space-6);
}

.topic-filters__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  font-weight: 500;
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
  line-height: 1.4;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
}

/* Active / selected chip */
.chip.is-active,
.chip[aria-pressed="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-bg);
}

/* Smaller tag chips used on cards and interview pages */
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--color-border);
  color: var(--color-text-muted);
  line-height: 1.4;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESULTS COUNT & STATUS LINE
   ───────────────────────────────────────────────────────────────────────────── */
.results-status {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-block: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.results-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.results-count strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────────────────
   CARD GRID
   ───────────────────────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  padding-block: var(--space-6) var(--space-16);
}

@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   INTERVIEW CARD
   ───────────────────────────────────────────────────────────────────────────── */
.interview-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  box-shadow: var(--shadow-card);
}

.interview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 106, 77, 0.3);
}

/* The entire card is a link target via a wrapping <a> inside */
.interview-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

.interview-card__photo-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-border);
  flex-shrink: 0;
}

.interview-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.interview-card:hover .interview-card__photo {
  transform: scale(1.03);
}

/* Placeholder shown when there is no photo */
.interview-card__photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-3xl);
  color: var(--color-text-muted);
  background: var(--color-border);
}

.interview-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-3);
}

.interview-card__topics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.interview-card__title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  line-height: var(--leading-tight);
}

.interview-card:hover .interview-card__title {
  color: var(--color-accent);
}

.interview-card__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.interview-card__role {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.interview-card__description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  /* Clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.interview-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: auto;
}

/* ─────────────────────────────────────────────────────────────────────────────
   INTERVIEW PAGE LAYOUT
   ───────────────────────────────────────────────────────────────────────────── */
.interview-page {
  padding-block: var(--space-10) var(--space-16);
}

.interview-page__inner {
  max-width: var(--max-width-narrow);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* Photo with credit */
.interview-photo {
  margin-bottom: var(--space-8);
}

.interview-photo__img {
  width: 100%;
  max-height: 28rem;
  object-fit: cover;
  border-radius: var(--radius-lg);
  object-position: top center;
}

.interview-photo__caption {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
}

/* Interview topics row */
.interview-topics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

/* Interview title (h1) */
.interview-title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

/* Name and role */
.interview-byline {
  margin-bottom: var(--space-8);
}

.interview-byline__name {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
}

.interview-byline__role {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.interview-byline__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.interview-byline__meta span::before {
  content: '';
}

/* Divider between sections */
.interview-section {
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.interview-section__heading {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-6);
  color: var(--color-text);
}

/* ─────────────────────────────────────────────────────────────────────────────
   AUDIO PLAYER
   ───────────────────────────────────────────────────────────────────────────── */
.audio-section {
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.audio-player {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  /* Player itself gets focus management; not focusable as a whole */
}

.audio-player__time-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.audio-player__controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Play/Pause button */
.audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: var(--color-bg);
  flex-shrink: 0;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.audio-btn:hover {
  background: var(--color-accent-hover);
  transform: scale(1.05);
}

.audio-btn:active {
  transform: scale(0.97);
}

/* Skip buttons */
.audio-skip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  flex-shrink: 0;
  transition: border-color var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
}

.audio-skip-btn:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

/* Seek / progress bar */
.audio-seek {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  min-width: 0;
}

.audio-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.audio-seek::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.audio-seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  cursor: pointer;
  border: none;
}

.audio-seek:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* Fill the played portion */
.audio-seek {
  background: linear-gradient(to right, var(--color-accent) 0%, var(--color-accent) var(--seek-progress, 0%), var(--color-border) var(--seek-progress, 0%), var(--color-border) 100%);
}

/* Time display */
.audio-time {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.audio-time__elapsed {
  color: var(--color-text);
}

/* Speed selector */
.audio-speed {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.audio-speed__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.audio-speed__select {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
  font-size: var(--text-sm);
  cursor: pointer;
}

/* Download notice under the player */
.audio-notice {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.audio-notice__download-off {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-style: italic;
  margin-bottom: var(--space-2);
}

/* No-audio message */
.audio-unavailable {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  text-align: center;
}

/* ─────────────────────────────────────────────────────────────────────────────
   PROSE — bio and transcript text (Source Serif 4)
   ───────────────────────────────────────────────────────────────────────────── */
.prose {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
}

.prose p {
  margin-bottom: var(--space-5);
}

.prose p:last-child {
  margin-bottom: 0;
}

/* Speaker label paragraph in transcript (e.g. "INTERVIEWER: ...") */
.prose .transcript-speaker {
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  letter-spacing: 0.02em;
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

/* Highlighted search match inside a snippet */
mark {
  background: rgba(255, 106, 77, 0.3);
  color: var(--color-text);
  border-radius: 2px;
  padding: 0 2px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   TAGS SECTION
   ───────────────────────────────────────────────────────────────────────────── */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ─────────────────────────────────────────────────────────────────────────────
   RELATED INTERVIEWS
   ───────────────────────────────────────────────────────────────────────────── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

@media (max-width: 540px) {
  .related-grid {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   CITE BOX
   ───────────────────────────────────────────────────────────────────────────── */
.cite-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.cite-box__note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  font-style: italic;
}

.cite-box__text {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  word-break: break-word;
}

.cite-box__copy-btn {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.cite-box__copy-btn:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.cite-box__copy-btn.is-copied {
  color: var(--color-success);
  border-color: var(--color-success);
}

/* ─────────────────────────────────────────────────────────────────────────────
   COLLECTION PAGE
   ───────────────────────────────────────────────────────────────────────────── */
.collection-header {
  padding-block: var(--space-10) var(--space-8);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-8);
}

.collection-header__title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

.collection-header__description {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  max-width: 42rem;
  line-height: var(--leading-relaxed);
}

/* ─────────────────────────────────────────────────────────────────────────────
   SIMPLE TEXT PAGES (about, cite, corrections)
   ───────────────────────────────────────────────────────────────────────────── */
.text-page {
  padding-block: var(--space-12) var(--space-16);
}

.text-page__inner {
  max-width: var(--max-width-prose);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.text-page__title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-8);
}

.text-page__body {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
}

.text-page__body p {
  margin-bottom: var(--space-5);
}

.text-page__placeholder {
  color: var(--color-text-muted);
  font-style: italic;
  font-size: var(--text-base);
  padding: var(--space-4);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
}

/* ─────────────────────────────────────────────────────────────────────────────
   STATUS PAGE
   ───────────────────────────────────────────────────────────────────────────── */
.status-page {
  padding-block: var(--space-16);
  text-align: center;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--text-lg);
  font-weight: 600;
  border: 1px solid var(--color-border);
}

.status-indicator--ok {
  border-color: var(--color-success);
  color: var(--color-success);
}

.status-indicator--error {
  border-color: var(--color-error);
  color: var(--color-error);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
}

/* ─────────────────────────────────────────────────────────────────────────────
   404 PAGE
   ───────────────────────────────────────────────────────────────────────────── */
.not-found-page {
  padding-block: var(--space-16);
  text-align: center;
}

.not-found-page__code {
  font-size: 6rem;
  font-weight: 600;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: var(--space-4);
}

.not-found-page__title {
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.not-found-page__message {
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--color-accent);
  color: var(--color-bg);
  font-weight: 600;
  font-size: var(--text-base);
  text-decoration: none;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: var(--color-bg);
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────────────────────────────
   LOADING STATES
   ───────────────────────────────────────────────────────────────────────────── */

/* Spinner */
.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-16);
}

/* Skeleton shimmer for cards */
.skeleton {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.03) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.skeleton-line {
  height: 1em;
  background: var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.skeleton-line--short {
  width: 40%;
}

.skeleton-line--medium {
  width: 70%;
}

/* ─────────────────────────────────────────────────────────────────────────────
   EMPTY STATE
   ───────────────────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--color-text-muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state__title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.empty-state__message {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

/* ─────────────────────────────────────────────────────────────────────────────
   ERROR STATE
   ───────────────────────────────────────────────────────────────────────────── */
.error-banner {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  color: var(--color-error);
  font-size: var(--text-sm);
  margin-block: var(--space-4);
}

/* ─────────────────────────────────────────────────────────────────────────────
   PAGINATION / BACK LINK
   ───────────────────────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  text-decoration: none;
  margin-bottom: var(--space-6);
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--color-text);
}

/* ─────────────────────────────────────────────────────────────────────────────
   UTILITY
   ───────────────────────────────────────────────────────────────────────────── */
.text-muted   { color: var(--color-text-muted); }
.text-accent  { color: var(--color-accent); }
.font-serif   { font-family: var(--font-serif); }
.mt-0         { margin-top: 0; }
.hidden       { display: none !important; }
