/*
 * Ad+genuity theme CSS: only what theme.json cannot express.
 * Loaded on the front end (inlined) and in the editor.
 */

/* ---------- Base ---------- */
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
.adg-main > .wp-block-post-content > :first-child { margin-block-start: 0; }
.adg-main > .wp-block-post-content > .alignfull:last-child { margin-block-end: 0; }
:where(h1, h2, h3, h4) { text-wrap: balance; }
:where(p, li) { text-wrap: pretty; }
img { height: auto; }
::selection { background: #5bc8db; color: #191a55; }
:focus-visible { outline: 2px solid #191a55; outline-offset: 2px; }
.adg-section.is-dark :focus-visible, .adg-footer :focus-visible, .is-style-panel-indigo :focus-visible { outline-color: #5bc8db; }
.screen-reader-text:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Skip link */
.skip-link.screen-reader-text:focus { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 12px 16px; background: #fff; color: #191a55; }

/* ---------- Header ---------- */
.adg-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: #fff;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}
.admin-bar .adg-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .adg-header { top: 0; } }
.adg-header__inner { min-height: var(--wp--custom--header-height, 80px); gap: 1.5rem; }
.adg-header__logo img { display: block; width: 112px; height: auto; }
.adg-header__nav .wp-block-navigation-item__content { color: #191a55; padding-block: 0.5rem; text-decoration: none; }
.adg-header__nav .wp-block-navigation-item__content:hover,
.adg-header__nav .current-menu-item > .wp-block-navigation-item__content,
.adg-header__nav [aria-current="page"] { color: #1b6fae; }
.adg-header__nav .wp-block-navigation__container { gap: 1.5rem; }
@media (max-width: 781px) {
	.adg-header__nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.adg-header__nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
/* Mobile menu: branded overlay */
.adg-header__nav .wp-block-navigation__responsive-container.is-menu-open {
	background: #221e54 !important;
	color: #fff !important;
	padding: 1.5rem clamp(1rem, 6vw, 2.5rem);
}
.adg-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { align-items: flex-start; }
.adg-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { align-items: flex-start; gap: 1.5rem; font-size: 1.5rem; font-family: var(--wp--preset--font-family--poppins); font-weight: 600; padding-top: 3rem; }
.adg-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { color: #fff; }
.adg-header__nav .wp-block-navigation__responsive-container.is-menu-open [aria-current="page"] { color: #5bc8db; }
.adg-header__nav .wp-block-navigation__responsive-container-close { color: #fff; }

/* ---------- Buttons ---------- */
.wp-block-button__link { transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.wp-block-button__link::before { content: "› "; }
.wp-block-button__link:hover { transform: translateY(-1px); }

.wp-block-button.is-style-teal .wp-block-button__link {
	background: #5bc8db;
	color: #191a55;
}
.wp-block-button.is-style-teal .wp-block-button__link:hover,
.wp-block-button.is-style-teal .wp-block-button__link:focus { background: #58c2ae; color: #191a55; }

.wp-block-button.is-style-white-pill .wp-block-button__link {
	background: #fff;
	color: #221e54;
	border-radius: 30px;
	padding: 0.9rem 2.2rem;
	font-size: 1rem;
	font-weight: 600;
	text-transform: none;
}
.wp-block-button.is-style-white-pill .wp-block-button__link::before { content: none; }
.wp-block-button.is-style-white-pill .wp-block-button__link:hover,
.wp-block-button.is-style-white-pill .wp-block-button__link:focus { background: #221e54; color: #fff; }

.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: currentColor;
	box-shadow: inset 0 0 0 2px currentColor;
}

/* ---------- Text styles ---------- */
p.is-style-eyebrow {
	font-size: clamp(0.875rem, 1.8vw, 1.5rem);
	font-weight: 700;
	letter-spacing: clamp(3px, 0.7vw, 10px);
	text-transform: uppercase;
	line-height: 1.6;
	margin-bottom: 0;
}
p.is-style-lead { font-size: var(--wp--preset--font-size--large); line-height: 1.5; }

ul.is-style-checks { list-style: none; padding-left: 0; }
ul.is-style-checks li { position: relative; padding-left: 1.75em; }
ul.is-style-checks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.35em;
	width: 1em;
	height: 1em;
	border-radius: 50%;
	background: #58c2ae url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23191a55' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/62% no-repeat;
}
.wp-block-list li + li { margin-top: 0.25em; }

/* ---------- Panels ---------- */
.wp-block-group.is-style-panel-indigo {
	background: #221e54;
	color: #fff;
	border-radius: 12px;
	padding: clamp(1.25rem, 3vw, 2rem);
	box-shadow: 0 2px 70px rgba(110, 130, 208, 0.18);
}
.wp-block-group.is-style-panel-indigo :where(h1, h2, h3, h4) { color: inherit; }
.wp-block-group.is-style-panel-white {
	background: #fff;
	color: #191a55;
	border-radius: 12px;
	padding: clamp(1.25rem, 3vw, 2rem);
	box-shadow: 0 2px 70px rgba(110, 130, 208, 0.18);
}

.wp-block-image.is-style-corner img { border-radius: 0 30px 0 0; }

/* Sections: links stay readable on dark backgrounds. */
.adg-section.is-dark a:where(:not(.wp-block-button__link)) { color: inherit; }

/* Columns: cards fill the column height */
.wp-block-column > .adg-card:only-child,
.wp-block-column > .adg-person:only-child { height: 100%; }

/* Card rows (class adg-cards-2up on Columns): never squeeze cards. Last row is centred.
 *  - 4 cards: 2x2 below 1100px.   - 5 cards: 3 + 2 below 1100px.   - 3 cards: stay in one row down to 481px.
 *  - Phones (<=600px): one per row. */
.wp-block-columns.adg-cards-2up { justify-content: center; }
@media (max-width: 1100px) {
	.wp-block-columns.adg-cards-2up:not(.is-not-stacked-on-mobile) { flex-wrap: wrap !important; }
	.wp-block-columns.adg-cards-2up:has(> .wp-block-column:nth-child(4)) > .wp-block-column { flex-basis: calc(50% - 1.5rem) !important; flex-grow: 0 !important; }
	.wp-block-columns.adg-cards-2up:has(> .wp-block-column:nth-child(5)) > .wp-block-column { flex-basis: calc(33.333% - 1.5rem) !important; flex-grow: 0 !important; }
}
@media (min-width: 601px) and (max-width: 781px) {
	.wp-block-columns.adg-cards-2up:not(:has(> .wp-block-column:nth-child(4))) { flex-wrap: nowrap !important; }
	.wp-block-columns.adg-cards-2up:not(:has(> .wp-block-column:nth-child(4))) > .wp-block-column { flex-basis: 0 !important; flex-grow: 1 !important; }
	.wp-block-columns.adg-cards-2up:has(> .wp-block-column:nth-child(5)) > .wp-block-column { flex-basis: calc(50% - 1.5rem) !important; }
}
/* Phones: always one card per row. The doubled class + :has() out-ranks the tablet rules above. */
@media (max-width: 600px) {
	.wp-block-columns.adg-cards-2up.adg-cards-2up:has(> .wp-block-column) > .wp-block-column { flex-basis: 100% !important; flex-grow: 1 !important; }
}

/* Tables */
.wp-block-table table { font-size: 0.9375rem; }
.wp-block-table th { background: #221e54; color: #fff; text-align: left; }
.wp-block-table td:first-child { font-weight: 600; width: 32%; }
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: #f4f4f6; }
@media (max-width: 600px) { .wp-block-table { overflow-x: auto; } .wp-block-table table { min-width: 520px; } }

/* Narrow centred panel (e.g. Join Us) */
.adg-narrow { max-width: 760px !important; margin-inline: auto !important; }

/* ---------- Posts ---------- */
.adg-post-meta { gap: 0.5rem 1rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: #6b5bd6; }
.adg-post-meta a { color: inherit; text-decoration: none; }
.adg-post-card { height: 100%; }
.adg-post-card .wp-block-post-title { font-size: 1.25rem; }
.adg-post-card .wp-block-post-title a { text-decoration: none; }
.adg-post-card .wp-block-post-excerpt { font-size: 0.9375rem; }
.wp-block-post-navigation-link { margin-top: 1rem; }

/* ---------- Footer ---------- */
.adg-footer { background: #201c51; color: #fff; }
.adg-footer a { color: #fff; text-decoration: none; }
.adg-footer a:hover, .adg-footer a:focus { text-decoration: underline; }
.adg-footer h2 { color: #fff; font-size: 1.125rem; margin: 0 0 0.75rem; }
.adg-footer .adg-footer__links { list-style: none; padding: 0; margin: 0; font-size: 1rem; line-height: 2; }
.adg-footer .adg-footer__legal { font-size: 0.8125rem; opacity: 0.85; }
.adg-footer .adg-footer__legal a { margin-right: 1rem; white-space: nowrap; display: inline-block; min-height: 24px; padding-block: 0.25rem; line-height: 1.5; }
.adg-footer .wp-block-social-links .wp-social-link { background: #0a66c2; color: #fff; border-radius: 4px; }

/* ---------- Gravity Forms (colours come from the gform_default_styles filter in functions.php) ---------- */
.gform-theme--framework { --gf-font-family-base: var(--wp--preset--font-family--poppins); --gf-ctrl-label-font-weight-primary: 600; }
.gform-theme--framework .gform_footer .gform_button,
.gform-theme--framework .gform_footer input[type="submit"],
.gform-theme--framework .gform-button {
	border-radius: 12px !important;
	padding-inline: 1.75rem !important;
	font-weight: 500 !important;
	text-transform: uppercase;
	letter-spacing: 2px;
	box-shadow: 0 20px 30px -10px rgba(110, 130, 208, 0.14);
}
.adg-section.is-dark .gform-theme--framework {
	--gf-ctrl-label-color-primary: #fff;
	--gf-ctrl-label-color-secondary: #fff;
}

/* Newsletter inline form */
.adg-newsletter .gform_wrapper { max-width: 640px; margin-inline: auto; }

/* ---------- Editor tweaks ---------- */
.editor-styles-wrapper .adg-header { position: relative; }
