/*
Theme Name: Aaron F. Stone
Description: Lightweight single-card theme for contact.aaronst.one. No jQuery or icon fonts; the G.I. typeface is self-hosted.
Author: Aaron F. Stone
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: aaronstone
*/

/* ------------------------------------------------------------------
   G.I. typeface (assets/fonts). It comes in 400, 530 and 750 only,
   so the rest of this file uses those weights.
------------------------------------------------------------------ */
@font-face {
	font-family: "G.I.";
	src: url("assets/fonts/gi-400.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "G.I.";
	src: url("assets/fonts/gi-400-italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "G.I.";
	src: url("assets/fonts/gi-530.woff2") format("woff2");
	font-weight: 530;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "G.I.";
	src: url("assets/fonts/gi-530-italic.woff2") format("woff2");
	font-weight: 530;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "G.I.";
	src: url("assets/fonts/gi-750.woff2") format("woff2");
	font-weight: 750;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "G.I.";
	src: url("assets/fonts/gi-750-italic.woff2") format("woff2");
	font-weight: 750;
	font-style: italic;
	font-display: swap;
}

/* ------------------------------------------------------------------
   Tokens
------------------------------------------------------------------ */
:root {
	--navy: #002254;
	--navy-deep: #061631;
	--navy-soft: #0d3470;
	--accent: #1f6feb;
	--accent-ring: rgba(31, 111, 235, 0.2);
	--ink: #0f1b2d;
	--muted: #5b6678;
	--line: #d6dce6;
	--field: #f7f9fc;
	--surface: #fff;
	--page: #eef2f7;
	--danger: #c62828;
	--radius: 18px;
	--radius-sm: 10px;
	--shadow: 0 1px 2px rgba(6, 22, 49, 0.06), 0 24px 48px -24px rgba(6, 22, 49, 0.35);
	--font: "G.I.", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--weight-medium: 530;
	--weight-bold: 750;
}

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

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

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--page);
	color: var(--ink);
	font-family: var(--font);
	font-size: 1rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
strong,
b {
	font-weight: var(--weight-bold);
}

img,
svg {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--accent);
	text-underline-offset: 0.18em;
}

a:hover {
	text-decoration-thickness: 2px;
}

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

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

.skip-link:focus {
	clip: auto;
	clip-path: none;
	width: auto;
	height: auto;
	z-index: 100;
	top: 12px;
	left: 12px;
	padding: 10px 16px;
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--ink);
	font-weight: var(--weight-medium);
	box-shadow: var(--shadow);
}

/* ------------------------------------------------------------------
   Header / hero
------------------------------------------------------------------ */
.site-header {
	position: relative;
	isolation: isolate;
	padding: 64px 24px 156px;
	background: var(--navy) var(--hero-image, none) center 65% / cover no-repeat;
	color: #fff;
	text-align: center;
}

.site-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(0, 34, 84, 0.55) 0%, rgba(6, 22, 49, 0.35) 45%, rgba(6, 22, 49, 0.9) 100%);
}

.custom-logo {
	display: block;
	width: 88px;
	height: 88px;
	margin: 0 auto;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9), 0 12px 32px rgba(0, 0, 0, 0.35);
}

.site-title {
	margin: 18px 0 0;
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	font-weight: var(--weight-bold);
	line-height: 1.15;
	letter-spacing: -0.02em;
	text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.site-description {
	max-width: 36em;
	margin: 8px auto 0;
	color: rgba(255, 255, 255, 0.82);
	font-size: 1.05rem;
}

/* ------------------------------------------------------------------
   Content card
------------------------------------------------------------------ */
.site-main {
	position: relative;
	flex: 1;
	width: 100%;
	max-width: 980px;
	margin: -112px auto 0;
	padding: 0 16px;
}

.card {
	background: var(--surface);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: clamp(24px, 5vw, 48px);
}

.card + .card {
	margin-top: 20px;
}

.entry-title {
	margin: 0 0 0.75em;
	font-size: clamp(1.5rem, 3vw, 1.9rem);
	line-height: 1.2;
	letter-spacing: -0.015em;
}

.entry-title a {
	color: inherit;
	text-decoration: none;
}

.entry-content > :first-child {
	margin-top: 0;
}

.entry-content > :last-child {
	margin-bottom: 0;
}

.entry-content h2 {
	margin: 2em 0 0.5em;
	font-size: 1.25rem;
	line-height: 1.3;
}

.entry-content h3 {
	margin: 1.6em 0 0.4em;
	font-size: 1.05rem;
}

.entry-content h4 {
	margin: 1.4em 0 0.3em;
	font-size: 0.95rem;
}

.entry-content p,
.entry-content ul,
.entry-content ol {
	margin: 0 0 1em;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.3em;
}

.entry-content li + li {
	margin-top: 0.3em;
}

/* ------------------------------------------------------------------
   Forms (generic, so any form plugin or a hand-built form looks right)
------------------------------------------------------------------ */
.entry-content label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.9rem;
	font-weight: var(--weight-medium);
}

.entry-content input[type="text"],
.entry-content input[type="email"],
.entry-content input[type="tel"],
.entry-content input[type="url"],
.entry-content input[type="number"],
.entry-content select,
.entry-content textarea {
	width: 100%;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--field);
	color: var(--ink);
	font: inherit;
	transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.entry-content select {
	appearance: none;
	padding-right: 2.5rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235b6678' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.95rem center;
	cursor: pointer;
}

.entry-content textarea {
	min-height: 160px;
	resize: vertical;
}

.entry-content input:hover,
.entry-content select:hover,
.entry-content textarea:hover {
	border-color: #b9c2d0;
}

.entry-content input:focus,
.entry-content select:focus,
.entry-content textarea:focus {
	outline: none;
	border-color: var(--accent);
	background-color: var(--surface);
	box-shadow: 0 0 0 4px var(--accent-ring);
}

.entry-content input[type="submit"],
.entry-content button[type="submit"] {
	padding: 0.8rem 1.8rem;
	border: 0;
	border-radius: var(--radius-sm);
	background: var(--navy);
	color: #fff;
	font: inherit;
	font-weight: var(--weight-medium);
	cursor: pointer;
	transition: background-color 0.15s, transform 0.15s;
}

.entry-content input[type="submit"]:hover,
.entry-content button[type="submit"]:hover {
	background: var(--navy-soft);
}

.entry-content input[type="submit"]:active,
.entry-content button[type="submit"]:active {
	transform: translateY(1px);
}

/* ------------------------------------------------------------------
   Contact Form 7 (+ "Builder for CF7" layout markup)
------------------------------------------------------------------ */
.wpcf7 p {
	margin: 0;
}

.cf7b-section {
	display: grid;
	gap: 1.15rem 1.25rem;
}

.cf7b-col,
.cf7b-row {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: 100%;
}

@media (min-width: 640px) {
	.cf7b-section {
		grid-template-columns: 1fr 1fr;
	}

	/* Name, email, phone and the yes/no question pair up; subject, message and send go full width. */
	.cf7b-col:nth-child(n + 5) {
		grid-column: 1 / -1;
	}
}

.wpcf7 [class*="cf7b-label-"] {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.9rem;
	font-weight: var(--weight-medium);
	line-height: 1.35;
}

.wpcf7 .cf7b-required::after {
	content: "\00a0*"; /* Non-breaking space keeps the asterisk on the label's last line. */
	color: var(--accent);
}

.wpcf7 [class*="cf7b-label-cf7b-random"] {
	display: none;
}

/* hCaptcha + Send button row */
.wpcf7 [class*="cf7b-group-cf7b-random"] > p {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	margin-top: 0.35rem;
}

.wpcf7 span[data-name="hcap-cf7"] ~ input[type="submit"] {
	order: 2;
	margin-top: 0;
}

.wpcf7 .h-captcha {
	margin-bottom: 0;
}

/* Spinner sits just left of Send, so Send stays flush right. */
.wpcf7 .wpcf7-spinner {
	order: 1;
	margin: 0 0 0 auto;
}

/* Pixsy note that follows the fields */
.wpcf7 .cf7b-content ~ p:not(.akismet-fields-container) {
	margin-top: 1.75rem;
	padding: 0.9rem 1.1rem;
	border-left: 3px solid var(--navy);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	background: var(--page);
	color: var(--muted);
	font-size: 0.875rem;
	line-height: 1.55;
}

.wpcf7-not-valid-tip {
	margin-top: 0.35rem;
	color: var(--danger);
	font-size: 0.85rem;
	font-weight: var(--weight-medium);
}

.entry-content .wpcf7-not-valid {
	border-color: var(--danger);
}

.wpcf7 form .wpcf7-response-output {
	margin: 1.25rem 0 0;
	padding: 0.85rem 1.1rem;
	border: 1px solid #f0c36d;
	border-radius: var(--radius-sm);
	background: #fff8e6;
	color: #6b4a00;
	font-size: 0.95rem;
}

.wpcf7 form.sent .wpcf7-response-output {
	border-color: #7fd1a4;
	background: #ecfbf2;
	color: #0b5d33;
}

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output {
	border-color: #f1a7a7;
	background: #fdeeee;
	color: #8a1c1c;
}

@media (max-width: 479px) {
	.entry-content input[type="submit"],
	.entry-content button[type="submit"] {
		width: 100%;
	}
}

/* Leave room for the 302px-wide hCaptcha box on small phones. */
@media (max-width: 400px) {
	.site-main {
		padding: 0 12px;
	}

	.card {
		padding: 22px 16px;
	}
}

/* ------------------------------------------------------------------
   Privacy Policy modal
------------------------------------------------------------------ */
.modal {
	width: min(720px, calc(100% - 32px));
	max-height: min(85vh, 860px);
	padding: 0;
	border: 0;
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--ink);
	box-shadow: 0 32px 64px -24px rgba(6, 22, 49, 0.55);
}

.modal[open] {
	display: flex;
	flex-direction: column;
}

.modal::backdrop {
	background: rgba(6, 22, 49, 0.6);
	backdrop-filter: blur(3px);
}

.modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 20px 16px 32px;
	border-bottom: 1px solid var(--line);
}

.modal__title {
	margin: 0;
	font-size: 1.25rem;
	letter-spacing: -0.01em;
}

.modal__header form {
	margin: 0;
}

.modal__close {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--page);
	color: var(--ink);
	cursor: pointer;
	transition: background-color 0.15s;
}

.modal__close:hover {
	background: var(--line);
}

.modal__body {
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 24px 32px 32px;
	font-size: 0.95rem;
}

/* Keep the page behind the modal from scrolling. */
body:has(.modal[open]) {
	overflow: hidden;
}

@media (max-width: 479px) {
	.modal__header {
		padding: 14px 14px 12px 20px;
	}

	.modal__body {
		padding: 20px;
	}
}

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------ */
.site-footer {
	margin-top: 72px;
	padding: 40px 24px 36px;
	background: var(--navy-deep);
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.9rem;
	text-align: center;
}

.social-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
}

.social-links a {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	transition: background-color 0.15s, transform 0.15s;
}

.social-links a:hover {
	background: var(--accent);
	transform: translateY(-2px);
}

.social-links svg {
	width: 20px;
	height: 20px;
}

.footer-widgets p {
	margin: 0.35em 0;
}

.footer-widgets strong {
	color: #fff;
	font-weight: var(--weight-medium);
}

.footer-widgets a {
	color: #fff;
}

.footer-widgets .widget-title {
	margin: 0 0 0.5em;
	color: #fff;
	font-size: 1rem;
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}
