/* ==========================================================================
   ramseycastaneda.com — shared site stylesheet
   Single source of truth for the whole site's look.
   Every page links this file; pages add only genuinely page-specific rules.

   Design intent: clean, academic, authoritative. Serif reading text with a
   restrained sans-serif for labels; near-monochrome palette; ruled sections
   instead of shadowed cards; no gradients, no decorative motion.
   ========================================================================== */

/* --- Design tokens -------------------------------------------------------- */
:root {
  /* Type */
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Ink & text */
  --ink: #1a1a1a;      /* headings / strongest text */
  --body: #33363b;     /* reading text */
  --muted: #6b7280;    /* secondary / meta */
  --faint: #9aa0a6;    /* least important */

  /* Accent (links and small accents only) */
  --accent: #1a4480;   /* navy */
  --accent-hover: #0d2d5a;
  --gold: #8a6d1f;     /* deep gold — used sparingly, if at all */

  /* Rules & surfaces */
  --line: #e6e4de;         /* hairline dividers */
  --line-strong: #cbc8c0;  /* section-header rule */
  --bg: #ffffff;           /* card / surface */
  --paper: #faf9f6;        /* page background (warm off-white) */

  /* Layout */
  --maxw: 960px;
}

/* --- Reset & base --------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--serif);
  font-size: 1.0625rem;   /* ~17px */
  line-height: 1.65;
  color: var(--body);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.15em;
  text-decoration-color: rgba(26, 68, 128, 0.35);
}
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }

strong, b { color: var(--ink); font-weight: 700; }
em, i { font-style: italic; }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); font-weight: 600; line-height: 1.25; }

/* --- Page layout: content column + sticky sidebar ------------------------ */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 2rem;
  display: grid;
  grid-template-columns: 224px 1fr;
  gap: 2.5rem;
}

@media (max-width: 820px) {
  .page {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.25rem;
  }
}

/* --- Sidebar -------------------------------------------------------------- */
@media (min-width: 821px) {
  .sidebar { position: sticky; top: 2.5rem; align-self: start; }
}

.sidebar__photo {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  margin-bottom: 1.1rem;
}

.sidebar h1 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 0.25rem;
}

.sidebar__post { color: var(--muted); font-weight: 400; }

.sidebar__tagline {
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

.sidebar__meta {
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.sidebar__meta p { margin-bottom: 0.6rem; }
.sidebar__meta p:last-child { margin-bottom: 0; }
.sidebar__meta a { word-break: break-word; }

.sidebar__nav {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.sidebar__nav a {
  font-family: var(--sans);
  font-size: 0.83rem;
  color: var(--body);
  text-decoration: none;
  padding: 0.34rem 0;
}
.sidebar__nav a:hover,
.sidebar__nav a.is-active { color: var(--accent); }

/* On mobile the sidebar sits above the content, so its section-jump links
   read better as a wrapped row than a tall column. Placed after the base
   rule above so it wins on source order (media queries add no specificity). */
@media (max-width: 820px) {
  .sidebar__nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.1rem 1.2rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
  }
  .sidebar__nav a { padding: 0.25rem 0; }
}

/* --- Sections & headers (journal-style ruled eyebrow) -------------------- */
.section { margin-bottom: 2.9rem; scroll-margin-top: 1.5rem; }
.section:last-of-type { margin-bottom: 0; }

.section > h2 {
  position: relative;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 0.6rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--line-strong);
}
.section > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
}

/* Intro lead paragraphs */
.section--intro {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.5rem;
}
.intro {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 0.7rem;
}
.intro:last-child { margin-bottom: 0; }
.intro strong { font-weight: 700; }

/* --- Resource index (typographic list, two columns to stay compact) ------- */
.reslist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2.25rem;
  border-top: 1px solid var(--line);
}
@media (max-width: 560px) { .reslist { grid-template-columns: 1fr; } }
.reslist__item {
  display: block;
  padding: 0.6rem 0.1rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.reslist__name {
  display: inline-block;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--accent);
}
.reslist__item:hover .reslist__name {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.reslist__desc {
  display: block;
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* --- Grouped resource columns (homepage) ---------------------------------- */
.res-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.1rem 2rem;
}
.res-group h3 {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.4rem;
  margin-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}
.res-list { list-style: none; }
.res-list li { padding: 0.28rem 0; line-height: 1.25; }
.res-list li a {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.res-list li a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 0.15em; }
.res-list li span {
  display: block;
  font-family: var(--sans);
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.3;
}

/* --- Two-column modifiers for CV / publication lists ---------------------- */
.cv--cols, .pubs--cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2.5rem;
}
.cv--cols { border-top: 1px solid var(--line); }
@media (max-width: 640px) { .cv--cols, .pubs--cols { grid-template-columns: 1fr; } }

/* --- CV list (teaching, education) ---------------------------------------- */
.cv { border-top: 1px solid var(--line); }
.cv__item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  padding: 0.65rem 0.1rem;
  border-bottom: 1px solid var(--line);
}
.cv__item--simple { grid-template-columns: 1fr; }
.cv__org {
  grid-column: 1;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
}
.cv__years {
  grid-column: 2;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
  padding-left: 1rem;
}
.cv__role {
  grid-column: 1 / -1;
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--body);
  margin-top: 0.1rem;
}

/* --- Publications / presentations list ------------------------------------ */
.pubs { border-top: 1px solid var(--line); }
.pub {
  padding: 0.65rem 0.1rem;
  border-bottom: 1px solid var(--line);
}
.pub__title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}
.pub__meta {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
/* Featured publication with a cover thumbnail (spans both columns of .pubs--cols) */
.pub--book { grid-column: 1 / -1; display: flex; gap: 1rem; align-items: flex-start; }
.pub--book .pub__cover { flex: 0 0 auto; width: 76px; line-height: 0; }
.pub--book .pub__cover img { width: 100%; height: auto; border: 1px solid var(--line); }
.pub--book .pub__body { min-width: 0; }

/* --- Media grid (performances, photographs) ------------------------------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem 1.1rem;
}
@media (max-width: 820px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .media-grid { grid-template-columns: 1fr; } }

.media { display: flex; flex-direction: column; }
.media__body { padding: 0.6rem 0.1rem 0; }
.media__kicker {
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.media__title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-top: 0.15rem;
}
.media__sub {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 0.1rem;
}

/* Photo cells */
.media--photo { cursor: pointer; }
.media--photo .media__visual {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid var(--line);
}
.media--photo .media__visual img { width: 100%; height: 100%; object-fit: cover; }
.media--photo:hover .media__visual { border-color: var(--line-strong); }

/* --- Video facade (click-to-load YouTube) --------------------------------- */
.video-facade {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid var(--line);
}
.video-facade__thumb {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  min-height: 100%;
  object-fit: cover;
}
.video-facade__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60px; height: 42px;
  background: rgba(20, 20, 20, 0.72);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}
.video-facade:hover .video-facade__play { background: rgba(20, 20, 20, 0.92); }
.video-facade__play::after {
  content: "";
  border-style: solid;
  border-width: 8px 0 8px 15px;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}
.video-facade iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* --- Lessons block -------------------------------------------------------- */
.lessons {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}
.lessons p { margin-bottom: 0.75rem; }
.lessons p:last-child { margin-bottom: 0; }
.lessons__contact { font-family: var(--sans); font-size: 0.95rem; }
.lessons__contact a { text-decoration: none; }
.lessons__contact a:hover { text-decoration: underline; text-underline-offset: 0.15em; }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  grid-column: 1 / -1;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--faint);
}

/* --- Accessibility: skip link & focus ------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 1000;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; outline: none; }

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

/* --- Photo lightbox ------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox__content { position: relative; max-width: 90%; max-height: 90%; }
.lightbox__img { max-width: 100%; max-height: 85vh; }
.lightbox__close {
  position: absolute;
  top: -42px; right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem;
  opacity: 0.85;
}
.lightbox__close:hover { opacity: 1; }
.lightbox__caption {
  text-align: center;
  color: #fff;
  font-family: var(--sans);
  font-size: 0.9rem;
  margin-top: 1rem;
  opacity: 0.9;
}

/* ==========================================================================
   INTERIOR PAGES — shared masthead, article/prose, tables, controls, buttons.
   Used by every non-homepage page so the whole site reads as one document.
   ========================================================================== */

/* --- Masthead (consistent top bar with home link) ------------------------- */
.masthead { border-bottom: 1px solid var(--line-strong); background: var(--bg); }
.masthead__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.masthead__name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.masthead__name:hover { color: var(--accent); }
.masthead__section {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 520px) {
  .masthead__inner { padding: 0.85rem 1.25rem; }
  .masthead__section { display: none; }
}

/* --- Content wrappers ----------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 2.75rem 2rem 3.5rem; }
.wrap--narrow { max-width: 760px; }
@media (max-width: 820px) { .wrap { padding: 2rem 1.25rem 2.75rem; } }

/* --- Page head ------------------------------------------------------------ */
.page-head { margin-bottom: 2rem; }
.page-head__kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.page-head h1 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.page-head__sub {
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 0.6rem;
}
@media (max-width: 520px) { .page-head h1 { font-size: 1.6rem; } }

/* --- Prose / article typography ------------------------------------------- */
.prose { font-size: 1.0625rem; line-height: 1.7; color: var(--body); }
.prose > * + * { margin-top: 1.05rem; }
.prose h2 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin-top: 2rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}
.prose h3 { font-size: 1.1rem; font-weight: 600; color: var(--ink); margin-top: 1.5rem; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.4rem; }
.prose li { padding-left: 0.2rem; }
.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1.2rem;
  border-left: 2px solid var(--line-strong);
  font-size: 1.18rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink);
}
.prose blockquote cite, .prose blockquote footer {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-style: normal;
  color: var(--muted);
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.prose figure { margin: 1.5rem 0; }
.prose figcaption {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* --- Numbered aphorisms (artist-advice lists) ----------------------------- */
.aphorisms { list-style: none; counter-reset: aph; border-top: 1px solid var(--line); }
.aphorisms > li {
  counter-increment: aph;
  position: relative;
  padding: 0.85rem 0 0.85rem 2.6rem;
  border-bottom: 1px solid var(--line);
}
.aphorisms > li::before {
  content: counter(aph);
  position: absolute;
  left: 0;
  top: 0.9rem;
  width: 1.9rem;
  text-align: right;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.aphorisms .aph__note {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}

/* --- Figures: manuscript scans / sheet music ------------------------------ */
.sheet { border: 1px solid var(--line); background: var(--bg); }
.sheet img { width: 100%; }
figure.sheet { margin: 1.5rem 0; }

/* --- Native media --------------------------------------------------------- */
audio { width: 100%; margin: 0.5rem 0; }
.embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  margin: 1.5rem 0;
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--accent);
  background: var(--bg);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent-hover); }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.25rem 0; }

/* --- Data tables ---------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
table.data td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tbody tr:hover td { background: var(--paper); }
.tabular { font-variant-numeric: tabular-nums; }

/* --- Filter / search controls --------------------------------------------- */
.controls { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1.25rem; }
.field {
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--bg);
  color: var(--ink);
}
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field::placeholder { color: var(--faint); }
.chip {
  font-family: var(--sans);
  font-size: 0.78rem;
  padding: 0.32rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--body);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active, .chip[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- Stat strip ----------------------------------------------------------- */
.statline {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.75rem;
}
.statline .stat__num { font-size: 1.35rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.statline .stat__lbl {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* --- Interior page footer ------------------------------------------------- */
.pagefoot { border-top: 1px solid var(--line); margin-top: 3rem; }
.pagefoot__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--faint);
}
.pagefoot__inner a { color: var(--muted); }
.pagefoot__links { display: flex; flex-wrap: wrap; gap: 1.1rem; }

/* --- Global navigation: single "Resources" dropdown ----------------------- */
.masthead { position: relative; }
.site-nav { position: relative; font-family: var(--sans); }
.site-nav__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--body);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.3rem 0;
}
.site-nav__trigger:hover { color: var(--accent); }
.site-nav__caret { font-size: 0.7em; color: var(--muted); }
.site-nav__bars { display: none; flex-direction: column; gap: 4px; }
.site-nav__bars span { display: block; width: 22px; height: 2px; background: var(--ink); }

.site-nav__panel {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 260px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 0.55rem 0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 60;
}
.site-nav:hover .site-nav__panel,
.site-nav:focus-within .site-nav__panel,
.site-nav.open .site-nav__panel { opacity: 1; visibility: visible; transform: none; }

.site-nav__panel a {
  display: block;
  padding: 0.34rem 1.1rem;
  font-size: 0.85rem;
  color: var(--body);
  text-decoration: none;
}
.site-nav__panel a:hover { background: var(--paper); color: var(--accent); }
.site-nav__group { margin-top: 0.4rem; padding-top: 0.4rem; border-top: 1px solid var(--line); }
.site-nav__label {
  display: block;
  padding: 0 1.1rem 0.15rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 760px) {
  .site-nav__label-text, .site-nav__caret { display: none; }
  .site-nav__bars { display: inline-flex; }
  .site-nav__trigger { padding: 0.4rem 0.2rem; }
  .site-nav:hover .site-nav__panel,
  .site-nav:focus-within .site-nav__panel { opacity: 0; visibility: hidden; }
  .site-nav.open .site-nav__panel { opacity: 1; visibility: visible; transform: none; }
  /* Keep the panel inside the viewport and give links comfortable touch targets */
  .site-nav__panel { min-width: 220px; max-width: calc(100vw - 2rem); }
  .site-nav__panel a { padding: 0.55rem 1.1rem; }
}

/* --- Two-column aphorisms (artist-advice, reduces scrolling) --------------- */
.aphorisms--cols { column-count: 2; column-gap: 2.75rem; }
.aphorisms--cols > li { break-inside: avoid; }
@media (max-width: 620px) { .aphorisms--cols { column-count: 1; } }

/* --- Featured resource callout (homepage) --------------------------------- */
.feature {
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  background: var(--bg);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.75rem;
}
.feature__eyebrow {
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.feature__title { font-size: 1.3rem; font-weight: 600; line-height: 1.2; margin-bottom: 0.4rem; }
.feature__title a { color: var(--ink); text-decoration: none; }
.feature__title a:hover { color: var(--accent); }
.feature__desc {
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--body);
  margin-bottom: 0.55rem;
}
.feature__link { font-family: var(--sans); font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.feature__link:hover { text-decoration: underline; text-underline-offset: 0.15em; }

/* --- Authoring placeholder (remove once content is added) ------------------ */
.todo {
  border: 1px dashed var(--line-strong);
  background: var(--paper);
  padding: 1rem 1.1rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.55;
}
.todo strong { color: var(--accent); }

/* --- Video + purchase card, side by side ---------------------------------- */
.buy-layout {
  display: grid;
  grid-template-columns: 1fr minmax(250px, 290px);
  gap: 1.5rem;
  align-items: start;
  margin: 1.5rem 0;
}
.buy-layout > figure,
.buy-layout > .todo { margin: 0; }
.buy-layout .purchase { max-width: none; margin: 0; }
@media (max-width: 680px) {
  .buy-layout { grid-template-columns: 1fr; gap: 1.25rem; }
  .buy-layout .purchase { max-width: 400px; }
}

/* --- Two media items side by side (artist-advice, etc.) ------------------- */
.media-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
  align-items: start;
  margin: 1.5rem 0;
}
.media-duo > figure { margin: 0; }
/* manuscript/handout images (direct figure children, not the video thumb):
   fully visible, height-capped so tall portrait scans don't dominate — never cropped */
.media-duo figure > img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 420px;
  margin: 0 auto;
}
@media (max-width: 640px) { .media-duo { grid-template-columns: 1fr; } }

/* Click-to-zoom manuscript/screenshot figures */
.zoomable { cursor: zoom-in; }
.zoomable img { transition: opacity 0.15s ease; }
.zoomable:hover img { opacity: 0.9; }

/* Framed screenshot (e.g. a provenance comment) — works for wide or tall shots */
.shot { max-width: 560px; }
.shot img {
  display: block;
  margin: 0 auto;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 480px;
  border: 1px solid var(--line);
  border-radius: 2px;
}

/* --- Purchase card (Payhip transcription sales) --------------------------- */
.purchase {
  max-width: 400px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  background: var(--bg);
  padding: 1.15rem 1.3rem;
  margin: 1.75rem 0;
}
.purchase__eyebrow {
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.purchase__price {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 0.75rem;
}
.purchase__incl {
  list-style: none;
  padding-left: 0;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--body);
  margin-bottom: 1rem;
}
.purchase__incl li {
  position: relative;
  padding-left: 1.1rem;
  line-height: 1.4;
}
.purchase__incl li + li { margin-top: 0.25rem; }
.purchase__incl li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}
/* Key selector (Concert / Bb / Eb) — only shown when a transcription has editions */
.purchase__keys {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.9rem;
}
.purchase__key {
  font-family: var(--sans);
  font-size: 0.72rem;
  white-space: nowrap;
  padding: 0.4rem 0.5rem;
  background: var(--bg);
  border: 0;
  border-right: 1px solid var(--line-strong);
  color: var(--body);
  cursor: pointer;
}
.purchase__key:last-child { border-right: 0; }
.purchase__key:hover { color: var(--accent); }
.purchase__key.is-active { background: var(--accent); color: #fff; }
/* Payhip's script sets inline styles on load, so override with !important.
   Higher specificity than the .payhip-buy-button display rule below so the
   inactive editions stay hidden. */
.purchase .payhip-buy-button.is-hidden,
.purchase__buy.is-hidden { display: none !important; }

/* keep the Payhip button on-brand (navy, flat) and contained even after payhip.js enhances it */
.purchase .payhip-buy-button {
  display: flex !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  justify-content: center;
  background: var(--accent) !important;
  background-image: none !important;
  color: #fff !important;
  border: 1px solid var(--accent) !important;
  border-radius: 2px !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-family: var(--sans) !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  padding: 0.6rem 0.9rem !important;
  height: auto !important;
}
.purchase .payhip-buy-button:hover { background: var(--accent-hover) !important; }
.purchase__note {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--faint);
  margin-top: 0.65rem;
}

/* --- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
