/* Song tempo pages (/songs/…): what the marketing site's style.css does not already cover.
   Same palette, same system type, light and dark from style.css's custom properties.
   Logical properties throughout, so a translated right-to-left copy lays out correctly.
   Source: Tools/web/site/songs.css — build_site.py copies it to /songs/songs.css. */

/* ---------------------------------------------------------------- breadcrumbs */

.sp-crumbs {
  font-size: 0.875rem;
  color: var(--ink-faint);
}

.sp-crumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.sp-crumbs li:not(:last-child)::after {
  content: "›";
  margin-inline-start: 0.5rem;
  color: var(--ink-faint);
}

[dir="rtl"] .sp-crumbs li:not(:last-child)::after {
  content: "‹";
}

.sp-crumbs a {
  color: var(--ink-soft);
  text-decoration: none;
}

.sp-crumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.sp-crumbs [aria-current] {
  color: var(--ink-faint);
}

/* ---------------------------------------------------------------- page */

.sp-main {
  padding-block: clamp(1.25rem, 4vw, 2.5rem) clamp(3rem, 8vw, 5rem);
}

.sp-main h1 {
  font-family: var(--round);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0 0 0.5rem;
  overflow-wrap: anywhere;
}

.sp-main h2 {
  font-family: var(--round);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 0.75rem;
}

.sp-main h3 {
  font-family: var(--round);
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 2rem 0 0.5rem;
}

.sp-byline {
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

.sp-answer {
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
  line-height: 1.5;
  max-width: var(--measure);
  margin: 0 0 2rem;
}

.sp-intro,
.sp-main section > p {
  color: var(--ink-soft);
  max-width: var(--measure);
}

.sp-intro {
  font-size: 1.0625rem;
  margin: 0 0 2rem;
}

.sp-note {
  font-size: 0.9375rem;
  color: var(--ink-faint);
}

/* ---------------------------------------------------------------- the click */

.sp-player {
  display: grid;
  justify-items: center;
  gap: 1rem;
  max-width: 34rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--rule-strong);
  border-radius: 18px;
  background: var(--raised);
  box-shadow: var(--shadow);
  text-align: center;
}

.sp-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  min-height: 1.25rem;
}

.sp-dots span {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--rule-strong);
  transition: background-color 0.06s linear, transform 0.06s linear;
}

/* The first beat of the bar is the accented one. */
.sp-dots span:first-child {
  width: 1rem;
  height: 1rem;
}

.sp-dots span.is-lit {
  background: var(--amber);
  transform: scale(1.3);
}

.sp-readout {
  margin: 0;
  font-family: var(--round);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.sp-readout output {
  display: block;
  font-size: clamp(3rem, 12vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.sp-readout span {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.sp-play {
  appearance: none;
  min-width: 9rem;
  min-height: 2.75rem;
  padding: 0.75rem 2.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--amber);
  color: #1e1203;
  font-family: var(--round);
  font-size: 1.0625rem;
  font-weight: 700;
  cursor: pointer;
}

.sp-play[aria-pressed="true"] {
  background: var(--ink);
  color: var(--ground);
}

.sp-play:disabled {
  opacity: 0.6;
  cursor: progress;
}

.sp-speeds {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.sp-speeds button {
  appearance: none;
  min-height: 2.25rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.sp-speeds button small {
  margin-inline-end: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-faint);
}

.sp-speeds button[aria-pressed="true"] {
  border-color: var(--amber);
  background: var(--amber);
  color: #1e1203;
}

.sp-speeds button[aria-pressed="true"] small {
  color: inherit;
}

.sp-hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-faint);
}

.sp-player .cta {
  font-size: 0.9375rem;
}

/* ---------------------------------------------------------------- facts and lists */

.sp-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.5rem 1.5rem;
  max-width: var(--measure);
  margin: 0;
}

.sp-facts dt {
  font-weight: 600;
}

.sp-facts dd {
  margin: 0;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 30rem) {
  .sp-facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .sp-facts dd {
    margin-block-end: 0.75rem;
  }
}

.sp-list {
  list-style: none;
  max-width: var(--measure);
  margin: 0;
  padding: 0;
}

.sp-list li {
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.sp-meta {
  font-size: 0.9375rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.sp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sp-grid.is-small {
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
}

.sp-grid a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  background: var(--raised);
  color: var(--ink);
  text-decoration: none;
}

.sp-grid a:hover {
  border-color: var(--amber);
}

.sp-grid a span {
  color: var(--ink-faint);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- tables */

.sp-table {
  margin-top: 0.5rem;
}

.sp-table th,
.sp-table td {
  text-align: start;
  padding-inline: 0 1rem;
}

.sp-table td:nth-child(n + 2) {
  white-space: nowrap;
}

.sp-table .num {
  font-variant-numeric: tabular-nums;
}

.sp-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0 0 0.5rem;
}

.sp-filter[hidden] {
  display: none;
}

.sp-filter input {
  min-width: min(100%, 20rem);
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--raised);
  color: var(--ink);
  font: inherit;
}

.sp-filter output {
  font-size: 0.9375rem;
  color: var(--ink-faint);
}

/* ---------------------------------------------------------------- the app card */

.sp-app {
  margin-top: 3.5rem;
}

.sp-app h2 {
  margin-top: 0;
}

/* ---------------------------------------------------------------- the 404 page */

.sp-lost {
  max-width: var(--measure);
  padding-block: clamp(2.5rem, 8vw, 5rem);
}

@media (prefers-reduced-motion: reduce) {
  .sp-dots span {
    transition: none;
  }
}

/* ---------------------------------------------------------------- narrow windows */

/* The masthead holds the wordmark and two links: let them wrap rather than push the page wide. */
.sp-page .masthead {
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.sp-page .masthead-links {
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.sp-page .footer-links {
  gap: 0.75rem 1.5rem;
}
