/* ============================================================
   MSHP History Pages — Shared Styles
   ADA Compliant (WCAG 2.1 AA)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.8;
    color: #333;
    background: #fff;
}

/* ===== Skip Link ===== */
.skip-link {
    position: absolute; top: -40px; left: 0;
    background: #131F3B; color: white;
    padding: 8px 16px; z-index: 100;
    text-decoration: none; font-weight: 600;
    font-size: 14px;
}
.skip-link:focus { top: 0; }

/* ===== Header ===== */
.history-header {
    background: linear-gradient(135deg, #131F3B 0%, #1a3a6b 100%);
    color: white;
    padding: 48px 20px;
    text-align: center;
}
.history-header .org-name {
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
}
.history-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}
.history-header .subtitle {
    font-size: 18px;
    color: #e8a820;
    font-weight: 500;
}

/* ===== Table of Contents ===== */
nav[aria-label="Table of Contents"] {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 20px;
    border-bottom: 2px solid #e8e8e8;
}
nav[aria-label="Table of Contents"] h2 {
    font-size: 20px;
    font-weight: 700;
    color: #131F3B;
    margin-bottom: 12px;
}
nav[aria-label="Table of Contents"] ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}
nav[aria-label="Table of Contents"] li {
    font-size: 14px;
}
nav[aria-label="Table of Contents"] a {
    color: #1a5dab;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
}
nav[aria-label="Table of Contents"] a:hover {
    text-decoration: underline;
    background: #f0f4f8;
}
nav[aria-label="Table of Contents"] a:focus-visible {
    outline: 3px solid #e8a820;
    outline-offset: 2px;
}

/* ===== Main Content ===== */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 20px;
}

main section {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}
main section:last-child {
    border-bottom: none;
}

main h2 {
    font-size: 24px;
    font-weight: 700;
    color: #131F3B;
    margin-bottom: 16px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e8a820;
}

main h3 {
    font-size: 18px;
    font-weight: 700;
    color: #131F3B;
    margin-top: 20px;
    margin-bottom: 8px;
}

main p {
    font-size: 16px;
    margin-bottom: 14px;
    text-align: justify;
}

main a {
    color: #1a5dab;
    text-decoration: underline;
}
main a:hover { color: #131F3B; }
main a:focus-visible {
    outline: 3px solid #e8a820;
    outline-offset: 2px;
}

/* ===== Footer ===== */
.history-footer {
    background: #131F3B;
    color: white;
    text-align: center;
    padding: 32px 20px;
    font-size: 14px;
}
.history-footer p {
    margin-bottom: 4px;
    color: rgba(255,255,255,0.8);
}
.history-footer a {
    color: #e8a820;
    text-decoration: none;
}
.history-footer a:hover { text-decoration: underline; }

/* ===== Back to Top ===== */
.back-to-top {
    display: inline-block;
    font-size: 13px;
    color: #1a5dab;
    text-decoration: none;
    margin-top: 8px;
}
.back-to-top:hover { text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .history-header h1 { font-size: 28px; }
    main p { text-align: left; }
    nav[aria-label="Table of Contents"] ul {
        flex-direction: column;
        gap: 4px;
    }
}

/* ===== Print ===== */
@media print {
    .skip-link { display: none; }
    .history-header { background: #131F3B !important; -webkit-print-color-adjust: exact; }
    main { max-width: 100%; }
}

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