/* ========================================
   COLOR PALETTE
   Balanced Dark Mode - AAA Accessible
   ======================================== */
/*
   Primary Colors:
   - Deep Slate: #1a2332 (primary background)
   - Medium Slate: #2a3444 (secondary background)
   - Bright Cyan: #A8D5E2 (primary text)
   - Soft Blue: #D4E8F0 (headings h2)
   - Pale Blue: #E8F4F8 (h1)
   - Muted Teal: #5A93AC (accents, links)
   
   Contrast Ratios (AAA = 7:1+):
   - #E8F4F8 on #1a2332: 13.1:1 ✓
   - #D4E8F0 on #1a2332: 11.8:1 ✓
   - #A8D5E2 on #1a2332: 9.2:1 ✓
   - #5A93AC on #1a2332: 7.1:1 ✓
*/

/* applies border-box to entire site */
*, *::before, *::after {
    box-sizing: border-box;
}

/* removes the default focus on individual items */
*:focus {
    outline: none;
}

/* color applied when user highlights text on a page */ 
/* adapted from HTML5 Boilerplate v8.0.0 | MIT License | https://html5boilerplate.com/ */
::selection {
    color: #1a2332;
    background: #A8D5E2;
    text-shadow: none;
}

/* styles for entire site */
:root {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 400;
    line-height: 1.8;
    color: #D4E8F0;
}

/* main container for html pages */
html {
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    background: #1a2332;
    min-height: 100vh;
}

/* main container for body of html pages */
body {
    margin: 0 auto;
    padding: 1.5rem 1rem;
    width: 100%;
    max-width: 1366px;
    overflow-x: hidden;
    text-align: center;
    font-size: 1.4rem;
}

/* align header and main content to left */
header,
main,
figure {
    text-align: left;
    max-width: 1366px;
    margin-left: auto;
    margin-right: auto;
}

figure {
    margin: 0 auto;
}

/* headings use Noto Serif font */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Noto Serif', serif;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    color: #E8F4F8;
    border-bottom: 3px solid #5A93AC;
    padding-bottom: 1rem;
    margin-bottom: 3rem;
    margin-top: 0;
    width: 100%;
}

h2 {
    font-size: 2.15rem;
    color: #D4E8F0;
    margin-top: 3rem;
    margin-bottom: 2rem;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: #5A93AC;
    margin: 0.5rem auto 0;
}

h3 {
    font-size: 1.8rem;
    color: #D4E8F0;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    position: relative;
}

h3::after {
    content: '';
    display: block;
    width: 80px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 0 6 Q 20 0, 40 6 Q 60 12, 80 6' stroke='%235A93AC' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    margin: 0.5rem auto 0;
}

h4 {
    font-size: 1.4rem;
    color: #D4E8F0;
    margin-top: 3rem;
    margin-bottom: 1rem;
    text-align: left;
}

/* horizontal rule styling */
hr {
    border: none;
    border-top: 2px solid #5A93AC;
    margin: 3rem auto;
    max-width: 850px;
}

section {
    margin-bottom: 3.5rem;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

section[aria-labelledby="survey"],
section[aria-labelledby="survey-box"] {
    border: 2px solid #5A93AC;
    padding: 1.25rem 2rem;
    border-radius: 8px;
    background: rgba(90, 147, 172, 0.05);
}

section[aria-labelledby="survey"] h2,
section[aria-labelledby="survey-box"] h3 {
    margin-top: 0;
}

/* Contents box styling */
.contents-box {
    border: 2px solid #5A93AC;
    padding: 1.25rem 2rem;
    border-radius: 8px;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.2rem;
}

.contents-box h3 {
    margin-top: 0;
    font-size: 1.5rem;
}

.contents-box h3::after {
    width: 50px;
    background-image: url("data:image/svg+xml,%3Csvg width='50' height='12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 0 6 Q 12.5 0, 25 6 Q 37.5 12, 50 6' stroke='%235A93AC' stroke-width='2' fill='none'/%3E%3C/svg%3E");
}

.contents-box ol {
    text-align: left;
    margin: 0;
    padding-left: 1.5rem;
}

/* Desktop: contents box at half width */
@media (min-width: 768px) {
    .contents-box {
        max-width: 425px;
    }
}

/* navigation styling */
[data-include="nav"] {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #1a2332;
    z-index: 100;
    padding: 0.75rem 2.5rem;
    width: 100%;
    max-width: 1366px;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.3s ease;
}

[data-include="nav"].scrolled {
    border-bottom-color: white;
}

/* Reduce nav padding on smaller screens below 768px */
@media (max-width: 767px) {
    [data-include="nav"] {
        padding: 0.75rem 1rem;
    }
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0;
}

/* Add spacing for fixed nav */
h1 {
    margin-top: 4.5rem !important;
}

nav .page-title {
    text-align: left;
    color: #E8F4F8;
    font-weight: 700;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav ul li {
    text-align: center;
}

nav ul li a {
    font-weight: 500;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

/* footer styling */
footer ul {
    list-style: none;
    padding: 0 1rem;
    margin: 0;
    margin-top: 4rem;
    padding-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0;
    border-top: 1px solid rgba(90, 147, 172, 0.2);
    font-size: 1.2rem;
    text-align: center;
}

footer ul li {
    display: inline;
}

footer ul li:not(:last-child)::after {
    content: ' | ';
    margin-left: 0.25rem;
    margin-right: 0.25rem;
}

/* paragraph spacing */
p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    color: #D4E8F0;
}

/* center utility class */
.center {
    text-align: center;
}

/* link styling */
a {
    color: #5A93AC;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.3s ease;
}

a:link,
a:visited {
    color: #5A93AC;
}

a:hover {
    color: #A8D5E2;
    outline: 2px solid white;
    outline-offset: 2px;
}

a:active {
    color: #D4E8F0;
}

/* page title link styling */
.page-title a {
    text-decoration: none;
    color: inherit;
    font-weight: 600;
}

/* hover effects for navigation and footer links */
nav ul li a:hover,
footer ul li a:hover {
    color: #A8D5E2;
}

/* custom focus styles for accessibility */
*:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* email link styling */
a.email {
    font-size: 1.1rem;
    text-transform: uppercase;
    margin-left: 0.35rem;
    font-weight: 600;
}

a.email::after {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f0e0";
    margin-left: 0.5rem;
}

/* skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: 6px;
    background: #1a2332;
    color: white;
    padding: 10px 16px;
    z-index: 1000;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid white;
}

.skip-link:focus {
    top: 6px;
    outline: 3px solid white;
    outline-offset: 2px;
}

/* ========================================
   SANKEY DIAGRAM RESPONSIVE BEHAVIOR
   ======================================== */

/* Default: Show interactive diagram, hide static image */
#sankey-chart {
    display: block;
}

#sankey-static {
    display: none;
    margin-bottom: 0;
}

.sankey-caption {
    font-size: 1.2rem;
    text-align: left;
    margin-top: 0;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
}

/* Below 992px: Hide interactive, show static image */
@media (max-width: 991px) {
    #sankey-chart {
        display: none;
    }

    #sankey-static {
        display: block;
        width: 100%;
        height: auto;
        margin: 2rem auto 0;
    }
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Mobile devices (up to 767px) */
@media (max-width: 767px) {
    section {
        padding: 0 0.5rem;
    }
}

/* Extra small devices (phones, up to 400px) */
@media (max-width: 400px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    body {
        font-size: 1.1rem;
        padding: 1.5rem 1rem;
    }

    section {
        padding: 0 0.5rem;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
    }

    nav .page-title {
        text-align: center;
    }

    nav ul {
        gap: 1rem;
        justify-content: center;
    }

    footer ul {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }
}

/* Small devices (phones, 480px and up) */
@media (min-width: 480px) {
    body {
        padding: 1.5rem 1.5rem;
    }
}

/* Small to medium devices (large phones/small tablets, 600px and up) */
@media (min-width: 600px) {
    body {
        padding: 1.5rem 2rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    body {
        padding: 1.5rem 2.5rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    body {
        padding: 1.5rem 3rem;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    body {
        padding: 1.5rem 4rem;
    }
}