/* ===== Faction & Ally Compatibility Interactive Quizzes =====
 * Shared stylesheet for:
 *   - /hunger-games-ally-compatibility-quiz/ (+ /zh/)
 *   - /divergent-faction-quiz/ (+ /zh/)
 *   - /red-rising-color-quiz/ (+ /zh/)
 *   - /piltover-vs-zaun-faction-quiz/ (+ /zh/)
 *
 * Strictly uses semantic CSS custom properties from main.css (zero raw hex).
 * Contrast ratios against --bg-card (#1a1a24) & --bg (#09090B):
 *   --text: 14.2:1 | --gold-bright: 12.3:1 | --text-body: 12.2:1
 *   --muted: 8.0:1 | --gold: 7.9:1 | --bg on --gold: 9.1:1
 * Every text/surface pair meets WCAG AAA (>= 7:1) in base & prefers-contrast:more.
 */

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

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

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

.fq-hero-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  min-width: 0;
}

.fq-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

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

.fq-lang-switch {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--gold-bright);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.fq-lang-switch:hover {
  border-color: var(--gold-bright);
  color: var(--text);
}

.fq-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;
}

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

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

.fq-trust-pills li {
  padding: 5px 11px;
  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;
}

/* ===== INTERACTIVE QUIZ / CALCULATOR SHELL ===== */
.fq-tool-section {
  padding: 32px 0 36px;
}

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

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

.fq-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.fq-mode-tab {
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.fq-mode-tab[aria-selected="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
}

.fq-mode-tab:hover:not([aria-selected="true"]) {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

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

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

.fq-label {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.fq-input,
.fq-select {
  width: 100%;
  min-height: 48px;
  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;
}

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

.fq-input:focus-visible,
.fq-select:focus-visible,
.fq-mode-tab:focus-visible,
.fq-option-btn:focus-visible,
.fq-btn-primary:focus-visible,
.fq-btn-secondary:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

.fq-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);
}

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

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

.fq-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;
}

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

.fq-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;
}

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

.fq-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);
}

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

.fq-back-btn {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.fq-back-btn:hover {
  border-color: var(--gold);
  color: var(--text);
}

/* ===== RESULT PANEL ===== */
.fq-result {
  padding-top: 4px;
  min-width: 0;
}

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

.fq-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);
}

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

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

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

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

.fq-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;
}

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

.fq-metric-note {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-body);
  overflow-wrap: anywhere;
}

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

.fq-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);
}

.fq-bar-row {
  display: grid;
  grid-template-columns: minmax(96px, 34%) minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

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

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

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

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

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

/* ===== PANEM BRIDGE & DOSSIER CTA ===== */
.fq-panem-cta-card {
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--gold);
  border-radius: 12px;
  margin-top: 16px;
}

.fq-panem-cta-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);
}

.fq-panem-cta-title {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1.16rem;
  line-height: 1.35;
  color: var(--gold-bright);
  overflow-wrap: anywhere;
}

.fq-panem-cta-copy {
  margin: 0 0 16px;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text-body);
}

.fq-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fq-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  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.2s ease, border-color 0.2s ease;
}

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

.fq-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  background: var(--bg-card);
  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.2s ease, color 0.2s ease;
}

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

.fq-offer-fineprint {
  margin: 12px 0 0;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

.fq-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

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

/* ===== EDITORIAL GUIDE SECTIONS ===== */
.fq-section {
  padding: 36px 0;
  border-top: 1px solid var(--line);
}

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

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

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

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

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

.fq-info-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1.06rem;
  color: var(--gold);
  overflow-wrap: anywhere;
}

.fq-info-card p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.62;
  color: var(--text-body);
}

.fq-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);
}

.fq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

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

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

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

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

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

.fq-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;
}

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

.fq-related-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--gold-bright);
  overflow-wrap: anywhere;
}

.fq-related-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.52;
  color: var(--muted);
}

.fq-disclaimer-box {
  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 <= 700px (includes 390x844 zero horizontal overflow) ===== */
@media (max-width: 700px) {
  .fq-hero-inner,
  .fq-container {
    padding: 0 16px;
  }
  .fq-shell {
    padding: 16px 14px;
  }
  .fq-mode-tabs,
  .fq-ally-grid,
  .fq-metrics-grid,
  .fq-cards-grid,
  .fq-related-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .fq-bar-row {
    grid-template-columns: minmax(82px, 38%) minmax(0, 1fr) 40px;
    gap: 8px;
  }
  .fq-btn-row,
  .fq-action-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .fq-btn-primary,
  .fq-btn-secondary {
    width: 100%;
  }
  .fq-table th,
  .fq-table td {
    padding: 9px 10px;
    font-size: 0.84rem;
  }
}

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

/* ===== HIGH CONTRAST WCAG AAA (>= 7:1) ===== */
@media (prefers-contrast: more) {
  .fq-shell,
  .fq-mode-tab,
  .fq-input,
  .fq-select,
  .fq-option-btn,
  .fq-metric-card,
  .fq-bars-box,
  .fq-panem-cta-card,
  .fq-info-card,
  .fq-table-wrap,
  .fq-related-card,
  .fq-lang-switch,
  .fq-trust-pills li,
  .fq-btn-secondary {
    border-width: 2px;
    border-color: var(--gold-bright);
  }
  .fq-progress-head,
  .fq-back-btn,
  .fq-offer-fineprint,
  .fq-related-card p,
  .fq-disclaimer-box {
    color: var(--text-body);
  }
  .fq-kicker,
  .fq-metric-label,
  .fq-panem-cta-kicker,
  .fq-info-card h3 {
    color: var(--gold-bright);
  }
  .fq-btn-primary,
  .fq-mode-tab[aria-selected="true"] {
    background: var(--gold-bright);
    border-color: var(--gold-bright);
    color: var(--bg);
  }
}

@media (forced-colors: active) {
  .fq-shell,
  .fq-option-btn,
  .fq-metric-card,
  .fq-panem-cta-card,
  .fq-info-card,
  .fq-related-card {
    border-color: CanvasText;
  }
  .fq-btn-primary,
  .fq-btn-secondary,
  .fq-mode-tab {
    border-color: ButtonText;
  }
}
