/*
 * LGofA 2026 — main stylesheet.
 *
 * Mobile-first. Color, type and spacing come from theme.json as
 * --wp--preset--* custom properties; nothing here hardcodes a brand hex.
 */

/* ---------------------------------------------------------------- tokens */

:root {
	--lg-primary: var(--wp--preset--color--primary, #2a5c2a);
	--lg-primary-dark: var(--wp--preset--color--primary-dark, #245024);
	--lg-secondary: var(--wp--preset--color--secondary, #2c5935);
	--lg-charcoal: var(--wp--preset--color--charcoal, #413c36);
	--lg-ink: var(--wp--preset--color--ink, #212121);
	--lg-white: var(--wp--preset--color--white, #ffffff);
	--lg-bone: var(--wp--preset--color--bone, #f6f5f1);
	--lg-mist: var(--wp--preset--color--mist, #e9efe8);
	--lg-rule: var(--wp--preset--color--rule, #d8d6d0);

	--lg-wrap: 1180px;
	--lg-gutter: var(--wp--preset--spacing--30, 1.25rem);
	--lg-section: var(--wp--preset--spacing--50, 3rem);

	--lg-radius: 4px;
	--lg-shadow: 0 1px 2px rgb(33 33 33 / 6%), 0 6px 20px rgb(33 33 33 / 6%);
	--lg-focus: 2px solid var(--lg-primary);
}

/* ------------------------------------------------------------- baseline */

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

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

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

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

body {
	margin: 0;
	background: var(--lg-white);
	color: var(--lg-ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium, 1.0625rem);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

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

img {
	display: block;
}

a {
	color: var(--lg-primary);
}

a:hover,
a:focus {
	color: var(--lg-primary-dark);
}

:focus-visible {
	outline: var(--lg-focus);
	outline-offset: 2px;
}

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

.skip-link:focus {
	position: fixed !important;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 1000;
	width: auto;
	height: auto;
	padding: 0.75rem 1rem;
	clip-path: none;
	background: var(--lg-white);
	color: var(--lg-primary);
	box-shadow: var(--lg-shadow);
	border-radius: var(--lg-radius);
}

/* --------------------------------------------------------------- layout */

.wrap {
	width: 100%;
	max-width: var(--lg-wrap);
	margin-inline: auto;
	padding-inline: var(--lg-gutter);
}

.site-main {
	display: block;
	min-height: 40vh;
	padding-block: var(--lg-section);
}

/* Blocks inherit widths from theme.json, but the flow needs a container. */
.entry__content > *,
.entry__header,
.archive-header {
	width: 100%;
	max-width: var(--wp--style--global--content-size, 720px);
	margin-inline: auto;
	padding-inline: var(--lg-gutter);
}

.entry__content > .alignwide {
	max-width: var(--wp--style--global--wide-size, 1180px);
}

.entry__content > .alignfull {
	max-width: none;
	padding-inline: 0;
}

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

.site-header {
	border-bottom: 1px solid var(--lg-rule);
	background: var(--lg-white);
	position: sticky;
	top: 0;
	z-index: 100;
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--20, 0.875rem);
	padding-block: var(--wp--preset--spacing--20, 0.875rem);
}

.site-branding {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.site-branding .custom-logo {
	width: auto;
	max-height: 56px;
}

.site-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large, 1.25rem);
	line-height: 1.15;
}

.site-title a {
	color: var(--lg-primary);
	text-decoration: none;
}

.site-tagline {
	margin: 0;
	color: var(--lg-charcoal);
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Toggle — visible below the nav breakpoint only. */
.nav-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 0.9rem;
	border: 1px solid var(--lg-rule);
	border-radius: var(--lg-radius);
	background: var(--lg-white);
	color: var(--lg-charcoal);
	font: inherit;
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	cursor: pointer;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
	display: block;
	width: 18px;
	height: 2px;
	background: currentcolor;
	content: "";
}

.nav-toggle__bars {
	position: relative;
}

.nav-toggle__bars::before {
	position: absolute;
	top: -6px;
}

.nav-toggle__bars::after {
	position: absolute;
	top: 6px;
}

.primary-nav {
	flex-basis: 100%;
	display: none;
	padding-block: var(--wp--preset--spacing--20, 0.875rem);
	border-top: 1px solid var(--lg-rule);
}

.primary-nav.is-open {
	display: block;
}

.primary-nav__list {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-nav__list a {
	display: block;
	padding: 0.7rem 0.25rem;
	color: var(--lg-charcoal);
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	text-decoration: none;
	border-bottom: 1px solid var(--lg-rule);
}

.primary-nav__list a:hover,
.primary-nav__list a:focus {
	color: var(--lg-primary);
}

.primary-nav__list .current-menu-item > a,
.primary-nav__list .current_page_item > a {
	color: var(--lg-primary);
	font-weight: 600;
}

/* Sub-menus stay in flow on small screens. */
.primary-nav__list .sub-menu {
	margin: 0;
	padding-left: 1rem;
	list-style: none;
}

@media (min-width: 62em) {
	.nav-toggle {
		display: none;
	}

	.primary-nav {
		display: flex !important;
		flex-basis: auto;
		align-items: center;
		gap: var(--wp--preset--spacing--30, 1.25rem);
		padding-block: 0;
		border-top: 0;
	}

	.primary-nav__list {
		flex-direction: row;
		align-items: center;
		gap: var(--wp--preset--spacing--20, 0.875rem);
	}

	.primary-nav__list > li {
		position: relative;
	}

	.primary-nav__list a {
		padding: 0.4rem 0.1rem;
		border-bottom: 2px solid transparent;
	}

	.primary-nav__list .current-menu-item > a,
	.primary-nav__list .current_page_item > a {
		border-bottom-color: var(--lg-primary);
	}

	.primary-nav__list .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 10;
		min-width: 14rem;
		padding: 0.4rem 0.75rem;
		background: var(--lg-white);
		border: 1px solid var(--lg-rule);
		border-radius: var(--lg-radius);
		box-shadow: var(--lg-shadow);
		opacity: 0;
		visibility: hidden;
	}

	.primary-nav__list li:hover > .sub-menu,
	.primary-nav__list li:focus-within > .sub-menu {
		opacity: 1;
		visibility: visible;
	}
}

/* --------------------------------------------------------------- social */

.social {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.social__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	color: var(--lg-charcoal);
	text-decoration: none;
}

.social__link:hover,
.social__link:focus {
	background: var(--lg-mist);
	color: var(--lg-primary);
}

.social--footer .social__link {
	color: var(--lg-white);
}

.social--footer .social__link:hover,
.social--footer .social__link:focus {
	background: rgb(255 255 255 / 14%);
	color: var(--lg-white);
}

/* ------------------------------------------------------------- entries */

.entry__header {
	margin-bottom: var(--wp--preset--spacing--40, 2rem);
}

.entry__title {
	margin: 0 0 0.4em;
	color: var(--lg-primary);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--display, 3rem);
	line-height: 1.1;
}

.entry__kicker {
	margin: 0 0 0.6rem;
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.entry__kicker a {
	text-decoration: none;
}

.entry__standfirst {
	margin: 0;
	color: var(--lg-charcoal);
	font-size: var(--wp--preset--font-size--large, 1.25rem);
	line-height: 1.5;
}

.entry__meta {
	margin: 0;
	color: var(--lg-charcoal);
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
}

.entry__footer {
	margin-top: var(--lg-section);
	padding-top: var(--wp--preset--spacing--30, 1.25rem);
	border-top: 1px solid var(--lg-rule);
}

.page-banner img {
	width: 100%;
	max-height: 22rem;
	object-fit: cover;
}

@media (min-width: 48em) {
	.page-banner img {
		max-height: 30rem;
	}
}

/* ---------------------------------------------------------- pull quote */

.pull-quote {
	margin-block: var(--wp--preset--spacing--40, 2rem);
}

.pull-quote blockquote {
	margin: 0;
	padding-left: var(--wp--preset--spacing--30, 1.25rem);
	border-left: 3px solid var(--lg-primary);
	color: var(--lg-charcoal);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large, 1.75rem);
	line-height: 1.35;
}

.pull-quote blockquote p {
	margin: 0;
}

.pull-quote figcaption {
	margin-top: 0.75rem;
	padding-left: calc(var(--wp--preset--spacing--30, 1.25rem) + 3px);
	color: var(--lg-charcoal);
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
}

/* --------------------------------------------------------- story cards */

.archive-header {
	margin-bottom: var(--lg-section);
}

.archive-title {
	margin: 0 0 0.4em;
	color: var(--lg-primary);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--xx-large, 2.25rem);
}

.sector-filter__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.sector-filter__list a {
	display: inline-block;
	padding: 0.4rem 0.9rem;
	border: 1px solid var(--lg-rule);
	border-radius: 999px;
	color: var(--lg-charcoal);
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	text-decoration: none;
}

.sector-filter__list a[aria-current="page"] {
	background: var(--lg-primary);
	border-color: var(--lg-primary);
	color: var(--lg-white);
}

.story-grid {
	display: grid;
	gap: var(--wp--preset--spacing--40, 2rem);
	grid-template-columns: 1fr;
}

@media (min-width: 40em) {
	.story-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 64em) {
	.story-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.story-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--lg-white);
	border: 1px solid var(--lg-rule);
	border-radius: var(--lg-radius);
}

.story-card__media img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.story-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.6rem;
	padding: var(--wp--preset--spacing--30, 1.25rem);
}

.story-card__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large, 1.25rem);
	line-height: 1.25;
}

.story-card__title a {
	color: var(--lg-primary);
	text-decoration: none;
}

.story-card__title a:hover,
.story-card__title a:focus {
	text-decoration: underline;
}

.story-card__meta,
.story-card__attr {
	margin: 0;
	color: var(--lg-charcoal);
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
}

.story-card__quote {
	margin: 0;
	padding-left: 0.9rem;
	border-left: 3px solid var(--lg-mist);
	color: var(--lg-charcoal);
	font-style: italic;
}

.story-card__quote p,
.story-card__excerpt {
	margin: 0;
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
}

.story-card__more {
	margin: auto 0 0;
	padding-top: 0.5rem;
}

.link-arrow {
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	font-weight: 600;
	text-decoration: none;
}

.link-arrow::after {
	content: " →";
}

.link-arrow:hover,
.link-arrow:focus {
	text-decoration: underline;
}

/* -------------------------------------------------- directory listings */

/*
 * Used by the Resources page. The `lgofa-directory` class is also the hook the
 * ItemList schema reads — see inc/template-tags.php.
 */
.lgofa-directory ul {
	display: grid;
	gap: var(--wp--preset--spacing--30, 1.25rem);
	margin: 0;
	padding: 0;
	list-style: none;
	grid-template-columns: 1fr;
}

@media (min-width: 40em) {
	.lgofa-directory ul {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.lgofa-directory li {
	padding: var(--wp--preset--spacing--30, 1.25rem);
	background: var(--lg-bone);
	border-radius: var(--lg-radius);
}

.lgofa-directory li strong {
	display: block;
	margin-bottom: 0.3rem;
	color: var(--lg-primary);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large, 1.25rem);
	font-weight: 600;
}

/* Book list on Resources. */
.lgofa-books ul {
	display: grid;
	gap: var(--wp--preset--spacing--20, 0.875rem);
	margin: 0;
	padding: 0;
	list-style: none;
	grid-template-columns: 1fr;
}

@media (min-width: 48em) {
	.lgofa-books ul {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.lgofa-books li {
	padding-left: 1rem;
	border-left: 3px solid var(--lg-mist);
}

.lgofa-books li strong {
	display: block;
}

/* An unfilled content slot. Deliberately loud — it must not ship unnoticed. */
.lgofa-form-placeholder {
	padding: var(--wp--preset--spacing--30, 1.25rem);
	border: 2px dashed var(--lg-rule);
	border-radius: var(--lg-radius);
	background: var(--lg-bone);
	color: var(--lg-charcoal);
}

/* --------------------------------------------------------------- forms */

.search-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: flex-end;
	margin-block: var(--wp--preset--spacing--30, 1.25rem);
}

.search-form__label {
	flex-basis: 100%;
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	font-weight: 600;
}

.search-form__input {
	flex: 1 1 14rem;
	min-height: 2.75rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--lg-rule);
	border-radius: var(--lg-radius);
	font: inherit;
}

.search-form__submit,
.wp-block-button__link {
	min-height: 2.75rem;
	padding: 0.7rem 1.4rem;
	border: 0;
	border-radius: var(--lg-radius);
	background: var(--lg-primary);
	color: var(--lg-white);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.search-form__submit:hover,
.search-form__submit:focus,
.wp-block-button__link:hover,
.wp-block-button__link:focus {
	background: var(--lg-primary-dark);
	color: var(--lg-white);
}

/* ------------------------------------------------------------ listings */

.post-list,
.search-results {
	display: grid;
	gap: var(--wp--preset--spacing--40, 2rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.post-list__title,
.search-result__title {
	margin: 0 0 0.3rem;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large, 1.75rem);
	line-height: 1.2;
}

.post-list__title a,
.search-result__title a {
	color: var(--lg-primary);
	text-decoration: none;
}

.post-list__meta,
.search-result__type {
	margin: 0 0 0.4rem;
	color: var(--lg-charcoal);
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.post-list__excerpt,
.search-result__excerpt {
	margin: 0;
}

/* ----------------------------------------------------------- pagination */

.pagination {
	margin-top: var(--lg-section);
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: 0 0.6rem;
	border: 1px solid var(--lg-rule);
	border-radius: var(--lg-radius);
	color: var(--lg-charcoal);
	text-decoration: none;
}

.pagination .page-numbers.current {
	background: var(--lg-primary);
	border-color: var(--lg-primary);
	color: var(--lg-white);
}

.post-navigation .nav-links {
	display: grid;
	gap: var(--wp--preset--spacing--20, 0.875rem);
}

@media (min-width: 48em) {
	.post-navigation .nav-links {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.post-navigation .nav-next {
		text-align: right;
	}
}

.nav-label {
	display: block;
	color: var(--lg-charcoal);
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* ------------------------------------------------------------- footer */

.site-footer {
	margin-top: var(--lg-section);
	padding-block: var(--lg-section);
	background: var(--lg-primary);
	color: var(--lg-white);
}

.site-footer__inner {
	display: grid;
	gap: var(--wp--preset--spacing--30, 1.25rem);
}

.footer-nav__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem var(--wp--preset--spacing--30, 1.25rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-nav__list a {
	color: var(--lg-white);
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	text-decoration: none;
	border-bottom: 1px solid rgb(255 255 255 / 40%);
}

.footer-nav__list a:hover,
.footer-nav__list a:focus {
	color: var(--lg-white);
	border-bottom-color: var(--lg-white);
}

.site-footer__copy {
	margin: 0;
	color: rgb(255 255 255 / 85%);
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
}

.site-footer :focus-visible {
	outline: 2px solid var(--lg-white);
	outline-offset: 2px;
}

@media (min-width: 62em) {
	.site-footer__inner {
		grid-template-columns: 1fr auto;
		align-items: center;
	}

	.site-footer__copy {
		grid-column: 1 / -1;
	}
}

/* --------------------------------------------------------------- misc */

.error-404__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem var(--wp--preset--spacing--30, 1.25rem);
	margin: var(--wp--preset--spacing--30, 1.25rem) 0 0;
	padding: 0;
	list-style: none;
}

.no-results {
	color: var(--lg-charcoal);
}

/* Blocks that need a touch of help. */
.wp-block-embed__wrapper {
	position: relative;
}

.entry__content .wp-block-group.has-background {
	padding: var(--wp--preset--spacing--40, 2rem);
	border-radius: var(--lg-radius);
}

/* Print: drop chrome, keep content. */
@media print {
	.site-header,
	.site-footer,
	.nav-toggle,
	.search-form,
	.pagination,
	.post-navigation {
		display: none !important;
	}

	body {
		color: #000;
	}
}
