/*
 * Site shell: header, navigation, page banner and footer, plus the section
 * h2 below. The rest of #main's content is still styled by main.css.
 */

:root {
	--header-background-color: #002147;
	--header-background-color-hover: #2a7fff;
	--header-text-color: #ffffff;
	--header-height: 64px;
	--banner-height: 325px;
}

/* The fixed header is taken out of the flow, so make room for it. */
body {
	padding-top: var(--header-height);
}

/* --------------------------------------------------------------- content -- */

/*
 * Every section title in #main is a plain <h2> — previously
 * <h2 class="wsite-content-title u-center">, the combined effect of
 * main.css's #wsite-content h2 rules and the u-center utility class.
 */
h2 {
	font-family: 'Lato', arial, sans-serif;
	font-weight: 700;
	font-size: 20px;
	margin: 0 auto 0.65em;
	color: #2a2a2a;
	text-align: center;
}

/* Opening title of each page, right below the banner. The bottom margin
 * stays at the plain h2's 13px instead of scaling with the larger font. */
h2.lead {
	font-size: 32px;
	margin-bottom: 13px;
}

/* Quotes in #main are centred; font and colour still come from main.css. */
blockquote {
	text-align: center;
}

/* Body text in #main. Font, size, colour and spacing still come from
 * main.css's shared "div.paragraph, p" rules; these were .paragraph-only. */
#wsite-content p {
	word-wrap: break-word;
}

#wsite-content p a {
	color: #24678d;
}

#wsite-content p a:hover {
	color: #2a7fff;
}

/* Secondary text in paragraphs (staff certifications and verification links),
 * at the 13px that <font size="2"> used to give. */
small {
	font-size: 13px;
}

/*
 * Side-by-side columns in #main (formerly Weebly's wsite-multicol tables).
 * Three equal columns; .staff gives the photo / certifications / badges
 * layout of the staff page. mobile.css stacks them into one column.
 */
.columns {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1em 20px;
}

.columns.staff {
	grid-template-columns: minmax(0, 33fr) minmax(0, 42fr) minmax(0, 25fr);
}

.columns.cols-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 40px;
}

/* Form fields span the whole form instead of Weebly's 400px cap. */
.wsite-form-field {
	max-width: none;
}

/* Two inputs sharing one form field's width (first and last name), so the
 * pair lines up with the full-width fields below it. */
.form-row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

/* The submit button, flush with the right edge of the fields above. */
.form-actions {
	margin-top: 10px;
	text-align: right;
}

/* Images side by side (formerly Weebly's imageGallery), each shown whole:
 * two per row by default, three or four with .cols-3 / .cols-4. */
.gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 25px 5px;
}

.gallery img {
	display: block;
	width: 100%;
	height: auto;
}

.gallery.cols-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery.cols-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Three equal columns with each item centred, so a row of buttons lines up
 * with the footer's social icons whatever the buttons' widths. */
.flex-row {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	justify-items: center;
}

/*
 * Every divider in #main is a plain <hr>: a full-width 1px light grey line
 * with 20px above and below.
 */
hr {
	height: 1px;
	margin: 20px 0;
	border: 0;
	background-color: rgba(0, 0, 0, 0.13);
}

/* ---------------------------------------------------------------- header -- */

header {
	background-color: var(--header-background-color);
	color: var(--header-text-color);
	height: var(--header-height);
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 1.5rem;
	position: fixed;
	top: 0;
	z-index: 10;
	width: 100%;
}

header .logo {
	display: flex;
	align-items: center;
	padding: 0;
}

header .logo img {
	display: block;
	height: 24px;
	width: auto;
}

#nav {
	display: flex;
	align-items: stretch;
	height: 100%;
}

#nav .nav-item {
	display: flex;
	align-items: center;
	padding: 0 15px;
	color: var(--header-text-color);
	font: 16px / 1 'Lato', arial, sans-serif;
	text-transform: uppercase;
	text-decoration: none;
}

#nav .nav-item:hover,
#nav .nav-item:focus-visible {
	background-color: var(--header-background-color-hover);
}

#nav .nav-item.is-active {
	background-color: var(--header-text-color);
	color: var(--header-background-color);
}

/* -------------------------------------------------- mobile menu (no JS) -- */

/*
 * #mobile-input is a checkbox that sits just before <header>; the label styled
 * as .hamburger toggles it and the sibling selectors below open the menu. It
 * stays focusable (and so keyboard-operable) but is never visible.
 */
.mobile-toggle {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	border: 0;
	opacity: 0;
	pointer-events: none;
}

.hamburger {
	display: none;
	position: relative;
	cursor: pointer;
	padding: 8px;
}

.hamburger span,
.hamburger::before,
.hamburger::after {
	position: relative;
	display: block;
	width: 24px;
	height: 4px;
	background: var(--header-text-color);
	transition: all 300ms cubic-bezier(0, 0.085, 0.68, 0.53);
}

.hamburger::before,
.hamburger::after {
	content: '';
}

.hamburger span {
	margin: 4px 0;
}

/* Collapse the three bars into a cross while the menu is open. */
#mobile-input:checked ~ header .hamburger::before {
	top: 8px;
	transform: rotate(45deg);
}

#mobile-input:checked ~ header .hamburger::after {
	top: -8px;
	transform: rotate(-45deg);
}

#mobile-input:checked ~ header .hamburger span {
	opacity: 0;
}

/* ---------------------------------------------------------------- banner -- */

/*
 * One rule for every page. PageBanner.astro supplies --banner-image and
 * --banner-position; .banner-tall / -medium / -short pick the height.
 */
.page-banner {
	height: var(--banner-height);
	background-image: var(--banner-image);
	background-size: cover;
	background-repeat: no-repeat;
	background-position: var(--banner-position, 50% 50%);
	display: flex;
	justify-content: center;
	align-items: center;
	text-align: center;
	color: var(--header-text-color);
	font-family: 'Lato', arial, sans-serif;
}

.banner-tall {
	--banner-height: 575px;
}

.banner-medium {
	--banner-height: 325px;
}

.banner-short {
	--banner-height: 225px;
}

.page-banner h1 {
	margin: 0;
	font-size: 32px;
	line-height: 45px;
	font-weight: 300;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: inherit;
}

.page-banner > h1.home {
	display: flex;
	gap: 0.5rem;
}

.page-banner > h1.home > span::first-letter {
	text-decoration: underline;
}
/* ---------------------------------------------------------------- footer -- */

footer {
	background-color: var(--header-background-color);
	color: var(--header-text-color);
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 2rem 1rem 0 1rem;
}

footer p {
	color: var(--header-text-color);
	margin: 0;
}

footer > div.social {
	width: 100%;
	max-width: calc(1100px - 2rem);
	display: flex;
	justify-content: space-around;
	align-items: center;
	padding-bottom: 20px;
}

footer > div.social img {
	width: auto;
	max-width: 100%;
}

footer > div.footer-text {
	text-align: center;
	font-size: 80%;
}

footer > div.footer-text > p {
	font-weight: bolder;
	line-height: 2;
}

footer > div.footer-text > p.mb {
	margin-bottom: 29px;
}

footer > div.privacy {
	margin: 2.5rem 0;
}

footer > div.privacy > a {
	font-size: 12px;
	color: var(--header-text-color);
	text-decoration: underline;
}
