/* The public chord library (/chords): the index, one page per instrument, one page per chord. Colours only through
   theme tokens, so light and dark follow the visitor's system like the other free tools. Chords and diagram dots are
   teal (--accent, set by fingering.css); the heading rule is coral; the one solid coloured action is mustard.
   Phone first: one column, the diagram big; wider screens put the alternates beside the main shape. */
.chords-page {
  width: min(64rem, 100% - 2rem);
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2.25rem) 0 1rem;
  color: var(--ink);
}
.chords-page .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.chords-page h1,
.chords-page h2,
.chords-page h3 { margin: 0; }
.chords-page h2 { margin-bottom: 0.6rem; font-size: 1.3rem; }
.chords-page section { margin-top: clamp(1.75rem, 5vw, 2.75rem); }
.chords-page a:not(.button) { color: var(--accent); text-underline-offset: 0.2em; }

.chords-crumbs { margin-bottom: 1rem; color: var(--muted); font-size: 0.92rem; }
.chords-crumbs [aria-current] { color: var(--ink); font-weight: 700; }

/* ---- headings ---- */
.chords-intro { padding-bottom: 0.9rem; border-bottom: 2px solid var(--heading-rule); }
.chords-intro h1,
.chord-head h1 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
.chords-intro h1 { font-size: clamp(2rem, 7.5vw, 3.4rem); }
.chords-intro__lede { max-width: 36rem; margin: 0.6rem 0 0; color: var(--muted); font-size: 1.1rem; }

.chord-head { padding-bottom: 0.9rem; border-bottom: 2px solid var(--heading-rule); }
.chord-head h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.6rem; }
.chord-head__name { font-size: clamp(3rem, 15vw, 5.5rem); color: var(--accent); }
.chord-head__what { font-size: clamp(1.2rem, 5vw, 1.8rem); color: var(--ink); }
.chord-head__spoken { margin: 0.4rem 0 0; color: var(--muted); font-size: 1.05rem; }

/* ---- the diagrams ---- */
.chord-hero { display: grid; gap: 1.25rem; }
.chord-hero figure { margin: 0; }
.chord-hero figcaption { margin-top: 0.6rem; color: var(--muted); font-size: 0.95rem; text-align: center; }
.chord-hero figcaption strong { color: var(--ink); }
.chord-hero__frets { display: block; font-variant-numeric: tabular-nums; }
.chord-hero__frets--inline { display: inline; white-space: nowrap; }
.chord-hero__main {
  padding: 1.1rem 1rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  background: var(--paper);
}
.chords-page .chord-hero__main .fg--fretboard[data-strings] { max-width: min(15rem, 68vw); }
.chords-page .chord-hero__main .fg--keyboard { max-width: min(30rem, 100%); }
.chord-hero__alts h3 { margin-bottom: 0.5rem; font-size: 1.05rem; }
.chord-hero__alts ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.chord-hero__alts li { padding: 0.8rem 0.6rem 0.6rem; border: 1px solid var(--rule); border-radius: 0.5rem; background: var(--paper); }
.chords-page .chord-hero__alts .fg--fretboard[data-strings] { max-width: min(8rem, 38vw); }
.chords-page .chord-hero__alts .fg--keyboard { max-width: 100%; }
.chord-hero__alts figcaption { font-size: 0.85rem; }
@media (min-width: 46rem) {
  .chord-hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .chord-hero > h2 { grid-column: 1 / -1; }
  .chord-hero__alts ul { grid-template-columns: 1fr; }
}

/* ---- facts, tips, links ---- */
.chord-facts dl { display: grid; gap: 0.5rem; margin: 0; }
.chord-facts dl > div { display: flex; gap: 0.75rem; align-items: baseline; padding: 0.55rem 0.8rem; border: 1px solid var(--rule); border-radius: 0.45rem; background: var(--surface); }
.chord-facts dt { min-width: 5.5rem; color: var(--muted); font-weight: 700; }
.chord-facts dd { margin: 0; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.chord-facts__notes { color: var(--accent); }
.chord-tips ul { display: grid; gap: 0.4rem; margin: 0; padding-left: 1.2rem; }

.chord-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.8rem; padding: 0; list-style: none; }
.chord-pills a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: 0 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
  text-decoration: none;
}
.chord-pills a:hover { border-color: var(--accent); }
.chord-pills--named li { display: flex; align-items: center; gap: 0.5rem; }
.chord-pills--named span { color: var(--muted); font-size: 0.9rem; }

/* ---- the index and the grids ---- */
.chords-instruments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.chords-instrument { padding: 0.9rem 0.7rem; border: 1px solid var(--rule); border-radius: 0.6rem; background: var(--paper); text-align: center; }
.chords-instrument h3 { margin-top: 0.4rem; font-size: 1.05rem; }
.chords-instrument h3 a { text-decoration: none; }
.chords-instrument__diagram { display: block; }
.chords-page .chords-instrument .fg--fretboard[data-strings] { max-width: min(6rem, 30vw); }
.chords-page .chords-instrument .fg--keyboard { max-width: 100%; }
.chords-instrument__quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.1rem 0.7rem; margin: 0.4rem 0 0; font-weight: 700; }
.chords-instrument__quick a { padding: 0.5rem 0.15rem; }
@media (min-width: 46rem) { .chords-instruments { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.chords-find__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.7rem; padding: 1rem; border: 1px solid var(--rule); border-radius: 0.6rem; background: var(--surface); }
.chords-find__form label { display: grid; gap: 0.25rem; font-weight: 700; }
.chords-find__form select { width: 100%; min-width: 0; min-height: 2.75rem; }
.chords-find__form .button { min-height: 3rem; }
@media (min-width: 46rem) {
  .chords-find__form { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; }
}

.chords-filter { display: grid; gap: 0.3rem; margin-top: 1.1rem; }
.chords-filter[hidden] { display: none; }
.chords-filter label { font-weight: 700; }
.chords-filter input {
  width: 100%;
  min-height: 3rem;
  padding: 0 0.9rem;
  border: 2px solid var(--hairline);
  border-radius: 0.5rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.chords-filter input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.chords-filter__status { min-height: 1.2rem; margin: 0; color: var(--muted); font-size: 0.9rem; }

.chords-jump ul { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.chords-jump a {
  display: inline-flex;
  min-width: 2.75rem;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 0.45rem;
  background: var(--surface);
  font-weight: 700;
  text-decoration: none;
}

/* Below-the-fold groups are skipped by the browser until they scroll near (no JavaScript, content stays in the HTML). */
.chord-group { content-visibility: auto; contain-intrinsic-size: auto 52rem; scroll-margin-top: 1rem; }
.chord-group[hidden] { display: none; }
.chord-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.chord-tile { padding: 0.7rem 0.4rem 0.5rem; border: 1px solid var(--rule); border-radius: 0.5rem; background: var(--paper); text-align: center; }
.chord-tile[hidden] { display: none; }
.chord-tile__diagram { display: block; }
.chords-page .chord-tile .fg--fretboard[data-strings] { max-width: min(5.6rem, 30vw); }
.chords-page .chord-tile .fg--keyboard { max-width: 100%; }
.chord-tile__names { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 0.6rem; margin: 0.35rem 0 0; }
.chord-tile__names a { padding: 0.55rem 0.2rem; font-weight: 700; }
.chords-page .chord-tile__twin { color: var(--muted); font-weight: 400; }
@media (min-width: 40rem) { .chord-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 60rem) { .chord-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.chords-none { margin-top: 1.5rem; color: var(--muted); }
.chords-other { margin-top: 1.5rem; color: var(--muted); }
.chords-other a { margin-right: 0.8rem; }

/* ---- the closing strip (the brand block comes from try.css) ---- */
.chords-song { margin: 2.5rem auto 1rem; }
.chords-song__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.3rem 0 0; }
.chords-song .button { min-height: 2.9rem; }
.chords-page .chords-cta,
.chords-song .chords-cta {
  border-color: var(--selected-line);
  color: var(--selected-ink);
  background: var(--selected-fill);
}
