:root {
	color-scheme: light;
	--theme-bg: #f8f8f8;
	--theme-surface: #ffffff;
	--theme-surface-alt: #eef2f4;
	--theme-text: #1b1b1b;
	--theme-muted: #565c65;
	--theme-border: #c9c9c9;
	--theme-link: #005ea8;
	--theme-link-hover: #1a4480;
}

body[data-theme="light"] {
	color-scheme: light;
	background: var(--theme-bg) !important;
	color: var(--theme-text);
}

body[data-theme="dark"] {
	color-scheme: dark;
	--theme-bg: #0f171f;
	--theme-surface: #17232e;
	--theme-surface-alt: #213140;
	--theme-text: #f2f5f7;
	--theme-muted: #c5d0d8;
	--theme-border: #506272;
	--theme-link: #64c7ff;
	--theme-link-hover: #a7e2ff;
	background: var(--theme-bg) !important;
	color: var(--theme-text);
}

body[data-theme="dark"] main,
body[data-theme="dark"] .usa-section:not(.usa-section-dark),
body[data-theme="dark"] .usa-footer-return-to-top {
	background-color: var(--theme-bg) !important;
	color: var(--theme-text);
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] h5,
body[data-theme="dark"] h6,
body[data-theme="dark"] p,
body[data-theme="dark"] li,
body[data-theme="dark"] label,
body[data-theme="dark"] legend,
body[data-theme="dark"] .usa-font-lead {
	color: inherit;
}

body[data-theme="dark"] a:not(.usa-button) {
	color: var(--theme-link) !important;
}

body[data-theme="dark"] a:not(.usa-button):hover,
body[data-theme="dark"] a:not(.usa-button):focus {
	color: var(--theme-link-hover);
}

body[data-theme="dark"] .usa-header,
body[data-theme="dark"] .site-header-navbar,
body[data-theme="dark"] .usa-navbar,
body[data-theme="dark"] .usa-nav {
	background-color: #121d27 !important;
	color: var(--theme-text);
}

body[data-theme="dark"] .usa-header .usa-logo a,
body[data-theme="dark"] .usa-header .usa-nav a,
body[data-theme="dark"] .usa-header .usa-nav-link,
body[data-theme="dark"] .usa-header .usa-header-search-button {
	color: #fff !important;
	text-decoration: none;
}

body[data-theme="dark"] .usa-header .usa-nav-link > span {
	color: inherit;
	border-bottom: 0;
	padding-bottom: 0;
}

body[data-theme="dark"] .usa-nav-link:hover,
body[data-theme="dark"] .usa-nav-link:focus,
body[data-theme="dark"] .usa-nav-link[aria-expanded="true"],
body[data-theme="dark"] .usa-nav-submenu a:hover,
body[data-theme="dark"] .usa-nav-submenu a:focus {
	background-color: var(--theme-surface-alt) !important;
}

body[data-theme="dark"] .usa-nav-submenu {
	background-color: #1d3950 !important;
}

body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select,
body[data-theme="dark"] .usa-input {
	background: var(--theme-surface) !important;
	border-color: var(--theme-border) !important;
	color: var(--theme-text) !important;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
	color: var(--theme-muted);
}

body[data-theme="dark"] table,
body[data-theme="dark"] th,
body[data-theme="dark"] td {
	border-color: var(--theme-border) !important;
}

body[data-theme="dark"] th,
body[data-theme="dark"] thead {
	background: #263a4b !important;
	color: var(--theme-text) !important;
}

body[data-theme="dark"] tbody tr:nth-child(odd),
body[data-theme="dark"] .usa-table tbody tr:nth-child(odd) {
	background: var(--theme-surface) !important;
}

body[data-theme="dark"] tbody tr:nth-child(even),
body[data-theme="dark"] .usa-table tbody tr:nth-child(even) {
	background: var(--theme-surface-alt) !important;
}

body[data-theme="dark"] .card,
body[data-theme="dark"] .profile-card,
body[data-theme="dark"] .soldier-card,
body[data-theme="dark"] .document-card,
body[data-theme="dark"] .result-card,
body[data-theme="dark"] .modal-content,
body[data-theme="dark"] .usa-alert,
body[data-theme="dark"] .usa-accordion-content {
	background: var(--theme-surface) !important;
	border-color: var(--theme-border) !important;
	color: var(--theme-text) !important;
}

body[data-theme="dark"] .roster-hero,
body[data-theme="dark"] .roster-gallery-card,
body[data-theme="dark"] .roster-section,
body[data-theme="dark"] .roster-gallery-thumb {
	background: var(--theme-surface) !important;
	border-color: var(--theme-border) !important;
	color: var(--theme-text) !important;
}

body[data-theme="dark"] .roster-table td {
	background: var(--theme-surface) !important;
	border-color: var(--theme-border) !important;
	color: var(--theme-text) !important;
}

body[data-theme="dark"] .roster-table tr:nth-child(even) td {
	background: var(--theme-surface-alt) !important;
}

body[data-theme="dark"] .roster-table tr,
body[data-theme="dark"] .roster-photo,
body[data-theme="dark"] .roster-flag-item img {
	border-color: var(--theme-border) !important;
}

body[data-theme="dark"] .empty-note {
	color: var(--theme-muted) !important;
}

/* Memorial, awards, and links pages use their own card styles. */
body[data-theme="dark"] :is(.honor-roll-hero, .honor-card, .honor-empty,
                            .awards-hero, .award-card, .links-hero, .links-section) {
	background-color: var(--theme-surface);
	border-color: var(--theme-border);
}

body[data-theme="dark"] .award-section {
	background-color: var(--theme-bg);
	border-color: var(--theme-border);
}

body[data-theme="dark"] :is(.award-section-header, .links-section-title) {
	background-color: var(--theme-surface-alt);
	color: var(--theme-text);
}

body[data-theme="dark"] :is(.honor-roll-hero p, .honor-empty, .award-empty, .links-section-note) {
	color: var(--theme-muted);
}

body[data-theme="dark"] :is(.honor-divider, .honor-photo, .award-notes, .award-photo) {
	border-color: var(--theme-border);
}

body[data-theme="dark"] .gallery-page-wrap :is(.gallery-hero, .photo-card, .gallery-empty) {
	background-color: var(--theme-surface);
	border-color: var(--theme-border);
	color: var(--theme-text);
}

body[data-theme="dark"] .gallery-page-wrap :is(.gallery-hero p, .photo-caption, .gallery-empty) {
	color: var(--theme-muted);
}

body[data-theme="dark"] .gallery-page-wrap .photo-thumb-wrap {
	background-color: var(--theme-surface-alt);
	border-color: var(--theme-border);
}

body[data-theme="dark"] .docs-page-wrap :is(.docs-hero, .docs-section, .doc-card, .video-card) {
	background-color: var(--theme-surface);
	border-color: var(--theme-border);
	color: var(--theme-text);
}

body[data-theme="dark"] .docs-page-wrap :is(.docs-section-title, .doc-thumb-wrap) {
	background-color: var(--theme-surface-alt);
	border-color: var(--theme-border);
}

body[data-theme="dark"] .docs-page-wrap :is(.docs-section-note, .doc-caption, .video-caption) {
	color: var(--theme-muted);
}

body[data-theme="dark"] .docs-page-wrap .video-placeholder {
	border-color: var(--theme-border);
}

body[data-theme="dark"] .mr-page-wrap :is(.mr-hero, .mr-info-card, .mr-folder-section, .mr-empty),
body[data-theme="dark"] .soldier-docs-wrap :is(.soldier-docs-hero, .doc-section),
body[data-theme="dark"] .reunion-wrap :is(.reunion-hero, .reunion-section),
body[data-theme="dark"] .history-page-wrap :is(.history-hero, .history-section),
body[data-theme="dark"] .contact-wrap :is(.contact-hero, .contact-card),
body[data-theme="dark"] .donate-wrap :is(.donate-hero, .donate-card) {
	background-color: var(--theme-surface);
	border-color: var(--theme-border);
	color: var(--theme-text);
}

body[data-theme="dark"] .mr-page-wrap :is(.mr-card, .mr-thumb-wrap),
body[data-theme="dark"] .soldier-docs-wrap :is(.soldier-doc-card, .soldier-doc-photo, .doc-section-title),
body[data-theme="dark"] .reunion-wrap :is(.reunion-video-card, .reunion-photo-card, .reunion-thumb-wrap, .reunion-section-title),
body[data-theme="dark"] .history-page-wrap :is(.history-card, .history-thumb-wrap, .history-section-title),
body[data-theme="dark"] .contact-wrap .donate-mini,
body[data-theme="dark"] .donate-wrap .donate-callout {
	background-color: var(--theme-surface-alt);
	border-color: var(--theme-border);
}

body[data-theme="dark"] .mr-page-wrap :is(.mr-caption, .mr-empty),
body[data-theme="dark"] .soldier-docs-wrap .doc-empty,
body[data-theme="dark"] .reunion-wrap :is(.reunion-video-caption, .reunion-photo-caption, .reunion-empty),
body[data-theme="dark"] .history-page-wrap :is(.history-caption, .history-section-note) {
	color: var(--theme-muted);
}

body[data-theme="dark"] .contact-wrap .contact-alert {
	background-color: var(--theme-surface-alt);
}

body[data-theme="dark"] .usa-section-dark {
	background-color: #173a57 !important;
}

body[data-theme="dark"] .usa-footer-primary-section {
	background: #182631 !important;
}

body[data-theme="dark"] .usa-footer-secondary_section {
	background: #101820 !important;
	color: var(--theme-text);
}

body[data-theme="dark"] .usa-footer-primary-link,
body[data-theme="dark"] .usa-footer-logo-heading {
	color: var(--theme-text) !important;
}

.usa-nav-secondary-links .theme-toggle {
	background: transparent;
	border: 0;
	border-radius: 0;
	color: #5b616b;
	cursor: pointer;
	display: inline-block;
	font: inherit;
	font-size: 1.5rem;
	margin: 0;
	padding: 0;
	text-align: left;
	width: auto;
}

.usa-nav-secondary-links .theme-toggle:hover {
	color: #0071bc;
}

.usa-nav-secondary-links .theme-toggle:focus-visible {
	outline: 3px solid #ffbe2e;
	outline-offset: 2px;
}

body[data-theme="dark"] .usa-nav-secondary-links .theme-toggle {
	color: #fff;
}

body[data-theme="dark"] .usa-nav-secondary-links .theme-toggle:hover {
	background-color: var(--theme-surface-alt);
}

@media screen and (max-width: 360px) {
	.honor-roll-wrap .honor-roll-grid,
	.links-wrap .links-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media print {
	.theme-toggle {
		display: none !important;
	}
}

