/* ==========================================================================
   Web Font Pairing & @font-face Generator — tool page only (/tools/font-pairing-generator/)
   Uses the design tokens from main.css, so both themes work automatically.
   ========================================================================== */

.fp [hidden] { display: none !important; }
.fp .opt { color: var(--muted); font-weight: 400; }
.fp-hint { margin: 0; line-height: 1.55; }
.fp-mono { font-family: var(--font-mono); font-size: 0.86rem; }
.fp-section { display: flex; flex-direction: column; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

/* Filters + pairing list */
.fp-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fp-pairs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.5rem;
  max-height: 380px; margin: 0; padding: 0.15rem; overflow: auto; list-style: none;
  overscroll-behavior: contain;
}
.fp-pair {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem;
  width: 100%; height: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border-2); border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit; text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.fp-pair:hover { border-color: rgba(139, 92, 246, 0.5); background: var(--surface-2); }
.fp-pair:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.fp-pair.is-active { border-color: rgba(139, 92, 246, 0.75); background: var(--grad-soft); }
.fp-pair-names { color: var(--text); font-size: 0.9rem; line-height: 1.35; overflow-wrap: anywhere; }
.fp-pair-names strong { font-weight: 700; }
.fp-pair-note { color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
.fp-pair-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: auto; padding-top: 0.15rem; }
.fp-pair-tags span { padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 0.7rem; font-weight: 600; text-transform: capitalize; }

/* Pickers */
.fp-pickers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 1100px) and (min-width: 961px), (max-width: 560px) { .fp-pickers { grid-template-columns: 1fr; } }
.fp-font {
  display: flex; flex-direction: column; gap: 0.75rem;
  min-width: 0; margin: 0; padding: 0.9rem;
  border: 1px solid var(--border-2); border-radius: var(--radius);
  background: var(--surface);
}
.fp-font legend { padding: 0 0.35rem; color: var(--text); font: 600 0.95rem/1.3 var(--font-display); }
.fp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 400px) { .fp-two { grid-template-columns: 1fr; } }
.fp-font .fp-two { grid-template-columns: 1fr; }
.fp .check { align-items: flex-start; line-height: 1.4; }
.fp .check input { flex: none; margin-top: 0.05rem; }
.fp .check input:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.fp .check input:disabled + * , .fp .check:has(input:disabled) { opacity: 0.6; cursor: not-allowed; }
.fp-warn { margin: 0; padding: 0.55rem 0.7rem; border: 1px solid rgba(245, 158, 11, 0.4); border-radius: 10px; background: rgba(245, 158, 11, 0.08); color: var(--warn-text); font-size: 0.82rem; line-height: 1.5; }
.fp-fluid { display: flex; flex-direction: column; gap: 0.75rem; }

/* Scale table */
.fp-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.fp-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.fp-table th, .fp-table td { padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.fp-table thead th { color: var(--muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface); }
.fp-table tbody tr:last-child th, .fp-table tbody tr:last-child td { border-bottom: 0; }
.fp-table code { color: var(--text); font: 0.8rem var(--font-mono); }
.fp-table td { color: var(--text-2); }

/* Preview */
.fp-ptheme .segmented-options label { padding: 0.3rem 0.8rem; font-size: 0.8rem; }
.fp-privacy { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.fp-privacy .field-hint { margin: 0; line-height: 1.5; }

.fp-preview {
  --fp-h: Georgia, serif; --fp-b: system-ui, sans-serif;
  --fp-hw: 700; --fp-bw: 400; --fp-bold: 700;
  --pv-bg: #ffffff; --pv-text: #1c1d2b; --pv-muted: #5b5f78; --pv-accent: #6d28d9; --pv-accent-text: #fff; --pv-border: rgba(20, 24, 60, 0.14);
  display: flex; flex-direction: column; gap: 0.9rem;
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--border-2); border-radius: var(--radius);
  background: var(--pv-bg); color: var(--pv-text);
  font-family: var(--fp-b); font-weight: var(--fp-bw);
  font-size: var(--fp-step-0, 1rem); line-height: 1.6;
  overflow-wrap: break-word;
  min-width: 0;
}
.fp-preview[data-ptheme="dark"] { --pv-bg: #111322; --pv-text: #eef0fb; --pv-muted: #a3a8c6; --pv-accent: #a78bfa; --pv-accent-text: #14112a; --pv-border: rgba(255, 255, 255, 0.18); }
.fp-preview p { margin: 0; }
.fp-eyebrow { color: var(--pv-accent); font-size: var(--fp-step--1, 0.85rem); font-weight: var(--fp-bold); letter-spacing: 0.12em; text-transform: uppercase; }
.fp-h1, .fp-h2, .fp-h3 { color: var(--pv-text); font-family: var(--fp-h); font-weight: var(--fp-hw); line-height: 1.15; letter-spacing: normal; text-wrap: balance; }
.fp-h1 { font-size: var(--fp-step-5, 2.5rem); }
.fp-h2 { margin-top: 0.6rem !important; font-size: var(--fp-step-4, 2rem); }
.fp-h3 { font-size: var(--fp-step-3, 1.5rem); }
.fp-text { max-width: 62ch; color: var(--pv-text); }
.fp-text strong { font-weight: var(--fp-bold); }
.fp-small { color: var(--pv-muted); font-size: var(--fp-step--1, 0.85rem); }
.fp-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.fp-btn {
  display: inline-flex; align-items: center;
  padding: 0.65em 1.2em;
  border: 1.5px solid var(--pv-accent); border-radius: 10px;
  background: var(--pv-accent); color: var(--pv-accent-text);
  font-size: var(--fp-step-0, 1rem); font-weight: var(--fp-bold); line-height: 1.2;
}
.fp-btn-ghost { background: transparent; color: var(--pv-accent); }

.fp-details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.fp-details summary { padding: 0.6rem 0.85rem; color: var(--text-2); font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.fp-details summary:hover { color: var(--text); }
.fp-details summary:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; border-radius: 12px; }
.fp-details[open] summary { border-bottom: 1px solid var(--border); }
.fp-details-body { display: flex; flex-direction: column; align-items: stretch; gap: 0.8rem; padding: 0.85rem; }
.fp-details-body .link-btn { align-self: flex-start; }
.fp .textarea.fp-s-text { min-height: 90px; }

/* Code tabs */
.fp-tabs { flex-wrap: wrap; align-self: flex-start; max-width: 100%; border-radius: 18px; }
.fp-panel { display: flex; flex-direction: column; gap: 0.85rem; min-width: 0; }
.fp-code-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; }
.fp-code-head .fp-hint { flex: 1 1 220px; }
.fp-code { max-height: 420px; white-space: pre; }
.fp-code-sm { max-height: 160px; }
.fp-sub { margin: 0; font: 600 0.95rem/1.3 var(--font-display); }
.fp-use { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fp-fs { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.fp-fs legend { margin-bottom: 0.45rem; padding: 0; }
.fp-wchecks { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }
.fp-wcheck { min-width: 3.6rem; }
.fp-ff-warn:empty { display: none; }
