/* Reset, text styles, layout and utilities. See docs 03, 04 and 05. */

/* Reset */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 6rem;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
ul,
ol,
dl,
dd {
	margin: 0;
}

img,
svg,
video {
	display: block;
	max-width: 100%;
}

img,
video {
	height: auto;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

/* Colors that depend on the background. Navy sections and cards set them for their contents. */
:root,
.ads-card {
	--ads-ctx-heading: var(--ads-color-navy);
	--ads-ctx-muted: var(--ads-color-text-muted);
	--ads-ctx-link: var(--ads-color-navy);
	--ads-ctx-eyebrow: var(--ads-color-navy);
	--ads-ctx-focus: var(--ads-color-navy);
	--ads-ctx-outline: var(--ads-color-navy);
}

/* Text styles */
body {
	font-family: var(--ads-font-body);
	font-size: var(--ads-fs-body);
	font-weight: 400;
	line-height: var(--ads-lh-body);
	color: var(--ads-color-text);
	background: var(--ads-color-bg);
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

/* Keeps the footer at the bottom of the screen on short pages. */
main {
	flex: 1;
}

h1,
h2,
.ads-display {
	font-family: var(--ads-font-heading);
	font-weight: 700;
	font-variant-numeric: lining-nums;
	line-height: var(--ads-lh-tight);
	color: var(--ads-ctx-heading);
}

h3,
h4,
h5,
h6 {
	font-family: var(--ads-font-body);
	font-weight: 600;
	line-height: var(--ads-lh-tight);
	color: var(--ads-ctx-heading);
}

h1 {
	font-size: var(--ads-fs-h1);
}

h2 {
	font-size: var(--ads-fs-h2);
}

h3 {
	font-size: var(--ads-fs-h3);
}

h4,
h5,
h6 {
	font-size: var(--ads-fs-h4);
}

.ads-display {
	font-size: var(--ads-fs-display);
	line-height: 1.15;
}

p {
	max-width: 70ch;
}

p + p,
:is(h1, h2, h3, h4, h5, h6, .ads-display) + * {
	margin-top: var(--ads-space-4);
}

* + :is(h2, h3, h4, h5, h6) {
	margin-top: var(--ads-space-6);
}

.ads-eyebrow + * {
	margin-top: var(--ads-space-2);
}

a {
	color: var(--ads-ctx-link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .2em;
	transition: text-decoration-color var(--ads-transition), color var(--ads-transition);
}

a:hover {
	text-decoration-color: var(--ads-color-gold);
	text-decoration-thickness: 2px;
}

.ads-lead {
	font-size: 1.1875rem;
	color: var(--ads-ctx-muted);
}

.ads-small {
	font-size: var(--ads-fs-small);
	color: var(--ads-ctx-muted);
}

.ads-eyebrow {
	font-size: var(--ads-fs-eyebrow);
	font-weight: 600;
	letter-spacing: var(--ads-ls-caps);
	text-transform: uppercase;
	color: var(--ads-ctx-eyebrow);
}

/* Layout */
.ads-container {
	width: 100%;
	max-width: var(--ads-container);
	margin-inline: auto;
	padding-inline: var(--ads-gutter);
}

.ads-section {
	padding-block: var(--ads-section-py);
	background: var(--ads-color-bg);
}

.ads-section--alt {
	background: var(--ads-color-bg-alt);
}

.ads-section--navy,
.ads-footer {
	--ads-ctx-heading: var(--ads-color-bg);
	--ads-ctx-muted: var(--ads-color-bg);
	--ads-ctx-link: var(--ads-color-gold);
	--ads-ctx-eyebrow: var(--ads-color-gold);
	--ads-ctx-focus: var(--ads-color-gold);
	--ads-ctx-outline: var(--ads-color-bg);
	color: var(--ads-color-bg);
}

.ads-section--navy {
	background: var(--ads-color-navy);
}

/* Utilities */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.ads-skip-link {
	position: fixed;
	top: var(--ads-space-2);
	left: var(--ads-space-2);
	z-index: 1000;
	padding: var(--ads-space-3) var(--ads-space-4);
	font-weight: 600;
	color: var(--ads-color-navy);
	background: var(--ads-color-gold);
	border-radius: var(--ads-radius-sm);
	transform: translateY(-200%);
	transition: transform var(--ads-transition);
}

.ads-skip-link:focus {
	transform: translateY(0);
}

:focus-visible {
	outline: 3px solid var(--ads-ctx-focus);
	outline-offset: 2px;
}

/* The skip link moves focus here; a ring around the whole page isn't useful. */
main:focus {
	outline: none;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-delay: 0s !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}
