/* =============================================================================
   AHD theme – main stylesheet. Plain CSS, no build step.
   Colours: #007de1 is the AHD brand blue (lines/accents). For text and buttons on white the darker
   blues are used, #007de1 itself is too light for text (contrast < 4.5:1).
   ============================================================================= */

:root {
	--blue: #007de1;
	--blue-text: #0062b0;
	--blue-dark: #004a85;
	--tint: #eef5fc;
	--line: #d5e3f1;
	--ink: #1f2a37;
	--ink-soft: #52606d;
	--footer: #1f2a37;
	--white: #ffffff;
	--error: #a4161a;

	--font: "PT Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--radius: 8px;
	--container: 1140px;
	--gutter: 24px;
	--section: clamp(48px, 7vw, 80px);
}

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

html { scroll-behavior: smooth; }

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

body {
	margin: 0;
	background: var(--white);
	color: var(--ink);
	font-family: var(--font);
	font-size: 18px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

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

a { color: var(--blue-text); font-weight: 700; text-underline-offset: 2px; }
a:hover { color: var(--blue-dark); }

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

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }

.container {
	width: 100%;
	max-width: calc(var(--container) + 2 * var(--gutter));
	margin: 0 auto;
	padding: 0 var(--gutter);
}

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

.skip-link {
	position: absolute;
	left: 16px;
	top: -60px;
	z-index: 100;
	padding: 10px 16px;
	background: var(--blue-dark);
	color: var(--white);
	border-radius: var(--radius);
}
.skip-link:focus { top: 12px; color: var(--white); }

.icon { flex: none; }

/* ---------- Buttons ---------- */
.button,
.wp-block-button__link,
.gform_wrapper .gform_button,
.gform_wrapper input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 10px 24px;
	border: 2px solid var(--blue-text);
	border-radius: 6px;
	background: var(--blue-text);
	color: var(--white);
	font: inherit;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}
.button:hover,
.wp-block-button__link:hover,
.gform_wrapper .gform_button:hover,
.gform_wrapper input[type="submit"]:hover {
	background: var(--blue-dark);
	border-color: var(--blue-dark);
	color: var(--white);
}
.button--outline { background: transparent; color: var(--blue-text); }
.button--outline:hover { background: var(--blue-text); color: var(--white); }
.button--light { background: var(--white); border-color: var(--white); color: var(--blue-dark); }
.button--light:hover { background: var(--tint); border-color: var(--tint); color: var(--blue-dark); }
.button--ghost { background: transparent; border-color: var(--white); color: var(--white); }
.button--ghost:hover { background: var(--white); border-color: var(--white); color: var(--blue-dark); }

/* ---------- Header ---------- */
.site-header {
	position: relative;
	z-index: 20;
	background: var(--white);
	border-bottom: 3px solid var(--blue);
}
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 84px;
}
.site-header__logo img { display: block; width: 250px; }
.site-header__toggle { display: none; }

.site-nav__list {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.site-nav__list a {
	display: block;
	padding: 6px 0;
	border-bottom: 2px solid transparent;
	color: var(--ink);
	font-size: 17px;
	text-decoration: none;
}
.site-nav__list a:hover { color: var(--blue-text); }
.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a,
.site-nav__list .current-page-ancestor > a,
.single-post .site-nav__list .current_page_parent > a {
	color: var(--blue-text);
	border-bottom-color: var(--blue);
}
.site-nav__list .sub-menu { display: none; }

@media (max-width: 900px) {
	.site-header__inner { min-height: 72px; }
	.site-header__logo img { width: 200px; }
	.site-header__toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 48px;
		height: 48px;
		border: 0;
		border-radius: var(--radius);
		background: transparent;
		color: var(--ink);
		cursor: pointer;
	}
	.site-header__toggle-close,
	.site-header__toggle[aria-expanded="true"] .site-header__toggle-open { display: none; }
	.site-header__toggle[aria-expanded="true"] .site-header__toggle-close { display: inline-flex; }

	.site-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--white);
		border-bottom: 3px solid var(--blue);
		box-shadow: 0 12px 24px rgba(0, 0, 0, .08);
	}
	.site-nav.is-open { display: block; }
	.site-nav__list { flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; }
	.site-nav__list a { padding: 12px 0; border-bottom: 1px solid var(--line); }
	.site-nav__list li:last-child a { border-bottom: 0; }
	.site-nav__list .current-menu-item > a,
	.site-nav__list .current_page_item > a { border-bottom-color: var(--line); }
}

/* ---------- Notice bar ---------- */
.notice-bar { background: var(--tint); border-bottom: 1px solid var(--line); }
.notice-bar__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 12px;
	padding-bottom: 12px;
	color: var(--blue-dark);
}
.notice-bar__text p { margin: 0; }

/* ---------- Hero and page banner ---------- */
.hero,
.page-banner {
	background-color: var(--blue-dark);
	background-image: linear-gradient(rgba(0, 40, 80, .58), rgba(0, 40, 80, .58)), var(--banner, none);
	background-size: cover;
	background-position: center;
	color: var(--white);
}
.hero__inner { padding-top: clamp(64px, 10vw, 104px); padding-bottom: clamp(64px, 10vw, 104px); }
.hero__title { max-width: 780px; margin: 0 0 16px; font-size: clamp(34px, 5vw, 50px); }
.hero__text { max-width: 680px; margin: 0; font-size: clamp(18px, 2vw, 21px); }
.hero__buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.page-banner__inner { padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(40px, 6vw, 64px); }
.page-banner__title { margin: 0; font-size: clamp(30px, 4.5vw, 44px); }
.page-banner__meta { margin: 8px 0 0; font-size: 17px; }

/* ---------- Sections (home) ---------- */
.section { padding: var(--section) 0; }
.section--tint { background: var(--tint); }
.section__head { max-width: 760px; margin-bottom: 32px; }
.section__more { margin: 32px 0 0; }
.section__row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 28px;
}
.section__title { margin: 0; }

.split {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	gap: 48px;
	align-items: center;
}
.framed-photo {
	display: block;
	width: 100%;
	border: 3px solid var(--blue);
	border-radius: var(--radius);
}

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 28px;
	background: var(--white);
	border-top: 4px solid var(--blue);
	border-radius: var(--radius);
}
.card__icon { color: var(--blue-text); }
.card__title { margin: 0; font-size: 21px; }

.info { display: grid; gap: 48px; }
.info--image { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.info__columns {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 40px;
}
@media (max-width: 900px) {
	.info__columns { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
.info--image .info__columns { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.info__col h2 { font-size: 26px; }

.contact-band { background: var(--blue-dark); color: var(--white); }
.contact-band__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
	gap: 40px;
	align-items: center;
	padding-top: 56px;
	padding-bottom: 56px;
}
.contact-band__offices {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 24px;
}
.contact-band__office h3 { font-size: 20px; margin-bottom: 8px; }
.contact-band a { color: var(--white); }
.contact-band .icon { color: #9ccbf3; }

@media (max-width: 900px) {
	.split,
	.info--image,
	.contact-band__inner { grid-template-columns: minmax(0, 1fr); }
	.split { gap: 32px; }
}

/* ---------- News ---------- */
.news-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 24px;
}
.news-list { display: flex; flex-direction: column; gap: 24px; }
.news-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 24px 28px;
	border: 1px solid var(--line);
	border-top: 4px solid var(--blue);
	border-radius: var(--radius);
	background: var(--white);
	scroll-margin-top: 24px;
}
.news-card:target { box-shadow: 0 0 0 3px var(--blue); }
.news-card__date { color: var(--ink-soft); font-size: 15px; }
.news-card__title { margin: 0; font-size: 22px; }
.news-card__title a { color: var(--ink); text-decoration: none; }
.news-card__title a:hover { color: var(--blue-text); text-decoration: underline; }
.news-card__text { font-size: 17px; }
.news-card__text > :first-child { margin-top: 0; }
.news-card__text > :last-child { margin-bottom: 0; }
.news-card__text img { border-radius: var(--radius); }
.news-card__more { margin: 8px 0 0; }
.news-grid .news-card__more { margin-top: auto; padding-top: 8px; }

.navigation.pagination { margin-top: 40px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--line);
	border-radius: 6px;
	text-decoration: none;
}
.page-numbers.current { background: var(--blue-text); border-color: var(--blue-text); color: var(--white); }

.back-link { margin-top: 40px; }
.back-link a { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Page layout ---------- */
.page-layout { padding-top: var(--section); padding-bottom: var(--section); }
.page-layout__main { max-width: 760px; min-width: 0; }
.page-layout--side {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
	gap: 56px;
	align-items: start;
}
.page-layout--side .page-layout__main { max-width: none; }

.side-box {
	padding: 28px;
	background: var(--tint);
	border-top: 4px solid var(--blue);
	border-radius: var(--radius);
}
.side-box__title { font-size: 24px; color: var(--blue-dark); }
.side-box__text > :last-child { margin-bottom: 0; }
.side-box__text + .side-box__form { margin-top: 20px; }

@media (max-width: 900px) {
	.page-layout--side { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

.offices {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
	margin-top: 24px;
}
.office-card {
	padding: 24px;
	border: 1px solid var(--line);
	border-top: 4px solid var(--blue);
	border-radius: var(--radius);
}
.office-card__title { font-size: 22px; }

.office-lines { margin: 0; padding: 0; list-style: none; }
.office-lines li { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 6px; }
.office-lines .icon { margin-top: 4px; color: var(--blue-text); }
.office-lines a { font-weight: 400; }
.office-villages { margin: 12px 0 0; }

/* ---------- Prose (block content) ---------- */
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { margin-top: 1.6em; font-size: clamp(26px, 3vw, 32px); color: var(--blue-dark); }
.prose h3 { margin-top: 1.4em; font-size: 22px; }
.prose h2 + h3 { margin-top: .6em; }
.prose p,
.prose ul,
.prose ol { margin: 0 0 1em; }
.prose ul,
.prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .3em; }
.prose li::marker { color: var(--blue-text); }
.prose--light h2 { color: var(--white); }
.prose--light a { color: var(--white); }

.prose figure { margin: 1.5em 0; }
.prose figcaption,
.prose .wp-element-caption { margin-top: 8px; color: var(--ink-soft); font-size: 15px; }
.prose img { border-radius: var(--radius); }
.prose .alignright { float: right; margin: .3em 0 1em 1.5em; max-width: 45%; }
.prose .alignleft { float: left; margin: .3em 1.5em 1em 0; max-width: 45%; }
.prose .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.prose::after { content: ""; display: table; clear: both; }
.prose h2,
.prose h3 { clear: both; }

@media (max-width: 600px) {
	.prose .alignright,
	.prose .alignleft { float: none; max-width: 100%; margin: 1em 0; }
}

.prose .wp-block-gallery,
.prose .gallery,
.news-card__text .wp-block-gallery,
.news-card__text .gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
	margin: 1.5em 0;
}
.prose .gallery-item,
.news-card__text .gallery-item { margin: 0; }
.prose .gallery-item img,
.prose .wp-block-gallery img,
.news-card__text .gallery-item img,
.news-card__text .wp-block-gallery img { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.prose .gallery br,
.news-card__text .gallery br { display: none; }
.news-card__text a[data-lightbox] { cursor: zoom-in; }

.prose a[data-lightbox] { cursor: zoom-in; }

.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.5em 0; }
.wp-block-separator { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* ---------- Search form ---------- */
.search-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.search-form label { flex: 1 1 260px; }
.search-form .search-field { width: 100%; }
.search-form .search-submit { min-height: 48px; }
.search-results { margin: 0; padding: 0; list-style: none; }
.search-result { padding: 20px 0; border-bottom: 1px solid var(--line); }
.search-result__title { font-size: 22px; margin-bottom: 4px; }

/* ---------- Forms (Gravity Forms CSS is off: gform_disable_css) ---------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="number"],
select,
textarea {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid #8aa1b8;
	border-radius: 6px;
	background: var(--white);
	color: var(--ink);
	font: inherit;
	font-size: 17px;
}
textarea { min-height: 140px; resize: vertical; }
input:focus,
select:focus,
textarea:focus { outline: 3px solid var(--blue); outline-offset: 0; border-color: var(--blue); }

.gform_wrapper .gform_fields {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 18px;
	margin: 0;
	padding: 0;
	border: 0;
}
.gform_wrapper .gfield { margin: 0; padding: 0; border: 0; min-width: 0; }
.gform_wrapper .gfield_label,
.gform_wrapper legend.gfield_label {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	font-size: 16px;
	font-weight: 700;
}
.gform_wrapper .gfield_required { margin-left: 4px; color: var(--error); font-weight: 400; }
.gform_wrapper .gfield_description { margin-top: 6px; color: var(--ink-soft); font-size: 15px; }
.gform_wrapper .gfield_radio,
.gform_wrapper .gfield_checkbox { display: flex; flex-direction: column; gap: 8px; }
.gform_wrapper .gchoice { display: flex; align-items: center; gap: 10px; }
.gform_wrapper .gchoice input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue-text); }
.gform_wrapper .gchoice label { font-weight: 400; }
.gform_wrapper .gform_footer { margin-top: 22px; }
.gform_wrapper .validation_message {
	margin-top: 6px;
	color: var(--error);
	font-size: 15px;
	font-weight: 700;
}
.gform_confirmation_message {
	padding: 16px 20px;
	background: var(--white);
	border-left: 4px solid var(--blue);
	border-radius: var(--radius);
}

/* Gravity Forms – functional safety net (GF 3.2): the rules GF needs to hide or run elements, which disappear with
   its stylesheet. Compare with basic.min.css / theme foundation after a GF update. */
.gform_wrapper .gform_validation_container { display: none !important; } /* honeypot */
.gform_wrapper .gform_hidden,
.gform_wrapper .gf_hidden,
.gform_wrapper .gf_step_hidden { display: none; }
.gform_wrapper .gf_invisible,
.gform_wrapper .gfield_visibility_hidden,
.gform_wrapper .gfield_visibility_administrative { position: absolute; left: -9999px; visibility: hidden; }
.gform_wrapper .validation_message--hidden-on-empty:empty { display: none; }
.gform_wrapper .screen-reader-text,
.gform_wrapper .hidden_label > .gfield_label,
.gform_wrapper .hidden_sub_label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	border: 0;
	word-wrap: normal !important;
}
.gform_wrapper button.screen-reader-text:focus { position: static !important; width: auto; height: auto; margin: 0; clip: auto; clip-path: none; }
.gform_wrapper .gform_validation_errors {
	margin-bottom: 20px;
	padding: 14px 18px;
	background: #fbe9ea;
	color: var(--error);
	border-radius: var(--radius);
}
.gform_wrapper .gform_validation_errors:focus,
.gform_confirmation_wrapper:focus,
.gform_wrapper:focus { outline: none; }
.gform_wrapper .gform_submission_error { margin: 0; font-size: 17px; }
.gform_wrapper .gform_validation_errors ol { margin: 8px 0 0; padding-left: 20px; font-size: 15px; }
.gform_wrapper .gform_validation_error_link { color: inherit; }
.gform_wrapper .gform-icon { display: none; }
.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error textarea,
.gform_wrapper .gfield_error select { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.gform_anchor,
.gform_wrapper .gform_validation_errors,
.gform_confirmation_wrapper { scroll-margin-top: 24px; }
.gform_wrapper .gform-has-spinner { position: relative; color: transparent !important; pointer-events: none; }
.gform_wrapper .gform-loader,
.gform_wrapper .gform_ajax_spinner {
	position: absolute;
	inset: 0;
	width: 20px;
	height: 20px;
	margin: auto;
	border: 2px solid rgba(255, 255, 255, .35);
	border-top-color: var(--white);
	border-radius: 50%;
	animation: ahd-spin .8s linear infinite;
}
@keyframes ahd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.gform_wrapper .gform-loader { animation-duration: 2.4s; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--footer); color: #d9e2ec; font-size: 16px; }
.site-footer__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr);
	gap: 32px;
	padding-top: 56px;
	padding-bottom: 48px;
}
.site-footer__brand img { display: block; width: 220px; margin-bottom: 12px; }
.site-footer__brand p { margin: 0; }
.site-footer__title { margin: 0 0 10px; color: var(--white); font-size: 18px; }
.site-footer a { color: var(--white); font-weight: 400; }
.site-footer .icon { color: #9ccbf3; }
.site-footer__list { margin: 0; padding: 0; list-style: none; }
.site-footer__list li { margin-bottom: 6px; }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .15); }
.site-footer__bottom .container { padding-top: 18px; padding-bottom: 18px; font-size: 15px; }

@media (max-width: 900px) {
	.site-footer__grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

/* ---------- Lightbox ---------- */
.lightbox {
	width: 100vw;
	max-width: 100vw;
	height: 100vh;
	max-height: 100vh;
	height: 100dvh;
	max-height: 100dvh;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(10, 18, 28, .94);
	color: var(--white);
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	max-width: calc(100vw - 140px);
	margin: 0;
}
.lightbox__img {
	display: block;
	max-width: 100%;
	max-height: calc(100dvh - 120px);
	object-fit: contain;
	border-radius: 4px;
}
.lightbox__caption { font-size: 16px; text-align: center; }
.lightbox__caption:empty { display: none; }
.lightbox__btn {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: var(--white);
	cursor: pointer;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .25); }
.lightbox__btn[hidden] { display: none; }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; left: 0; right: 0; bottom: 12px; margin: 0; font-size: 15px; text-align: center; }
.lightbox__count:empty { display: none; }

@media (max-width: 600px) {
	.lightbox__figure { max-width: 100vw; }
	.lightbox__prev,
	.lightbox__next { top: auto; bottom: 16px; transform: none; }
	.lightbox__img { max-height: calc(100dvh - 160px); }
}

body.lightbox-open { overflow: hidden; }
