/*
Theme Name: GEMWA
Theme URI: https://gemwa.local
Author: GEMWA
Description: An independent WordPress block theme for GEMWA — the Global Ethnic Majority Women in Academia Support Network. Approved identity: warm off-white, black, charcoal and soft grey, structured through rules, alignment and modular grid relationships rather than colour or a dark editorial frame. Not derived from, or shared with, any other theme.
Version: 0.3.2
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: gemwa
*/

/*
 * Public Sans — locally hosted, sourced from the official Public Sans
 * project (github.com/uswds/public-sans, release v2.001), SIL Open Font
 * License 1.1. Licence and attribution: assets/fonts/OFL.txt,
 * assets/fonts/AUTHORS.txt, assets/fonts/README.md. Only the weights this
 * site uses are included.
 */
@font-face {
	font-family: "Public Sans";
	src: url("assets/fonts/PublicSans-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Public Sans";
	src: url("assets/fonts/PublicSans-Italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Public Sans";
	src: url("assets/fonts/PublicSans-SemiBold.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Public Sans";
	src: url("assets/fonts/PublicSans-Bold.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* Visible keyboard-focus states: applied broadly so every interactive element gets a clear, high-contrast outline. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid var(--wp--preset--color--ink, #171412);
	outline-offset: 2px;
}

/* Skip link: visually hidden until focused. */
.gemwa-skip-link {
	position: absolute;
	left: 8px;
	top: -100px;
	z-index: 100000;
	background: var(--wp--preset--color--ink, #171412);
	color: var(--wp--preset--color--warm-off-white, #f6f3ed);
	padding: 12px 20px;
	border-radius: 4px;
	font-weight: 600;
	text-decoration: none;
	transition: top 0.15s ease;
}

.gemwa-skip-link:focus {
	top: 8px;
}

/* Respect reduced-motion preferences site-wide. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/*
 * Activity labels: three distinct BORDER treatments (solid fill / outline /
 * dashed outline), not three colours. Meaning is carried by the text label
 * itself in every case, never by colour or shape alone.
 */
.gemwa-activity-label {
	display: inline-flex;
	align-items: center;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	padding: 0.5em 1em;
	border-radius: 3px;
	line-height: 1.3;
}

.gemwa-activity-label--gemwa {
	background: var(--wp--preset--color--ink, #171412);
	color: var(--wp--preset--color--warm-off-white, #f6f3ed);
	border: 1.5px solid var(--wp--preset--color--ink, #171412);
}

.gemwa-activity-label--member-led {
	background: var(--wp--preset--color--white, #ffffff);
	color: var(--wp--preset--color--ink, #171412);
	border: 1.5px solid var(--wp--preset--color--ink, #171412);
}

.gemwa-activity-label--shared {
	background: transparent;
	color: var(--wp--preset--color--charcoal, #423d34);
	border: 1.5px dashed var(--wp--preset--color--charcoal, #423d34);
}

/*
 * Header / footer "chrome": a light band structured by a single strong
 * black rule, not a full-width dark panel. The header rule sits below the
 * bar; the footer rule sits above it, so the two read as a matched frame
 * around the page without either one becoming a dark band the page content
 * sits inside.
 */
.gemwa-chrome {
	background: var(--wp--preset--color--white, #ffffff);
	color: var(--wp--preset--color--ink, #171412);
}

.gemwa-chrome a {
	color: var(--wp--preset--color--ink, #171412);
}

.gemwa-chrome a:hover {
	color: var(--wp--preset--color--charcoal, #423d34);
}

.gemwa-chrome--header {
	border-bottom: 3px solid var(--wp--preset--color--ink, #171412);
}

.gemwa-chrome--footer {
	border-top: 3px solid var(--wp--preset--color--ink, #171412);
}

.gemwa-header-inner {
	padding-block: 24px;
}

.gemwa-logo-lockup {
	display: flex;
	align-items: center;
	gap: 16px;
}

/*
 * Plain CSS flex utilities for template parts (header/footer) instead of
 * the block editor's "layout" support. That support auto-generates
 * instance-numbered classes (e.g. wp-container-core-group-is-layout-3)
 * whose number depends on how many other layout-using blocks appear
 * earlier on whichever page a template part is reused on — harmless at
 * runtime, but it makes the editor's saved-content validation flag a false
 * "invalid content" warning for shared template parts. Plain classes avoid
 * that mechanism entirely.
 */
.gemwa-row-between {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: nowrap;
	gap: 16px;
}

.gemwa-row-wrap {
	flex-wrap: wrap;
}

/*
 * Horizontal gutter: one value shared by the header and footer inner
 * containers, the main content area and the open mobile menu, so every
 * edge of the page lines up. 32px on larger screens (unchanged); on mobile
 * it ramps from 16px at 320px to 20px at 390px and stays at 20px above.
 */
:root {
	--gemwa-gutter: 32px;
}

.gemwa-container {
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: var(--gemwa-gutter);
	box-sizing: border-box;
}

.gemwa-logo-lockup img {
	display: block;
	height: 64px;
	width: 64px;
}

.gemwa-logo-fullname {
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--wp--preset--color--charcoal, #423d34);
	max-width: 230px;
}

/* Full name is present for every visitor and every assistive technology on mobile too — visually hidden, not removed. */
.gemwa-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Keep the desktop nav on a single line: shortened labels do the real work, this is a safety net. */
.gemwa-chrome--header .wp-block-navigation {
	flex-wrap: nowrap;
}

.gemwa-chrome--header .wp-block-navigation__container {
	flex-wrap: nowrap;
	gap: 22px;
}

@media (max-width: 781px) {
	.gemwa-logo-lockup img {
		height: 44px;
		width: 44px;
	}

	.gemwa-logo-fullname {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}
}

/* Soft-grey panels: the primary device for organising content into modules, alignment and borders rather than colour. */
.gemwa-card {
	background: var(--wp--preset--color--white, #ffffff);
	border: 1px solid var(--wp--preset--color--soft-grey, #dad5c9);
	border-radius: 4px;
}

.gemwa-panel {
	background: var(--wp--preset--color--soft-grey, #dad5c9);
	border-radius: 4px;
}

/* Quote / secondary-voice treatment: italic, set off by a black rule, not colour. */
.gemwa-quote {
	font-style: italic;
	font-size: 1.15rem;
	line-height: 1.6;
	color: var(--wp--preset--color--ink, #171412);
	border-left: 3px solid var(--wp--preset--color--ink, #171412);
	padding-left: 1.1em;
	margin: 0;
}

/*
 * Ways to take part: a 2x2 grid on desktop, one connected system rather
 * than four separate cards. The grid's own background shows through a
 * small gap between cells as a set of ink rules — the same "connecting
 * rule" device used in the hero's network matrix — so the four routes
 * read as one module, not four competing accent-coloured boxes.
 */
.gemwa-routes-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 3px;
	background: var(--wp--preset--color--ink, #171412);
	border: 3px solid var(--wp--preset--color--ink, #171412);
	border-radius: 4px;
	overflow: hidden;
}

.gemwa-route-card {
	padding: 40px 36px;
	background: var(--wp--preset--color--soft-grey, #dad5c9);
}

.gemwa-route-card h3 {
	font-size: 1.3rem;
	overflow-wrap: normal;
	word-break: normal;
	hyphens: none;
	margin-bottom: 10px;
}

.gemwa-route-card p {
	font-size: 1.0625rem;
}

.gemwa-route-icon {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--wp--preset--color--white, #ffffff);
	border: 1.5px solid var(--wp--preset--color--ink, #171412);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	margin-bottom: 18px;
}

@media (max-width: 781px) {
	.gemwa-routes-grid {
		grid-template-columns: 1fr;
	}

	.gemwa-route-card {
		padding: 32px 28px;
	}
}

/*
 * Hero: an asymmetric grid rather than a mirrored two-column split. The
 * visual module is offset downward on desktop so the two halves read as
 * unequal, deliberate proportions — not a founder portrait, and not a
 * mosaic of placeholder boxes.
 */
.gemwa-hero-grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	gap: 56px;
	align-items: start;
}

.gemwa-hero-visual {
	margin-top: 64px;
}

/*
 * Network matrix: four real, linked concepts — not decorative dots and not
 * a statistic. A 2x2 grid whose cells share a 3px ink-coloured gap, so the
 * relationship between Members / Activity / Advocacy / Partnerships is
 * shown structurally (shared rules) rather than with connecting-line
 * graphics. The rules carry no information of their own, so nothing here
 * needs an accessible description beyond the words themselves.
 */
.gemwa-network-matrix {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 3px;
	background: var(--wp--preset--color--ink, #171412);
	border: 3px solid var(--wp--preset--color--ink, #171412);
	border-radius: 4px;
	overflow: hidden;
}

.gemwa-network-matrix div {
	background: var(--wp--preset--color--white, #ffffff);
	padding: 28px 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: 100px;
}

.gemwa-network-matrix strong {
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--wp--preset--color--ink, #171412);
}

@media (max-width: 781px) {
	.gemwa-hero-grid {
		grid-template-columns: 1fr;
	}

	.gemwa-hero-visual {
		margin-top: 0;
	}

	.gemwa-network-matrix div {
		min-height: 80px;
		padding: 22px 16px;
	}
}

/*
 * "What GEMWA is": prose stays at a readable measure; the four named areas
 * (Connection / Visibility / Advocacy / Mutual support) sit in their own
 * small modules below it, using the wider grid without stretching the
 * paragraph itself. No single large grey rectangle.
 */
.gemwa-prose {
	max-width: 780px;
}

.gemwa-areas-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 3px;
	background: var(--wp--preset--color--soft-grey, #dad5c9);
	border: 1px solid var(--wp--preset--color--soft-grey, #dad5c9);
	border-radius: 4px;
	overflow: hidden;
}

.gemwa-areas-grid div {
	background: var(--wp--preset--color--white, #ffffff);
	padding: 20px 16px;
	text-align: center;
	font-weight: 600;
	font-size: 1rem;
}

@media (max-width: 781px) {
	.gemwa-areas-grid {
		grid-template-columns: 1fr 1fr;
	}
}

/* Closing section: a rule and spacing, not a full-width black panel. */
.gemwa-closing-rule {
	border-top: 3px solid var(--wp--preset--color--ink, #171412);
	padding-top: 40px;
}

/* Our People — founder headshot not yet supplied; an honest text note, not an image placeholder box. */
.gemwa-photo-note {
	font-size: 0.85rem;
	font-style: italic;
	color: var(--wp--preset--color--charcoal, #423d34);
}

.gemwa-people-shell-note {
	font-size: 0.85rem;
	color: var(--wp--preset--color--charcoal, #423d34);
	border-left: 3px solid var(--wp--preset--color--soft-grey, #dad5c9);
	padding-left: 1em;
}

/* With thanks: a clean names grid, not a bullet list — no titles, roles or photographs. */
.gemwa-names-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2px;
	background: var(--wp--preset--color--soft-grey, #dad5c9);
	border: 1px solid var(--wp--preset--color--soft-grey, #dad5c9);
	border-radius: 4px;
	overflow: hidden;
}

.gemwa-names-grid div {
	background: var(--wp--preset--color--white, #ffffff);
	padding: 18px 16px;
	text-align: center;
	font-weight: 600;
}

@media (max-width: 781px) {
	.gemwa-names-grid {
		grid-template-columns: 1fr 1fr;
	}
}

/* Footer legibility: organisation name reads as clearly as the logo beside it. */
.gemwa-footer-name {
	font-weight: 600;
	font-size: 1rem;
}

.gemwa-footer-copyright {
	font-size: 0.9375rem;
}

/* Page intro: a short standfirst under the auto post-title, at a readable measure. */
.gemwa-page-intro {
	font-size: 1.25rem;
	max-width: 780px;
}

/* Eyebrow section label, reused across every inner page for consistent rhythm. */
.gemwa-eyebrow {
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin: 0;
}

/*
 * Numbered-free step sequence (Member-led Activity registration process).
 * Steps are told apart by a left rule and the step name itself, not by a
 * large decorative numeral — deliberately different from Holding the
 * Space's numbered strands.
 */
.gemwa-steps {
	display: grid;
	gap: 2px;
	background: var(--wp--preset--color--soft-grey, #dad5c9);
	border: 1px solid var(--wp--preset--color--soft-grey, #dad5c9);
	border-radius: 4px;
	overflow: hidden;
}

.gemwa-step {
	background: var(--wp--preset--color--white, #ffffff);
	padding: 22px 28px;
	border-left: 3px solid var(--wp--preset--color--ink, #171412);
}

.gemwa-step h3 {
	font-size: 1.0625rem;
	margin: 0 0 6px;
}

.gemwa-step p {
	margin: 0;
	max-width: 700px;
}

/*
 * Activity label definitions: the three labels shown with their meaning,
 * for real, public explanation (not the private pattern preview).
 */
.gemwa-label-defs {
	display: grid;
	gap: 2px;
	background: var(--wp--preset--color--soft-grey, #dad5c9);
	border: 1px solid var(--wp--preset--color--soft-grey, #dad5c9);
	border-radius: 4px;
	overflow: hidden;
}

.gemwa-label-def {
	background: var(--wp--preset--color--white, #ffffff);
	padding: 22px 28px;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 16px;
}

.gemwa-label-def p {
	margin: 0;
	flex: 1 1 320px;
}

/* Partnerships: seven equal-weight areas, none prioritised, no logos or amounts. */
.gemwa-partnership-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2px;
	background: var(--wp--preset--color--soft-grey, #dad5c9);
	border: 1px solid var(--wp--preset--color--soft-grey, #dad5c9);
	border-radius: 4px;
	overflow: hidden;
}

.gemwa-partnership-grid div {
	background: var(--wp--preset--color--white, #ffffff);
	padding: 22px 20px;
}

.gemwa-partnership-grid strong {
	display: block;
	margin-bottom: 6px;
	font-size: 1.0625rem;
}

.gemwa-partnership-grid p {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--charcoal, #423d34);
}

@media (max-width: 981px) {
	.gemwa-partnership-grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 600px) {
	.gemwa-partnership-grid {
		grid-template-columns: 1fr;
	}
}

/*
 * Empty state: an intentional, designed message for an archive or listing
 * with nothing published yet — not a bare "no results" line.
 */
.gemwa-empty-state {
	background: var(--wp--preset--color--soft-grey, #dad5c9);
	border-radius: 4px;
	padding: 48px 36px;
	text-align: center;
}

.gemwa-empty-state p {
	max-width: 520px;
	margin-inline: auto;
}

/* Outstanding-detail note: an honest, plain statement that a detail is pending — never a bracketed editorial note. */
.gemwa-pending-note {
	background: var(--wp--preset--color--white, #ffffff);
	border: 1px solid var(--wp--preset--color--soft-grey, #dad5c9);
	border-radius: 4px;
	padding: 22px 26px;
	max-width: 700px;
}

.gemwa-pending-note p {
	margin: 0;
}

/*
 * Partnership grid: a deliberately full final row. The last card spans the
 * grid's full width instead of leaving a partial row with visible empty
 * cells — no decorative filler, every visible card holds real content.
 */
.gemwa-partnership-grid > .gemwa-partnership-wide {
	grid-column: 1 / -1;
}

/*
 * On-this-page anchor navigation for long pages. A plain, always-visible
 * list of real section links — not an accordion, nothing hidden.
 */
.gemwa-toc {
	background: var(--wp--preset--color--soft-grey, #dad5c9);
	border-radius: 4px;
	padding: 24px 28px;
}

.gemwa-toc p {
	margin: 0 0 10px;
}

.gemwa-toc ol {
	margin: 0;
	padding-left: 1.2em;
	columns: 2;
	column-gap: 32px;
}

.gemwa-toc li {
	break-inside: avoid;
	margin-bottom: 6px;
}

@media (max-width: 700px) {
	.gemwa-toc ol {
		columns: 1;
	}
}

/*
 * Comfortable landing position for anchor-jumped headings — breathing room
 * above the target, not flush against the viewport edge.
 */
h2[id], h3[id] {
	scroll-margin-top: 32px;
}

/*
 * Typography scale note: "large" (introductory text) is now 19-26px, below the
 * 30px section headings. A heading that was given the "large" size in content
 * would otherwise sit smaller than its sibling headings, so headings set to
 * "large" take the x-large (section-heading) size instead.
 */
.wp-block-heading.has-large-font-size {
	font-size: var(--wp--preset--font-size--x-large) !important;
}

/*
 * Mobile reading size: substantive text (body copy, card descriptions, form
 * help text, and short statements set in the "small" size) is never below
 * 16px on small screens. Eyebrow labels, activity badges, metadata and the
 * copyright line stay smaller, as secondary text.
 */
@media (max-width: 781px) {
	.gemwa-partnership-grid p,
	p.has-small-font-size.has-charcoal-color {
		font-size: 1rem !important;
		line-height: 1.55;
	}

	.wp-block-jetpack-contact-form .contact-form__field-help,
	.contact-form__field-help {
		font-size: 1rem !important;
		line-height: 1.5;
	}
}

/*
 * Mobile gutter. Applied once, to the main content container (never the
 * body and never to nested groups, so there is no double padding): text,
 * form fields, cards and bordered panels all sit inside it. The header and
 * footer keep their full-width backgrounds and rules; only their inner
 * container uses the same gutter. The open full-screen menu keeps its
 * full-screen overlay but insets its links and close button by the gutter.
 */
@media (max-width: 781px) {
	:root {
		--gemwa-gutter: clamp(16px, calc(16px + (100vw - 320px) * 0.0571428), 20px);
	}

	main.wp-block-group {
		box-sizing: border-box;
		padding-inline: var(--gemwa-gutter);
	}

	/* Open full-screen menu: still edge to edge, but its links and close button follow the gutter. */
	.wp-block-navigation__responsive-container.has-modal-open.is-menu-open {
		padding-inline: var(--gemwa-gutter);
		box-sizing: border-box;
	}

	main.wp-block-group form,
	main.wp-block-group input,
	main.wp-block-group textarea,
	main.wp-block-group select,
	.gemwa-card,
	.gemwa-panel {
		box-sizing: border-box;
	}
}


/*
 * Graphics integration (local, awaiting approval).
 * - Home "Member-led activity": text and the complete conference poster side by
 *   side on desktop, stacked on mobile. The poster keeps its own 2:3 shape.
 * - About GEMWA: the archival GEMWA graphic at no more than its own width.
 * Both: sharp rectangular edges with a thin soft-grey rule, no filters.
 */
.gemwa-activity-poster {
	margin: 0;
}

.gemwa-activity-poster a {
	display: block;
}

.gemwa-activity-poster img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--wp--preset--color--soft-grey, #dad5c9);
	border-radius: 0;
}

.gemwa-archival-graphic {
	margin: var(--wp--preset--spacing--30, 28px) 0 0;
	max-width: 469px;
}

.gemwa-archival-graphic img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--wp--preset--color--soft-grey, #dad5c9);
	border-radius: 0;
}

@media (max-width: 781px) {
	.gemwa-activity-poster {
		max-width: 360px;
	}
}
