/* ============================================================
   Pathway Compare (pathway-compare.html)
   pc- prefix for all classes
   No inline styles — all state via CSS classes (CSP-safe)
   ============================================================ */

/* ── Page layout ── */
.pc-main {
  padding-top: 72px; /* clear fixed navbar */
  padding-bottom: 64px; /* clear fixed upsell bar */
  min-height: 100vh;
}

/* ── Hero ── */
.pc-hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  padding: 52px 0 44px;
  color: #fff;
}

.pc-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 14px;
}

.pc-hero-sub {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  max-width: 640px;
  line-height: 1.6;
}

/* ── Controls section ── */
.pc-controls-section {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 72px;
  z-index: 90;
  box-shadow: var(--shadow);
}

.pc-controls-row {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.pc-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pc-control-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.pc-select {
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  color: var(--navy);
  background: var(--white);
  cursor: pointer;
  min-width: 280px;
  outline: none;
  transition: border-color 0.15s;
  appearance: auto;
}

.pc-select:focus {
  border-color: var(--accent);
}

/* ── Destination slots ── */
.pc-destinations-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.pc-slot {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pc-dest-slot {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  color: var(--navy);
  background: var(--white);
  cursor: pointer;
  min-width: 170px;
  outline: none;
  transition: border-color 0.15s;
  appearance: auto;
}

.pc-dest-slot:focus {
  border-color: var(--accent);
}

.pc-slot-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  font-family: 'Inter', sans-serif;
}

.pc-slot-remove:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

/* ── Results section ── */
.pc-results-section {
  padding: 32px 0 48px;
}

/* ── State visibility — CSS-only (no inline style) ── */
.pc-msg--no-pathway,
.pc-msg--no-dest {
  display: none;
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.pc-table-wrap {
  display: none;
}

.pc-cta-strip {
  display: none;
}

/* State: no pathway selected */
.pc-state--no-pathway .pc-msg--no-pathway {
  display: block;
}

/* State: pathway selected but no destinations yet */
.pc-state--no-dest .pc-msg--no-dest {
  display: block;
}

/* State: table visible */
.pc-state--table .pc-table-wrap {
  display: block;
}

.pc-state--table .pc-cta-strip {
  display: block;
}

/* ── Comparison table ── */
.pc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 24px;
}

.pc-table {
  width: 100%;
  min-width: 520px; /* forces horizontal scroll on narrow viewports */
  border-collapse: collapse;
  table-layout: auto;
}

.pc-table th,
.pc-table td {
  padding: 13px 16px;
  vertical-align: top;
  font-size: 0.875rem;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}

.pc-table tbody tr:last-child td {
  border-bottom: none;
}

/* Destination header cells */
.pc-th-dest {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  white-space: nowrap;
  min-width: 200px;
}

.pc-th-dest-flag {
  font-size: 1.3rem;
  display: block;
  margin-bottom: 4px;
}

/* ── Frozen first column (dimension labels) ── */
.pc-table td:first-child,
.pc-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--navy-dark); /* fully opaque — no transparency */
  color: #fff;
  width: 180px;
  min-width: 180px;
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.4;
  border-right: 2px solid rgba(255, 255, 255, 0.15);
}

/* Sticky header row */
.pc-table thead tr {
  position: sticky;
  top: 0;
  z-index: 3;
}

/* Corner cell — intersection of sticky row + sticky column */
.pc-table thead th:first-child {
  z-index: 4; /* above both sticky row (z:3) and sticky column (z:2) */
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* ── Three-state cells ── */
.pc-cell {
  color: var(--text);
}

/* State 2: structural N/A */
.pc-cell--na {
  color: var(--text-muted);
}

.pc-em-dash {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 300;
}

/* State 3a: verify link */
.pc-cell--verify {
  vertical-align: middle;
}

.pc-verify-link {
  color: var(--accent);
  font-size: 0.82rem;
  text-decoration: underline;
  text-decoration-style: dotted;
  word-break: break-word;
  transition: color 0.15s;
}

.pc-verify-link:hover {
  color: var(--navy);
  text-decoration-style: solid;
}

/* State 3b: note text (no URL) */
.pc-cell--note .pc-note-text {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.4;
}

/* Dimension note caption (e.g. time_to_pr_note) */
.pc-dim-note {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  margin-top: 5px;
  line-height: 1.4;
}

/* Visa code chips (pathway_full_name row) */
.pc-visa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.pc-visa-chip {
  display: inline-block;
  background: rgba(74, 144, 217, 0.12);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* Alternating row shading for readability */
.pc-table tbody tr:nth-child(even) td {
  background: var(--bg-alt);
}

/* Override frozen column background on even rows */
.pc-table tbody tr:nth-child(even) td:first-child {
  background: var(--navy-dark);
}

/* ── Infeasible column ── */
.pc-cell--infeasible {
  background: rgba(220, 38, 38, 0.04);
  border-left: 3px solid rgba(220, 38, 38, 0.35);
  vertical-align: top;
  padding: 20px 16px;
}

.pc-infeasible-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pc-infeasible-reason {
  color: #b91c1c;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.5;
}

.pc-infeasible-closest {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pc-infeasible-alt-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.pc-switch-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s, transform 0.1s;
  line-height: 1.3;
}

.pc-switch-btn:hover {
  background: var(--navy);
  transform: translateY(-1px);
}

/* ── CTA strip ── */
.pc-cta-strip {
  margin-top: 20px;
  padding: 20px 0 8px;
  border-top: 2px solid var(--border);
}

.pc-cta-strip-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.pc-cta-strip-inner {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.pc-cta-btn {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--gradient);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.12s;
}

.pc-cta-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* External gov link variant */
.pc-cta-btn--ext {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}

.pc-cta-btn--ext:hover {
  background: var(--navy);
  color: #fff;
  opacity: 1;
}

/* Fallback generic link */
.pc-cta-btn--generic {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  font-weight: 500;
}

/* ── Sticky upsell bar ── */
.pc-upsell-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--navy-dark);
  color: #fff;
  text-align: center;
  padding: 11px 24px;
  border-top: 2px solid var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
}

.pc-upsell-bar p {
  margin: 0;
}

.pc-upsell-link {
  color: var(--gold);
  font-weight: 700;
  text-decoration: underline;
  transition: opacity 0.15s;
}

.pc-upsell-link:hover {
  opacity: 0.82;
}

/* ── Promo band (used on index.html) ── */
.pc-promo-band {
  background: linear-gradient(135deg, var(--accent) 0%, var(--navy) 100%);
  color: #fff;
  text-align: center;
  padding: 40px 24px;
}

.pc-promo-heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.pc-promo-band p {
  font-size: 1rem;
  margin: 0 0 20px;
  opacity: 0.9;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Mobile overrides ── */
@media (max-width: 768px) {
  .pc-controls-row {
    gap: 14px;
    flex-direction: column;
    align-items: stretch;
  }

  .pc-select {
    min-width: 100%;
  }

  .pc-destinations-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .pc-dest-slot {
    min-width: 100%;
  }

  /* Full-bleed table on mobile for maximum scroll width */
  .pc-table-wrap {
    border-radius: 0;
    margin-left: -24px;
    margin-right: -24px;
    border-left: none;
    border-right: none;
  }

  /* Narrower frozen label column on mobile */
  .pc-table td:first-child,
  .pc-table th:first-child {
    width: 120px;
    min-width: 120px;
    font-size: 0.76rem;
    padding: 10px 10px;
  }

  .pc-table th,
  .pc-table td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .pc-th-dest {
    min-width: 160px;
  }

  .pc-cta-strip-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .pc-cta-btn {
    text-align: center;
    width: 100%;
  }

  .pc-upsell-bar {
    padding: 9px 16px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .pc-hero {
    padding: 36px 0 30px;
  }

  .pc-controls-section {
    top: 64px; /* navbar collapses on very small screens */
  }

  .pc-promo-band {
    padding: 28px 16px;
  }
}
