/* Tool pages (metronome, tuner, circle of fifths, staff paper): see views/tool.html. */

.tool-page h1 { font-size: 1.9rem; }
.tool-page .lead { font-size: 1.1rem; max-width: 46rem; }

/* The hub's cards. */
.tool-card { transition: border-color .15s ease, box-shadow .15s ease; }
.tool-card:hover,
.tool-card:focus-visible { border-color: var(--bs-primary); box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .08); }
.tool-icon { display: block; }
.adm-page-icon.tool-icon { width: 48px; height: 48px; flex: 0 0 48px; }

/* The words under a tool: what it is and how to use it. */
.tool-text { max-width: 46rem; }
.tool-text h2 { margin-top: 2rem; }
.tool-text h2:first-child { margin-top: 0; }

/* Tables in the words under a tool. */
.tool-table { max-width: 34rem; }

/* The metronome (tools/tool-metronome.js). */
.tool-metronome { max-width: 46rem; }
.metronome-bpm { font-size: 4rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.metronome-marking { min-height: 1.5em; }
.metronome-beats { display: flex; justify-content: center; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; min-height: 1.75rem; }
.metronome-dot { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--bs-secondary-bg); border: 2px solid var(--bs-border-color); align-self: center; transition: background-color .06s linear, transform .06s linear; }
.metronome-dot.first { width: 1.5rem; height: 1.5rem; }
.metronome-dot.on { background: var(--bs-primary); border-color: var(--bs-primary); transform: scale(1.2); }
.metronome-dot.on.muted { background: transparent; border-color: var(--bs-primary); }
.metronome-step { width: 2.75rem; font-size: 1.25rem; line-height: 1; padding-left: 0; padding-right: 0; }
.metronome-toggle { min-width: 10rem; }
.metronome-status { min-height: 1.5em; }
@media (prefers-reduced-motion: reduce) { .metronome-dot { transition: none; } .metronome-dot.on { transform: none; } }

/* The theme compiles its range thumbs in the default primary; the tools'
   sliders take the page's (data-bs-theme) primary like their buttons. */
.tool-page .form-range::-webkit-slider-thumb { background-color: var(--bs-primary); }
.tool-page .form-range::-moz-range-thumb { background-color: var(--bs-primary); }
.tool-page .form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 1px #fff, 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25); }

/* The cadran tonal, the circle of fifths as a spiral (views/content/unelte/
   cadranul-tonal.html, package unelte CircleSVG; tools/tool-circle-of-fifths.js). */
.circle-svg { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; font-family: var(--bs-body-font-family); }
.circle-wedge { fill: var(--bs-body-bg); stroke: var(--bs-border-color); stroke-width: 1.5; transition: fill .12s ease; }
.circle-minor .circle-wedge { fill: var(--bs-tertiary-bg); }
.circle-key { cursor: pointer; }
.circle-key.in-key .circle-wedge { fill: rgba(var(--bs-primary-rgb), .16); }
.circle-key:hover .circle-wedge { fill: rgba(var(--bs-primary-rgb), .28); }
.circle-key.selected .circle-wedge { fill: var(--bs-primary); }
.circle-key:focus-visible { outline: none; }
.circle-key:focus-visible .circle-wedge { stroke: var(--bs-primary); stroke-width: 3; }
.circle-name { fill: var(--bs-body-color); font-weight: 700; }
.circle-key.selected .circle-name,
.circle-key.selected .circle-glyph { fill: #fff; }
.circle-key.selected .circle-staff-line { stroke: #fff; }
/* With the signatures hidden, the major's name moves up to the middle of its part. */
.circle-tool[data-signatures="off"] .circle-major-name { transform: translateY(-17px); }
.circle-spiral { fill: none; stroke: var(--bs-body-color, #212529); stroke-width: 2.5; stroke-linejoin: round; pointer-events: none; }
.circle-arrow { fill: var(--bs-body-color, #212529); pointer-events: none; }
.circle-etc { fill: var(--bs-secondary-color); font-style: italic; }
.circle-order rect { fill: none; stroke: var(--bs-border-color); stroke-width: 1.5; }
.circle-order-caption { fill: var(--bs-secondary-color); }
.circle-center { fill: var(--bs-tertiary-bg); stroke: var(--bs-border-color); stroke-width: 1.5; }
.circle-center-name { fill: var(--bs-body-color); font-weight: 700; }
.circle-center-sig { fill: var(--bs-secondary-color); }
.circle-staff-line { stroke: var(--bs-body-color, #212529); stroke-width: .8; }
.circle-glyph { font-family: "Bravura"; fill: var(--bs-body-color, #212529); }
/* One clef at a time (data-clef on the tool), and the ring's signatures can go. */
.circle-tool[data-clef="treble"] .circle-sig-bass,
.circle-tool[data-clef="bass"] .circle-sig-treble,
.circle-tool[data-clef="treble"] .circle-pdf-bass,
.circle-tool[data-clef="bass"] .circle-pdf-treble,
.circle-tool[data-signatures="off"] .circle-svg .circle-sig { display: none; }
.circle-panel-staff { display: block; max-width: 100%; height: auto; }
.circle-panel-staff .circle-staff-line { stroke-width: 1; }
.circle-facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
.circle-facts > div { display: contents; }
.circle-facts dt { font-weight: 600; }
.circle-facts dd { margin: 0; }
.circle-chords caption { color: var(--bs-secondary-color); }
.circle-numeral { font-family: Georgia, "Times New Roman", serif; font-weight: 600; white-space: nowrap; }
.circle-play { line-height: 1; text-decoration: none; }
.circle-play .bi { font-size: 1.6rem; }

/* Printed (Printează): the circle and the selected key, nothing around them. */
@media print {
  #header, #footer, .breadcrumb, .tool-page > .lead, .circle-controls, .tool-text,
  .circle-panel-actions, .circle-play, .circle-chords th:last-child, .circle-chords td:last-child { display: none !important; }
  @page { size: A4; margin: 12mm; }
  .tool-page { padding: 0 !important; }
  .tool-page h1 { font-size: 16pt; margin-bottom: 4mm !important; }
  /* The circle on top, the selected key under it in two columns: its facts
     beside its chords, all on one page. */
  .circle-tool .col-lg-7, .circle-tool .col-lg-5 { width: 100%; }
  .circle-tool .row { --bs-gutter-y: 4mm; }
  .circle-svg { max-width: 13.5cm; }
  .circle-panel { break-inside: avoid; font-size: 10pt; display: grid; grid-template-columns: 1fr 1.25fr; column-gap: 8mm; align-items: start; }
  .circle-panel > * { grid-column: 1; }
  .circle-panel > .circle-chords { grid-column: 2; grid-row: 1 / span 5; }
  .circle-panel h2 { font-size: 14pt; }
  .circle-panel-staff { width: 34mm; }
  .circle-chords { font-size: 10pt; }
  .circle-chords > :not(caption) > * > * { padding: .15rem .35rem; }
}

/* The tuner (tools/tool-tuner.js). */
.tool-tuner { max-width: 40rem; }
.tuner-display { text-align: center; --tuner-state: var(--bs-secondary-color); }
.tuner-display[data-state="in-tune"] { --tuner-state: var(--bs-success, #198754); }
.tuner-display[data-state="close"] { --tuner-state: #e0a800; }
.tuner-display[data-state="off"] { --tuner-state: var(--bs-danger, #dc3545); }
.tuner-gauge { display: block; width: 100%; max-width: 22rem; margin: 0 auto; }
.tuner-arc { fill: none; stroke: var(--bs-border-color); stroke-width: 2; }
.tuner-zone { fill: none; stroke-width: 8; stroke-linecap: butt; }
.tuner-zone.close { stroke: rgba(224, 168, 0, .35); }
.tuner-zone.in-tune { stroke: var(--bs-success, #198754); }
.tuner-tick { stroke: var(--bs-secondary-color); stroke-width: 1.5; }
.tuner-tick.zero { stroke: var(--bs-body-color); stroke-width: 2.5; }
.tuner-scale { fill: var(--bs-secondary-color); font-size: 11px; }
.tuner-needle { transform-origin: 150px 165px; transform-box: view-box; transition: transform .12s ease-out; }
.tuner-needle path { stroke: var(--tuner-state); stroke-width: 3.5; stroke-linecap: round; }
.tuner-needle circle { fill: var(--tuner-state); }
.tuner-note { margin-top: -1.5rem; line-height: 1; }
.tuner-note-name { font-size: 3.5rem; font-weight: 700; color: var(--tuner-state); }
.tuner-detail { min-height: 1.5em; margin-top: .5rem; font-variant-numeric: tabular-nums; }
.tuner-status { min-height: 1.6em; font-weight: 600; color: var(--tuner-state); }
.tuner-strings { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1.25rem; }
.tuner-string { min-width: 3.5rem; font-weight: 600; text-transform: none; }
.tuner-string.heard { box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .35); }
.tuner-string.active { background: var(--bs-primary); color: #fff; }
.tuner-auto { text-transform: none; }
.tuner-a4-input { width: 5.5rem; text-align: center; }
.tuner-toggle { min-width: 14rem; }
@media (prefers-reduced-motion: reduce) { .tuner-needle { transition: none; } }

/* The staff paper page: each sheet's preview, A4 in proportion. */
.sheet-card { overflow: hidden; }
.sheet-link { display: block; padding: .6rem .6rem 0; background: var(--bs-tertiary-bg); }
.sheet-preview { display: block; width: 100%; height: auto; aspect-ratio: 210 / 297; padding: 6% 6.2% 5%; background: #fff; box-shadow: 0 .1rem .4rem rgba(0, 0, 0, .12); }
.sheet-card:hover .sheet-preview { box-shadow: 0 .2rem .8rem rgba(0, 0, 0, .2); }
/* At thumbnail size a 0.18 mm line is a fraction of a pixel: keep each one
   a visible pixel wide. The PDF keeps the printed widths. */
.sheet-preview path, .sheet-preview rect { vector-effect: non-scaling-stroke; stroke-width: .9px; }
