/* ========================================
   CACHE MANAGEMENT REMINDER
   ======================================== */
/*
   IMPORTANT: When this CSS file is updated, you MUST increment
   the version number in the following HTML files:

   - /index.html (line ~26 and ~32): /css/style.css?vers=00X
   - /survey.html (line ~21 and ~27): /css/style.css?vers=00X

   Current version: 012

   This forces browsers to reload the updated stylesheet and
   prevents users from seeing cached/outdated styles.
*/

/* ========================================
   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;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* 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;
}

/* ========================================
   LAYOUT & SPACING
   ======================================== */

/* 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 {
    background: #1a2332;
    min-height: 100vh;
    scroll-padding-top: 6.5rem;
}

/* 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;
}

/* 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;
    }
}

/* 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;
}

/* Add top margin to all figures except the header figure */
figure:not(#header) {
    margin-top: 2.8rem;
}

/* Ensure images don't overflow their containers */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Clickable images - show cursor and hover effect */
figure a {
    display: block;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

figure a:hover {
    opacity: 0.85;
}

figure a:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Figure caption styling */
.caption {
    font-size: 1.2rem;
    line-height: 1.5;
    text-align: left;
    margin-top: 0.75rem;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

/* 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: 3.5rem; /* spacing for fixed nav */
    width: 100%;
}

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

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

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

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

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

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

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;
}

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

/* 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;
}

/* Extra small devices (phones, up to 400px) */
@media (max-width: 400px) {
    section {
        padding: 0;
    }
}

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

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"] h2 {
    margin-top: 0;
}

/* ========================================
   COMPONENTS
   ======================================== */

/* Table styling */
table {
    font-size: 1.3rem;
    width: 100%;
    border-collapse: collapse;
    margin: 2rem auto;
    max-width: 850px;
}

th, td {
    padding: .5rem 1rem;
    text-align: left;
    border: 1px solid #5A93AC;
}

th {
    background: rgba(90, 147, 172, 0.15);
    color: #E8F4F8;
    font-weight: 600;
}

td {
    background: rgba(90, 147, 172, 0.05);
}

/* 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.3rem;
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .contents-box {
        max-width: 425px;
    }

    .contents-box:has(#results-brief) {
        max-width: 75%;
    }

    /* Project developers list: center based on longest item */
    #project-developers + ul {
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }
}

.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;
}

/* Menu-specific styling: reduce spacing between items and center list */
.contents-box:has(#menu) {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

#menu {
    font-style: normal;
    text-transform: uppercase;
    margin-bottom: 0;
}

#menu + ol {
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

/* Results brief specific styling */

.contents-box:has(#results-brief) {
    margin-top: 2.8rem;
}

#results-brief {
    font-style: normal;
}

#results-brief + ol {
    margin-bottom: 0.5rem;
}

/* 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;
}

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

nav .page-title {
    text-align: left;
    color: #E8F4F8;
    font-weight: 700;
    font-size: 1.2rem;
    flex: 0 1 auto;
}

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

nav ul li {
    text-align: center;
}

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

/* Mobile devices - horizontal nav optimization (up to 600px) */
@media (max-width: 600px) {
    [data-include="nav"] {
        padding: 0.75rem 0.5rem;
    }

    nav {
        gap: 0.5rem;
    }

    nav .page-title {
        font-size: 1.2rem;
    }

    nav ul {
        gap: 0.5rem;
    }

    nav ul li a {
        font-size: 1.2rem;
    }
}

/* Mobile devices (max-width: 767px) */
@media (max-width: 767px) {
    [data-include="nav"] {
        padding: 0.75rem 1rem;
    }
}

/* 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;
}

/* Extra small devices (phones, up to 400px) */
@media (max-width: 400px) {
    footer ul {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }
}

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

/* list styling */
ul, ol {
    padding-left: 1.5rem;
    padding-right: 0;
    margin-top: 0;
    margin-bottom: 0;
}

/* Add spacing for nested lists */
li > ul,
li > ol {
    margin-top: .25rem;
}

/* Style nested unordered lists with hollow circles */
li > ul {
    list-style-type: circle;
}

li {
    padding: .25rem 0;
}

/* Remove top padding only for lists directly following headings */
h1 + ul > li:first-child,
h1 + ol > li:first-child,
h2 + ul > li:first-child,
h2 + ol > li:first-child,
h3 + ul > li:first-child,
h3 + ol > li:first-child,
h4 + ul > li:first-child,
h4 + ol > li:first-child {
    padding-top: 0;
}

/* Remove top padding from list item that follows a list item containing a nested list */
li:has(> ul) + li,
li:has(> ol) + li {
    padding-top: 0;
}

/* Remove bottom padding from last item in nested lists */
li > ul > li:last-child,
li > ol > li:last-child {
    padding-bottom: 0;
}

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

/* ========================================
   INTERACTIVE ELEMENTS & LINKS
   ======================================== */

/* 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;
}

/* ========================================
   SPECIALIZED COMPONENTS
   ======================================== */

/* Sankey Diagram - Show interactive diagram by default, hide static image */
#sankey-chart {
    display: block;
}

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

/* Sankey diagram responsive behavior (below 992px) */
@media (max-width: 991px) {
    #sankey-chart {
        display: none;
    }

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