/* =============================================================
   MSHP Job Descriptions — Accessible HTML Styles
   WCAG 2.1 Level AA compliant
   Colors: MSHP Navy (#1e3a5f) + Gold (#ffc408) + white background
   All interactive elements ≥44×44px per WCAG 2.5.5
   ============================================================= */

/* ===== RESET / BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1a1a1a;          /* 17.36:1 on #fff — well beyond AAA */
  background: #fff;
}

/* ===== REDUCED MOTION (WCAG 2.3.3) ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== SKIP LINK (WCAG 2.4.1) ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0.5rem;
  background: #1e3a5f;
  color: #fff;             /* 10.96:1 on navy */
  padding: 0.75rem 1rem;
  text-decoration: none;
  font-weight: 600;
  z-index: 100;
  border-radius: 0 0 4px 4px;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  outline: 3px solid #ffc408;
  outline-offset: 2px;
}

/* ===== FOCUS INDICATORS (WCAG 2.4.7) ===== */
:focus-visible {
  outline: 3px solid #1e3a5f;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== HEADER / BANNER ===== */
.site-header {
  background: #1e3a5f;
  color: #fff;
  padding: 1rem 1.25rem;
  border-bottom: 4px solid #ffc408;
}
.site-header .brand {
  font-size: 0.875rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ffc408;          /* 7.01:1 on navy — AA+ */
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}
.site-header .title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.site-header nav {
  margin-top: 0.75rem;
}
.site-header nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.site-header nav a {
  color: #fff;
  text-decoration: underline;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.25rem;
}
.site-header nav a:hover,
.site-header nav a:focus-visible {
  color: #ffc408;
  text-decoration-thickness: 2px;
}

/* ===== MAIN CONTENT ===== */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}
main:focus {
  outline: none;
}

/* ===== HEADINGS ===== */
h1 {
  font-size: 2rem;
  line-height: 1.25;
  color: #1e3a5f;
  margin: 0 0 0.5rem;
  font-weight: 700;
}
.job-family {
  font-size: 0.875rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #4a4a4a;          /* 9.74:1 on white — AA+ */
  margin: 0 0 1.5rem;
  font-weight: 600;
}
h2 {
  font-size: 1.5rem;
  color: #1e3a5f;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #ffc408;
  font-weight: 700;
}
h3 {
  font-size: 1.25rem;
  color: #2c5282;          /* 6.79:1 on white — AA+ */
  margin: 1.5rem 0 0.5rem;
  font-weight: 600;
}

/* "Pay grade: NN" suffix within an <h3> job-title heading is shown in normal
   weight + lighter color, matching the original PDF where the pay grade text
   was right-aligned and unbolded next to the bolded title. */
h3 .pay-grade {
  font-weight: 400;
  color: #4a5568;          /* 6.66:1 on white — AA */
  font-size: 0.95em;
}

/* ===== PARAGRAPHS & LISTS ===== */
p { margin: 0 0 1rem; }
ul, ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}
li { margin-bottom: 0.5rem; }

/* ===== METADATA DEFINITION LIST ===== */
dl.metadata {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1rem;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: #f5f7fa;
  border-left: 4px solid #1e3a5f;
  border-radius: 0 4px 4px 0;
}
dl.metadata dt {
  font-weight: 600;
  color: #1e3a5f;
}
dl.metadata dd {
  margin: 0;
  color: #1a1a1a;
}

/* Glossary-style definition list (term + definition stacked, not in a grid).
   Used by MSHPClassificationCompensationPlan reference page. */
dl.glossary {
  margin: 1.5rem 0;
}
dl.glossary dt {
  font-weight: 600;
  color: #1e3a5f;
  margin-top: 1rem;
}
dl.glossary dt:first-child { margin-top: 0; }
dl.glossary dd {
  margin: 0.25rem 0 0 1.5rem;
  color: #1a1a1a;
}
dl.glossary dd + dd {
  margin-top: 0.5rem;
}

/* Document-level metadata (e.g., "Effective: July 2025") */
.document-meta {
  font-size: 0.95rem;
  color: #555;
  font-style: italic;
  margin: -0.5rem 0 1.5rem 0;
}

/* ===== LINKS ===== */
a { color: #0542a0; }       /* 7.43:1 on white — AAA */
a:hover, a:focus-visible { text-decoration-thickness: 2px; }
.external-link::after {
  content: " (opens in new window)";
  font-size: 0.875rem;
  color: #4a4a4a;
}
.pdf-link::after {
  content: " (PDF)";
  font-size: 0.875rem;
  color: #4a4a4a;
}

/* ===== PAY-STRUCTURE TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}
caption {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  color: #1e3a5f;
  padding: 0.5rem 0;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}
caption .caption-pdf {
  font-weight: 400;
  font-size: 0.875rem;
  color: #4a4a4a;
  font-style: italic;
}
caption .caption-pdf a {
  color: #0542a0;
}
thead th {
  background: #1e3a5f;
  color: #fff;             /* 10.96:1 on navy — AAA */
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 1px solid #1e3a5f;
  font-weight: 600;
}
tbody th {
  background: #f5f7fa;
  color: #1a1a1a;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: 1px solid #dcdfe3;
  font-weight: 600;
  vertical-align: top;
}
tbody td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #dcdfe3;
  vertical-align: top;
}
tbody tr:nth-child(even) td,
tbody tr:nth-child(even) th {
  background: #fafbfc;
}
/* Mobile: scrollable wrapper for wide tables */
@media (max-width: 700px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }
  caption { white-space: normal; }
}

/* ===== INDEX PAGE STYLES ===== */
.index-intro {
  background: #f5f7fa;
  border-left: 4px solid #ffc408;
  padding: 1rem 1.25rem;
  margin: 0 0 2rem;
  border-radius: 0 4px 4px 0;
}
.category-section {
  margin: 2.5rem 0;
}
.category-section h2 {
  margin-bottom: 1rem;
}
.job-family-group {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid #dcdfe3;
  border-radius: 4px;
}
.job-family-group h3 {
  margin-top: 0;
}
.job-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.5rem;
}
.job-list a {
  display: block;
  padding: 0.75rem 1rem;
  min-height: 44px;
  background: #fff;
  border: 1px solid #c5cad1;
  border-radius: 4px;
  text-decoration: none;
  color: #0542a0;
  font-weight: 500;
}
.job-list a:hover,
.job-list a:focus-visible {
  background: #e8eef6;
  border-color: #1e3a5f;
  text-decoration: underline;
}

/* ===== FOOTER / CONTENTINFO ===== */
footer {
  margin-top: 3rem;
  padding: 1.5rem 1.25rem;
  background: #1e3a5f;
  color: #fff;
  text-align: center;
  font-size: 0.875rem;
}
footer a { color: #ffc408; }
footer p { margin: 0.25rem 0; }

/* ===== UTILITY ===== */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .site-header .title { font-size: 1.25rem; }
  h1 { font-size: 1.625rem; }
  h2 { font-size: 1.25rem; }
  main { padding: 1.5rem 1rem 2rem; }
  dl.metadata { grid-template-columns: 1fr; gap: 0.25rem; }
  dl.metadata dt { margin-top: 0.5rem; }
}

/* ===== PRINT ===== */
@media print {
  .site-header, .skip-link, footer nav { display: none; }
  body { color: #000; }
  a { color: #000; text-decoration: underline; }
  h1, h2, h3 { color: #000; page-break-after: avoid; }
  h2 { border-bottom-color: #000; }
  main { max-width: none; padding: 0; }
}
