/* PsychPathways™ — baseline stylesheet
   Plain CSS3 only, per Specification D v1.2 §2/§6: Bootstrap or any other
   CSS framework is prohibited unless a formal architectural revision
   authorizes it — this file has no such dependency. Responsive,
   accessible-by-default: visible focus states, sufficient contrast,
   readable type scale. */

:root {
  /* Design tokens aligned with drnasirbhat.com's institutional palette
     (Academic Website v1.1, assets/css/tokens.css) so PsychPathways reads
     as part of the same Digital Psychology Ecosystem rather than a visually
     foreign app once linked from the Ecosystem page. Variable *names* below
     are unchanged from the original scaffold (nothing downstream had to be
     rewired) — only the underlying values were brought into alignment. */
  --color-bg: #ffffff;              /* --c-bg */
  --color-text: #10202a;            /* --color-ink-900 */
  --color-muted: #465563;           /* --color-slate-600 / --c-text-muted */
  --color-primary: #0f2e33;         /* --color-primary-900: deep slate-teal brand */
  --color-primary-contrast: #ffffff;
  --color-secondary: #f4f6f6;       /* --color-paper-100 / --c-bg-alt */
  --color-secondary-text: #10202a;
  --color-border: #d5dbdf;          /* --color-line-300 */
  --color-accent: #1f6f43;          /* --color-success-700: progress/match-strength */
  --color-danger: #a12626;          /* --color-error-700 */
  --color-focus: #9a6414;           /* --c-focus: accent-derived, >=3:1 on light surfaces */
  --font-display: Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 8px;                    /* matches --radius-md */
  --max-width: 780px;
  --space-1: 0.4rem;
  --space-2: 0.8rem;
  --space-3: 1.4rem;
  --space-4: 2.2rem;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

/* Belt-and-suspenders responsive safeguard (Part 20 of the 2026-08-26
   hardening pass): a <select>'s intrinsic width can be driven by its widest
   <option> text and will overflow a narrow viewport unless explicitly
   constrained, since flex/grid items default to min-width:auto. Applied
   globally so no future form control reintroduces this. */
select, input, textarea, img, svg, table {
  max-width: 100%;
}

/* Belt-and-suspenders responsive safeguard, added after this pass's own
   mobile-behavior test caught a real overflow: a long data-driven string
   with no natural break points (e.g. a slash/underscore-joined enum list
   in a JSON field rendered verbatim, such as data/app.json's buildNote)
   overflows a narrow viewport by default, since browsers don't break
   inside a "word" unless told to. Applied globally to text-bearing
   elements so a future long, unbroken string from any data file can't
   reintroduce this class of bug. */
p, li, td, th, dd, dt, blockquote, figcaption {
  overflow-wrap: break-word;
  word-break: break-word;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.5;
}

h1, h2, .brand {
  font-family: var(--font-display);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  padding: var(--space-2);
  z-index: 100;
}
.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
}

a, button, input, [tabindex] {
  outline-offset: 2px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus);
}

.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-2);
}
.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
}
.tagline {
  color: var(--color-muted);
  font-size: 0.92rem;
}

.app-root {
  max-width: var(--content-max, 1080px);
  margin: 0 auto;
  padding: var(--space-4) var(--space-2);
  min-height: 50vh;
}
.app-root .screen {
  max-width: var(--max-width);
}
.app-root .screen.wide,
.app-root .screen:has(.compare-table),
.app-root .screen:has(.career-list),
.app-root .screen:has(.riasec-grid),
.app-root .screen:has(.filters-row) {
  max-width: none;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.85rem;
  padding: var(--space-3) var(--space-2);
}
.site-footer p {
  max-width: var(--max-width);
  margin: 0 auto;
}
.ecosystem-link {
  margin-top: var(--space-1) !important;
}
.ecosystem-link a {
  color: var(--color-primary);
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 var(--space-2);
}
h2 {
  font-size: 1.2rem;
  margin: var(--space-3) 0 var(--space-1);
}
h3 {
  font-size: 1rem;
  margin: var(--space-2) 0 var(--space-1);
}

p {
  margin: 0 0 var(--space-2);
}
.note {
  color: var(--color-muted);
  font-size: 0.9rem;
}
.muted {
  color: var(--color-muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 0.65rem 1.1rem;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
}
.btn-secondary {
  background: var(--color-secondary);
  color: var(--color-secondary-text);
  border-color: var(--color-border);
}
.btn-tertiary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-border);
}

.progress {
  background: var(--color-secondary);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-bottom: var(--space-3);
}
.progress-bar {
  background: var(--color-accent);
  height: 100%;
  transition: width 0.2s ease;
}

.question-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}
.question-fieldset legend {
  color: var(--color-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.question-text {
  font-size: 1.1rem;
  font-weight: 600;
}

.options {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
}
.option:hover {
  background: var(--color-secondary);
}
.option input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
}

.career-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.match-score {
  font-weight: 700;
  color: var(--color-accent);
}
.regulatory-note {
  font-size: 0.85rem;
  color: var(--color-muted);
  border-top: 1px dashed var(--color-border);
  padding-top: var(--space-2);
}
.holland-summary {
  font-weight: 600;
  color: var(--color-accent);
  margin-top: calc(-1 * var(--space-2));
  margin-bottom: var(--space-3);
}
.holland-note {
  font-size: 0.9rem;
  color: var(--color-muted);
  font-style: italic;
}

.error-screen h1 {
  color: var(--color-danger);
}

.noscript-notice {
  border: 1px solid var(--color-border);
  background: var(--color-secondary);
  padding: var(--space-2);
  border-radius: var(--radius);
}

.storage-warning {
  border: 1px solid #e0c896;
  background: #fff8ec;
  color: #6b4a00;
  padding: var(--space-2);
  border-radius: var(--radius);
}

/* Print/PDF report (Spec D v1.2 §11) — hidden on screen, shown only when
   printing, so print/PDF output is a genuine report export rather than a
   screenshot of the interactive UI. */
.print-only {
  display: none;
}

.print-report h1 {
  font-size: 1.4rem;
}
.print-report h2 {
  font-size: 1.05rem;
  border-bottom: 1px solid #999;
  padding-bottom: 0.2rem;
  margin-top: 1.4rem;
}
.print-report .print-label {
  font-weight: 700;
  margin-top: 0.6rem;
  margin-bottom: 0.2rem;
}
.print-report .print-career {
  margin-top: 1rem;
  padding-top: 0.6rem;
  border-top: 1px dashed #999;
}
table.print-meta {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 0.6rem;
}
table.print-meta th,
table.print-meta td {
  border: 1px solid #ccc;
  padding: 0.3rem 0.5rem;
  text-align: left;
  font-size: 0.85rem;
  vertical-align: top;
  word-break: break-word;
}
table.print-meta th {
  width: 35%;
  background: #f2f2f2;
}

/* ---------- Navigation ---------- */
.site-header-inner {
  position: relative;
}
.brand {
  text-decoration: none;
}
.nav-toggle {
  display: none;
  font: inherit;
  font-weight: 600;
  background: var(--color-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  align-self: flex-start;
}
.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  padding: 0;
  margin: var(--space-2) 0 0;
}
.nav-list a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.2rem 0.1rem;
  border-bottom: 2px solid transparent;
}
.nav-list a:hover {
  color: var(--color-primary);
}
.nav-list a.active {
  border-bottom-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

/* ---------- Cards, filters, badges ---------- */
.career-card.mini {
  padding: var(--space-2) var(--space-3);
}
.card-meta {
  color: var(--color-muted);
  font-size: 0.85rem;
  text-transform: capitalize;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-2);
}
.btn-small {
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
}
.compare-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
}
.career-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-2) 0;
}
.filters-row input[type="search"],
.filters-row select {
  font: inherit;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  min-width: 0;
  max-width: 100%;
}
.filters-row input[type="search"] {
  flex: 1 1 220px;
  min-width: 120px;
}
.filters-row select {
  flex: 1 1 160px;
}
@media (max-width: 480px) {
  .filters-row input[type="search"],
  .filters-row select {
    flex-basis: 100%;
  }
}
.riasec-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.results-count {
  margin-bottom: var(--space-2);
}
.active-filters {
  margin-bottom: var(--space-2);
}
.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.85rem;
  background: var(--color-surface-alt, transparent);
  cursor: pointer;
}
.filter-chip:hover {
  border-color: var(--color-accent, currentColor);
}
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--color-secondary);
  border: 1px solid var(--color-border);
}
.badge-regulated { background: #e6f3ec; border-color: #bfe0cd; }
.badge-institution-dependent, .badge-partially-regulated { background: #eef1f8; border-color: #c9d2ea; }
.badge-employer-dependent { background: #fdf3e3; border-color: #ecd8a8; }
.badge-unclear-unverified, .badge-not-established-regulated { background: #f5f0f0; border-color: #e0cccc; }
.badge-resource-type-official { background: #e6f3ec; border-color: #bfe0cd; }
.badge-resource-type-educational { background: #eef1f8; border-color: #c9d2ea; }
.badge-resource-type-professional { background: #fdf3e3; border-color: #ecd8a8; }
.badge-resource-type-general { background: var(--color-secondary); }

/* ---------- Alerts & empty states ---------- */
.alert {
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  margin: var(--space-3) 0;
  background: var(--color-secondary);
}
.alert-title {
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.alert-warning { border-left-color: var(--color-accent); }
.alert-error { border-left-color: var(--color-danger); }
.empty-state {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-align: center;
}

/* ---------- Home flow steps ---------- */
.home-hero .lede {
  font-size: 1.15rem;
}
.flow-steps {
  list-style: none;
  counter-reset: flow;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
  padding: 0;
}
.flow-steps li {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2);
  counter-increment: flow;
}
.flow-label {
  display: inline-block;
  font-weight: 700;
  color: var(--color-primary);
}
.flow-label::before {
  content: counter(flow) ". ";
}

/* ---------- RIASEC grid ---------- */
.riasec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-3);
}

/* ---------- Profile bars ---------- */
.profile-bars {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 480px;
}
.profile-bar-row {
  display: grid;
  grid-template-columns: 1.5rem 1fr 3rem;
  align-items: center;
  gap: 0.5rem;
}
.profile-bar-track {
  background: var(--color-secondary);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.profile-bar-fill {
  background: var(--color-primary);
  height: 100%;
}
.interpretation-block {
  border-top: 1px dashed var(--color-border);
  padding-top: var(--space-2);
  margin-top: var(--space-2);
}

/* ---------- Pathways ---------- */
.pathway-kind {
  color: var(--color-muted);
  font-size: 0.85rem;
}
.kind-legend {
  padding-left: 1.2rem;
}

/* ---------- Compare table ---------- */
.compare-table {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow-x: auto;
}
.compare-row {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2);
}
.compare-row-title {
  margin: 0 0 var(--space-2);
}
.compare-row-cells {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}
.compare-cell {
  border-left: 3px solid var(--color-border);
  padding-left: var(--space-2);
}

/* ---------- Tabs ---------- */
.tab-row {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border);
  margin: var(--space-2) 0;
  flex-wrap: wrap;
}
.tab-button {
  font: inherit;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  color: var(--color-muted);
}
.tab-button.tab-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* ---------- Career plan form ---------- */
.plan-fields {
  display: grid;
  gap: var(--space-2);
  max-width: 560px;
}
.plan-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
}
.plan-field textarea,
.plan-field input {
  font: inherit;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.link-button {
  background: none;
  border: none;
  color: var(--color-primary);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

/* ---------- Journey ---------- */
.journey-steps {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.journey-steps li {
  border-left: 4px solid var(--color-border);
  padding: 0.4rem var(--space-2);
}
.journey-done { border-left-color: var(--color-accent); }
.journey-pending { border-left-color: #cbb26a; }

/* ---------- FAQ ---------- */
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
}

/* ---------- Resources ---------- */
.resource-list {
  list-style: none;
  padding: 0;
}
.resource-list li {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-2) 0;
}
.meta-list-plain {
  list-style: none;
  padding: 0;
}

.breadcrumb {
  margin-bottom: 0;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 700px) {
  .nav-toggle {
    display: inline-block;
  }
  .nav-list {
    display: none;
    flex-direction: column;
    width: 100%;
  }
  .nav-list.open {
    display: flex;
  }
  .compare-row-cells {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    font-size: 15px;
  }
  .button-row {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
}

@media print {
  /* Only the print-report target is shown — the interactive app (Spec D
     v1.2 §11: "shall not simply print the application's interactive
     results screen") is hidden entirely. */
  .site-header, .site-footer, .button-row, .skip-link, .app-root {
    display: none !important;
  }
  .print-only {
    display: block;
  }
  body {
    color: #000;
  }
}
