/*
Theme Name: BAGP
Theme URI: https://bagp.org.uk/
Description: Child theme of Ollie for the British Association of General Paediatricians. Logo-based colours, Montserrat type, BAGP header and footer, and BAGP section and page patterns.
Author: British Association of General Paediatricians
Template: ollie
Version: 1.9.6
Requires at least: 6.6
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: bagp
*/

/* ---------- Colour stripe under the header ---------- */
.bagp-stripe {
	height: 6px !important;
	margin: 0 !important;
	background: linear-gradient(
		to right,
		var(--wp--preset--color--red) 0 25%,
		var(--wp--preset--color--primary) 25% 50%,
		var(--wp--preset--color--green) 50% 75%,
		var(--wp--preset--color--sunflower) 75% 100%
	);
}

/* ---------- Header ---------- */
.bagp-topbar p {
	margin: 0;
}
.bagp-topbar a {
	text-decoration: none;
}
.bagp-topbar a:hover {
	text-decoration: underline;
}
.bagp-topbar .bagp-topbar-join a {
	color: var(--wp--preset--color--sunflower);
	font-weight: 700;
}
.bagp-logo {
	margin: 0;
}
.bagp-logo img {
	display: block;
	height: auto;
}

/* ---------- Footer ---------- */
.bagp-footer a {
	text-decoration: none;
}
.bagp-footer a:hover {
	text-decoration: underline;
}
.bagp-footer p {
	margin-block: 0;
}
.bagp-footer-bottom {
	border-top: 1px solid #2a3578;
	padding-top: var(--wp--preset--spacing--medium);
}

/* ---------- Eyebrow text (small capitals label above headings) ---------- */
.is-style-bagp-eyebrow {
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ---------- Card ---------- */
.is-style-bagp-card {
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: 14px;
	padding: clamp(1.25rem, 3vw, 2rem);
}
.is-style-bagp-card.has-background {
	border-color: transparent;
}
.is-style-bagp-card > :first-child {
	margin-top: 0;
}
.bagp-card-flush {
	padding: 0 !important;
	overflow: hidden;
}
.bagp-card-flush .wp-block-post-featured-image {
	margin: 0;
}
.bagp-card-body {
	padding: clamp(1.25rem, 3vw, 1.75rem);
}

/* Small icons above card headings */
.bagp-icon {
	margin: 0 0 0.25rem;
}
.bagp-icon img {
	display: block;
}

/* ---------- Home hero: photo on the left, fading to the background ---------- */
/*
 * As in the mock-up: the photo fills the left two-thirds only (so the people
 * stay clear of the fade), and the text sits in a 540px column at the right
 * edge of the 1200px content width. Core's cover CSS sets the text column to
 * width:auto with a stronger selector, hence !important.
 */
@media (min-width: 782px) {
	.wp-block-cover.bagp-hero {
		padding-right: max(var(--wp--preset--spacing--large), calc(50vw - 600px)) !important;
		padding-left: max(var(--wp--preset--spacing--medium), calc(50vw - 600px)) !important;
	}
	.wp-block-cover.bagp-hero .wp-block-cover__image-background {
		width: 66% !important;
		right: auto !important;
		object-position: 35% 40% !important;
	}
	.wp-block-cover.bagp-hero .wp-block-cover__inner-container {
		width: min(540px, 48vw) !important;
		flex: 0 1 auto;
	}
}
@media (max-width: 781px) {
	.bagp-hero {
		min-height: 0 !important;
		padding-top: 300px !important;
		align-items: flex-end;
	}
	.bagp-hero .wp-block-cover__image-background {
		height: 340px !important;
		bottom: auto !important;
		object-position: 30% 30% !important;
	}
	.bagp-hero .wp-block-cover__background {
		background: linear-gradient(
			to bottom,
			rgba(241, 243, 252, 0) 0,
			rgba(241, 243, 252, 0) 170px,
			#f1f3fc 320px
		) !important;
	}
	.bagp-hero .wp-block-cover__inner-container {
		width: 100%;
	}
}

/* ---------- Dark (navy) panels ---------- */
.bagp-panel-dark {
	border-radius: 20px;
}
.bagp-panel-dark h1,
.bagp-panel-dark h2,
.bagp-panel-dark h3 {
	color: var(--wp--preset--color--base);
}

/* ---------- History timeline ---------- */
.bagp-timeline-row {
	margin-block: 0 !important;
	gap: 1.5rem !important;
}
.bagp-timeline-date p {
	margin: 0;
	text-align: right;
	font-weight: 700;
	color: var(--wp--preset--color--navy);
}
/*
 * The line is drawn by ::after rather than a border, so it can run from this
 * entry's dot to the next entry's dot. The colour change then sits under a
 * dot. Dot: 18px with a 3px white gap and a 2px coloured outer ring, centred
 * on the 3px line.
 */
.is-style-bagp-timeline {
	--bagp-dot: 18px;
	--bagp-dot-top: 0.15em;
	--bagp-line: 3px;
	position: relative;
	padding: 0 0 2rem calc(1.5rem + var(--bagp-line));
}
.is-style-bagp-timeline::after {
	content: "";
	position: absolute;
	z-index: 0;
	left: 0;
	width: var(--bagp-line);
	top: calc(var(--bagp-dot-top) + var(--bagp-dot) / 2);
	bottom: calc(-1 * (var(--bagp-dot-top) + var(--bagp-dot) / 2));
	background: currentColor;
}
.bagp-timeline-row:last-child .is-style-bagp-timeline::after,
.bagp-timeline-row:last-of-type .is-style-bagp-timeline::after {
	bottom: 0;
}
.is-style-bagp-timeline::before {
	content: "";
	position: absolute;
	z-index: 1;
	box-sizing: border-box;
	left: calc(var(--bagp-line) / 2 - var(--bagp-dot) / 2);
	top: var(--bagp-dot-top);
	width: var(--bagp-dot);
	height: var(--bagp-dot);
	border-radius: 50%;
	background: currentColor;
	border: 3px solid var(--wp--preset--color--base);
	box-shadow: 0 0 0 2px currentColor;
}
.is-style-bagp-timeline > * {
	margin-top: 0;
}
.is-style-bagp-timeline h3,
.is-style-bagp-timeline h4 {
	color: var(--wp--preset--color--navy);
	margin-bottom: 0.25rem;
}
.is-style-bagp-timeline p {
	color: var(--wp--preset--color--secondary);
}
@media (max-width: 600px) {
	.bagp-timeline-date {
		flex-basis: 88px !important;
	}
}

/* ---------- Headings that are links (cards, news) stay navy ---------- */
.is-style-bagp-card h3 a,
.bagp-card-body .wp-block-post-title a {
	color: var(--wp--preset--color--navy);
	text-decoration: none;
}
.is-style-bagp-card h3 a:hover,
.bagp-card-body .wp-block-post-title a:hover {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
}

/* ---------- Group headings with a coloured marker (Our team) ---------- */
.bagp-group-heading {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: var(--wp--preset--spacing--large) !important;
}
.bagp-group-heading:first-child {
	margin-top: 0 !important;
}
.bagp-group-heading::before {
	content: "";
	width: 28px;
	height: 6px;
	border-radius: 3px;
	background: var(--wp--preset--color--primary);
}
.bagp-marker-green::before {
	background: var(--wp--preset--color--green);
}
.bagp-marker-red::before {
	background: var(--wp--preset--color--red);
}
.bagp-marker-sunflower::before {
	background: var(--wp--preset--color--sunflower);
}

/* ---------- Team cards ---------- */
.bagp-person img {
	width: 84px;
	height: 84px;
	object-fit: cover;
}
.bagp-person p {
	margin: 0;
	line-height: 1.3;
}
.bagp-person p + p {
	font-size: 0.95rem;
	line-height: 1.35;
}
/* Every card the same height, whatever wraps. */
.bagp-person {
	min-height: 10rem;
	align-items: center;
	box-sizing: border-box;
}

/* ---------- Pale tint behind team photos (from the mock-up) ----------
   Each person keeps the same tint wherever their photo appears.
   For a new member, add bagp-tint-blue / -green / -red / -sunflower
   to the image block's "Additional CSS class(es)". */
.bagp-person img,
.bagp-avatar img,
.bagp-profile-photo img {
	background: var(--bagp-tint, var(--wp--preset--color--primary-accent));
}
.bagp-person img {
	box-sizing: border-box;
	border: 3px solid var(--bagp-tint, var(--wp--preset--color--primary-accent));
}
.bagp-tint-blue,
img[src*="/Marianne"],
img[src*="/Colin"] {
	--bagp-tint: var(--wp--preset--color--primary-accent);
}
.bagp-tint-green,
img[src*="/Rachel-Kirk"],
img[src*="/Pooja"] {
	--bagp-tint: var(--wp--preset--color--green-tint);
}
.bagp-tint-red,
img[src*="/Pramodh"],
img[src*="/Blessing"] {
	--bagp-tint: var(--wp--preset--color--red-tint);
}
.bagp-tint-sunflower,
img[src*="/Laura"],
img[src*="/PeterR"] {
	--bagp-tint: var(--wp--preset--color--primary-alt);
}

/* ---------- Full-width stacked buttons ---------- */
.bagp-buttons-full > .wp-block-button,
.bagp-buttons-full > .wp-block-button .wp-block-button__link {
	width: 100%;
	box-sizing: border-box;
	text-align: center;
}

/* ---------- Header on smaller screens ---------- */
/* The menu's extra "Join us" / "Member log in" item only shows in the phone menu. */
.wp-block-navigation .bagp-nav-join {
	display: none !important;
}
.wp-block-navigation__responsive-container.is-menu-open .bagp-nav-join {
	display: flex !important;
	margin-top: 0.75rem;
}
.wp-block-navigation__responsive-container.is-menu-open .bagp-nav-join .wp-block-navigation-item__content {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base) !important;
	border-radius: 8px;
	padding: 0.7em 1.4em !important;
	font-weight: 700;
	text-decoration: none;
}
@media (max-width: 599px) {
	.bagp-header-join {
		display: none !important;
	}
	.bagp-topbar-tagline {
		display: none;
	}
}
@media (max-width: 960px) {
	.bagp-logo img {
		width: 190px !important;
	}
}

/* ---------- News cards without a featured image get a tinted logo panel ---------- */
.bagp-card-flush:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	display: block;
	aspect-ratio: 16 / 9;
	background: var(--wp--preset--color--tertiary) url("assets/icons/cat-news.svg") center / auto 38% no-repeat;
}

/* ---------- Single posts ---------- */
.bagp-post-image img {
	border-radius: 14px;
}
.bagp-panel-dark-text {
	width: 100%;
}
.bagp-panel-dark-text p {
	margin: 0;
}

/* =========================================================================
   v1.2: event pages, news, posts, GAPRUKI and profile components
   ========================================================================= */

/* ---------- Small shared bits ---------- */
.bagp-crumbs a {
	color: inherit;
}
.bagp-strong {
	font-weight: 600;
}
.bagp-grow {
	flex: 1 1 420px;
	min-width: 0;
}
.bagp-pill {
	display: inline-block;
	width: fit-content;
	margin: 0;
	padding: 0.35em 0.95em;
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
}
.bagp-pills > p {
	margin: 0;
}
.bagp-avatar {
	flex: none;
	margin: 0;
}
.bagp-initials {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin: 0;
	padding: 0;
	border-radius: 50%;
	font-weight: 700;
}
.bagp-speaker .bagp-initials {
	width: 60px;
	height: 60px;
}
.bagp-speaker p,
.is-style-bagp-card .bagp-initials + .wp-block-group p {
	margin: 0;
}

/* ---------- Event pages ---------- */
.bagp-event-band p {
	margin: 0;
}
.bagp-event-hero .bagp-crumbs a {
	color: var(--wp--preset--color--base);
}
.bagp-event-hero .is-style-bagp-card {
	border-color: transparent;
}
.bagp-date-tile {
	flex: none;
	width: 72px;
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: 10px;
	overflow: hidden;
	text-align: center;
}
.bagp-date-tile p {
	margin: 0;
}
.bagp-date-month {
	padding: 3px 0;
	font-size: 0.8125rem;
	font-weight: 700;
}
.bagp-date-day {
	padding: 4px 0;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.2;
}
.bagp-date-text {
	margin: 0;
}
.bagp-date-text strong {
	color: var(--wp--preset--color--navy);
}
.bagp-event-hero .is-style-bagp-card p {
	margin-block: 0;
}

/* Programme cards */
.bagp-programme {
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: 18px;
	overflow: hidden;
}
.bagp-programme-head {
	padding: 18px 28px;
	border-bottom: 1px solid var(--wp--preset--color--border-light);
}
.bagp-programme-head > * {
	margin: 0 !important;
}
.bagp-programme-row {
	padding: 18px 28px;
	border-bottom: 1px solid var(--wp--preset--color--border-light);
}
.bagp-programme-row:last-child {
	border-bottom: 0;
}
.bagp-programme-row p {
	margin: 0;
}
.bagp-programme-time {
	flex: 0 0 150px;
}
.bagp-programme-body {
	flex: 1 1 420px;
	min-width: 0;
}
.bagp-programme .bagp-pill {
	padding: 2px 10px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}
.bagp-programme ol {
	margin: 0.5rem 0 0;
	padding-left: 1.4rem;
}
.bagp-programme ol li + li {
	margin-top: 0.3rem;
}
@media (max-width: 600px) {
	.bagp-programme-head,
	.bagp-programme-row {
		padding: 16px 18px;
	}
}

/* ---------- GAPRUKI ---------- */
.bagp-number {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border-radius: 50%;
	font-weight: 700;
}
.bagp-goal p {
	margin: 0;
}
.bagp-card-stack {
	display: flex;
	flex-direction: column;
}
/* Push a card's button or closing link to the bottom, but not its description
   (in a card with only a heading and a description, the description is last). */
.bagp-card-stack > .wp-block-buttons,
.bagp-card-stack > p:last-child:not(:nth-child(2)) {
	margin-top: auto !important;
	padding-top: 0.5rem;
}
.bagp-partners {
	border-top: 1px solid var(--wp--preset--color--border-light);
}
.bagp-partners p {
	margin: 0;
}
.bagp-partners a {
	color: var(--wp--preset--color--navy);
}
.bagp-partner-logo {
	margin: 0;
}

/* ---------- Profiles ---------- */
.bagp-profile-photo {
	margin: 0;
}
.bagp-profile-photo img {
	border: 6px solid var(--wp--preset--color--base);
	box-sizing: content-box;
}
.bagp-person-link {
	padding: 14px 16px !important;
	border-radius: 12px;
}
.bagp-person-link p {
	margin: 0;
}
.bagp-person-link a {
	color: var(--wp--preset--color--navy);
	text-decoration: none;
}

/* ---------- News: "category · date" line ---------- */
.bagp-meta {
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.bagp-meta > * {
	margin: 0 !important;
}
.bagp-meta a {
	color: inherit;
	text-decoration: none;
}

/* News page: latest post shown large */
.bagp-feature {
	align-items: stretch;
}
.bagp-feature > .bagp-feature-image {
	flex: 1 1 460px;
	min-height: 280px;
	margin: 0;
}
.bagp-feature > .bagp-feature-image a,
.bagp-feature > .bagp-feature-image img {
	height: 100%;
}
.bagp-feature > .bagp-feature-body {
	flex: 1 1 460px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(1.5rem, 4vw, 2.5rem);
}
.bagp-feature:not(:has(.wp-block-post-featured-image))::before {
	flex: 1 1 460px;
	aspect-ratio: auto;
	min-height: 280px;
}
.bagp-news-card:not(:has(.wp-block-post-featured-image))::before {
	aspect-ratio: auto;
	height: 160px;
}
.wp-block-post-excerpt__more-link {
	font-weight: 700;
	text-decoration: none;
}

/* ---------- Single posts ---------- */
.bagp-pill-terms a {
	display: inline-block;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--wp--preset--color--primary-accent);
	color: var(--wp--preset--color--primary);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
}
.bagp-byline {
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--wp--preset--color--border-light);
}
.bagp-byline > * {
	margin: 0 !important;
}
.bagp-post-image img {
	border-radius: 18px;
}
.bagp-post-body .wp-block-post-content {
	font-size: 1.125rem;
}

/* Share buttons */
.bagp-share {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-top: var(--wp--preset--spacing--large);
	padding-top: 20px;
	border-top: 1px solid var(--wp--preset--color--border-light);
	font-size: 0.9375rem;
}
.bagp-share-label {
	margin-right: 6px;
	font-weight: 600;
	color: var(--wp--preset--color--navy);
}
.bagp-share-button {
	padding: 10px 16px;
	border: 1px solid #c6cbe3;
	border-radius: 8px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--navy);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}
.bagp-share-button:hover,
.bagp-share-button:focus-visible {
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

/* ---------- Category colours and icons ----------
   Cards without a featured image show a pale panel with the category's icon,
   and the "category · date" line takes the category's colour. Query loops give
   each post a category-{slug} class. Later rules win when a post has several
   categories. */
.wp-block-post.category-news .bagp-card-flush:not(:has(.wp-block-post-featured-image))::before {
	background-color: var(--wp--preset--color--tertiary);
	background-image: url("assets/icons/cat-news.svg");
}
.wp-block-post.category-announcements .bagp-card-flush:not(:has(.wp-block-post-featured-image))::before {
	background-color: var(--wp--preset--color--primary-alt);
	background-image: url("assets/icons/cat-announcements.svg");
}
.wp-block-post.category-advocacy .bagp-card-flush:not(:has(.wp-block-post-featured-image))::before {
	background-color: var(--wp--preset--color--main-accent);
	background-image: url("assets/icons/cat-advocacy.svg");
}
.wp-block-post.category-opportunities .bagp-card-flush:not(:has(.wp-block-post-featured-image))::before {
	background-color: var(--wp--preset--color--red-tint);
	background-image: url("assets/icons/cat-opportunities.svg");
}
.wp-block-post.category-research .bagp-card-flush:not(:has(.wp-block-post-featured-image))::before {
	background-color: var(--wp--preset--color--green-tint);
	background-image: url("assets/icons/cat-research.svg");
}
.wp-block-post.category-events .bagp-card-flush:not(:has(.wp-block-post-featured-image))::before {
	background-color: var(--wp--preset--color--primary-accent);
	background-image: url("assets/icons/cat-events.svg");
}
.wp-block-post.category-news .bagp-meta,
.wp-block-post.category-announcements .bagp-meta,
.wp-block-post.category-advocacy .bagp-meta {
	color: var(--wp--preset--color--navy) !important;
}
.wp-block-post.category-opportunities .bagp-meta {
	color: var(--wp--preset--color--red-text) !important;
}
.wp-block-post.category-research .bagp-meta {
	color: var(--wp--preset--color--green) !important;
}
.wp-block-post.category-events .bagp-meta {
	color: var(--wp--preset--color--primary) !important;
}

/* ---------- Category pages: newest post shown large, like the News page ----------
   On the first page of a category, the first card spans the full width with the
   picture on the left. Later pages show an ordinary grid. Only the latest card
   shows "Read more". */
.bagp-archive-grid .wp-post-excerpt__more-text,
.bagp-archive-grid .wp-block-post-excerpt__more-text {
	display: none;
}
@media (min-width: 782px) {
	body:not(.paged) .bagp-archive-grid > .wp-block-post:first-child {
		grid-column: 1 / -1;
	}
	body:not(.paged) .bagp-archive-grid > .wp-block-post:first-child .bagp-news-card {
		display: flex;
		flex-wrap: wrap;
		align-items: stretch;
	}
	body:not(.paged) .bagp-archive-grid > .wp-block-post:first-child .wp-block-post-featured-image {
		flex: 1 1 460px;
		min-height: 280px;
		height: auto !important;
		margin: 0;
	}
	body:not(.paged) .bagp-archive-grid > .wp-block-post:first-child .wp-block-post-featured-image a,
	body:not(.paged) .bagp-archive-grid > .wp-block-post:first-child .wp-block-post-featured-image img {
		height: 100% !important;
	}
	body:not(.paged) .bagp-archive-grid > .wp-block-post:first-child .bagp-news-card:not(:has(.wp-block-post-featured-image))::before {
		flex: 1 1 460px;
		height: auto;
		min-height: 280px;
	}
	body:not(.paged) .bagp-archive-grid > .wp-block-post:first-child .bagp-card-body {
		flex: 1 1 460px;
		min-width: 0;
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding: clamp(1.5rem, 4vw, 2.5rem);
	}
	body:not(.paged) .bagp-archive-grid > .wp-block-post:first-child .wp-block-post-title {
		font-size: var(--wp--preset--font-size--large) !important;
	}
	body:not(.paged) .bagp-archive-grid > .wp-block-post:first-child .wp-block-post-excerpt {
		font-size: var(--wp--preset--font-size--base) !important;
	}
	body:not(.paged) .bagp-archive-grid > .wp-block-post:first-child .wp-block-post-excerpt__more-text {
		display: block;
	}
}

/* ---------- Category label on posts takes the category's colours ---------- */
.bagp-pill-terms a[href*="/category/announcements/"] {
	background: var(--wp--preset--color--primary-alt);
	color: var(--wp--preset--color--navy);
}
.bagp-pill-terms a[href*="/category/advocacy/"] {
	background: var(--wp--preset--color--main-accent);
	color: var(--wp--preset--color--navy);
}
.bagp-pill-terms a[href*="/category/news/"] {
	background: var(--wp--preset--color--tertiary);
	color: var(--wp--preset--color--navy);
}
.bagp-pill-terms a[href*="/category/opportunities/"] {
	background: var(--wp--preset--color--red-tint);
	color: var(--wp--preset--color--red-text);
}
.bagp-pill-terms a[href*="/category/research/"] {
	background: var(--wp--preset--color--green-tint);
	color: var(--wp--preset--color--green);
}
.bagp-pill-terms a[href*="/category/events/"] {
	background: var(--wp--preset--color--primary-accent);
	color: var(--wp--preset--color--primary);
}
.bagp-pill-terms {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
.bagp-pill-terms .wp-block-post-terms__separator {
	display: none;
}

/* ---------- Post with side panel ---------- */
.bagp-lead {
	font-weight: 400;
	line-height: 1.5;
}
.bagp-callout {
	padding: 1.5rem 1.75rem;
	border-radius: 14px;
}
.bagp-callout p {
	margin: 0;
	font-size: 1rem;
}
.bagp-callout .bagp-icon {
	flex: none;
	margin: 0.1rem 0 0;
}
.bagp-glance h2 {
	margin-bottom: 0.25rem;
}
.bagp-glance p {
	margin-bottom: 0;
}
.bagp-video iframe {
	border-radius: 14px;
}
.bagp-glance p strong {
	color: var(--wp--preset--color--navy);
}
@media (min-width: 782px) {
	.bagp-side-panel > .wp-block-column:last-child {
		position: sticky;
		top: 2rem;
	}
	.bagp-post-body-wide .bagp-share {
		max-width: calc(64% - 1rem);
	}
}

/* ---------- "Closed" posts ----------
   Tag a post "Closed" to show the yellow strip at the top of the post, and a
   "Closed" note on its card in news lists. */
.bagp-closed-band {
	display: none !important;
}
body.bagp-closed .bagp-closed-band {
	display: block !important;
}
.wp-block-post.tag-closed .bagp-meta::after {
	content: "· Closed";
	margin-left: 0.4rem;
	color: var(--wp--preset--color--red-text);
}

/* ---------- Placeholder header picture on posts without a featured image ----------
   Uses the same pale colour and icon as the category's news cards. A featured
   image, when set, replaces it. */
.bagp-featured-wrap:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	display: block;
	width: 100%;
	max-width: 1100px;
	height: clamp(180px, 28vw, 320px);
	margin: 0 auto var(--wp--preset--spacing--medium);
	border-radius: 18px;
	background: var(--wp--preset--color--tertiary) url("assets/icons/cat-news.svg") center / auto 38% no-repeat;
}
body.bagp-cat-announcements .bagp-featured-wrap::before {
	background-color: var(--wp--preset--color--primary-alt);
	background-image: url("assets/icons/cat-announcements.svg");
}
body.bagp-cat-advocacy .bagp-featured-wrap::before {
	background-color: var(--wp--preset--color--main-accent);
	background-image: url("assets/icons/cat-advocacy.svg");
}
body.bagp-cat-opportunities .bagp-featured-wrap::before {
	background-color: var(--wp--preset--color--red-tint);
	background-image: url("assets/icons/cat-opportunities.svg");
}
body.bagp-cat-research .bagp-featured-wrap::before {
	background-color: var(--wp--preset--color--green-tint);
	background-image: url("assets/icons/cat-research.svg");
}
body.bagp-cat-events .bagp-featured-wrap::before {
	background-color: var(--wp--preset--color--primary-accent);
	background-image: url("assets/icons/cat-events.svg");
}

/* ---------- Breadcrumbs (WordPress Breadcrumbs block) ---------- */
.wp-block-breadcrumbs.bagp-crumbs {
	margin-bottom: 0.75rem;
}
.wp-block-breadcrumbs.bagp-crumbs a {
	color: inherit;
}
.bagp-event-hero .wp-block-breadcrumbs a {
	color: var(--wp--preset--color--base);
}

/* ---------- Contrast: green text on the pale green tint ----------
   #2E7D32 on #E6F2E7 is 4.45:1, just under the 4.5:1 minimum for small text, so
   small green text on the tint uses a slightly darker green (5.65:1). */
.has-green-tint-background-color.has-green-color,
.has-green-tint-background-color .has-green-color,
.bagp-pill-terms a[href*="/category/research/"] {
	color: #276b2b !important;
}

/* ---------- Whole news cards are clickable ----------
   The post title's link is stretched over the whole card, so tapping the
   picture, the placeholder panel or the excerpt opens the post (helpful on
   phones). The category link and "Read more" stay separately clickable above
   it. One link per card keeps it simple for screen readers. */
.wp-block-post .is-style-bagp-card {
	position: relative;
}
.wp-block-post .is-style-bagp-card .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
}
.wp-block-post .is-style-bagp-card .wp-block-post-terms a,
.wp-block-post .is-style-bagp-card .wp-block-post-excerpt__more-link {
	position: relative;
	z-index: 2;
}
.wp-block-post .is-style-bagp-card:hover {
	border-color: var(--wp--preset--color--border-dark);
	box-shadow: 0 6px 20px rgba(16, 26, 92, 0.08);
}
.wp-block-post .is-style-bagp-card:hover .wp-block-post-title a {
	text-decoration: underline;
}
.wp-block-post .is-style-bagp-card:has(.wp-block-post-title a:focus-visible) {
	outline: 3px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}
.wp-block-post .is-style-bagp-card .wp-block-post-title a:focus-visible {
	outline: none;
}
