/* Parts shared by the inner pages (key pages, chords, search, 404): the page hero, pill tabs, the practice card,
   option buttons and the score. Loaded after main.css. */

/* Page hero */
.page-hero {
  padding: 36px var(--pad) 24px;
}

.page-hero>span {
  display: block;
  margin-bottom: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-ink);
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.page-hero p {
  max-width: 56ch;
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

/* the small label above the heading (main.css) keeps its own size beside the hero's paragraph styles */
.page-hero .eyebrow {
  margin: 0 0 10px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
}

/* breadcrumb above the heading (key pages, theory pages) */
.crumbs {
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* padded above and below to tap, without moving the line */
.crumbs a {
  padding: 8px 0;
}

.crumbs a:hover {
  color: var(--text);
}

.crumbs span {
  margin: 0 4px;
}

/* a table that scrolls sideways on a narrow screen instead of squashing (theory, fingering charts) */
.table-scroll {
  overflow-x: auto;
}

/* Key tabs */
.scale-tabs {
  display: flex;
  gap: 8px;
  padding: 0 var(--pad) 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.scale-tabs button {
  flex: 0 0 auto;
  min-width: 44px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.scale-tabs button[aria-pressed="true"] {
  background: var(--strong);
  border-color: var(--strong);
  color: var(--on-strong);
}

/* Note chips: a scale's or chord's notes, each with its place in it, that sound when tapped (key pages, chords) */
.note-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}

.note-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 42px;
  height: 50px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.05);
  color: var(--text);
  font: inherit;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.note-chip small {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

/* the note the scale or chord is built on */
.note-chip.is-root {
  background: var(--accent-light);
  border-color: transparent;
  color: var(--accent-ink);
}

.note-chip.is-root small {
  color: var(--accent-ink);
}

.note-chip.is-sounding {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(1px);
}

.note-chip.is-sounding small {
  color: rgba(255, 255, 255, 0.82);
}

@media (hover: hover) {
  .note-chip:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
  }

  .note-chip.is-root:hover {
    border-color: transparent;
  }
}

/* Practice card */
.practice {
  padding: 0 var(--pad) 40px;
}

.practice-card,
.scale-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.practice-card h2 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.scale-alt {
  margin: 0 0 4px;
  font-size: 0.82rem;
  color: var(--muted);
}



/* option rows */
.options {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.option-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.seg button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.seg button[aria-pressed="true"] {
  background: var(--strong);
  color: var(--on-strong);
}

/* Type row (minor page): full width on phones so the three buttons fit */
.option-wide {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.option-wide .seg {
  display: flex;
}

.option-wide .seg button {
  flex: 1;
  padding: 0 8px;
}

/* The score: black ink, drawn by VexFlow. On a dark screen the music sits on its own sheet of warm white paper, as
   it would on the music stand, while the card around it stays dark. */
@media screen {
  :root[data-theme="dark"] .score {
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--paper);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 26px -14px rgba(0, 0, 0, 0.75);
  }
}

.score svg {
  display: block;
  width: 100%;
  height: auto;
}

.practice-foot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.fingering-text p,
.fingering-line {
  margin: 0 0 4px;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.fingering-text strong,
.fingering-line strong {
  letter-spacing: 0;
  color: var(--text);
}

/* a link to another part of the site: the key page from the chord explorer, the chord explorer from a key page */
.go-link {
  font-weight: 700;
  color: var(--accent-ink);
}

.go-link::after {
  content: " \203A";
}

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

/* Reference list */
.scale-reference {
  padding: 0 var(--pad) 56px;
}

.scale-list {
  display: grid;
  gap: 16px;
}

.scale-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Tablet */
@media (min-width: 768px) {
  .page-hero {
    padding: 56px var(--pad) 32px;
  }

  .note-chip {
    min-width: 50px;
    height: 54px;
    padding: 0 10px;
  }

  .scale-tabs {
    flex-wrap: wrap;
    overflow: visible;
  }

  .practice-card,
  .scale-card {
    padding: 28px;
  }

  .options {
    grid-template-columns: repeat(3, auto);
    justify-content: space-between;
  }

  .option-wide {
    align-items: flex-start;
  }

  .option-wide .seg button {
    padding: 0 14px;
  }

  .option {
    flex-direction: column;
    align-items: flex-start;
  }

  .practice-foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Desktop */
@media (min-width: 1024px) {

  .page-hero,
  .scale-tabs,
  .practice,
  .scale-reference {
    padding-inline: var(--gutter);
  }

  .practice-card {
    padding: 32px 36px;
  }

  .scale-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}