/*
  careers-hub.css — Phase 2 (#80) "career hub" styling for careers.html.

  Loaded ONLY by careers.html (and degrees.html, which reuses the same
  primitives because the layout is symmetric). Self-contained — does not
  override or depend on styles.css selectors. If the script fails to
  hydrate the hub card, no rule below applies (because every selector
  is scoped under .career-hub / .degree-hub which only appear when JS
  unhides them).

  Founder rules carried forward:
    • No SOC/CIP/MSA codes anywhere visible (this file emits no codes —
      JS-side responsibility, but kept in mind here so we don't add
      e.g. a "code chip" pattern by accident).
    • Additive — does not redefine .card / .hero / .selection-list etc.
      that styles.css owns; it only adds new classes prefixed with hub-
      / career-hub- / degree-hub-.
*/

/* ─── Top-level hub card layout ───────────────────────────────────────── */
.career-hub,
.degree-hub {
  display: grid;
  gap: 1.5rem;
}
/* The [hidden] HTML attribute is implemented by browsers as
   `[hidden] { display: none }` in the user-agent stylesheet. Author
   rules above with the same specificity that set `display: grid`
   override that, so a hidden hub container can still render visually
   if anything injects content into it. Re-state the hide rule here
   with [hidden] so the attribute always wins. Same trap that bit
   `.aliases-row` on jobs-history.html. */
.career-hub[hidden],
.degree-hub[hidden] { display: none; }

.hub-summary-card {
  background: var(--card, #ffffff);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.hub-summary-card .hub-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.4rem;
}

.hub-summary-card h2.hub-title {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
  line-height: 1.25;
  color: var(--text);
}

.hub-summary-card .hub-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* "Also known as" alias chips, mirrored from jobs-history.html */
.hub-summary-card .hub-aliases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
  padding: 0;
}
.hub-summary-card .hub-aliases[hidden] { display: none; }
.hub-summary-card .hub-alias-chip {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  font-size: 0.78rem;
  background: #f3f4f6;
  border-radius: 999px;
  color: var(--text);
}

/* Stat strip — wage / growth / education / openings */
.hub-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin: 1.1rem 0 0;
}
.hub-stat {
  background: var(--bg, #f9fafb);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}
.hub-stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.hub-stat-value {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}
.hub-stat-foot {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

/* Cross-link tile group beneath the summary card */
.hub-crosslinks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}
.hub-crosslink {
  display: block;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, transform 120ms ease;
}
.hub-crosslink:hover,
.hub-crosslink:focus {
  border-color: #6366f1;
  transform: translateY(-1px);
  outline: none;
}
.hub-crosslink-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hub-crosslink-label {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
}
.hub-crosslink-sub {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Section header used by paths / related careers / schools blocks */
.hub-section-header {
  margin: 0 0 0.5rem;
}
.hub-section-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}
.hub-section-header .hub-note {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Paths grid — adapted from jobs-history.html .path-grid so the styling
   stays consistent if a user navigates back. We re-emit it under
   .career-hub-paths to avoid colliding with jobs-history's <style>. */
.career-hub-paths {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.career-hub-paths .path-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}
.career-hub-paths .path-rank {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
}
.career-hub-paths .path-rank.primary { background: #fef3c7; color: #92400e; }
.career-hub-paths .path-rank.alternate { background: #e0e7ff; color: #3730a3; }
.career-hub-paths .path-rank.fallback { background: #f3f4f6; color: var(--muted); }
.career-hub-paths .path-label {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}
.career-hub-paths .path-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.45rem;
  font-size: 0.85rem;
}
.career-hub-paths .path-stat {
  background: var(--bg, #f9fafb);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
}
.career-hub-paths .path-stat .k {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.career-hub-paths .path-stat .v {
  margin-top: 0.15rem;
  font-weight: 600;
  color: var(--text);
}
.career-hub-paths .path-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.career-hub-paths .path-flags .flag {
  font-size: 0.72rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.career-hub-paths .path-flags .flag.license { color: #b45309; border-color: #fcd34d; background: #fef3c7; }
.career-hub-paths .path-flags .flag.military { color: #1e40af; border-color: #bfdbfe; background: #dbeafe; }
.career-hub-paths .schools-button {
  margin-top: auto;
  padding: 0.5rem 0.7rem;
  background: var(--bg, #fff);
  color: #6366f1;
  border: 1px solid #6366f1;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}
.career-hub-paths .schools-button:hover { background: #eef2ff; }
.career-hub-paths .schools-button:disabled {
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
}

/* Schools modal — same DNA as jobs-history's modal */
.hub-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2vh 2vw;
}
.hub-modal-backdrop.open { display: flex; }
.hub-modal {
  background: var(--card, #fff);
  border-radius: 12px;
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.hub-modal-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.hub-modal-header h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.hub-modal-header .hub-modal-sub {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}
.hub-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0.2rem 0.5rem;
}
.hub-modal-body {
  padding: 1rem 1.4rem 1.4rem;
  overflow-y: auto;
  flex: 1;
}
.hub-modal-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.hub-modal-body th, .hub-modal-body td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--border);
}
.hub-modal-body th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.hub-modal-body td.num, .hub-modal-body th.num { text-align: right; }
.hub-modal-empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Skeleton + error placeholders */
.hub-loading,
.hub-error,
.hub-empty {
  background: var(--card, #fff);
  border: 1px dashed var(--border);
  border-radius: var(--radius, 12px);
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.hub-error { border-color: #fca5a5; color: #991b1b; background: #fef2f2; }

/* Related careers / related degrees: simple chip list */
.hub-related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.hub-related-list .hub-related-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg, #fff);
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
}
.hub-related-list .hub-related-chip:hover,
.hub-related-list .hub-related-chip:focus {
  border-color: #6366f1;
  color: #4338ca;
  outline: none;
}

/* Mobile (<600px) — additive overrides only */
@media (max-width: 600px) {
  .hub-summary-card { padding: 1.1rem; }
  .hub-summary-card h2.hub-title { font-size: 1.3rem; }
  .career-hub-paths { grid-template-columns: 1fr; }
  .hub-crosslinks { grid-template-columns: 1fr; }
  .hub-modal-backdrop { padding: 0; }
  .hub-modal { border-radius: 0; max-height: 100vh; }
  .hub-modal-body { padding: 0.75rem 1rem 1.1rem; }
  .hub-modal-body table { font-size: 0.78rem; }
  .hub-modal-body th, .hub-modal-body td { padding: 0.45rem 0.3rem; }
}


/* In-page hub crosslink grid — used on career-detail / degree-detail
   to embed hub navigation chips directly without a separate page. */
.hub-crosslink-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}
.hub-crosslinks-card.hidden { display: none; }
