/*
Theme Name: Agape Jeevan
Description: Block theme for Agape Jeevan Ministries, Direction H (Steadfast Hope), terracotta accent.
Version: 0.19.2
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: agape-jeevan
*/

/* One type scale for the whole site. Every size in this file is one of these ten steps (plus the body size set in theme.json). */
:root {
	--ajm-fs-label: 0.85rem;      /* buttons, capital-letter labels */
	--ajm-fs-small: 0.95rem;      /* dates, captions, notes */
	--ajm-fs-lead: 1.2rem;        /* opening paragraphs, story text */
	--ajm-fs-h4: 1.35rem;         /* small card titles */
	--ajm-fs-h3: 1.5rem;          /* card and sub-section titles */
	--ajm-fs-h3-large: 1.75rem;   /* larger card titles, in-story headings */
	--ajm-fs-h2-small: clamp(1.6rem, 3vw, 2.15rem);   /* second-level headings inside columns */
	--ajm-fs-h2: clamp(1.8rem, 3.4vw, 2.75rem);       /* section headings, statements, pull quotes */
	--ajm-fs-title: clamp(2.2rem, 4.6vw, 3.75rem);    /* page and story titles, the opening statement */
	--ajm-fs-figure: clamp(3rem, 6vw, 4.75rem);       /* large numbers */
}


/* Full-width sections sit edge to edge, with no white strips between them. */
.wp-site-blocks > * + * { margin-block-start: 0; }
main.wp-block-group > * { margin-block: 0; }
.wp-block-post-content > .alignfull { margin-block: 0; }

/* Sections: consistent vertical rhythm and side gutters. */
.ajm-section {
	padding: clamp(64px, 8vw, 104px) var(--wp--style--root--padding-right, clamp(1.25rem, 5vw, 4.5rem));
}
.ajm-section > :first-child { margin-block-start: 0; }
.ajm-section > :last-child { margin-block-end: 0; }
.ajm-section :where(h2, h3) + * { margin-block-start: 1rem; }
.ajm-section * + :where(h2, h3) { margin-block-start: 2.5rem; }

/* Header and footer. */
.ajm-header {
	padding: 1.25rem var(--wp--style--root--padding-right, clamp(1.25rem, 5vw, 4.5rem));
	gap: 1rem;
	align-items: center;
	background: var(--wp--preset--color--ivory);
	border-bottom: 1px solid var(--wp--preset--color--sand);
}
.ajm-header .ajm-brand { gap: 0.6rem; align-items: center; }
.ajm-header .ajm-brand-mark { margin: 0; }
.ajm-header .wp-block-site-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: var(--ajm-fs-h4);
	line-height: 1.1;
}
.ajm-header .wp-block-site-title a { text-decoration: none; }
.ajm-header-actions { gap: 0.5rem 1.75rem; align-items: center; }
.ajm-header .wp-block-navigation a { text-decoration: none; padding-block: 0.6rem; }
.ajm-header .wp-block-navigation a:hover { text-decoration: underline; }
.ajm-header .wp-block-button__link { padding: 0.6rem 1.6rem; white-space: nowrap; }
.ajm-footer {
	padding: 2rem var(--wp--style--root--padding-right, clamp(1.25rem, 5vw, 4.5rem));
	gap: 1rem 3rem;
	font-size: var(--ajm-fs-small);
}
.ajm-footer p, .ajm-footer .wp-block-site-title { margin: 0; }
.ajm-footer a { color: var(--wp--preset--color--white); }

/* Short context line above a heading, such as a date. */
.ajm-eyebrow {
	font-size: var(--ajm-fs-small);
	font-weight: 600;
	margin-bottom: 0.5rem;
}

/* Opening photo slot, or a real photo once one is approved. */
.ajm-hero-media { margin: 0; }
.ajm-hero-media img,
.ajm-photo-slot {
	width: 100%;
	min-height: 420px;
	object-fit: cover;
	border-radius: 4px;
	border-bottom: 6px solid var(--wp--preset--color--accent);
	box-sizing: border-box;
}
.ajm-photo-slot {
	background: var(--wp--preset--color--sand);
	color: var(--wp--preset--color--stone);
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 2.5rem;
	font-size: var(--ajm-fs-small);
}
.ajm-photo-slot.is-plain { border-bottom: 0; background: var(--wp--preset--color--ivory); min-height: 360px; }

/* Photos placed in content. */
.ajm-photo { margin: 0 0 1.5rem; }
.ajm-photo img { width: 100%; height: auto; border-radius: 4px; display: block; }
.ajm-banner { margin: 0; }
.wp-block-image.ajm-banner img { width: 100%; height: clamp(260px, 38vw, 520px); object-fit: cover; display: block; }
.ajm-portrait img { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; }
.wp-block-gallery.ajm-gallery img { border-radius: 4px; }
.ajm-person { gap: 1.5rem; align-items: center; margin-block: 1.5rem; }
.ajm-person .ajm-portrait { margin: 0; flex-shrink: 0; }
.ajm-person h3 { margin: 0; }
.ajm-person p { margin: 0.25rem 0 0; color: var(--wp--preset--color--stone); }

/* Ministry-reported figures. */
.ajm-figure {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--ajm-fs-title);
	line-height: 1;
	color: var(--wp--preset--color--accent-text);
	margin-bottom: 0.25rem;
}

/* Story columns. */
.ajm-story { border-top: 2px solid var(--wp--preset--color--accent); padding-top: 1.5rem; }
.ajm-story > :first-child { margin-top: 0; }

/* "The challenge" and "The hope" columns. */
.ajm-rule { border-top: 2px solid var(--wp--preset--color--mist); padding-top: 1.5rem; }
.ajm-rule.is-hope { border-top-color: var(--wp--preset--color--accent); }
.ajm-rule > :first-child { margin-top: 0; }

/* Conference years as a list of links. */
.ajm-years { list-style: none; padding: 0; margin: 0; }
.ajm-years li { border-top: 1px solid var(--wp--preset--color--line); margin: 0; }
.ajm-years li:last-child { border-bottom: 1px solid var(--wp--preset--color--line); }
.ajm-years a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: 1.25rem 0;
	text-decoration: none;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--ajm-fs-h3);
}
.ajm-years a::after { content: "\2192"; color: var(--wp--preset--color--accent-text); }
.ajm-years a:hover { color: var(--wp--preset--color--accent-text); }

/* Panels on the Give page. */
.ajm-panel { border-radius: 4px; padding: clamp(28px, 3vw, 40px); }
.ajm-panel-outline { border: 1px solid var(--wp--preset--color--sand); }
.ajm-panel > :first-child { margin-top: 0; }
.ajm-panel > :last-child { margin-bottom: 0; }

/* Scripture and prayer invitation. */
.ajm-verse { margin: 0 auto; text-align: center; }
.ajm-verse p { line-height: 1.35; }
.ajm-verse cite {
	display: block;
	margin-top: 1rem;
	font-family: var(--wp--preset--font-family--body);
	font-style: normal;
	font-size: var(--ajm-fs-small);
	color: var(--wp--preset--color--stone);
}

/* Closing call to give. */
.ajm-give-band { border-top: 4px solid var(--wp--preset--color--accent); }

/* Giving details that need the EIN stay hidden until it is entered. The plugin also removes them server-side. */
.ajm-requires-ein { display: none; }
.ajm-has-ein .ajm-requires-ein { display: block; }

/* Stand-alone text links get a taller tap area (WCAG 2.5.8). */
.ajm-footer a,
.wp-block-post-content p > a:only-child,
.ajm-section p > a:only-child {
	display: inline-block;
	padding-block: 0.3rem;
}

/* Visible keyboard focus everywhere. */
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent-text);
	outline-offset: 3px;
}

main:focus { outline: none; }

/* ---------- Story-led home page (0.3.0) ---------- */

/* Opening: full-width photo, statement at the bottom left. */
.ajm-hero.wp-block-cover {
	padding: clamp(96px, 14vh, 160px) var(--wp--style--root--padding-right, clamp(1.25rem, 5vw, 4.5rem)) clamp(40px, 7vh, 72px);
}
/* A gradient instead of a flat tint: the photo stays bright at the top, the text sits on a dark base. */
.wp-block-cover.ajm-hero .wp-block-cover__background { opacity: 0 !important; }
.wp-block-cover.ajm-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	/* Measured: white text needs at least 0.5 overlay behind the headline and 0.62 behind body text over the bright ceiling. */
	background:
		linear-gradient(to right, rgb(28 25 23 / 0.45), rgb(28 25 23 / 0) 65%),
		linear-gradient(to top, rgb(28 25 23 / 0.88) 0%, rgb(28 25 23 / 0.66) 50%, rgb(28 25 23 / 0.52) 88%, rgb(28 25 23 / 0.3) 100%);
}
@media (max-width: 781px) {
	.wp-block-cover.ajm-hero::before { background: linear-gradient(to top, rgb(28 25 23 / 0.9) 0%, rgb(28 25 23 / 0.72) 55%, rgb(28 25 23 / 0.58) 100%); }
	.wp-block-cover.ajm-hero { min-height: 75vh !important; }
}
.ajm-hero .wp-block-cover__inner-container > * { max-width: 46rem; }
.ajm-hero-title { font-size: var(--ajm-fs-title); line-height: 1.04; letter-spacing: -0.02em; margin: 0; }
.ajm-hero-text { margin-block: 1.25rem 2rem; line-height: 1.5; }
.ajm-hero-caption { margin-top: 2.5rem; }
.ajm-on-dark .wp-block-button__link { color: var(--wp--preset--color--white); border-color: var(--wp--preset--color--white); }
.ajm-on-dark .wp-block-button__link:hover { background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink); }
/* The one orchestrated moment: the opening statement rises in once. */
@media (prefers-reduced-motion: no-preference) {
	.ajm-hero-title, .ajm-hero-text, .ajm-hero-actions { animation: ajm-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
	.ajm-hero-text { animation-delay: 0.15s; }
	.ajm-hero-actions { animation-delay: 0.3s; }
}
@keyframes ajm-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Our name: the two words, set large. */
.ajm-name-word {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--ajm-fs-figure);
	line-height: 0.95;
	letter-spacing: -0.02em;
	margin: 0;
}
.ajm-name-word + .ajm-name-word { margin-top: 1.75rem; }
.ajm-name-gloss {
	display: block;
	margin-top: 0.6rem;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--ajm-fs-lead);
	letter-spacing: 0;
	color: var(--wp--preset--color--accent-text);
}

/* The story so far: a timeline that reads left to right, then top to bottom on phones. */
.ajm-timeline {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
	gap: 2.5rem 0;
	margin-top: 3rem;
}
.ajm-timeline > .ajm-moment { margin: 0; position: relative; border-top: 2px solid var(--wp--preset--color--sand); padding-top: 1.5rem; padding-right: 2rem; }
.ajm-moment::before {
	content: "";
	position: absolute;
	top: -7px;
	left: 0;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
}
.ajm-moment > * { margin: 0; }
.ajm-moment > * + * { margin-top: 0.5rem; }
.ajm-moment-year {
	display: block;
	margin-bottom: 0.4rem;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--ajm-fs-h3-large);
	line-height: 1;
	color: var(--wp--preset--color--accent-text);
}
.ajm-moment h3 { font-size: var(--ajm-fs-lead); line-height: 1.3; }
@media (max-width: 600px) {
	.ajm-timeline { gap: 0; border-left: 2px solid var(--wp--preset--color--sand); margin-left: 5px; }
	.ajm-timeline > .ajm-moment { border-top: 0; padding: 0 0 2rem 1.5rem; }
	.ajm-moment::before { top: 0.35rem; left: -7px; }
}

/* Cost beside hope. */
.ajm-contrast { gap: clamp(2rem, 5vw, 5rem); }
.ajm-contrast h2 { font-size: var(--ajm-fs-h2-small); }

/* Featured story. */
.ajm-feature { gap: clamp(2rem, 5vw, 5rem); }
.ajm-photo-tall { margin: 0; }
.ajm-photo-tall img { aspect-ratio: 4 / 3; object-fit: cover; }
.ajm-feature p:not(.ajm-eyebrow) { font-size: var(--ajm-fs-lead); }

/* Stories grid. */
.ajm-stories { margin-top: 2.5rem; gap: 2.5rem 2rem; }
.ajm-stories > .ajm-story { margin: 0; }
.ajm-story > * { margin: 0; }
.ajm-story > * + * { margin-top: 0.6rem; }
.ajm-story-year { display: block; margin-bottom: 0.35rem; font-family: var(--wp--preset--font-family--body); font-size: var(--ajm-fs-small); font-weight: 600; color: var(--wp--preset--color--accent-text); }

/* Acts 25 at full width. */
.wp-block-image.ajm-banner-tall img { height: clamp(300px, 52vw, 680px); }
.ajm-big-claim { font-size: var(--ajm-fs-title); line-height: 1.05; letter-spacing: -0.02em; }

/* Ministry Center progress. */
.ajm-progress > * { margin: 0; }
.ajm-progress > * + * { margin-top: 1rem; }
.ajm-progress-figure { font-family: var(--wp--preset--font-family--heading); font-size: var(--ajm-fs-h3); }
.ajm-progress-figure strong { font-size: var(--ajm-fs-h2); font-weight: 600; color: var(--wp--preset--color--accent-text); margin-right: 0.25rem; }
.ajm-meter { height: 12px; border-radius: 6px; background: var(--wp--preset--color--sand); overflow: hidden; }
.ajm-meter > span { display: block; height: 100%; border-radius: 6px; background: var(--wp--preset--color--accent); }

/* Ways to stand with them. */
.ajm-gifts { margin-top: 2.5rem; gap: 2rem; }
.ajm-gifts > .ajm-gift { margin: 0; border-top: 2px solid var(--wp--preset--color--accent); padding-top: 1.25rem; }
.ajm-gift > * { margin: 0; }
.ajm-gift > * + * { margin-top: 0.6rem; }
.ajm-gift-amount { font-family: var(--wp--preset--font-family--heading); font-size: var(--ajm-fs-h3); line-height: 1.2; }
.ajm-give-row { margin-top: 2.5rem; gap: 1rem 1.5rem; }
.ajm-give-row p { margin: 0; }

/* Closing verse. */
.ajm-closing .ajm-verse p { font-size: var(--ajm-fs-h2-small); }

/* ---------- Review fixes and editor-friendly structure (0.4.0) ---------- */

/* Keyboard focus stays visible on dark backgrounds (WCAG 1.4.11: white on ink is 17.5:1). */
.ajm-footer :focus-visible,
.ajm-hero :focus-visible,
.has-ink-background-color :focus-visible { outline-color: var(--wp--preset--color--white); }

/* Phone header: logo, menu and Give on one row. */
.ajm-header .ajm-brand { min-width: 0; }
@media (max-width: 600px) {
	.ajm-header { gap: 0.75rem; padding-block: 0.9rem; }
	.ajm-header .wp-block-site-title { font-size: var(--ajm-fs-small); }
	.ajm-header .ajm-brand-mark img { width: 24px !important; height: 24px !important; }
	.ajm-header-actions { gap: 0.5rem; }
	.ajm-header .wp-block-button__link { padding: 0.55rem 1.1rem; white-space: nowrap; }
}

/* Tighter sections on phones: the page is long enough. */
@media (max-width: 600px) {
	.ajm-section { padding-block: 56px; }
}

/* One-line mission above the cost and the hope. */
.ajm-lead { max-width: 52rem; margin-bottom: 3rem; line-height: 1.5; }
.ajm-lead em { font-style: normal; font-family: var(--wp--preset--font-family--heading); font-weight: 600; color: var(--wp--preset--color--accent-text); }

/* Quotes use the upright face; the italic font file is no longer loaded. */
.wp-block-quote, .wp-block-pullquote { font-style: normal; }

/* Acts 25: the story that shows the training working. */
.ajm-payoff {
	margin: 0 0 2rem;
	padding: 0 0 0 1.5rem;
	border-left: 3px solid var(--wp--preset--color--accent);
	font-size: var(--ajm-fs-h4);
	line-height: 1.45;
}
.ajm-payoff cite { display: block; margin-top: 0.75rem; font-family: var(--wp--preset--font-family--body); font-size: var(--ajm-fs-small); color: var(--wp--preset--color--stone); }
.ajm-next-slot,
.ajm-next {
	background: var(--wp--preset--color--ivory);
	border: 1px solid var(--wp--preset--color--sand);
	border-radius: 4px;
	padding: 1.25rem 1.5rem;
	margin-block: 0 2rem;
}
.ajm-next > * { margin: 0; }
.ajm-next > * + * { margin-top: 0.5rem; }
.ajm-years-query { margin-top: 0; }
.ajm-years .wp-block-post-title { margin: 0; font-size: inherit; }
.ajm-years.wp-block-post-template { list-style: none; padding: 0; margin: 0; }

/* Featured story pull quote. */
.ajm-pull.wp-block-pullquote { padding: 0; margin: 1.5rem 0 0; text-align: left; border: 0; }
.ajm-pull blockquote { margin: 0; }
.ajm-pull p { font-family: var(--wp--preset--font-family--heading); font-size: var(--ajm-fs-h3-large); line-height: 1.35; color: var(--wp--preset--color--accent-text); }
.ajm-stories-two { margin-top: 3.5rem; }

/* Verse at the top of Ways to stand with them. */
.ajm-verse-inline { margin: 1.25rem 0; padding: 0; font-size: var(--ajm-fs-h4); line-height: 1.45; }
.ajm-verse-inline cite { display: block; margin-top: 0.5rem; font-family: var(--wp--preset--font-family--body); font-size: var(--ajm-fs-small); color: var(--wp--preset--color--stone); }
.ajm-gifts .ajm-gift-amount { margin: 0; font-weight: 500; }
.ajm-gift p:last-child a { font-weight: 600; }

/* Ministry Center: the match line stands out. */
.ajm-match { font-weight: 600; }

/* Update cards and posts with photos. */
.ajm-card-image { margin: 0 0 1rem; }
.ajm-card-image img { border-radius: 4px; }
.ajm-story:has(.ajm-card-image) { border-top: 0; padding-top: 0; }
.ajm-update-list > li { margin-bottom: 3rem; }
.ajm-post-image { max-width: 1200px; margin: 0 auto; padding-inline: var(--wp--style--root--padding-right, clamp(1.25rem, 5vw, 4.5rem)); }
.ajm-post-image img { border-radius: 4px; }

/* Board members stack on narrow phones. */
@media (max-width: 480px) {
	.ajm-person { flex-wrap: wrap !important; }
}

/* Lead line lines up with the columns below it, not centered. */
.ajm-section > .ajm-lead { margin-left: max(0px, calc((100% - 1200px) / 2)) !important; }

/* Pull quote and Acts 25 story: larger than core's quote defaults. */
.wp-block-pullquote.ajm-pull blockquote p { font-size: var(--ajm-fs-h3-large); line-height: 1.35; }
.wp-block-quote.ajm-payoff p { font-size: var(--ajm-fs-lead); line-height: 1.5; }
.wp-block-quote.ajm-verse-inline p { font-size: var(--ajm-fs-lead); line-height: 1.45; }

/* Ministry Center figure comes from settings as plain text, so it is styled whole. */
.ajm-progress .ajm-progress-figure { font-family: var(--wp--preset--font-family--heading); font-size: var(--ajm-fs-h2-small); font-weight: 600; line-height: 1.2; color: var(--wp--preset--color--accent-text); }
.ajm-meter { background: var(--wp--preset--color--white); box-shadow: inset 0 0 0 1px var(--wp--preset--color--line); }

/* ---------- Photo headers, photo sets, gatherings and fuller pages (0.5.0) ---------- */

/* Photo header on inner pages: the page's featured image, title and excerpt. */
.wp-block-cover.ajm-page-hero {
	padding-block: clamp(72px, 10vh, 120px) clamp(32px, 5vh, 56px);
}
.ajm-page-hero .ajm-hero-title { font-size: var(--ajm-fs-title); line-height: 1.08; color: inherit; }
.ajm-page-hero .ajm-hero-text { margin-block: 1rem 0; }
.ajm-page-hero .ajm-hero-text p { margin: 0; line-height: 1.5; }
@media (max-width: 781px) {
	.wp-block-cover.ajm-hero.ajm-page-hero { min-height: 44vh !important; }
}
/* No featured image: a calm ivory band instead of an empty dark box. */
.wp-block-cover.ajm-page-hero:not(:has(.wp-block-cover__image-background)) {
	min-height: 0 !important;
	background: var(--wp--preset--color--ivory);
	color: var(--wp--preset--color--ink);
	padding-block: clamp(56px, 7vw, 88px);
}
.wp-block-cover.ajm-page-hero:not(:has(.wp-block-cover__image-background))::before { display: none; }
.wp-block-cover.ajm-page-hero:not(:has(.wp-block-cover__image-background)) :focus-visible { outline-color: var(--wp--preset--color--accent-text); }

/* Photo set: still photos in a grid. Three or five photos put the first one large beside the rest. */
.wp-block-gallery.has-nested-images.is-style-photo-set {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
}
.wp-block-gallery.has-nested-images.is-style-photo-set figure.wp-block-image:not(#individual-image) {
	width: auto !important;
	max-width: none;
	margin: 0;
	aspect-ratio: 3 / 2;
}
.wp-block-gallery.has-nested-images.is-style-photo-set figure.wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 4px;
}
/* On a phone an odd number of photos leaves one alone on a row; the first photo takes the full width instead. */
.wp-block-gallery.has-nested-images.is-style-photo-set figure.wp-block-image:not(#individual-image):first-child:nth-last-child(odd) { grid-column: span 2; }
@media (min-width: 782px) {
	.wp-block-gallery.has-nested-images.is-style-photo-set { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
	.wp-block-gallery.has-nested-images.is-style-photo-set figure.wp-block-image:not(#individual-image):first-child:nth-last-child(odd) { grid-column: auto; }
	/* Two or four photos: one row. */
	.wp-block-gallery.has-nested-images.is-style-photo-set:has(> figure:first-child:nth-last-child(2)) { grid-template-columns: repeat(2, 1fr); }
	.wp-block-gallery.has-nested-images.is-style-photo-set:has(> figure:first-child:nth-last-child(4)) { grid-template-columns: repeat(4, 1fr); }
	/* Five photos: one large, four small. */
	.wp-block-gallery.has-nested-images.is-style-photo-set:has(> figure:first-child:nth-last-child(5)) { grid-template-columns: repeat(4, 1fr); }
	/* Three or five: the first photo is twice as wide and twice as tall. */
	.wp-block-gallery.has-nested-images.is-style-photo-set > figure.wp-block-image:not(#individual-image):first-child:nth-last-child(3),
	.wp-block-gallery.has-nested-images.is-style-photo-set > figure.wp-block-image:not(#individual-image):first-child:nth-last-child(5) {
		grid-column: span 2;
		grid-row: span 2;
		aspect-ratio: auto;
	}
}
.ajm-photos-caption { margin: 0.9rem 0 0; }
.ajm-photos-band { padding-block: clamp(48px, 6vw, 80px); }
.ajm-photos-band > .wp-block-gallery { margin-block: 0; }

/* Countdown and the next-gathering notice. */
.wp-block-ajm-countdown { margin-block: 1.5rem; }
.ajm-countdown { margin: 0; display: flex; align-items: baseline; gap: 0.6rem; }
.ajm-countdown-number {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--ajm-fs-figure);
	font-weight: 600;
	line-height: 1;
	color: var(--wp--preset--color--accent-text);
	font-variant-numeric: tabular-nums;
}
.ajm-countdown-label { font-size: var(--ajm-fs-lead); font-weight: 600; }
.ajm-countdown.is-now .ajm-countdown-label { font-family: var(--wp--preset--font-family--heading); font-size: var(--ajm-fs-h3-large); color: var(--wp--preset--color--accent-text); }
.ajm-next .ajm-eyebrow { color: var(--wp--preset--color--accent-text); }
.ajm-next .ajm-next-name { font-family: var(--wp--preset--font-family--heading); font-size: var(--ajm-fs-h3); line-height: 1.25; }
.ajm-next .ajm-next-when { color: var(--wp--preset--color--stone); }
.ajm-next .ajm-countdown-number { font-size: var(--ajm-fs-h2); }
.ajm-next .ajm-next-link a { font-weight: 600; }

/* Photo beside text, alternating down the page. */
.ajm-rows > .ajm-feature + .ajm-feature { margin-top: clamp(3rem, 6vw, 5.5rem); }
.ajm-feature h2 { margin-top: 0; }
.ajm-feature .wp-block-buttons { margin-top: 1.5rem; }

/* Smaller items in a grid. */
.ajm-grid { gap: 2.5rem 2rem; }
.ajm-grid > .ajm-story { margin: 0; }
.ajm-grid h3 { font-size: var(--ajm-fs-h4); }

/* Conference pages: dates above the facts, figures in a row. */
.ajm-figures-row { gap: 2rem; margin-top: 2.5rem; }
.ajm-figures-row .ajm-figure { margin-bottom: 0.4rem; }
.ajm-figures-row p { margin: 0; }
.ajm-source { margin-top: 1.5rem; }

/* Buttons inside cards and under sections. */
.ajm-gift .wp-block-buttons { margin-top: 1rem; }
.ajm-gift .wp-block-button__link,
.ajm-story .wp-block-button__link { padding: 0.55rem 1.25rem; font-size: var(--ajm-fs-small); }
.ajm-section > .wp-block-buttons { margin-top: 2.5rem; }
.ajm-section > .wp-block-query + .wp-block-buttons { margin-top: 1rem; }

/* Update cards. */
.ajm-update-list { gap: 3rem 2.5rem; }
.ajm-update-list > li { margin-bottom: 0; }
.ajm-update-list .wp-block-post-title { margin-block: 0.25rem 0.5rem; }
.ajm-update-list .wp-block-post-title a { text-decoration: none; }
.ajm-update-list .wp-block-post-title a:hover { text-decoration: underline; }

/* ---------- Latest content on Home, forms, fuller footer and Updates (0.6.0) ---------- */

/* Footer: newsletter sign-up, then three columns, then the language choice. */
.ajm-footer { padding-block: clamp(48px, 6vw, 72px) 2rem; }
.ajm-footer > * { max-width: 1200px; margin-inline: auto; }
.ajm-footer-cols { gap: 2rem 4rem; align-items: flex-start; justify-content: space-between; }
.ajm-footer-about { flex: 1 1 18rem; max-width: 26rem; }
.ajm-footer-about > * + * { margin-top: 0.35rem; }
.ajm-footer-about .wp-block-site-title { font-family: var(--wp--preset--font-family--heading); font-size: var(--ajm-fs-h4); margin-bottom: 0.5rem; }
.ajm-footer-links { flex: 0 1 12rem; }
.ajm-footer .ajm-footer-heading { font-weight: 600; color: var(--wp--preset--color--white); margin-bottom: 0.5rem; }
.ajm-footer-links ul { list-style: none; padding: 0; margin: 0; }
.ajm-footer-links li { margin: 0; }
.ajm-footer a { text-decoration: none; }
.ajm-footer a:hover { text-decoration: underline; }

/* Newsletter sign-up: a white card on a sand band, just above the footer. */
.ajm-signup-band {
	margin: 0;
	padding: clamp(40px, 6vw, 80px) var(--wp--style--root--padding-right, 1.5rem) clamp(40px, 6vw, 80px) var(--wp--style--root--padding-left, 1.5rem);
	background: var(--wp--preset--color--sand);
}
.ajm-signup {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	gap: 2rem clamp(2rem, 6vw, 5rem);
	align-items: center;
	max-width: 1000px;
	margin-inline: auto;
	padding: clamp(1.75rem, 5vw, 3.5rem);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
}
.ajm-signup .ajm-signup-title { margin: 0 0 0.75rem; font-size: var(--ajm-fs-h2-small); line-height: 1.15; }
.ajm-signup .ajm-signup-text { margin: 0; font-size: var(--ajm-fs-lead); color: var(--wp--preset--color--stone); }
.ajm-signup-main > * { margin: 0; }
.ajm-signup-names { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 1rem; }
.ajm-signup-names.is-single { grid-template-columns: minmax(0, 1fr); }
.ajm-signup .ajm-field { margin: 0 0 1rem; }
.ajm-signup .ajm-form-button { display: block; width: 100%; margin-top: 0.25rem; padding-block: 0.95rem; text-align: center; text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--ajm-fs-small); }
.ajm-signup .ajm-signup-status { font-weight: 600; margin-top: 0.75rem; }
.ajm-signup .ajm-signup-status:empty { display: none; }
.ajm-signup-main.is-done .ajm-signup-status { margin-top: 0; font-family: var(--wp--preset--font-family--heading); font-size: var(--ajm-fs-h3); font-weight: 400; line-height: 1.3; }
.ajm-signup .ajm-signup-status:focus { outline: none; }
.ajm-signup .ajm-signup-trap { position: absolute; left: -9999px; }
.ajm-signup .ajm-signup-form[hidden] { display: none; }
@media (max-width: 781px) {
	.ajm-signup { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
}
@media (max-width: 420px) {
	.ajm-signup-names { grid-template-columns: minmax(0, 1fr); }
}

/* Form fields, shared by the sign-up and the contact form. */
.ajm-field input,
.ajm-field textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: 4px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	font: inherit;
}
.ajm-field textarea { resize: vertical; }
.ajm-required { color: var(--wp--preset--color--accent-text); font-weight: 600; }
.ajm-form-button {
	padding: 0.75rem 1.6rem;
	border: 0;
	border-radius: 4px;
	background: var(--wp--preset--color--accent-text);
	color: var(--wp--preset--color--white);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}
.ajm-form-button:hover { background: var(--wp--preset--color--ink); }
.ajm-footer .ajm-form-button:hover { background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink); text-decoration: none; }

/* Contact form. */
.ajm-form { max-width: 40rem; }
.ajm-form .ajm-field { margin: 0 0 1.25rem; }
.ajm-field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.ajm-field-error { display: block; margin-top: 0.35rem; font-weight: 600; color: #9b1c1c; }
.ajm-form-actions { margin: 0; }
.ajm-form-note { font-size: var(--ajm-fs-small); color: var(--wp--preset--color--stone); }
.ajm-form-message { margin: 0 0 1.5rem; padding: 1rem 1.25rem; border-left: 4px solid var(--wp--preset--color--accent); border-radius: 4px; background: var(--wp--preset--color--sand); font-weight: 600; }
.ajm-form-message.is-error { border-left-color: #9b1c1c; background: #fdecea; color: #7a1414; }
/* The extra field catches junk-mail robots. People never see it. */
.ajm-field-extra { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* A note only signed-in editors see, when a setting is still empty. */
.ajm-editor-note { padding: 0.75rem 1rem; border: 1px dashed var(--wp--preset--color--stone); border-radius: 4px; font-size: var(--ajm-fs-small); }
.ajm-footer .ajm-editor-note { border-color: rgb(255 255 255 / 0.5); }

/* Language choice. */
.ajm-translate {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgb(255 255 255 / 0.2);
	font-size: var(--ajm-fs-small);
}
.ajm-translate > * { margin: 0; }
.ajm-translate .ajm-translate-label { font-weight: 600; color: var(--wp--preset--color--white); }

/* A section heading with a link to the full list beside it. */
.ajm-section-head { align-items: baseline; gap: 0.5rem 2rem; margin-bottom: 2.5rem; }
.ajm-section-head > * { margin: 0; }
.ajm-section-head a { font-weight: 600; }

/* Topic line above a title. */
.wp-block-post-terms.ajm-eyebrow { font-size: var(--ajm-fs-small); margin-bottom: 0.25rem; color: var(--wp--preset--color--accent-text); }
.wp-block-post-terms.ajm-eyebrow a { color: inherit; text-decoration: none; }
.wp-block-post-terms.ajm-eyebrow a:hover { text-decoration: underline; }

/* Home: the newest update shown large, then three more. */
.ajm-lead-update .wp-block-post-template { list-style: none; padding: 0; margin: 0; }
.ajm-lead-update .ajm-card-image { margin: 0; }
.ajm-lead-update .ajm-feature .wp-block-column > * { margin-block: 0; }
.ajm-lead-update .ajm-feature .wp-block-column > * + * { margin-top: 0.6rem; }
.ajm-lead-title { font-size: var(--ajm-fs-h2); line-height: 1.15; }
.ajm-lead-title a { text-decoration: none; }
.ajm-lead-title a:hover { text-decoration: underline; }
.ajm-more-updates { margin-top: clamp(2.5rem, 5vw, 4rem); }
.ajm-story-text > * { margin: 0; }
.ajm-story-text > * + * { margin-top: 0.6rem; }
.ajm-more-updates .wp-block-post-title { font-size: var(--ajm-fs-h4); line-height: 1.25; }
.wp-block-post-excerpt__more-text { margin: 0.5rem 0 0; }
.wp-block-post-excerpt__more-link { font-weight: 600; }

/* Gatherings: each one a title and a line about it. Fills itself in from the Acts 25 sub-pages. */
.ajm-gatherings.wp-block-post-template { list-style: none; padding: 0; margin: 0; }
.ajm-gatherings > li { margin: 0; padding: 1.25rem 0; border-top: 1px solid var(--wp--preset--color--line); }
.ajm-gatherings > li:last-child { border-bottom: 1px solid var(--wp--preset--color--line); }
.ajm-gatherings .wp-block-post-title { margin: 0; font-size: var(--ajm-fs-h3); line-height: 1.25; }
.ajm-gatherings .wp-block-post-title a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; text-decoration: none; }
.ajm-gatherings .wp-block-post-title a::after { content: "\2192"; color: var(--wp--preset--color--accent-text); }
.ajm-gatherings .wp-block-post-title a:hover { color: var(--wp--preset--color--accent-text); }
.ajm-gatherings .wp-block-post-excerpt { margin: 0.4rem 0 0; }
.ajm-gatherings .wp-block-post-excerpt p { margin: 0; font-size: var(--ajm-fs-small); color: var(--wp--preset--color--stone); max-width: 34rem; }

/* Updates: topics to browse by. */
.ajm-topics { gap: 0.5rem 1rem; margin-bottom: 2.5rem; }
.ajm-topics .ajm-topics-label { margin: 0; font-weight: 600; }
.ajm-topics .wp-block-categories { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; }
.ajm-topics .wp-block-categories li { margin: 0; }
.ajm-topics .wp-block-categories a {
	display: inline-block;
	padding: 0.35rem 0.9rem;
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: 999px;
	text-decoration: none;
	font-size: var(--ajm-fs-small);
}
.ajm-topics .wp-block-categories a:hover,
.ajm-topics .wp-block-categories .current-cat a { background: var(--wp--preset--color--ink); border-color: var(--wp--preset--color--ink); color: var(--wp--preset--color--white); }

/* Updates: the newest one runs the full width, photo beside text. Later pages are all cards. */
@media (min-width: 782px) {
	body:not(.paged) .ajm-update-index > li:first-child { grid-column: 1 / -1; }
	body:not(.paged) .ajm-update-index > li:first-child .ajm-story:has(.ajm-card-image) {
		display: grid;
		grid-template-columns: 55fr 45fr;
		gap: clamp(2rem, 5vw, 5rem);
		align-items: center;
	}
	body:not(.paged) .ajm-update-index > li:first-child .ajm-card-image { margin: 0; }
	body:not(.paged) .ajm-update-index > li:first-child .ajm-story-text { margin: 0; }
	body:not(.paged) .ajm-update-index > li:first-child .wp-block-post-title { font-size: var(--ajm-fs-h2); line-height: 1.15; }
}
.wp-block-query-pagination { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--wp--preset--color--line); font-weight: 600; }

/* Conference timetable. */
.ajm-schedule { margin: 1.5rem 0 0; overflow-x: auto; }
.ajm-schedule table { width: 100%; min-width: 32rem; border-collapse: collapse; table-layout: auto; }
.ajm-schedule th, .ajm-schedule td { border: 0; padding: 0.8rem 1.5rem 0.8rem 0; text-align: left; vertical-align: top; }
.ajm-schedule thead { border: 0; }
.ajm-schedule th { font-family: var(--wp--preset--font-family--heading); font-size: var(--ajm-fs-lead); font-weight: 600; border-bottom: 2px solid var(--wp--preset--color--accent); }
.ajm-schedule td { border-bottom: 1px solid var(--wp--preset--color--line); }
.ajm-schedule td:first-child { white-space: nowrap; font-weight: 600; }

/* Questions that open to show their answers. */
.wp-block-details { margin: 0; padding: 1rem 0; border-top: 1px solid var(--wp--preset--color--line); }
.wp-block-details + .wp-block-details { margin-top: 0; }
.wp-block-details:last-of-type { border-bottom: 1px solid var(--wp--preset--color--line); }
.wp-block-details summary { cursor: pointer; font-family: var(--wp--preset--font-family--heading); font-size: var(--ajm-fs-lead); font-weight: 600; line-height: 1.3; }
.wp-block-details summary:hover { color: var(--wp--preset--color--accent-text); }
.wp-block-details p { margin: 0.75rem 0 0; max-width: 44rem; }
.wp-block-details + :where(h2, h3, .wp-block-group) { margin-top: 3rem; }
.wp-block-group.ajm-requires-contact-form + h2 { margin-top: 3rem; }

/* ---------- Home bands, story note and reading polish (0.7.0) ---------- */

/* Headings break into even lines; paragraphs avoid a single stranded word. Browsers without support ignore both. */
h1, h2, h3, .ajm-hero-title, .ajm-big-claim, .wp-block-post-title { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* Links inside a page land below the header, not under it. */
:target { scroll-margin-top: 5rem; }

/* "What we do": three photo cards. */
.ajm-cards { margin-top: 2.5rem; gap: 2.5rem 2rem; }
.ajm-card > * { margin: 0; }
.ajm-card > * + * { margin-top: 0.6rem; }
.ajm-card .ajm-card-image { margin-bottom: 1.1rem; }
.ajm-card .ajm-card-image img { width: 100%; height: auto; }
.ajm-card h3 { font-size: var(--ajm-fs-h3); }
.ajm-card-link { font-weight: 600; }
.ajm-card-link a { text-underline-offset: 0.2em; }

/* "Stand with the church": pray, give, stay informed. */
.ajm-ways { margin-top: 2.5rem; gap: 2rem; }
.ajm-way {
	margin: 0;
	padding: clamp(24px, 3vw, 36px);
	background: var(--wp--preset--color--white);
	border-top: 4px solid var(--wp--preset--color--accent);
	border-radius: 0 0 4px 4px;
}
.ajm-way > * { margin: 0; }
.ajm-way > * + * { margin-top: 0.75rem; }
.ajm-way-title { font-size: var(--ajm-fs-h3-large); }

/* Under an update: the note on how stories are told, then three more updates. */
.ajm-story-note { padding-block: 0 clamp(32px, 4vw, 48px); }
.ajm-story-note p { padding-top: 1.25rem; border-top: 1px solid var(--wp--preset--color--mist); }
.ajm-related { padding-top: 0; }
.ajm-related .wp-block-post-title { font-size: var(--ajm-fs-h4); line-height: 1.25; }
@media (max-width: 781px) {
	.ajm-related .ajm-update-list { grid-template-columns: 1fr; }
}

/* ---------- Story pages, story cards and video (0.9.0) ---------- */

/* An update opens like a magazine story: topic, title and one-line summary centred, then a wide photo. */
.ajm-story-head { padding-block: clamp(48px, 7vw, 96px) clamp(28px, 4vw, 48px); text-align: center; }
.ajm-story-head > * { margin-block: 0; }
.ajm-story-head > * + * { margin-top: 1rem; }
.ajm-story-title { font-size: var(--ajm-fs-title); line-height: 1.08; letter-spacing: -0.02em; }
.ajm-story-sub { max-width: 40rem; margin-inline: auto; font-size: var(--ajm-fs-lead); line-height: 1.5; color: var(--wp--preset--color--stone); }
.ajm-story-sub .wp-block-post-excerpt__excerpt { margin: 0; }

/* The story itself: a narrow column of slightly larger text, with photos and quotes allowed to run wider. */
.ajm-story-body { padding-top: clamp(32px, 5vw, 56px); }
.ajm-story-body > p, .ajm-story-body > ul, .ajm-story-body > ol { font-size: var(--ajm-fs-lead); line-height: 1.65; }
.ajm-story-body > h2 { margin-top: 2.75rem; font-size: var(--ajm-fs-h3-large); }
.ajm-story-body > .wp-block-pullquote { margin-block: 2.75rem; padding: 0; text-align: center; }
.ajm-story-body > .wp-block-pullquote.ajm-pull blockquote { border: 0; padding: 0; }
.ajm-story-body > .wp-block-pullquote.ajm-pull blockquote p { font-size: var(--ajm-fs-h2-small); line-height: 1.3; }
.ajm-story-body > .wp-block-gallery, .ajm-story-body > .wp-block-image, .ajm-story-body > .wp-block-video, .ajm-story-body > .wp-block-embed { margin-block: 2.75rem 0; }
.ajm-story-body > .wp-block-image img { border-radius: 4px; }
.ajm-story-body > .ajm-photos-caption { margin-bottom: 2.75rem; }
.ajm-story-body > .wp-block-image figcaption, .ajm-story-body > .wp-block-video figcaption, .ajm-story-body > .wp-block-embed figcaption { font-size: var(--ajm-fs-small); color: var(--wp--preset--color--stone); text-align: left; }

/* A short centred introduction above a row of cards. */
.ajm-section-intro { margin-bottom: 2.75rem; }
.ajm-section-intro > * { margin-block: 0; }
.ajm-section-intro > * + * { margin-top: 0.9rem; }

/* Story cards: square photo, title, one line, link. */
.ajm-story-cards .ajm-card-image img { width: 100%; }
.ajm-story-cards .wp-block-post-title { font-size: var(--ajm-fs-h3); line-height: 1.2; }
.ajm-story-cards + .wp-block-buttons { margin-top: 2.5rem; }
@media (max-width: 781px) {
	.ajm-story-cards .ajm-update-list { grid-template-columns: 1fr; }
}

/* Video, uploaded or from YouTube or Vimeo: full width of its column, rounded like the photos. */
.wp-block-video video { width: 100%; height: auto; border-radius: 4px; background: var(--wp--preset--color--ink); }
.wp-block-embed.is-type-video .wp-block-embed__wrapper { border-radius: 4px; overflow: hidden; }
.wp-block-embed.is-type-video iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; }

/* ---------- Site-wide pass: figures on dark, centred introductions (0.10.0) ---------- */

/* The three figures on a dark band. */
.ajm-figures-dark .ajm-figures-title { margin-bottom: 2.5rem; font-size: var(--ajm-fs-h2-small); color: var(--wp--preset--color--white); }
.ajm-figures-dark .ajm-figure { color: var(--wp--preset--color--white); font-size: var(--ajm-fs-figure); }
.ajm-figures-dark .wp-block-column > p { margin: 0; }
.ajm-figures-dark .wp-block-column > p + p { margin-top: 0.5rem; max-width: 18rem; }
.ajm-figures-dark .ajm-source { margin-top: 2.5rem; }
.ajm-figures-dark a { color: var(--wp--preset--color--white); }

/* Centred introductions read as a pair: heading, then one larger line. */
.ajm-section-intro .has-large-font-size { font-size: var(--ajm-fs-lead); line-height: 1.5; color: var(--wp--preset--color--stone); }
.ajm-section-intro + .ajm-cards, .ajm-section-intro + .ajm-ways { margin-top: 0; }

/* On Home, the "next gathering" box appears only when a gathering has been announced. */
#acts-25 .ajm-next-empty { display: none; }

/* ---------- Calmer type, labelled buttons, square photos (0.11.0) ---------- */

/* The opening statement is large but not shouting; headings are a regular weight. */
.ajm-hero-title { font-size: var(--ajm-fs-title); line-height: 1.1; letter-spacing: -0.01em; font-weight: 400; }
.ajm-big-claim { font-size: var(--ajm-fs-title); line-height: 1.12; }
.ajm-story-title { font-size: var(--ajm-fs-title); }

/* Buttons and "read more" links are small labels in capitals, spaced out, so they read as actions and not as text. */
.wp-block-button__link,
.ajm-gift .wp-block-button__link,
.ajm-story .wp-block-button__link,
.ajm-form-button {
	font-size: var(--ajm-fs-label);
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}
.ajm-card-link a,
.wp-block-post-excerpt__more-link,
.ajm-section-head p a {
	font-size: var(--ajm-fs-label);
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	text-underline-offset: 0.3em;
}
.wp-block-post-excerpt__more-text { margin-top: 0.75rem; }

/* Photos have square corners. Portraits stay round. */
main figure:not(.ajm-portrait) img,
main .wp-block-cover__image-background { border-radius: 0 !important; }

/* ---------- Long-form stories: photos and text mixed (0.12.0) ---------- */

/* Story row: two or three photos side by side at one height. */
.wp-block-gallery.has-nested-images.is-style-story-row {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.75rem;
	align-items: stretch;
}
.wp-block-gallery.has-nested-images.is-style-story-row figure.wp-block-image:not(#individual-image) {
	flex: 1 1 0;
	width: auto !important;
	min-width: 0;
	margin: 0;
	height: clamp(150px, 28vw, 380px);
}
.wp-block-gallery.has-nested-images.is-style-story-row figure.wp-block-image:not(#individual-image):first-child { flex-grow: 1.35; }
.wp-block-gallery.has-nested-images.is-style-story-row figure.wp-block-image img { width: 100%; height: 100%; object-fit: cover; }

/* Inside a story: generous space around every photo, quote and heading, so the page breathes. */
.ajm-story-body > .wp-block-image,
.ajm-story-body > .wp-block-gallery,
.ajm-story-body > .wp-block-video,
.ajm-story-body > .wp-block-embed { margin-block: clamp(2.5rem, 5vw, 4rem) 0; }
.ajm-story-body > .wp-block-image + p,
.ajm-story-body > .ajm-photos-caption + *,
.ajm-story-body > .wp-block-video + p,
.ajm-story-body > .wp-block-embed + p { margin-top: clamp(2.5rem, 5vw, 4rem); }
.ajm-story-body > .ajm-photos-caption { margin: 0.75rem 0 0; }
.ajm-story-body > .wp-block-image img { width: 100%; height: auto; }
.ajm-story-body > .wp-block-image figcaption { margin-top: 0.75rem; }
.ajm-story-body > .wp-block-pullquote { margin-block: clamp(2.5rem, 5vw, 4rem); }
.ajm-story-body > h2 { margin-top: clamp(2.75rem, 5vw, 4rem); }
/* The first paragraph of a story is set a little larger, as an opening. */
.ajm-story-body > p:first-child { font-size: var(--ajm-fs-h4); line-height: 1.55; }

/* ---------- A richer Home: photos in every band (0.13.0) ---------- */

/* "Why" band: the two statements stacked beside a tall photo. */
.ajm-why .ajm-contrast > * { margin-block: 0; }
.ajm-why .ajm-contrast > * + * { margin-top: 1rem; }
.ajm-why .ajm-contrast > p + h2 { margin-top: 2.5rem; }
.ajm-why .ajm-contrast > .wp-block-buttons { margin-top: 2rem; }
.ajm-why .ajm-photo-tall img { width: 100%; height: auto; }

/* Verse over a photo. */
.ajm-verse-band .ajm-verse { margin: 0 auto; padding: 0; border: 0; text-align: center; color: var(--wp--preset--color--white); }
.ajm-verse-band .ajm-verse p { font-family: var(--wp--preset--font-family--heading); font-size: var(--ajm-fs-h2); line-height: 1.25; }
.ajm-verse-band .ajm-verse cite { display: block; margin-top: 1.5rem; font-style: normal; font-size: var(--ajm-fs-label); font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--wp--preset--color--mist); }

/* Take part: photo cards. The photo runs to the card's edges. */
.ajm-way { padding: 0; border-top: 0; border-radius: 0; overflow: hidden; }
.ajm-way > * { margin-inline: clamp(20px, 2.5vw, 32px); }
.ajm-way > .ajm-card-image { margin: 0; }
.ajm-way > .ajm-card-image img { width: 100%; height: auto; display: block; }
.ajm-way > .ajm-way-title { margin-top: 1.5rem; }
.ajm-way > :last-child { margin-bottom: clamp(24px, 3vw, 36px); }

/* Home: the three smaller updates are photo cards. */
.ajm-more-updates .ajm-story:has(.ajm-card-image) { border-top: 0; padding-top: 0; }
@media (max-width: 781px) {
	.ajm-more-updates .ajm-update-list { grid-template-columns: 1fr; }
}

/* A linked photo eases in slightly when pointed at, for visitors who have not asked for less motion. */
.ajm-card-image a { display: block; overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
	.ajm-card-image a img { transition: transform 0.5s ease; }
	.ajm-card-image a:hover img, .ajm-card-image a:focus-visible img { transform: scale(1.04); }
}

/* Three cards always share the row equally on wide screens, instead of leaving an empty fourth column. */
@media (min-width: 782px) {
	.ajm-ways, .ajm-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Inner pages: a statement over a photo (0.14.0) ---------- */
.ajm-photo-statement .wp-block-cover__inner-container > * { margin-block: 0; }
.ajm-photo-statement .wp-block-cover__inner-container > * + * { margin-top: 1.5rem; }
.ajm-statement-label { font-size: var(--ajm-fs-label); font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; }
.ajm-statement { font-size: var(--ajm-fs-h2); line-height: 1.25; }
.ajm-photo-statement .wp-block-buttons { justify-content: center; margin-top: 2.25rem; }
.ajm-photo-statement .is-style-outline .wp-block-button__link { color: var(--wp--preset--color--white); border-color: var(--wp--preset--color--white); }
.ajm-photo-statement .is-style-outline .wp-block-button__link:hover { background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink); }
/* Four short cards sit two by two on wide screens, so none is left alone on a row. */
@media (min-width: 782px) {
	.ajm-grid:has(> .ajm-story:first-child:nth-last-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- After the independent review of 2026-11-13 (0.15.0) ---------- */

/* Update cards: one title size for every card, and a larger one only for the newest. */
.ajm-update-list .wp-block-post-title.has-x-large-font-size { font-size: var(--ajm-fs-h3) !important; line-height: 1.25; }
@media (min-width: 782px) {
	body:not(.paged) .ajm-update-index > li:first-child .wp-block-post-title.has-x-large-font-size { font-size: var(--ajm-fs-h2) !important; line-height: 1.15; }
}

/* Filled and outline buttons are the same height: the outline's border is taken out of its padding. */
.wp-block-button.is-style-outline > .wp-block-button__link { padding: calc(0.85rem - 1px) calc(1.9rem - 1px); }
.ajm-gift .wp-block-button.is-style-outline > .wp-block-button__link,
.ajm-story .wp-block-button.is-style-outline > .wp-block-button__link { padding: calc(0.55rem - 1px) calc(1.25rem - 1px); }

/* The menu shows which page you are on. */
.ajm-header .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content,
.ajm-header .wp-block-navigation-item__content[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.45em; }

/* Give appears inside the phone menu too. On wide screens the button beside the menu is enough. */
/* Links that only belong in the phone menu stay out of the desktop row. */
.ajm-header .wp-block-navigation__container > .ajm-nav-give,
.ajm-header .wp-block-navigation__container > .ajm-nav-secondary { display: none; }

/* ---------- Phone header and menu (0.18.0) ----------
   Below 1200px the row of links is swapped for a menu button (WordPress does this below 600px; the rules further down extend it to tablets).
   Header: menu button on the left, name beside it, Give always on the right.
   Menu: full screen, links as full-width rows with dividers, Give in its top bar. */
@media (max-width: 1199px) {
	.ajm-header { gap: 0.75rem; min-height: 60px; }
	.ajm-header .ajm-header-actions { display: contents; }
	.ajm-header .wp-block-navigation { order: -1; flex: 0 0 auto; }
	.ajm-header .ajm-brand { order: 0; flex: 1 1 auto; }
	.ajm-header .wp-block-buttons { order: 1; flex: 0 0 auto; }
	.ajm-header .wp-block-navigation__responsive-container-open { padding: 10px; margin: -10px -6px -10px -10px; }

	.ajm-header .wp-block-navigation__responsive-container.is-menu-open {
		padding: 0;
		background: var(--wp--preset--color--ivory);
		color: var(--wp--preset--color--ink);
	}
	.ajm-header .is-menu-open .wp-block-navigation__responsive-dialog { margin-top: 0; }
	/* Top bar of the open menu: close on the left where the menu button was, the flame beside it. */
	.ajm-header .is-menu-open .wp-block-navigation__responsive-dialog::before {
		content: "";
		display: block;
		height: 60px;
		border-bottom: 1px solid var(--wp--preset--color--line);
		background: url(assets/images/flame.png) 60px center / 24px 24px no-repeat;
	}
	.ajm-header .is-menu-open .wp-block-navigation__responsive-container-close {
		top: 8px;
		left: 8px;
		right: auto;
		padding: 10px;
	}
	.ajm-header .is-menu-open .wp-block-navigation__responsive-container-content {
		display: block;
		padding: 0;
	}
	.ajm-header .is-menu-open .wp-block-navigation__container {
		display: block;
		width: 100%;
		gap: 0;
	}
	.ajm-header .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item {
		display: block;
		margin: 0;
		border-bottom: 1px solid var(--wp--preset--color--line);
	}
	.ajm-header .is-menu-open .wp-block-navigation-item__content {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 1.2rem 1.25rem;
		font-family: var(--wp--preset--font-family--body);
		font-size: var(--ajm-fs-small);
		font-weight: 600;
		letter-spacing: 0.12em;
		text-transform: uppercase;
		text-decoration: none;
	}
	/* A small chevron at the end of each row. */
	.ajm-header .is-menu-open .wp-block-navigation-item__content::after {
		content: "";
		flex: 0 0 auto;
		width: 8px;
		height: 8px;
		margin-left: 1rem;
		border-top: 2px solid currentColor;
		border-right: 2px solid currentColor;
		transform: rotate(45deg);
		opacity: 0.6;
	}
	.ajm-header .is-menu-open .wp-block-navigation-item__content[aria-current] { color: var(--wp--preset--color--accent-text); text-decoration: none; }

	/* Give sits in the menu's top bar as a button, as it does in the header. */
	.ajm-header .is-menu-open .wp-block-navigation__container > .ajm-nav-give {
		display: block;
		position: absolute;
		top: 10px;
		right: 1.25rem;
		border: 0;
	}
	.ajm-header .is-menu-open .ajm-nav-give .wp-block-navigation-item__content {
		padding: 0.55rem 1.1rem;
		border-radius: 4px;
		background: var(--wp--preset--color--accent);
		color: var(--wp--preset--color--white);
		font-size: var(--ajm-fs-label);
		letter-spacing: 0.08em;
	}
	.ajm-header .is-menu-open .ajm-nav-give .wp-block-navigation-item__content::after { content: none; }

	/* The newsletter link: quieter, under the rows. Hidden when the sign-up is not on the page. */
	.ajm-header .is-menu-open .wp-block-navigation__container > .ajm-nav-secondary { display: block; border: 0; }
	.ajm-header .is-menu-open .ajm-nav-secondary .wp-block-navigation-item__content {
		padding-top: 1.5rem;
		font-size: var(--ajm-fs-body, 1rem);
		font-weight: 400;
		letter-spacing: 0;
		text-transform: none;
		text-decoration: underline;
		text-underline-offset: 0.2em;
	}
	.ajm-header .is-menu-open .ajm-nav-secondary .wp-block-navigation-item__content::after { content: none; }
	body:not(:has(#newsletter)) .ajm-header .ajm-nav-secondary { display: none !important; }
}

/* WordPress's own menu rules are more specific than ours, so the layout rules that must win are marked important. */
@media (max-width: 1199px) {
	/* Show the menu button, and hide the row of links, on tablets as well as phones. */
	.ajm-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
	.ajm-header .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
	.ajm-header .wp-block-navigation__responsive-container.is-menu-open { background-color: var(--wp--preset--color--ivory) !important; }
	.ajm-header .is-menu-open .wp-block-navigation__responsive-dialog { position: relative; }
	.ajm-header .is-menu-open .wp-block-navigation__responsive-container-content { display: block !important; padding: 0 !important; width: 100%; }
	.ajm-header .is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container { display: block !important; width: 100% !important; position: static; }
	.ajm-header .is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container > .wp-block-navigation-item { display: block !important; width: 100%; position: static; }
	.ajm-header .is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content { display: flex !important; justify-content: space-between !important; padding: 1.2rem 1.25rem !important; width: 100%; box-sizing: border-box; }
	.ajm-header .is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container > .ajm-nav-give { position: absolute !important; top: 10px; right: 1.25rem; width: auto !important; border: 0; }
	.ajm-header .is-menu-open .wp-block-navigation__responsive-container-content .ajm-nav-give .wp-block-navigation-item__content { padding: 0.55rem 1.1rem !important; width: auto; }
	.ajm-header .is-menu-open .wp-block-navigation__responsive-container-content .ajm-nav-secondary .wp-block-navigation-item__content { justify-content: flex-start !important; padding-top: 1.5rem !important; }
}

/* Links to other websites open in a new tab; screen readers are told so. */
.ajm-outside-link::after {
	content: " (opens in a new tab)";
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Small links are easier to tap. */
.ajm-footer-links li a, .ajm-topics a, .ajm-translate a { display: inline-block; padding-block: 0.3rem; }

/* Page not found: places to go. */
.ajm-not-found-links { margin-top: 2rem; }

/* A person with a short biography: the text sits beside the portrait and wraps under it on a phone. */
.ajm-person-bio { align-items: flex-start; }
.ajm-person-bio .ajm-person-text { flex: 1 1 18rem; max-width: 38rem; }
.ajm-person-bio .ajm-person-text > * { margin-block: 0; }
.ajm-person-bio .ajm-person-text > * + * { margin-top: 0.5rem; }
.ajm-person-bio .ajm-person-text > p:nth-of-type(1) { color: var(--wp--preset--color--stone); }

/* Topic pages and "Page not found" use the same title size as every other page. */
main h1.wp-block-heading:not(.ajm-hero-title), main h1.wp-block-query-title { font-size: var(--ajm-fs-title); line-height: 1.1; }

/* ---------- Touch targets (0.18.1) ----------
   On touch screens a link needs about 44px of height to be hit comfortably.
   Where a taller link would push the layout around, the extra height is added as padding
   and taken back with an equal negative margin, so only the tappable area grows. */
@media (max-width: 1199px) {
	body .ajm-section p > a:only-child,
	body .wp-block-post-content p > a:only-child,
	body .wp-block-post-excerpt__more-link { display: inline-block; padding-block: 0.7rem; }
	body .ajm-footer-links li a { padding-block: 0.6rem; }
	body .ajm-topics .wp-block-categories a,
	body .wp-block-button .wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box; }
	body .ajm-header .wp-block-navigation__responsive-container-open { padding: 12px; margin: -12px -8px -12px -12px; }
	body .ajm-header .wp-block-button__link { padding-block: 0.75rem; }
	.wp-block-details > summary { padding-block: 0.6rem; }
	.wp-block-post-terms a,
	.ajm-header .wp-block-site-title a { display: inline-block; padding-block: 0.9rem; margin-block: -0.9rem; }
	.wp-block-post-title a { padding-block: 0.5rem; margin-block: -0.5rem; }
}

/* ---------- Home page video (0.19.0) ----------
   The video lies over the hero photo and under the dark gradient, so the headline keeps its contrast. */
.ajm-hero-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 40%;
	z-index: 0;
	pointer-events: none;
}
/* The pause control: a small, quiet icon in the corner. It has no words on screen
   (screen readers hear "Pause video"), and brightens when pointed at or focused. */
.ajm-hero-pause {
	position: absolute;
	right: clamp(0.5rem, 2vw, 1.25rem);
	bottom: clamp(0.5rem, 2vw, 1.25rem);
	z-index: 2;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wp--preset--color--white);
	opacity: 0.45;
	cursor: pointer;
	transition: opacity 0.2s;
}
.ajm-hero-pause:hover,
.ajm-hero-pause:focus-visible { opacity: 1; }
/* Two bars while playing. */
.ajm-hero-pause::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 3px;
	height: 12px;
	margin: -6px 0 0 -5px;
	border-left: 3px solid currentColor;
	border-right: 3px solid currentColor;
	box-sizing: content-box;
}
/* A triangle while paused. */
.ajm-hero-pause.is-paused::before {
	width: 0;
	height: 0;
	margin: -7px 0 0 -4px;
	border: 0;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	border-left: 11px solid currentColor;
}
.ajm-hero-pause[hidden] { display: none; }
@media (max-width: 781px) {
	/* On phones the bottom of the hero holds the buttons and the caption, so the control moves to the top. */
	.ajm-hero-pause { top: 0.5rem; bottom: auto; right: 0.5rem; }
}
