/* ═══════════════════════════════════════════════════════
   THEME 2 — SAGE QASS ("little green books")
   sage/mint, bold sans titles, sunburst rays motif
   ═══════════════════════════════════════════════════════ */

.theme-qass {
  --qass-bg: #b9d3a8;
  --qass-bg-2: #a3c294;
  --qass-fg: #14281d;
  --qass-fg-dim: rgba(20, 40, 29, 0.72);
  --qass-rule: rgba(20, 40, 29, 0.35);
  --qass-ray: rgba(20, 40, 29, 0.42);

  background: linear-gradient(180deg, var(--qass-bg) 0%, var(--qass-bg-2) 100%);
  color: var(--qass-fg);
}

/* Paper-grain noise overlay — sits above the bg/rays/frame, below content. */
.theme-qass::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.10;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Black frame inset from the section edges. Rays are anchored INSIDE
   the frame: polygon coords (0–100) map to the frame's bounds, and
   anything outside is clipped by overflow:hidden. */
.theme-qass .qass-frame {
  position: absolute;
  /* T R B L — extra right inset so the volume badge (centered on the
     right border, half-overflowing) doesn't clip past the section edge. */
  inset: 20px 30px 20px 20px;
  border: 2px solid #000;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.theme-qass .qass-rays {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.theme-qass .qass-rays polygon {
  fill: url(#qass-ray-fade);
}

/* Z-logo, à la SAGE oval. Pinned to bottom-right of the frame. */
.theme-qass .qass-zlogo {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 48px;
  height: auto;
  color: rgba(20, 40, 29, 0.85);
}

/* Volume number badge — circle, sage bg with black text. Centered on
   the right border line at ~80% down from top of section. */
.theme-qass .qass-volume {
  position: absolute;
  right: 31px;            /* border line: 30px right inset + 1px (half of 2px border) */
  top: 72%;
  transform: translate(50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #aac89b;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  z-index: 4;
}

/* When this section is in view, the sidebar nav reads dark on light.
   We swap nav vars via :has() so the active section drives the nav style. */
body:has(.theme-qass.in-view) .nav {
  --nav-fg: rgba(20, 40, 29, 0.6);
  --nav-fg-active: #14281d;
  --nav-indicator: rgba(20, 40, 29, 0.3);
  --nav-indicator-active: #14281d;
}
body:has(.theme-qass.in-view) .nav__link { text-shadow: none; }

.theme-qass .section__content {
  max-width: 1000px;
  padding-top: 140px;
  padding-bottom: 140px;
}

/* QASS series line — serif italic, like "Series: Quantitative
   Applications in the Social Sciences" on the actual covers. */
.theme-qass .qass-series-top {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 14px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--qass-fg-dim);
  margin-bottom: 40px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--qass-rule);
  max-width: 360px;
}

/* Photo + name side-by-side. Photo height is tied to the h1's font-size
   (×2 = two lines tall). Width derived from aspect-ratio. */
.theme-qass .qass-hero {
  --hero-h1-size: clamp(3.9rem, 7.7vw, 6.4rem);
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}
.theme-qass .qass-photo {
  flex-shrink: 0;
  height: calc(var(--hero-h1-size) * 1.72);
  aspect-ratio: 3 / 4;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-qass .qass-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.theme-qass .qass-hero h1 {
  margin-top: -0.15em;  /* compensate for cap-height vs em-box top */
  margin-bottom: 0;
  line-height: 1;
  font-size: var(--hero-h1-size);
}

/* Title — heavy uppercase sans, à la Helvetica Bold on the QASS spines. */
.theme-qass h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(3.9rem, 7.7vw, 6.4rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  text-align: left;
  color: var(--qass-fg);
  margin-bottom: 24px;
}

/* Subtitle — serif italic, echoing the author line on the cover. */
.theme-qass h2 {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.2rem, 1.9vw, 1.5rem);
  line-height: 1.4;
  color: var(--qass-fg-dim);
  margin-bottom: 48px;
  max-width: 40ch;
}

.theme-qass h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--qass-fg);
  margin: 40px 0 16px;
}

/* Body — serif, gives the section a book-page feel. Scales with viewport. */
.theme-qass p {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(1.4rem, 1.9vw, 2.1rem);
  line-height: 1.55;
  color: var(--qass-fg);
  margin-bottom: 18px;
  max-width: 60ch;
}

/* Affiliation block — tight line-height, bold italic Garamond, reads
   like a masthead. */
.theme-qass .qass-affiliation {
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 28px;
  color: var(--qass-fg);
  opacity: 0.92;
}

/* Smaller affiliation on mobile only */
@media (max-width: 900px) {
  .theme-qass .qass-affiliation {
    font-size: 0.95rem;
    line-height: 1.3;
  }
}

.theme-qass .qass-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  max-width: 60ch;
}
.theme-qass .qass-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--qass-rule);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.5;
}
.theme-qass .qass-list li strong {
  font-weight: 600;
  font-style: italic;
}

/* SAGE-style numbered badge, bottom-right */
.theme-qass .qass-badge {
  position: absolute;
  bottom: 40px;
  right: 60px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 1.5px solid var(--qass-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--qass-fg);
  background: var(--qass-bg);
  z-index: 3;
}

@media (max-width: 900px) {
  .theme-qass .qass-badge { right: 24px; bottom: 24px; width: 70px; height: 70px; font-size: 10px; }
}
