/* Chord finder pages. Inherit the palette from ../styles.css. The default accent is
   the mandolin app's teal; .theme-amber re-themes the page for the guitar app. */

.cf-page {
    --cf-accent: var(--chordseek-mando-teal);
    --cf-glow: rgba(47, 214, 190, 0.25);
    --cf-on: #06302B;
    --cf-link: #12796C;
    --cf-ring: #0E7A6C;
    --cf-tint: #E6FBF7;
}

.cf-page.theme-amber {
    --cf-accent: var(--chordseek-amber);
    --cf-glow: rgba(224, 147, 42, 0.25);
    --cf-on: #2B1700;
    --cf-link: #8A5200;
    --cf-ring: #8A5200;
    --cf-tint: #FCEBD2;
}

.cf-wrap {
    max-width: 1100px;
    padding-bottom: 4rem;
}

.cf-head {
    padding: 2.5rem 0 1.25rem;
}

.cf-head h1 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cf-head .lead {
    max-width: 62ch;
    color: var(--gray-40);
}

/* ---------- controls ---------- */

.cf-controls {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--gray-95);
    padding: 0.85rem 0 0.6rem;
    border-bottom: 1px solid var(--gray-90);
}

.cf-search input {
    width: 100%;
    max-width: 420px;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--gray-80);
    border-radius: 9px;
    font-size: 1rem;
    background: #fff;
}

.cf-search input:focus {
    outline: none;
    border-color: var(--cf-accent);
    box-shadow: 0 0 0 3px var(--cf-glow);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.6rem;
}

.chip {
    border: 1px solid var(--gray-80);
    background: #fff;
    color: var(--gray-20);
    border-radius: 999px;
    padding: 0.22rem 0.7rem;
    font-size: 0.86rem;
    line-height: 1.45;
    cursor: pointer;
}

.chip:hover {
    border-color: var(--gray-50);
}

.chip.on {
    background: var(--cf-accent);
    border-color: var(--cf-accent);
    color: var(--cf-on);
    font-weight: 600;
}

.count {
    margin: 0.55rem 0 0;
    font-size: 0.82rem;
    color: var(--gray-60);
}

/* ---------- grid ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 0.9rem;
    margin-top: 1.4rem;
}

.card {
    background: #fff;
    border: 1px solid var(--gray-90);
    border-radius: 13px;
    padding: 0.8rem 0.7rem 0.7rem;
    text-align: center;
}

.card h3 {
    margin: 0 0 0.1rem;
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card h3 small {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--gray-60);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-top: 0.1rem;
}

/* The ASCII spelling (F#) is for search engines and in-page search, not for
   reading -- the heading already shows the typographic one. */
.alias {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.card .meta {
    margin: 0.3rem 0 0;
    font-size: 0.78rem;
    color: var(--gray-50);
}

.card .notes {
    margin: 0.1rem 0 0.45rem;
    font-size: 0.8rem;
    color: var(--gray-40);
    font-variant-numeric: tabular-nums;
}

.more {
    background: none;
    border: none;
    color: var(--cf-link);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0.1rem 0.3rem;
    border-radius: 6px;
}

.more:hover {
    background: var(--purple-tint-90);
}

/* An expanded card widens to two grid columns so its three alternative shapes
   sit in a row. Left at one column they stacked vertically and the card grew
   to about four times the height of its neighbours. */
.card.open {
    grid-column: span 2;
}

.alts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin-top: 0.5rem;
    border-top: 1px dashed var(--gray-90);
    padding-top: 0.5rem;
}

.alts figure {
    margin: 0;
}

.alts figcaption {
    font-size: 0.7rem;
    color: var(--gray-60);
}

/* ---------- diagram ---------- */

.dia {
    width: 100%;
    max-width: 118px;
    height: auto;
    display: block;
    margin: 0.15rem auto 0;
}

.dia .fret,
.dia .str {
    stroke: var(--gray-70);
    stroke-width: 1.1;
}

.dia .nut {
    fill: var(--gray-10);
}

.dia .dot {
    fill: var(--gray-10);
}

/* The root is the note the chord is named after; players look for it first. */
.dia .dot.root {
    fill: var(--cf-accent);
    stroke: var(--cf-ring);
    stroke-width: 1.2;
}

.dia .barre {
    fill: var(--gray-10);
}

.dia .open {
    fill: none;
    stroke: var(--gray-30);
    stroke-width: 1.5;
}

.dia .fing {
    fill: #fff;
    font-size: 8.5px;
    font-weight: 700;
    text-anchor: middle;
    font-family: system-ui, sans-serif;
}

.dia .dot.root + .fing,
.dia .fing.on-root {
    fill: var(--cf-on);
}

.dia .mark {
    fill: var(--gray-50);
    font-size: 10px;
    text-anchor: middle;
    font-family: system-ui, sans-serif;
}

.dia .pos {
    fill: var(--gray-50);
    font-size: 8px;
    text-anchor: end;
    font-family: system-ui, sans-serif;
}

.dia .snam {
    fill: var(--gray-60);
    font-size: 8.5px;
    text-anchor: middle;
    font-family: system-ui, sans-serif;
}

/* ---------- CTA, FAQ, footer bits ---------- */

.noresult {
    margin: 2rem 0;
    color: var(--gray-50);
}

.cta {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin: 3rem 0 2rem;
    padding: 1.6rem;
    background: linear-gradient(135deg, var(--purple-tint-90), var(--cf-tint));
    border-radius: 16px;
}

.cta img {
    border-radius: 16px;
    flex: 0 0 auto;
}

.cta h2 {
    margin-top: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.cta p {
    max-width: 62ch;
    color: var(--gray-30);
}

.cta .small {
    color: var(--gray-60);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.faqs {
    margin: 2.5rem 0;
}

.faq {
    border-bottom: 1px solid var(--gray-90);
    padding: 0.7rem 0;
}

.faq summary {
    cursor: pointer;
    font-weight: 600;
}

.faq p {
    margin: 0.6rem 0 0.2rem;
    color: var(--gray-40);
    max-width: 72ch;
}

.also ul {
    padding-left: 1.1rem;
    color: var(--gray-40);
}

@media (max-width: 575px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.6rem;
    }

    .cta {
        flex-direction: column;
        padding: 1.2rem;
    }

    .cf-head {
        padding-top: 1.5rem;
    }
}
