/* ============================================================
   JADE — Jobs, Accessibility, Diversity, Equality
   Brand design system
   ============================================================ */

/* --- Variables --- */
:root {
  --dark-teal:  #114B5F;
  --teal:       #028090;
  --mint:       #E4FDE1;
  --baltic:     #456990;
  --pink:       #F45B69;
  --white:      #ffffff;
  --off-white:  #f9fafb;
  --border:     #dde3e8;
  --text-dark:  #111827;
  --text-mid:   #374151;
  --radius:     8px;
  --shadow-sm:  0 1px 4px rgba(17,75,95,0.08);
  --shadow-md:  0 4px 20px rgba(17,75,95,0.12);
  --shadow-lg:  0 8px 40px rgba(17,75,95,0.16);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

/* Kill all focus outlines and rings globally — individual elements below
   restore a subtle Dark Teal border where appropriate (textarea, select). */
*:focus,
*:focus-within,
*:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

html {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--white);
  color: var(--text-dark);
  line-height: 1.65;
  margin: 0;
}

/* Force DM Sans on USWDS elements that set their own font */
h1, h2, h3, h4, h5, h6,
p, a, button, input, textarea, select, label, li, span,
.usa-prose, .usa-prose p, .usa-prose h1, .usa-prose h2,
.usa-header, .usa-nav, .usa-button, .usa-textarea {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

p { line-height: 1.7; margin-top: 0; }

/* --- Header --- */
.bas-header {
  background: var(--dark-teal);
  border-bottom: 3px solid var(--teal);
  position: sticky;
  top: 0;
  z-index: 100;
}

.bas-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.bas-logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.2;
}
.bas-logo:hover { text-decoration: none; }

.bas-logo__name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.bas-logo__sub {
  font-size: 0.6875rem;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 640px) {
  .bas-logo__sub { display: none; }
}

.bas-nav {
  display: flex;
  gap: 0.25rem;
}

.bas-nav__link {
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

.bas-nav__link:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  text-decoration: none;
}

.bas-nav__link--active {
  color: var(--white);
  background: rgba(255,255,255,0.12);
}

.bas-nav__link:focus,
.bas-nav__link:focus-visible,
.bas-nav__link:active,
.bas-nav__link:visited {
  outline: none !important;
  box-shadow: none !important;
  text-decoration: none;
}

/* --- Footer --- */
.bas-footer {
  background: var(--off-white);
  border-top: 1px solid var(--border);
}

.bas-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 2rem;
  text-align: center;
}

.bas-footer p {
  color: var(--baltic);
  font-size: 0.8125rem;
  margin: 0;
  line-height: 1.5;
}

/* --- Layout overrides for USWDS grid --- */
.grid-container {
  max-width: none;
  padding-left: 40px;
  padding-right: 40px;
}

.usa-section {
  padding-top: 56px;
  padding-bottom: 72px;
}

/* --- Page headings --- */
.bas-eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--dark-teal);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: 16px;
}

h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--dark-teal);
  letter-spacing: -0.01em;
  margin-top: 0;
  margin-bottom: 20px;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark-teal);
  margin-top: 0;
}

/* --- Pill selector --- */
.pill-selector {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 10px;
}

.pill {
  background: var(--white);
  border: 2px solid var(--dark-teal);
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dark-teal);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  line-height: 1.4;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  white-space: nowrap;
}

.pill:hover {
  background: var(--mint);
  border-color: var(--dark-teal);
  color: var(--dark-teal);
}

.pill:focus,
.pill:focus-visible,
.pill:active,
.pill.active,
.pill.active:focus,
.pill.active:focus-visible,
.pill.active:active,
.pill.active:hover {
  outline: none !important;
  box-shadow: none !important;
}

.pill.active {
  background: var(--teal) !important;
  border-color: var(--teal) !important;
  color: var(--white) !important;
}

.pill-microcopy {
  min-height: 1.4em;
  color: var(--baltic);
  font-size: 0.8125rem;
  font-weight: 400;
  margin-top: 4px;
  margin-bottom: 24px;
}

/* --- Sector dropdown --- */
.bas-field-group {
  margin-bottom: 16px;
}

.bas-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark-teal);
  margin-bottom: 6px;
}

.bas-select {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--dark-teal);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: var(--text-dark);
  background: var(--white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23114B5F' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.bas-select:focus {
  border-color: var(--dark-teal);
  box-shadow: none !important;
  outline: none !important;
}

/* --- Text input (job title field) --- */
.bas-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--dark-teal);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
}

.bas-input:focus {
  border-color: var(--dark-teal);
  box-shadow: none !important;
  outline: none !important;
}

.bas-input::placeholder { color: #9ca3af; }

/* --- Textarea --- */
.bas-textarea {
  display: block;
  width: 100%;
  min-height: 200px;
  padding: 16px 18px;
  border: 2px solid var(--dark-teal);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: var(--text-dark);
  background: var(--white);
  resize: vertical;
  line-height: 1.6;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.bas-textarea:focus {
  border-color: var(--dark-teal);
  box-shadow: none !important;
  outline: none !important;
}

.bas-textarea::placeholder { color: #9ca3af; }

/* --- Submit button --- */
.bas-button {
  display: inline-block;
  background: var(--white);
  color: var(--pink) !important;
  border: 2px solid var(--pink);
  border-radius: var(--radius);
  padding: 14px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  margin-top: 16px;
  letter-spacing: 0.01em;
}

.bas-button:hover {
  background: var(--pink);
  color: var(--white) !important;
  transform: translateY(-1px);
}

.bas-button:active { transform: translateY(0); }

.bas-button:focus,
.bas-button:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

@media (max-width: 600px) {
  .bas-button {
    width: 100%;
    text-align: center;
  }
}

.bas-button-outline {
  display: inline-block;
  background: var(--white);
  color: var(--dark-teal) !important;
  border: 2px solid var(--dark-teal);
  border-radius: 8px;
  padding: 10px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-top: 12px;
}

.bas-button-outline:hover {
  background: var(--dark-teal);
  color: var(--white) !important;
  text-decoration: none;
}

.bas-button-outline:focus,
.bas-button-outline:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* --- Form helper text --- */
.bas-form-hint {
  font-size: 0.875rem;
  color: var(--text-mid);
  margin-bottom: 12px;
}

/* --- Result page header bar --- */
.bas-result-header {
  padding: 40px 0 28px;
}

.bas-result-header .bas-tag {
  display: inline-block;
  background: var(--mint);
  color: var(--dark-teal);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 12px;
}

.bas-result-count {
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}

/* --- Result box (annotated text) --- */
.result-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  min-height: 15rem;
  font-size: 1rem;
  line-height: 1.9;
  box-shadow: var(--shadow-sm);
  white-space: pre-line;
}

/* --- Flagged terms --- */
.flagged-term {
  background: var(--teal);
  color: var(--white);
  border-radius: 4px;
  padding: 1px 6px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  transition: background 0.12s;
}

.flagged-term:hover, .flagged-term:focus {
  background: var(--dark-teal);
  outline: none;
}

/* --- Tooltip --- */
.term-tooltip {
  display: none;
  position: fixed;
  z-index: 9999;
  background: var(--dark-teal);
  color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 16px 18px;
  max-width: 320px;
  min-width: 220px;
  font-size: 0.875rem;
  line-height: 1.5;
  pointer-events: none;
}

.term-tooltip.visible { display: block; }

.term-tooltip .tt-term {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--white);
}

.term-tooltip .tt-reason {
  color: var(--mint);
  font-style: italic;
  margin-bottom: 10px;
  font-size: 0.8125rem;
}

.term-tooltip .tt-alts-label {
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--mint);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.term-tooltip .tt-alts {
  margin: 0;
  padding-left: 16px;
  color: rgba(255,255,255,0.9);
}

.term-tooltip .tt-alts li { margin-bottom: 3px; }

/* --- Alert --- */
.bas-alert {
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.9375rem;
  margin-bottom: 20px;
}

.bas-alert--success {
  background: var(--mint);
  color: var(--dark-teal);
  border-left: 4px solid var(--teal);
  font-weight: 600;
}

.bas-alert--error {
  background: #fff0f1;
  color: #8b0000;
  border-left: 4px solid var(--pink);
  font-weight: 600;
}

.bas-alert--warning {
  background: #fffbea;
  color: #5a4000;
  border-left: 4px solid #e6ac00;
  font-weight: 500;
}

/* --- Compact 3-up dashboard --- */
.viz-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (min-width: 700px) {
  .viz-dashboard { grid-template-columns: repeat(3, 1fr); }
}

/* --- Benchmark 2-up row --- */
.benchmark-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

@media (min-width: 700px) {
  .benchmark-row { grid-template-columns: 1fr 1fr; }
}

.bench-card {
  padding: 16px 18px;
}

.benchmark-note {
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
  margin-bottom: 28px;
}

/* --- Sector tag on score card --- */
.score-sector-tag {
  font-size: 0.75rem;
  color: var(--teal);
  font-weight: 600;
  margin-top: 8px;
  margin-bottom: 0;
}

.viz-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.dash-card {
  padding: 16px 18px;
}

.viz-card h3 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--baltic);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.chart-click-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.7rem;
  color: var(--baltic);
  opacity: 0.8;
}

/* --- Inclusion score --- */
.score-display {
  text-align: center;
  padding: 8px 0 4px;
}

.score-number {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--dark-teal);
  letter-spacing: -0.03em;
}

.score-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--baltic);
  margin-top: 8px;
}

/* --- Coming soon card --- */
.coming-soon-card {
  background: var(--mint);
  border: none;
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.coming-soon-badge {
  display: inline-block;
  background: var(--pink);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 12px;
}

.coming-soon-card h3 {
  font-size: 1.125rem;
  color: var(--dark-teal);
  margin-bottom: 10px;
}

.coming-soon-card p {
  color: var(--baltic);
  font-size: 0.9rem;
  max-width: 40ch;
  margin-inline: auto;
  margin-bottom: 0;
  line-height: 1.6;
}

/* --- Results layout --- */
.results { grid-area: results; }
.info    { grid-area: info; }

.results-wrapper {
  display: grid;
  gap: 24px;
  grid-template-areas: "results" "info";
  margin-top: 24px;
}

@media (min-width: 1000px) {
  .results-wrapper {
    grid-template-columns: 2fr 1fr;
    grid-template-areas: "results info";
  }
}

/* --- Density chart caption --- */
.chart-caption {
  font-size: 0.75rem;
  color: var(--baltic);
  margin-top: 10px;
  margin-bottom: 0;
}

/* --- Category definitions (about page) --- */
.category-definitions {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-def {
  background: var(--off-white);
  border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
}

.category-def dt {
  font-weight: 700;
  color: var(--dark-teal);
  font-size: 0.9375rem;
  margin-bottom: 4px;
}

.category-def dd {
  margin: 0;
  color: var(--text-mid);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- Utility --- */
.info-box {
  background: var(--mint);
  line-height: 1.5;
  border-radius: var(--radius);
  padding: 16px 20px;
}

/* --- Text sections in result box --- */
.text-section {
  background: #f7f8f9;
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 10px;
  scroll-margin-top: 80px;  /* clear sticky header on scroll */
  transition: background 0.4s;
}

.text-section--active {
  background: #eaf6f7;
}

.section-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--baltic);
  margin-bottom: 8px;
  opacity: 0.7;
}

/* --- Word counter --- */
.word-counter {
  font-size: 0.8125rem;
  color: var(--baltic);
  margin-top: 6px;
  margin-bottom: 4px;
  font-weight: 500;
}

.word-counter--warn {
  color: #b45309;
}

.word-counter--over {
  color: var(--pink);
  font-weight: 700;
}

.word-counter-warning {
  font-size: 0.8125rem;
  color: var(--pink);
  font-weight: 600;
  min-height: 1.2em;
  margin-bottom: 4px;
}
