/* =====================================================
   Q4 · Useful Info
   Visually connected to q2 — same palette, same font,
   single-column reading layout.
   ===================================================== */

:root {
  --color-moss:   #7b886f;
  --color-sand:   #c19a82;
  --color-slate:  #5784ba;
  --color-text:   #24679f;
  --color-muted:  #4a5a67;
  --color-signal: #a11d06;
  --color-tip-bg: rgba(87, 132, 186, 0.07);
  --border:       rgba(0, 0, 0, 0.1);
  --bg:           #ffffff;
  --transition:   0.2s ease;
  --max-width:    720px;
}

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

html {
  scroll-behavior: smooth;
  font-size: clamp(16px, 1.05vw, 18px);
}

body {
  font-family: "Nunito", sans-serif;
  background: var(--bg);
  color: var(--color-text);
  line-height: 1.75;
}

a {
  color: var(--color-slate);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity var(--transition);
}

a:hover {
  opacity: 0.7;
}

/* =====================================================
   BACK LINK
   ===================================================== */
.back-link {
  display: inline-block;
  padding: 0.6rem 1rem;
  margin: 1.25rem 0 0 clamp(1rem, 5vw, 2.5rem);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}

.back-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-text);
  opacity: 1;
}

/* =====================================================
   PAGE WRAP
   ===================================================== */
.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem clamp(1.25rem, 5vw, 2.5rem) 6rem;
}

/* =====================================================
   PAGE HEADER
   ===================================================== */
.page-header {
  padding-bottom: 2.5rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--color-slate);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.page-intro {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--color-muted);
  max-width: 55ch;
  margin-bottom: 1.75rem;
}

/* Section index nav */
.section-index {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.section-index a {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--color-muted);
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
  transition: color var(--transition), border-color var(--transition);
}

.section-index a:hover {
  color: var(--color-slate);
  border-left-color: var(--color-slate);
  opacity: 1;
}

/* =====================================================
   SECTIONS
   ===================================================== */
.q4-section {
  margin-bottom: 4rem;
  scroll-margin-top: 2rem;
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-number {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-muted);
  opacity: 0.6;
  margin-bottom: 0.3rem;
}

.section-header h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.section-intro {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--color-muted);
  max-width: 55ch;
}

/* =====================================================
   FIELD NOTES & FOLDS
   ===================================================== */
.q4-field-note {
  border-top: 1px solid var(--border);
}

.q4-field-note:last-child {
  border-bottom: 1px solid var(--border);
}

.q4-fold {
  padding: 0;
}

.q4-fold summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 0.9rem 0;
  user-select: none;
}

.q4-fold summary::-webkit-details-marker {
  display: none;
}

.q4-fold summary:focus-visible {
  outline: 2px solid var(--color-slate);
  outline-offset: 3px;
  border-radius: 2px;
}

.fold-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  flex: 1 0 auto;
}

.q4-signal {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-signal);
  opacity: 0.7;
  flex: 0 0 auto;
}

/* Expand indicator */
.q4-fold summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--color-muted);
  opacity: 0.5;
  transition: transform var(--transition);
  flex: 0 0 auto;
}

.q4-fold[open] summary::after {
  content: "–";
}

/* Fold body */
.q4-fold ul {
  padding: 0 0 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.q4-fold li {
  font-size: 0.97rem;
  line-height: 1.7;
  color: var(--color-muted);
}

.q4-fold a {
  word-break: break-word;
}

.q4-tip {
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--color-slate);
  background: var(--color-tip-bg);
  border-left: 3px solid var(--color-slate);
  padding: 0.6rem 0.85rem;
  margin-bottom: 1rem;
  border-radius: 0 4px 4px 0;
}

/* =====================================================
   MOBILE
   ===================================================== */
@media (max-width: 600px) {
  .q4-fold summary {
    gap: 0.35rem 0.75rem;
  }

  .q4-signal {
    font-size: 0.68rem;
  }
}

/* =====================================================
   REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================
   FOCUS
   ===================================================== */
:focus-visible {
  outline: 2px solid var(--color-slate);
  outline-offset: 3px;
}
