/* ===== DistrictQuiz Free Interactive Tools & Mini-Quizzes =====
 * Shared stylesheet for /free-tools/ hub + 15 interactive calculators,
 * mini-quizzes, generators, and trackers.
 *
 * Strictly uses semantic CSS custom properties from /styles/main.css (zero raw hex).
 */

.ft-main {
  padding-top: 84px;
  background: var(--bg);
  color: var(--text-body);
  max-width: 100%;
  overflow-x: clip;
}

.ft-main .breadcrumb {
  padding-top: 8px;
}

.ft-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
  min-width: 0;
}

.ft-hero {
  padding: 28px 0 34px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}

.ft-kicker {
  display: inline-block;
  margin-bottom: 10px;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.ft-hero h1 {
  margin: 0 0 14px;
  font-family: var(--font-heading);
  font-size: clamp(1.65rem, 4vw, 2.45rem);
  line-height: 1.22;
  color: var(--gold-bright);
  overflow-wrap: anywhere;
}

.ft-lede {
  margin: 0 0 16px;
  font-size: 1.03rem;
  line-height: 1.68;
  color: var(--text-body);
  max-width: 840px;
}

.ft-trust-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ft-trust-pills li {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--gold-bright);
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 600;
}

/* ===== TOOL WORKBENCH SHELL ===== */
.ft-tool-section {
  padding: 32px 0 38px;
}

.ft-shell {
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: 14px;
  padding: 24px;
  min-width: 0;
  box-sizing: border-box;
}

.ft-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.ft-form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.ft-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ft-field-full {
  grid-column: 1 / -1;
}

.ft-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.ft-label-val {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.ft-input,
.ft-select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.94rem;
  line-height: 1.35;
  box-sizing: border-box;
}

.ft-input::placeholder {
  color: var(--muted);
}

.ft-range {
  width: 100%;
  height: 8px;
  margin: 10px 0 4px;
  accent-color: var(--gold);
  cursor: pointer;
}

.ft-range-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--muted);
}

.ft-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ft-chip {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ft-chip[aria-pressed="true"],
.ft-chip.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
}

.ft-chip:hover:not(.is-active):not([aria-pressed="true"]) {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

/* ===== BUTTONS ===== */
.ft-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ft-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  background: var(--gold);
  color: var(--bg);
  border: 2px solid var(--gold);
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.ft-btn-primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: var(--bg);
}

.ft-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  background: var(--bg);
  color: var(--gold-bright);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.ft-btn-secondary:hover {
  border-color: var(--gold-bright);
  color: var(--text);
}

.ft-copy-status {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-bright);
}

/* ===== QUIZ INTERFACE ===== */
.ft-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.ft-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--line);
}

.ft-progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.ft-question-title {
  margin: 0 0 16px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  line-height: 1.4;
  color: var(--text);
  overflow-wrap: anywhere;
}

.ft-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.ft-option-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.ft-option-btn:hover {
  border-color: var(--gold);
  background: var(--bg-alt);
  color: var(--text);
}

.ft-option-key {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold-bright);
}

.ft-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

/* ===== RESULT PANEL & CANVAS CARD ===== */
.ft-result-box {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.ft-result-banner {
  padding: 20px;
  background: var(--bg);
  border: 2px solid var(--gold);
  border-radius: 12px;
  text-align: center;
  margin-bottom: 18px;
}

.ft-result-kicker {
  display: inline-block;
  padding: 4px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.ft-result-title {
  margin: 4px 0 8px;
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 3.2vw, 1.9rem);
  line-height: 1.28;
  color: var(--gold-bright);
  overflow-wrap: anywhere;
}

.ft-result-summary {
  margin: 0 auto;
  max-width: 700px;
  font-size: 0.98rem;
  line-height: 1.62;
  color: var(--text-body);
  overflow-wrap: anywhere;
}

.ft-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ft-metrics-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ft-metric-card {
  padding: 15px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
}

.ft-metric-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}

.ft-metric-val {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.ft-metric-note {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.52;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ft-bars-box {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 18px;
}

.ft-bars-title {
  margin: 0 0 12px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.ft-bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 34%) minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  margin-bottom: 9px;
}

.ft-bar-row:last-child {
  margin-bottom: 0;
}

.ft-bar-name {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.ft-bar-track {
  height: 9px;
  background: var(--bg-card);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.ft-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
}

.ft-bar-pct {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-bright);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ===== CANVAS SHAREABLE CARD ===== */
.ft-canvas-panel {
  margin: 18px 0;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--gold-dim);
  border-radius: 12px;
}

.ft-canvas-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ft-canvas-head span {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.ft-canvas-el {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}

/* ===== NAME GENERATOR & TRACKER LISTS ===== */
.ft-name-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ft-name-card {
  padding: 15px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.ft-name-card:hover,
.ft-name-card.is-selected {
  border-color: var(--gold);
  background: var(--bg-alt);
}

.ft-name-card h3 {
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-size: 1.08rem;
  color: var(--gold-bright);
}

.ft-name-meta {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  color: var(--gold);
  margin-bottom: 6px;
}

.ft-name-desc {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.48;
  color: var(--muted);
}

.ft-checklist {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 16px 0 20px;
}

.ft-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.ft-check-item.is-done {
  border-color: var(--gold);
}

.ft-check-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--gold);
  cursor: pointer;
}

.ft-check-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 2px;
}

.ft-check-sub {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ===== MAIN QUIZ BRIDGE CTA ===== */
.ft-bridge-cta {
  padding: 22px;
  background: var(--bg);
  border: 1px solid var(--gold);
  border-radius: 12px;
  margin-top: 20px;
}

.ft-bridge-kicker {
  margin: 0 0 6px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.ft-bridge-title {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1.22rem;
  line-height: 1.32;
  color: var(--gold-bright);
}

.ft-bridge-copy {
  margin: 0 0 16px;
  font-size: 0.96rem;
  line-height: 1.62;
  color: var(--text-body);
}

/* ===== HUB CATALOG GRID ===== */
.ft-hub-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.ft-hub-search {
  min-width: 220px;
  flex: 1 1 240px;
  max-width: 340px;
}

.ft-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ft-hub-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  min-width: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ft-hub-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.ft-hub-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 9px;
  margin-bottom: 10px;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.ft-hub-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1.04rem;
  line-height: 1.32;
  color: var(--gold-bright);
}

.ft-hub-card p {
  margin: 0 0 14px;
  font-size: 0.89rem;
  line-height: 1.56;
  color: var(--muted);
  flex: 1;
}

.ft-hub-launch {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
}

/* ===== EDITORIAL, TABLES, FAQ, RELATED ===== */
.ft-section {
  padding: 36px 0;
  border-top: 1px solid var(--line);
}

.ft-section-alt {
  background: var(--bg-alt);
}

.ft-section h2 {
  margin: 0 0 14px;
  font-family: var(--font-heading);
  font-size: clamp(1.28rem, 2.8vw, 1.68rem);
  line-height: 1.3;
  color: var(--gold-bright);
  overflow-wrap: anywhere;
}

.ft-section p {
  margin: 0 0 14px;
  font-size: 1rem;
  line-height: 1.72;
  color: var(--text-body);
}

.ft-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.ft-info-card {
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
}

.ft-info-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1.04rem;
  color: var(--gold);
}

.ft-info-card p {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--text-body);
}

.ft-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-card);
}

.ft-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
}

.ft-table th,
.ft-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.ft-table th {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: var(--bg);
}

.ft-table td {
  color: var(--text-body);
}

.ft-table tr:last-child td {
  border-bottom: 0;
}

.ft-faq-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.ft-faq-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
}

.ft-faq-item summary {
  padding: 16px 18px;
  font-family: var(--font-heading);
  font-size: 1.02rem;
  color: var(--gold-bright);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ft-faq-item summary::-webkit-details-marker {
  display: none;
}

.ft-faq-item summary::after {
  content: '+';
  font-family: var(--font-ui);
  font-size: 1.2rem;
  color: var(--gold);
  flex-shrink: 0;
}

.ft-faq-item[open] summary::after {
  content: '\2212';
}

.ft-faq-body {
  padding: 0 18px 16px;
  font-size: 0.95rem;
  line-height: 1.66;
  color: var(--text-body);
}

.ft-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.ft-related-card {
  display: block;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  min-width: 0;
  transition: border-color 0.2s ease;
}

.ft-related-card:hover {
  border-color: var(--gold);
}

.ft-related-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  color: var(--gold-bright);
}

.ft-related-card p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

.ft-disclaimer {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  font-size: 0.86rem;
  line-height: 1.58;
  color: var(--muted);
}

/* ===== MOBILE <= 760px (0px horizontal overflow down to 320px) ===== */
@media (max-width: 760px) {
  .ft-container {
    padding: 0 15px;
  }
  .ft-shell {
    padding: 16px 14px;
  }
  .ft-form-grid,
  .ft-form-grid-3,
  .ft-metrics-grid,
  .ft-metrics-grid-3,
  .ft-name-grid,
  .ft-info-grid,
  .ft-hub-grid,
  .ft-related-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ft-bar-row {
    grid-template-columns: minmax(90px, 40%) minmax(0, 1fr) 42px;
    gap: 8px;
  }
  .ft-btn-row {
    flex-direction: column;
    align-items: stretch;
  }
  .ft-btn-primary,
  .ft-btn-secondary {
    width: 100%;
  }
  .ft-hub-search {
    max-width: 100%;
  }
  .ft-table th,
  .ft-table td {
    padding: 9px 10px;
    font-size: 0.84rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ft-chip,
  .ft-btn-primary,
  .ft-btn-secondary,
  .ft-progress-fill,
  .ft-option-btn,
  .ft-hub-card,
  .ft-related-card {
    transition: none;
  }
}
