/* The Guitar Chord Atlas: its controls, legend, cards and chord diagrams. The page's header,
   paint and the chord colours are in ../resources.css. */

.ctl-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--silk-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.seg {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}
.seg button {
  font: inherit;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--silk);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 8px 2px;
  min-height: 42px;
  cursor: pointer;
  line-height: 1.1;
}
.seg button:first-child {
  border-left: 0;
}
.seg button .alt {
  display: block;
  font-size: 11px;
  color: var(--silk-dim);
}
.seg button:hover:not([aria-pressed="true"]) {
  background: var(--tape);
}
.seg button[aria-pressed="true"],
.seg button[aria-pressed="true"] .alt {
  background: var(--root);
  color: #000;
}
.row2 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
}
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  max-width: 100%;
  padding: 2px;
}
.chip,
.tog button {
  font: inherit;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--silk);
  border-radius: 999px;
  padding: 6px 13px;
  min-height: 36px;
}
.chip:hover:not([aria-pressed="true"]) {
  border-color: var(--silk-dim);
}
.chip[aria-pressed="true"] {
  border-color: var(--silk);
  background: var(--silk);
  color: var(--ink);
  font-weight: 700;
}
.tog {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tog .grp {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--panel);
}
.tog button {
  border: 0;
  border-radius: 0;
  padding: 6px 11px;
}
.tog button + button {
  border-left: 1px solid var(--line);
}
.tog button[aria-pressed="true"] {
  background: var(--silk);
  color: var(--ink);
  font-weight: 700;
}
button:focus-visible,
.chips:focus-visible {
  outline: 2px solid var(--silk);
  outline-offset: 2px;
  position: relative;
  z-index: 1;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin: 20px 0 4px;
  font-size: 15px;
  color: var(--silk-dim);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}
.legend .k-root {
  background: var(--root);
}
.legend .k-tone {
  background: var(--tone);
}
.legend .k-color {
  background: var(--color);
}
.legend .k-bar {
  width: 26px;
  border-radius: 7px;
  background: var(--silk);
  opacity: 0.25;
}
.legend .sym {
  font-family: var(--mono);
  color: var(--silk);
}

.fam {
  margin-top: 32px;
}
.fam h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.fam h2 span {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--silk-dim);
}
.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}
.card {
  min-width: 0;
  padding: 16px 16px 14px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
}
/* A chord's name keeps its case (m is minor, M is not), so it is set in the body face, not in
   the display faces, which print only capitals */
.card h3 {
  margin: 0;
  font-family: var(--body);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.card .tname {
  margin-top: 2px;
  font-size: 14px;
  color: var(--silk-dim);
}
.meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 10px 0 6px;
}
.meta dt {
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--silk-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.meta dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.meta dd b {
  color: var(--color);
  font-weight: inherit;
}
.meta dd .r {
  color: var(--root);
}
.use {
  margin: 4px 0 10px;
  font-size: 15px;
  line-height: 1.45;
}
.diagrams {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}
figure.dg {
  margin: 0;
  width: 112px;
  text-align: center;
}
figure.dg svg {
  display: block;
  width: 112px;
  height: auto;
  overflow: visible;
}
figure.dg figcaption {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--silk-dim);
}
svg .str,
svg .fret {
  stroke: var(--silk-dim);
}
svg .nut {
  stroke: var(--silk);
}
svg .lbl {
  fill: var(--silk-dim);
  font-family: var(--mono);
  font-size: 10px;
}
svg .tab {
  fill: var(--silk);
  font-family: var(--mono);
  font-size: 10px;
}
svg .mute {
  stroke: var(--silk-dim);
}
svg .bar {
  fill: var(--silk);
  fill-opacity: 0.22;
}
svg .d-root {
  fill: var(--root);
}
svg .d-tone {
  fill: var(--tone);
}
svg .d-color {
  fill: var(--color);
}
svg .o-root {
  stroke: var(--root);
  fill: none;
}
svg .o-tone {
  stroke: var(--tone);
  fill: none;
}
svg .o-color {
  stroke: var(--color);
  fill: none;
}
svg .dt {
  fill: var(--on-dot);
  font-family: var(--body);
  font-weight: 700;
}

@media (max-width: 640px) {
  .seg {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .seg button:nth-child(7) {
    border-left: 0;
  }
  .seg button:nth-child(n + 7) {
    border-top: 1px solid var(--line);
  }
  .card h3 {
    font-size: 23px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .seg button,
  .chip,
  .tog button {
    transition: background-color 0.15s ease, color 0.15s ease;
  }
}

.togs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
}
