/*
 * /chord-identifier: the interactive tool in the hero (piano, fretboard, result card)
 * and the few blocks seo.css does not have. Loaded after seo.css.
 */

.hero--tool .hero__inner { max-width: 900px; }

.ci-tool {
  --ci-white: #ffffff;
  --ci-white-ink: #57524a;
  --ci-black: #26231f;
  --ci-black-ink: #f2efe8;
  max-width: 860px;
  margin: 32px auto 0;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: left;
  overflow: hidden;
}
:root[data-theme="dark"] .ci-tool { --ci-white: #dcd7cc; --ci-white-ink: #3a362f; --ci-black: #0d0c0a; }

.ci-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px 0 8px; border-bottom: 1px solid var(--stroke); }
.ci-bar .tabs { border-bottom: 0; }
.ci-bar .tab { padding: 15px 16px; font-size: 14px; }
.ci-bar .tab[aria-selected="true"] { border-bottom-color: var(--accent); }

.ci-input { padding: 20px 16px 6px; }
.ci-swipe { display: none; }
.ci-hint { margin: 0; padding: 0 16px 16px; font-size: 12.5px; line-height: 1.5; color: var(--ink-tertiary); }
.ci-scroll { overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }

/* ---------- piano ---------- */
.ci-piano { position: relative; height: 156px; min-width: 460px; user-select: none; }
.ci-key { position: absolute; top: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 9px; border: 1px solid var(--stroke-strong); cursor: pointer; transition: background var(--motion-fast), color var(--motion-fast), transform var(--motion-fast); }
.ci-key__name { font: 600 11.5px/1 var(--font-sans); pointer-events: none; }
.ci-key--white { height: 100%; background: var(--ci-white); color: var(--ci-white-ink); border-radius: 0 0 8px 8px; }
.ci-key--white:hover { background: var(--accent-soft); }
.ci-key--black { z-index: 2; height: 62%; background: var(--ci-black); color: var(--ci-black-ink); border-color: var(--ci-black); border-radius: 0 0 6px 6px; padding-bottom: 7px; }
.ci-key--black .ci-key__name { font-size: 10px; }
.ci-key--black:hover { background: #4a4540; }
.ci-key[aria-pressed="true"] { background: var(--accent); border-color: var(--accent-strong); color: var(--accent-on); }
.ci-key--white[aria-pressed="true"]:hover { background: var(--accent-hover); }
.ci-key:focus-visible { z-index: 3; outline: 3px solid var(--ink); outline-offset: -3px; }

/* ---------- fretboard ---------- */
.ci-neck { min-width: 540px; padding: 4px 0 8px; }
.ci-neck__head, .ci-string { display: grid; grid-template-columns: 30px repeat(14, minmax(0, 1fr)); align-items: center; }
.ci-neck__fret { text-align: center; font-size: 11px; font-weight: 600; color: var(--ink-tertiary); padding-bottom: 6px; }
.ci-neck__fret.is-mark { color: var(--ink); }
.ci-string__name { font: 700 12px var(--font-chord); color: var(--ink-tertiary); text-align: center; }
.ci-fret { position: relative; display: grid; place-items: center; height: 36px; padding: 0; border: 0; border-right: 1px solid var(--stroke-strong); background: transparent; border-radius: 0; }
.ci-fret::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--string, 1px); background: var(--ink-tertiary); opacity: .5; transform: translateY(-50%); }
.ci-fret--mute { border-right: 0; }
.ci-fret--mute::before { display: none; }
.ci-fret--open { border-right: 4px solid var(--ink); }
.ci-string[data-string="0"] { --string: 3px; }
.ci-string[data-string="1"] { --string: 2.6px; }
.ci-string[data-string="2"] { --string: 2.2px; }
.ci-string[data-string="3"] { --string: 1.8px; }
.ci-string[data-string="4"] { --string: 1.4px; }
.ci-string[data-string="5"] { --string: 1px; }
.ci-fret__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font: 700 11px/1 var(--font-sans); color: var(--accent-on); transition: background var(--motion-fast), transform var(--motion-fast); }
.ci-fret:hover .ci-fret__dot { background: var(--surface-hover); }
.ci-fret[aria-pressed="true"] .ci-fret__dot { background: var(--accent); box-shadow: 0 1px 4px rgba(var(--accent-rgb), .4); }
.ci-fret--mute .ci-fret__dot { font-size: 16px; font-weight: 600; color: var(--ink-tertiary); }
.ci-fret--mute[aria-pressed="true"] .ci-fret__dot { background: var(--surface-2); box-shadow: none; border: 1px solid var(--stroke-strong); }
.ci-fret:focus-visible { outline-offset: -3px; z-index: 2; }

/* ---------- result ---------- */
.ci-result { min-height: 232px; padding: 22px 20px 16px; border-top: 1px solid var(--stroke); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.ci-label { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-tertiary); }
.ci-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: start; }
.ci-name { margin: 0; font: 700 clamp(40px, 7vw, 56px)/1.05 var(--font-chord); letter-spacing: -.04em; color: var(--accent-strong); overflow-wrap: anywhere; }
.ci-name--none { font-size: 28px; color: var(--ink); }
.ci-sub { margin: 8px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-secondary); }
.ci-facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 8px 28px; margin: 18px 0 0; }
.ci-facts div { display: grid; gap: 2px; }
.ci-facts dt { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-tertiary); }
.ci-facts dd { margin: 0; font: 650 16px/1.4 var(--font-chord); color: var(--ink); white-space: pre-wrap; }
.ci-alts { margin-top: 18px; }
.ci-alts__list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.ci-alts__list li { display: grid; gap: 1px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-sm); }
.ci-alts__list b { font: 700 16px/1.2 var(--font-chord); color: var(--chord); }
.ci-alts__list span { font-size: 12px; color: var(--ink-secondary); }
.ci-diagram { display: grid; justify-items: center; gap: 6px; margin: 0; padding: 10px 14px 12px; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-md); color: var(--ink); }
.ci-diagram__svg svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.ci-diagram figcaption { font-size: 11.5px; color: var(--ink-tertiary); }
.ci-diagram__none { margin: 0; max-width: 150px; font-size: 13px; color: var(--ink-secondary); text-align: center; }
.ci-empty { display: grid; align-content: center; justify-items: center; gap: 6px; min-height: 150px; text-align: center; }
.ci-empty__title { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.015em; }
.ci-empty__body { margin: 0; max-width: 460px; font-size: 14.5px; line-height: 1.6; color: var(--ink-secondary); }
.ci-nomatch .ci-alts__list { margin-top: 12px; }
.ci-cta { display: flex; align-items: center; gap: 6px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--stroke); font-size: 13.5px; }
.ci-cta a { color: var(--accent-strong); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ci-cta .icon { width: 15px; height: 15px; color: var(--accent-strong); }

/* ---------- blocks used by this page only ---------- */
.ci-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ci-chip-row li { padding: 7px 12px; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-sm); font: 650 14px/1.3 var(--font-chord); color: var(--chord); }
.ci-mono { font-family: var(--font-chord); font-weight: 650; color: var(--ink); white-space: nowrap; }
.seo-table .ci-mono { white-space: nowrap; }
.ci-notes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ci-notes li { display: grid; place-items: center; min-width: 40px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--stroke); border-radius: var(--radius-sm); font: 700 16px/1 var(--font-chord); color: var(--ink); }
.ci-notes li.is-bass { background: var(--now-bg); border-color: rgba(var(--accent-rgb), .4); color: var(--accent-strong); }
.ci-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ci-pair > div { display: grid; align-content: start; gap: 10px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-md); }
.ci-pair h4 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-tertiary); }
.ci-pair p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-secondary); }
.ci-pair .ci-bigname { font: 700 26px/1.1 var(--font-chord); letter-spacing: -.03em; color: var(--accent-strong); }
.ci-promo { display: grid; gap: 14px; padding: 26px; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.ci-promo .seo-output__label { margin: 0; }
.ci-promo__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

@media (min-width: 761px) {
  .ci-readouts { grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, 1.1fr); }
}
@media (max-width: 760px) {
  .ci-swipe { display: inline; }
  .ci-bar { padding-right: 10px; }
  .ci-bar .tab { padding: 13px 12px; }
  .ci-card { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ci-diagram { justify-self: start; }
  .ci-facts { grid-template-columns: minmax(0, 1fr); }
  .ci-result { padding: 18px 14px 14px; }
  .ci-pair { grid-template-columns: minmax(0, 1fr); }
  .ci-promo { padding: 20px; }
}
