/**
 * GW Trailers — base layer.
 *
 * Everything a theme has to provide for itself once it is not sitting on a
 * parent framework: reset, typography, forms, tables, WordPress's own core
 * classes, and the prose styles that editor content lands in.
 */

/* ================================================================== Reset */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
}

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

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

body {
	margin: 0;
	background: var(--gw-surface);
	color: var(--gw-ink);
	font-family: var(--gw-text);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

iframe,
embed,
object {
	max-width: 100%;
}

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

button { cursor: pointer; }

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .6em;
	font-weight: 700;
	line-height: 1.2;
	text-wrap: balance;
}

p, ul, ol, dl, blockquote, pre, figure, table {
	margin: 0 0 1.1em;
}

a {
	color: var(--gw-blue);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

a:hover { color: var(--gw-blue-600); }

hr {
	height: 1px;
	margin: 2em 0;
	border: 0;
	background: var(--gw-line);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--gw-blue-300);
	outline-offset: 3px;
	border-radius: 3px;
}

/* ================================================= WordPress core classes */

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

.screen-reader-text:focus {
	position: fixed !important;
	top: 12px;
	left: 12px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: 12px 20px;
	clip-path: none;
	border-radius: var(--gw-radius);
	background: var(--gw-navy);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}

.alignleft {
	float: left;
	margin: .3em 1.5em 1em 0;
}

.alignright {
	float: right;
	margin: .3em 0 1em 1.5em;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.alignwide,
.alignfull {
	margin-inline: auto;
}

.wp-caption { max-width: 100%; }

.wp-caption-text,
figcaption {
	margin-top: .5em;
	font-size: .84rem;
	color: var(--gw-ink-soft);
	text-align: center;
}

.sticky .gw-post-card-title::after {
	content: " ★";
	color: var(--gw-blue);
}

/* ============================================================== Layout */

.gw-site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.gw-site-content { flex: 1 0 auto; }

.gw-wrap {
	width: 100%;
	max-width: var(--gw-wrap);
	margin-inline: auto;
	padding-inline: 20px;
}

.gw-wrap-narrow { max-width: var(--gw-wrap-narrow); }

.gw-main { display: block; }

/* ============================================================== Prose */

/*
 * Editor content lands here. Everything is scoped so the dealer can paste in
 * whatever the block editor produces and it looks deliberate.
 */

.gw-prose {
	font-size: 1.02rem;
	line-height: 1.75;
	color: var(--gw-ink);
}

.gw-prose > :first-child { margin-top: 0; }
.gw-prose > :last-child { margin-bottom: 0; }

.gw-prose h2 {
	margin-top: 1.8em;
	font-family: var(--gw-display);
	font-size: 1.5rem;
	color: var(--gw-navy);
}

.gw-prose h3 {
	margin-top: 1.6em;
	font-family: var(--gw-display);
	font-size: 1.2rem;
	color: var(--gw-navy);
}

.gw-prose h4 {
	margin-top: 1.5em;
	font-size: 1.05rem;
}

.gw-prose ul,
.gw-prose ol {
	padding-left: 1.3em;
}

.gw-prose li { margin-bottom: .4em; }
.gw-prose li::marker { color: var(--gw-blue); }

.gw-prose blockquote {
	margin: 1.6em 0;
	padding: 4px 0 4px 22px;
	border-left: 3px solid var(--gw-blue);
	color: var(--gw-ink-soft);
	font-size: 1.05rem;
}

.gw-prose blockquote > :last-child { margin-bottom: 0; }

.gw-prose code {
	padding: 2px 6px;
	border-radius: 4px;
	background: var(--gw-surface-alt);
	font-size: .9em;
}

.gw-prose pre {
	padding: 16px 18px;
	border-radius: var(--gw-radius);
	background: var(--gw-navy);
	color: #e8eaf4;
	overflow-x: auto;
	font-size: .88rem;
	line-height: 1.6;
}

.gw-prose pre code {
	padding: 0;
	background: none;
	color: inherit;
}

.gw-prose img { border-radius: var(--gw-radius); }

.gw-prose a { font-weight: 500; }

/* ============================================================== Tables */

table {
	width: 100%;
	border-collapse: collapse;
	font-size: .94rem;
}

th, td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--gw-line);
	text-align: left;
	vertical-align: top;
}

thead th {
	font-size: .76rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--gw-ink-soft);
}

/* ============================================================== Forms */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="password"],
input[type="date"],
select,
textarea {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--gw-line);
	border-radius: 6px;
	background: var(--gw-surface);
	color: var(--gw-ink);
	font-size: .95rem;
}

select {
	appearance: none;
	padding-right: 36px;
	/* Chevron drawn as a gradient pair so no icon asset is needed. */
	background-image:
		linear-gradient(45deg, transparent 50%, var(--gw-ink-soft) 50%),
		linear-gradient(135deg, var(--gw-ink-soft) 50%, transparent 50%);
	background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}

textarea { resize: vertical; min-height: 140px; }

input::placeholder,
textarea::placeholder { color: #9aa1b4; }

input:focus,
select:focus,
textarea:focus {
	border-color: var(--gw-blue);
	outline: 2px solid color-mix(in srgb, var(--gw-blue) 35%, transparent);
	outline-offset: 0;
}

label { font-weight: 500; }

/* ============================================================== Buttons */

.gw-btn,
.wp-block-button__link,
button[type="submit"]:not(.gw-btn):not([class*="gwti"]) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 13px 24px;
	border: 1.5px solid transparent;
	border-radius: var(--gw-radius);
	font-family: var(--gw-text);
	font-size: .95rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.wp-block-button__link,
button[type="submit"]:not(.gw-btn):not([class*="gwti"]) {
	background: var(--gw-blue);
	color: #fff;
}

.wp-block-button__link:hover,
button[type="submit"]:not(.gw-btn):not([class*="gwti"]):hover {
	background: var(--gw-blue-600);
	color: #fff;
}

.gw-btn-primary { background: var(--gw-blue); color: #fff; }
.gw-btn-primary:hover { background: var(--gw-blue-600); color: #fff; }

.gw-btn-dark { background: var(--gw-navy); color: #fff; }
.gw-btn-dark:hover { opacity: .9; color: #fff; }

.gw-btn-outline { border-color: rgba(255, 255, 255, .45); color: #fff; }
.gw-btn-outline:hover { border-color: #fff; background: rgba(255, 255, 255, .1); color: #fff; }

.gw-btn-outline-dark {
	border-color: var(--gw-line);
	background: #fff;
	color: var(--gw-ink);
}

.gw-btn-outline-dark:hover { border-color: var(--gw-blue); color: var(--gw-blue); }

.gw-link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--gw-blue);
	font-weight: 600;
	font-size: .92rem;
	text-decoration: none;
	white-space: nowrap;
}

.gw-link-arrow:hover { color: var(--gw-blue-600); text-decoration: underline; }
.gw-link-arrow svg { transition: transform .15s ease; }
.gw-link-arrow:hover svg { transform: translateX(3px); }

/* ============================================= Editor colour palette */

.has-gw-navy-color { color: var(--gw-navy); }
.has-gw-blue-color { color: var(--gw-blue); }
.has-gw-red-color { color: var(--gw-red); }
.has-gw-white-color { color: #fff; }

.has-gw-navy-background-color { background-color: var(--gw-navy); }
.has-gw-blue-background-color { background-color: var(--gw-blue); }
.has-gw-red-background-color { background-color: var(--gw-red); }
.has-gw-surface-alt-background-color { background-color: var(--gw-surface-alt); }
.has-gw-white-background-color { background-color: #fff; }
