/* fonts.free - "Identify a font" tools (guided wizard, compare, image match).
   Scoped idf-* styles layered on top of styles.css; reuses the site's CSS
   variables so everything themes correctly in both light and dark. Nothing
   here overrides a styles.css selector - only new idf-* classes (plus a couple
   of local tweaks to shared ff-* nodes rendered by identify.js). */

/* ---------- tool-card row (hub) ---------- */
.idf-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 16px;
}
.idf-tool {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: 1.25rem 1.4rem;
    background: var(--ff-surface);
    border: 1px solid var(--ff-border);
    border-radius: var(--ff-r);
    box-shadow: var(--ff-shadow-sm);
    text-decoration: none;
    color: var(--ff-body);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.idf-tool:hover {
    transform: translateY(-3px);
    border-color: var(--ff-border-2);
    box-shadow: var(--ff-shadow);
    color: var(--ff-body);
}
.idf-tool-active {
    border-color: var(--ff-indigo);
    box-shadow: 0 0 0 1px var(--ff-indigo) inset, var(--ff-shadow-sm);
}
.idf-tool-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--ff-r-sm);
    background: var(--ff-indigo-tint);
    color: var(--ff-indigo);
    font-size: 1.2rem;
    font-weight: 700;
}
.idf-tool-h { font-weight: 700; color: var(--ff-ink); font-size: 1.02rem; }
.idf-tool-p { color: var(--ff-muted); font-size: .88rem; margin: 0; }

/* ---------- guided wizard ---------- */
.idf-wizard { margin-top: .5rem; }
.idf-nojs { display: none; }        /* JS replaces the whole root; noscript covers the rest */
.idf-steps { display: flex; flex-direction: column; gap: 1.25rem; }
.idf-step {
    padding: 1.1rem 1.3rem;
    background: var(--ff-surface);
    border: 1px solid var(--ff-border);
    border-radius: var(--ff-r);
    box-shadow: var(--ff-shadow-sm);
}
.idf-step-q { font-weight: 700; color: var(--ff-ink); margin-bottom: .3rem; }
.idf-step-help { margin-bottom: .7rem; }
.idf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: .5rem; }
.idf-chip {
    border: 1px solid var(--ff-border-2);
    background: var(--ff-surface);
    color: var(--ff-body);
    border-radius: var(--ff-r-pill);
    padding: .45rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.idf-chip:hover { background: var(--ff-surface-2); color: var(--ff-ink); border-color: var(--ff-border-2); }
.idf-chip.is-on {
    background: var(--ff-indigo);
    border-color: var(--ff-indigo);
    color: #fff;
}
[data-theme="dark"] .idf-chip.is-on { color: var(--ff-bg); background: var(--ff-gold); border-color: var(--ff-gold); }

.idf-res-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 1.75rem 0 1rem;
}
.idf-res-count { font-weight: 700; color: var(--ff-ink); }
.idf-startover { padding: .4rem 1rem; font-size: .85rem; }

/* result cards (rendered by identify.js as .font-card.idf-result) */
.idf-result-preview {
    font-size: 40px;
    line-height: 1.18;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ff-ink);
}
.idf-card-note { margin-top: .35rem; }
.idf-card-score {
    flex: 0 0 auto;
    font-size: .72rem;
    font-weight: 700;
    color: var(--ff-indigo);
    background: var(--ff-indigo-tint);
    border-radius: var(--ff-r-pill);
    padding: 2px 9px;
}

/* ---------- how it works ---------- */
.idf-step-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ff-gold-tint);
    color: var(--ff-gold-deep);
    font-weight: 700;
    margin-bottom: .5rem;
}

/* ---------- compare ---------- */
.idf-cmp-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 1rem;
}
.idf-cmp-field { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 220px; }
.idf-cmp-size { flex: 1 1 200px; max-width: 320px; }
.idf-cmp-add {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: .4rem;
}
.idf-cmp-picker { position: relative; flex: 1 1 260px; }
.idf-cmp-results {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 320px;
    overflow-y: auto;
    background: var(--ff-surface);
    border: 1px solid var(--ff-border-2);
    border-radius: var(--ff-r-sm);
    box-shadow: var(--ff-shadow);
}
.idf-cmp-opt {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: .55rem .9rem;
    color: var(--ff-body);
    font-size: .92rem;
    cursor: pointer;
}
.idf-cmp-opt:hover { background: var(--ff-surface-2); color: var(--ff-ink); }
.idf-cmp-imgbtn { cursor: pointer; }
.idf-cmp-privacy { margin: .1rem 0 1.25rem; }

.idf-cmp-stack { display: flex; flex-direction: column; gap: 14px; }
.idf-cmp-empty { text-align: center; padding: 2rem 0; }
.idf-cmp-row {
    padding: 1rem 1.25rem;
    background: var(--ff-surface);
    border: 1px solid var(--ff-border);
    border-radius: var(--ff-r);
    box-shadow: var(--ff-shadow-sm);
}
.idf-cmp-rowhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: .5rem;
}
.idf-cmp-fam { font-weight: 700; color: var(--ff-ink); text-decoration: none; font-size: .9rem; }
a.idf-cmp-fam:hover { color: var(--ff-link); }
.idf-cmp-x {
    border: 0;
    background: none;
    color: var(--ff-faint);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 .3rem;
}
.idf-cmp-x:hover { color: var(--ff-ink); }
.idf-cmp-sample {
    color: var(--ff-ink);
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.idf-cmp-pin { border-style: dashed; }
.idf-cmp-refimg { max-width: 100%; height: auto; border-radius: var(--ff-r-sm); display: block; }

/* ---------- image match ---------- */
.idf-beta {
    background: var(--ff-gold-tint);
    border: 1px solid var(--ff-border-2);
    border-radius: var(--ff-r-sm);
    padding: .8rem 1rem;
    margin-bottom: 1.25rem;
    color: var(--ff-body);
    font-size: .92rem;
}
.idf-beta strong { color: var(--ff-ink); }
.idf-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--ff-surface);
    border: 2px dashed var(--ff-border-2);
    border-radius: var(--ff-r);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.idf-drop:hover, .idf-drop.is-over {
    border-color: var(--ff-indigo);
    background: var(--ff-indigo-tint);
}
.idf-drop-ico {
    font-size: 2rem;
    color: var(--ff-indigo);
    line-height: 1;
}
.idf-drop-h { font-weight: 700; color: var(--ff-ink); }
.idf-img-preview {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
}
.idf-img-preview img {
    max-width: 100%;
    max-height: 260px;
    height: auto;
    border-radius: var(--ff-r-sm);
    border: 1px solid var(--ff-border);
}
.idf-img-reset { padding: .4rem 1rem; font-size: .85rem; }
.idf-status {
    margin-top: 1.25rem;
    font-weight: 600;
    color: var(--ff-body);
}
.idf-status-busy { color: var(--ff-indigo); }
.idf-status-ok { color: var(--ff-ink); }
.idf-status-warn { color: var(--ff-gold-deep); }
.idf-matches { margin-top: 1rem; }
.idf-privacy { margin-top: 1.25rem; }

@media (max-width: 560px) {
    .idf-result-preview { font-size: 32px; }
    .idf-drop { padding: 1.75rem 1rem; }
}
