/*
Theme Name: Bridgend Centre
Author: MJ Creative
Description: Calm, accessible block theme for the Bridgend Centre, Bollington.
Version: 0.14.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bridgend-centre
*/

/*
 * Only things theme.json cannot express live here.
 * Colours, fonts, sizes and spacing all come from theme.json via CSS variables.
 */

/* ---------- Focus: strong, visible ring on every interactive element ---------- */

/* Dark ring on light backgrounds by default. */
:root {
	--bc-focus-colour: var(--wp--preset--color--ink);
}

/* Light ring inside dark sections (hero, footer, green cards). Buttons are
   deliberately excluded so a dark-green button on cream keeps the dark ring. */
:where(.wp-block-cover, .wp-block-group, .wp-block-column, .wp-block-template-part).has-ink-background-color,
:where(.wp-block-cover, .wp-block-group, .wp-block-column, .wp-block-template-part).has-green-700-background-color,
:where(.wp-block-cover, .wp-block-group, .wp-block-column, .wp-block-template-part).has-green-600-background-color,
.wp-block-cover {
	--bc-focus-colour: var(--wp--preset--color--lime);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.wp-element-button:focus-visible {
	outline: var(--wp--custom--focus-width) solid var(--bc-focus-colour);
	outline-offset: 3px;
	box-shadow: none;
}

/* ---------- Touch targets (WCAG 2.5.8): buttons at least 48px tall ---------- */

.wp-element-button,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	text-align: center;
}

/* Underline offset makes links easier to read for people with low vision. */
a {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 0.08em;
}

/* Keep long words (e.g. URLs) from causing sideways scrolling at 360px / 200% zoom. */
body {
	overflow-wrap: break-word;
}

/* ---------- Header and navigation ---------- */

/* Two rows, shared by every page: logo with Basket and Donate on white,
   then the menu on a dark green bar. */

/* Phones: logo and buttons centred, one above the other when they don't fit. */
@media (max-width: 600px) {
	.bc-header__top > .wp-block-group,
	.bc-header__actions {
		justify-content: center;
	}
}

/* Basket: outlined button with a basket icon. The icon is a mask filled with
   the text colour, so it follows whatever colour the button is given. */
.bc-basket .wp-block-button__link {
	gap: 0.5em;
	border: 2px solid currentColor;
	padding-top: calc(0.8rem - 2px);
	padding-bottom: calc(0.8rem - 2px);
}

.bc-basket .wp-block-button__link::before {
	content: "";
	flex: none;
	width: 1.25em;
	height: 1.25em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.21 9l-4.38-6.56a1 1 0 0 0-1.66 0L6.79 9H2a1 1 0 0 0-.96 1.27l2.54 9.27A2 2 0 0 0 5.5 21h13a2 2 0 0 0 1.93-1.46l2.54-9.27L23 10a1 1 0 0 0-1-1h-4.79zM9 9l3-4.4L15 9H9zm3 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.21 9l-4.38-6.56a1 1 0 0 0-1.66 0L6.79 9H2a1 1 0 0 0-.96 1.27l2.54 9.27A2 2 0 0 0 5.5 21h13a2 2 0 0 0 1.93-1.46l2.54-9.27L23 10a1 1 0 0 0-1-1h-4.79zM9 9l3-4.4L15 9H9zm3 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Menu items: white on the green bar (8.22:1), comfortable 48px touch
   targets, underlined on hover like other links. */
.bc-header__nav .wp-block-navigation-item__content {
	color: inherit;
}

.bc-header .wp-block-navigation-item__content {
	padding: 0.75rem 0.5rem;
}

.bc-header .wp-block-navigation-item__content:hover {
	text-decoration: underline;
}

/* Dropdowns (sub-pages under a menu item): open on hover or keyboard focus,
   cream with ink text (13.8:1), set on the Navigation block's "Submenu &
   overlay" colours. The focus ring goes back to ink on the light dropdown and
   on the phone menu overlay. */
.bc-header .wp-block-navigation__submenu-container,
.wp-block-navigation__responsive-container.is-menu-open {
	--bc-focus-colour: var(--wp--preset--color--ink);
}

.bc-header .wp-block-navigation__submenu-container {
	min-width: 16rem !important;
	border-radius: 0 0 var(--wp--custom--radius--small) var(--wp--custom--radius--small);
	box-shadow: 0 8px 20px rgb(28 43 32 / 0.15);
}

.bc-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.6rem 1rem;
	font-weight: 400;
}

/* Mobile "Menu" / "Close" buttons: visible text label, bordered, 48px. */
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	min-width: 48px;
	min-height: 48px;
	padding: 0.5rem 1rem;
	border: 2px solid currentColor;
	border-radius: 999px;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
}

/* Overlay menu: large, well-spaced items. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--large);
}

/* Buttons with a palette colour can't change colour on hover (WordPress's
   colour classes win), so give every button an underline on hover instead. */
.wp-block-button__link:hover {
	text-decoration: underline;
}

/* The footer sits straight under the page (WordPress otherwise leaves a
   cream gap, which shows under the white sub-home and news pages). */
.wp-site-blocks > footer.wp-block-template-part {
	margin-block-start: 0;
}

/* ---------- Homepage sections ---------- */

/* Sections on the homepage sit flush against each other; each one has its
   own top and bottom padding. */
.wp-block-post-content > .alignfull {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* Hero: gentle curved bottom edge, drawn as a cream ellipse over the bottom
   of the photo. It sits inside the hero's large bottom padding, so it can
   never overlap the text. Decorative only. */
.bc-hero {
	overflow: hidden;
}

.bc-hero::after {
	content: "";
	position: absolute;
	z-index: 2;
	left: -10%;
	right: -10%;
	bottom: -1px;
	height: clamp(1.5rem, 5vw, 4rem);
	background: var(--wp--preset--color--cream);
	border-radius: 50% 50% 0 0 / 100% 100% 0 0;
	pointer-events: none;
}

/* On the white pages (sub-home, blog posting, news...) the curve is white to
   match, so there's no cream band under the photo. */
.bc-page .bc-hero::after {
	background: var(--wp--preset--color--white);
}

/* Hero text panel: dark green at 90% so a little of the photo shows through.
   White text on it measures at least 6.34:1 even over pure white, so it stays
   readable whatever photo is used. !important is needed to beat WordPress's
   colour class. Browsers without color-mix() fall back to solid green-700. */
.bc-hero-panel.has-green-700-background-color {
	background-color: color-mix(in srgb, var(--wp--preset--color--green-700) 90%, transparent) !important;
}

/* Tablets and up: the Cover's own 80vh made the hero far too tall on an
   iPad in portrait and on very tall windows. Cap it by width too, so the
   photo keeps a sensible landscape shape on every screen. */
@media (min-width: 601px) {
	.bc-hero {
		min-height: min(80vh, 70vw, 50rem) !important;
	}
}

/* The panel area is 62rem wide and centred along the bottom. */
.wp-block-cover.bc-hero.bc-hero .wp-block-cover__inner-container {
	box-sizing: border-box;
	width: 100%;
	max-width: 62rem;
}

/* Desktop: the panel is wide (62rem, see above) and centred along the
   bottom, with tighter padding so it stays short and the faces stay clear. */
.bc-hero .bc-hero-panel {
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50) !important;
}

/* Phones: show the photo uncovered (all the faces visible), with the panel
   just below it, slightly overlapping. !important beats the min-height,
   padding and focal point the Cover block sets inline. */
@media (max-width: 600px) {
	.bc-hero {
		display: block;
		min-height: 0 !important;
		padding: 0 0 var(--wp--preset--spacing--40) !important;
	}

	.bc-hero .wp-block-cover__image-background {
		position: static;
		display: block;
		width: 100%;
		height: auto;
		aspect-ratio: 3 / 2;
		object-position: 50% 30% !important;
	}

	.bc-hero .wp-block-cover__background,
	.bc-hero::after {
		display: none;
	}

	.bc-hero .wp-block-cover__inner-container {
		margin-top: calc(-1 * var(--wp--preset--spacing--40));
		padding-inline: var(--wp--preset--spacing--30);
	}

	.bc-hero .bc-hero-panel {
		padding: var(--wp--preset--spacing--40) !important;
	}
}

/* Hero "Page header" style (sub-home pages): a shorter photo with just the
   page title, sitting in the content column with rounded corners. Phones use
   the same photo-then-panel layout as the homepage hero (above). */
@media (min-width: 601px) {
	.bc-hero.is-style-page-header {
		min-height: clamp(15rem, 26vw, 22rem) !important;
		padding: var(--wp--preset--spacing--40) !important;
		border-radius: var(--wp--custom--radius--large);
	}

	.bc-hero.is-style-page-header .bc-hero-panel {
		padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40) !important;
	}
}

.bc-hero.is-style-page-header::after {
	display: none;
}

@media (max-width: 600px) {
	.bc-hero.is-style-page-header .wp-block-cover__image-background {
		border-radius: var(--wp--custom--radius--large);
	}
}

/* Cards: keep buttons lined up along the bottom when card text lengths differ. */
.bc-card {
	display: flex;
	flex-direction: column;
}

.bc-card > .wp-block-buttons {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--30);
}

/* ---------- Coming up (blocks/coming-up) ---------- */

.bc-coming-up__day {
	margin: 0;
	text-align: center;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}

/* Cards wrap and stay centred, so one event doesn't stretch across the page.
   20rem cards give one column on phones, two on tablets, three on desktop. */
.bc-coming-up__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--wp--preset--spacing--40);
	margin: var(--wp--preset--spacing--40) 0 0;
	padding: 0;
	list-style: none;
}

.bc-event {
	flex: 0 1 20rem;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--wp--preset--color--white);
	border: 2px solid var(--wp--preset--color--lime);
	border-radius: var(--wp--custom--radius--large);
}

.bc-event__image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.bc-event__body {
	padding: var(--wp--preset--spacing--40);
}

.bc-event__body > * {
	margin: 0;
}

.bc-event__body > * + * {
	margin-top: var(--wp--preset--spacing--20);
}

.bc-event__when {
	font-weight: 700;
	color: var(--wp--preset--color--green-700);
}

.bc-event__title {
	font-size: var(--wp--preset--font-size--large);
}

/* "The next few events" (the default): equal cards filling the whole width,
   three across on wide screens, fewer as it narrows, one on phones. */
.bc-coming-up.is-next .bc-coming-up__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
	margin-top: 0;
}

.bc-event__date {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
}

.bc-event__day {
	margin: 0;
	font-weight: 700;
}

.bc-event__where,
.bc-event__tags {
	font-size: var(--wp--preset--font-size--small);
}

.bc-event__price {
	margin-left: 0.4rem;
	font-weight: 700;
}

/* Small date badge (inc/events.php): month over day number. Decorative; the
   date is written out in words beside it. */
.bc-date-badge {
	flex: none;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 0;
	background: var(--wp--preset--color--green-700);
	color: var(--wp--preset--color--white);
	line-height: 1;
	text-align: center;
}

.bc-date-badge__month {
	font-size: 1rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.bc-date-badge__day {
	font-size: 1.5rem;
	font-weight: 800;
}

/* "Tickets" tag: outlined, in words, so it isn't colour alone. */
.bc-tag {
	display: inline-block;
	padding: 0 0.6rem;
	border: 2px solid var(--wp--preset--color--green-700);
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--green-700);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.5;
}

.bc-coming-up__none {
	text-align: center;
}

.bc-coming-up__more {
	display: flex;
	justify-content: center;
	margin-top: var(--wp--preset--spacing--50);
}

/* ---------- Sidebar (parts/sidebar-home.html, blocks/upcoming-events) ---------- */

/* Columns stack below 782px, so the sidebar drops under About. */

.bc-upcoming__list {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
	margin: 0;
	padding: 0;
	list-style: none;
}

.bc-upcoming__item {
	display: flex;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--30);
	padding-bottom: var(--wp--preset--spacing--30);
	border-bottom: 2px solid var(--wp--preset--color--lime);
}

.bc-upcoming__text {
	min-width: 0;
}

.bc-upcoming__text > * {
	margin: 0;
}

.bc-upcoming__where,
.bc-upcoming__summary {
	font-size: var(--wp--preset--font-size--small);
}

.bc-upcoming__tags {
	margin-top: 0.3rem !important;
}

.bc-upcoming__day {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: var(--wp--preset--color--green-700);
}

.bc-upcoming__title {
	margin-block: 0.15rem;
	font-size: var(--wp--preset--font-size--medium);
}

.bc-upcoming__when {
	font-size: var(--wp--preset--font-size--small);
}

.bc-upcoming__more {
	margin-top: var(--wp--preset--spacing--40);
}

/* ---------- Sub-home and document pages ---------- */

/* Pages in this section (blocks/child-pages): cards that wrap, two or three
   across in the content column, one on phones. */
.bc-child-pages {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
	gap: var(--wp--preset--spacing--40);
	margin-inline: 0;
	padding: 0;
	list-style: none;
}

.bc-child-page {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--wp--preset--color--cream);
	border: 2px solid var(--wp--preset--color--lime);
	border-radius: var(--wp--custom--radius--large);
}

.bc-child-page__image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.bc-child-page__body {
	padding: var(--wp--preset--spacing--40);
}

.bc-child-page__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}

.bc-child-page__excerpt {
	margin: var(--wp--preset--spacing--20) 0 0;
	font-size: var(--wp--preset--font-size--small);
}

/* On this page (blocks/contents). */
.bc-contents {
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--cream);
	border-left: 6px solid var(--wp--preset--color--green-700);
	border-radius: var(--wp--custom--radius--small);
}

.bc-contents__label {
	margin: 0;
	font-weight: 700;
}

.bc-contents__list {
	margin: var(--wp--preset--spacing--20) 0 0;
	padding-left: 1.5em;
}

.bc-contents__list li + li {
	margin-top: 0.35em;
}

/* Jumping to a heading from the contents list leaves a little room above it. */
.wp-block-post-content h2[id] {
	scroll-margin-top: var(--wp--preset--spacing--40);
}

/* Download as PDF (blocks/download-pdf). The print button stays hidden until
   its script runs; the theme's inline-flex on buttons would otherwise beat
   the hidden attribute. */
.bc-download-pdf__print[hidden] {
	display: none;
}

.bc-download-pdf__size {
	margin-left: 0.35em;
	font-weight: 400;
}

.bc-download-pdf__note {
	flex-basis: 100%;
	margin: 0.25rem 0 0;
	font-size: 14px;
	color: #555;
}

/* Downloads list (core File block): file name, then the green button. */
.wp-block-file:not(.wp-element-button) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	font-size: var(--wp--preset--font-size--medium);
}

.wp-block-file .wp-block-file__button {
	margin-left: 0;
}

/* Photo galleries (core Gallery): rounded photos with captions underneath in
   the body colour, rather than WordPress's white-on-dark overlay, so every
   caption keeps full contrast whatever the photo. */
.wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption)::before {
	display: none;
}

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	position: static;
	max-height: none;
	margin: var(--wp--preset--spacing--20) 0 0;
	padding: 0;
	overflow: visible;
	background: none;
	color: inherit;
	font-size: var(--wp--preset--font-size--small);
	text-align: left;
	text-shadow: none;
	-webkit-mask-image: none;
	mask-image: none;
}

.wp-block-gallery.has-nested-images figure.wp-block-image {
	flex-direction: column;
	justify-content: flex-start;
}

/* With the caption underneath, cropped photos need a set shape instead of
   stretching to fill the tile. Core's gallery CSS loads after this file and
   uses :not(#individual-image), hence the repeated class to outrank it. */
.wp-block-gallery.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) img,
.wp-block-gallery.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) > a {
	flex: none;
}

.wp-block-gallery.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.wp-block-gallery.has-nested-images figure.wp-block-image img {
	border-radius: var(--wp--custom--radius--small);
}

/* Embedded videos and other pasted links get rounded corners like photos. */
.wp-block-embed iframe {
	border-radius: var(--wp--custom--radius--small);
}

/* ---------- News (templates/home.html, single.html, patterns/news-feed.php) ---------- */

/* The feed: one card per post, like a social media timeline. */
.bc-feed .wp-block-post-template {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--50);
}

.bc-post-card {
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--cream);
	border: 2px solid var(--wp--preset--color--lime);
	border-radius: var(--wp--custom--radius--large);
}

.bc-post-card .wp-block-post-excerpt__excerpt {
	margin-top: 0;
}

.bc-post-card .wp-block-post-featured-image img {
	border-radius: var(--wp--custom--radius--small);
}

.bc-post__date {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: var(--wp--preset--color--green-700);
}

.bc-feed .wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--50);
}

.wp-block-post-featured-image img {
	border-radius: var(--wp--custom--radius--large);
}

.bc-post-nav {
	padding-top: var(--wp--preset--spacing--40);
	border-top: 2px solid var(--wp--preset--color--lime);
}

/* "Older post" / "Newer post" on its own line above the post's title. */
.bc-post-nav .post-navigation-link__label {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}

/* ---------- Blog posting pages (templates/page-blog.html, blocks/post-feed) ---------- */

.bc-post-feed {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--50);
}

/* "Posted by Becky · 26 October 2026 at 10:15am" */
.bc-post-meta {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--green-700);
}

.bc-post-meta__author {
	font-weight: 700;
}

/* The newest posts, in full. */
.bc-feed-post {
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--cream);
	border: 2px solid var(--wp--preset--color--lime);
	border-radius: var(--wp--custom--radius--large);
}

.bc-feed-post > * {
	margin: 0;
}

.bc-feed-post > * + * {
	margin-top: var(--wp--preset--spacing--30);
}

.bc-feed-post__title {
	font-size: var(--wp--preset--font-size--x-large);
}

/* Post content inside the feed keeps the theme's block spacing. */
.bc-feed-post__content > *,
.bc-feed-item__content > * {
	margin-block: 0;
}

.bc-feed-post__content > * + *,
.bc-feed-item__content > * + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

.bc-feed-post__image {
	margin: 0;
}

.bc-post-feed img {
	max-width: 100%;
	height: auto;
	border-radius: var(--wp--custom--radius--small);
}

/* Older posts: a row with the title and when it was posted; click (or Enter)
   to open the full post underneath. Uses <details>, so it works without
   JavaScript and screen readers announce it as expandable. */
.bc-feed-older,
.bc-feed-year__items {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
}

.bc-feed-item {
	background: var(--wp--preset--color--white);
	border: 2px solid var(--wp--preset--color--lime);
	border-radius: var(--wp--custom--radius--small);
}

.bc-feed-item > summary,
.bc-feed-year > summary {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.25rem 1rem;
	min-height: 48px;
	box-sizing: border-box;
	padding: 0.75rem 1rem 0.75rem 2.75rem;
	list-style: none;
	cursor: pointer;
}

.bc-feed-item > summary::-webkit-details-marker,
.bc-feed-year > summary::-webkit-details-marker {
	display: none;
}

/* Chevron: points right when closed, down when open. */
.bc-feed-item > summary::before,
.bc-feed-year > summary::before {
	content: "";
	position: absolute;
	left: 1.1rem;
	top: 1.15em;
	width: 0.55rem;
	height: 0.55rem;
	border-right: 3px solid currentColor;
	border-bottom: 3px solid currentColor;
	transform: rotate(-45deg);
	transition: transform 0.2s ease;
}

.bc-feed-item[open] > summary::before,
.bc-feed-year[open] > summary::before {
	transform: rotate(45deg);
}

.bc-feed-item__title {
	font-weight: 700;
}

.bc-feed-item > summary:hover .bc-feed-item__title,
.bc-feed-year > summary:hover .bc-feed-year__year {
	text-decoration: underline;
}

.bc-feed-item__content {
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40) var(--wp--preset--spacing--40);
	border-top: 2px solid var(--wp--preset--color--lime);
}

.bc-feed-item__link {
	font-size: var(--wp--preset--font-size--small);
}

/* Earlier years: one bar per year, holding that year's posts. */
.bc-feed-year > summary {
	align-items: center;
	background: var(--wp--preset--color--lime);
	border-radius: var(--wp--custom--radius--small);
	color: var(--wp--preset--color--ink);
}

.bc-feed-year > summary::before {
	top: 50%;
	margin-top: -0.4rem;
}

.bc-feed-year[open] > summary::before {
	margin-top: -0.55rem;
}

.bc-feed-year__year {
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
}

.bc-feed-year__count {
	font-size: var(--wp--preset--font-size--small);
}

.bc-feed-year__items {
	padding-top: var(--wp--preset--spacing--20);
}

/* Posts written on a blog posting page (blocks/posts). Each post is a card
   whose Heading 2 is the button that opens and closes it (<details>). */
.bc-posts {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
}

.bc-post-entry {
	background: var(--wp--preset--color--cream);
	border: 2px solid var(--wp--preset--color--lime);
	border-radius: var(--wp--custom--radius--large);
}

.bc-post-entry > summary {
	position: relative;
	display: block;
	min-height: 48px;
	box-sizing: border-box;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40) var(--wp--preset--spacing--30) calc(var(--wp--preset--spacing--40) + 1.75rem);
	list-style: none;
	cursor: pointer;
}

.bc-post-entry > summary::-webkit-details-marker {
	display: none;
}

/* Chevron beside the title: points right when closed, down when open. */
.bc-post-entry > summary::before {
	content: "";
	position: absolute;
	left: var(--wp--preset--spacing--40);
	top: calc(var(--wp--preset--spacing--30) + 0.55em);
	width: 0.65rem;
	height: 0.65rem;
	border-right: 3px solid var(--wp--preset--color--green-700);
	border-bottom: 3px solid var(--wp--preset--color--green-700);
	transform: rotate(-45deg);
	transition: transform 0.2s ease;
}

.bc-post-entry[open] > summary::before {
	transform: rotate(45deg);
}

.bc-post-entry__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--x-large);
	color: var(--wp--preset--color--green-700);
}

.bc-post-entry > summary:hover .bc-post-entry__title {
	text-decoration: underline;
}

.bc-post-entry > summary .bc-post-meta {
	display: block;
	margin-top: 0.25rem;
}

.bc-post-entry__content {
	padding: var(--wp--preset--spacing--40);
	border-top: 2px solid var(--wp--preset--color--lime);
}

.bc-post-entry__content > * {
	margin-block: 0;
}

.bc-post-entry__content > * + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

.bc-post-entry__content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--wp--custom--radius--small);
}

/* Earlier years inside Posts use the same year bars as the Post feed. */
.bc-posts .bc-feed-year__items {
	gap: var(--wp--preset--spacing--30);
}

/* Latest news box (patterns/latest-news.php). */
.bc-latest-news .wp-block-post-template {
	margin: 0;
	padding: 0;
}

.bc-latest-news .wp-block-post {
	padding-bottom: var(--wp--preset--spacing--30);
	border-bottom: 2px solid var(--wp--preset--color--lime);
}

.bc-latest-news .wp-block-post + .wp-block-post {
	margin-top: var(--wp--preset--spacing--30);
}

.bc-latest-news .wp-block-post > * {
	margin-block: 0;
}

.bc-latest-news .wp-block-post-title {
	margin-block: 0.15rem;
}

.bc-latest-news .wp-block-post-excerpt {
	font-size: var(--wp--preset--font-size--small);
}

.bc-latest-news .wp-block-post-excerpt__excerpt {
	margin: 0;
}

/* Latest news block (blocks/latest-news): heading linking to the news page,
   the newest titles, and about three lines of the newest. */
.bc-news > * {
	margin: 0;
}

.bc-news > * + * {
	margin-top: var(--wp--preset--spacing--30);
}

.bc-news__heading a {
	color: inherit;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.15em;
}

.bc-news__list {
	margin-block: var(--wp--preset--spacing--30) 0;
	padding: 0;
	list-style: none;
}

.bc-news__item {
	padding-bottom: var(--wp--preset--spacing--30);
	border-bottom: 2px solid var(--wp--preset--color--lime);
}

.bc-news__item + .bc-news__item {
	margin-top: var(--wp--preset--spacing--30);
}

.bc-news__item:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.bc-news__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.3;
}

.bc-news__preview {
	display: -webkit-box;
	margin: 0.35rem 0 0;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
}

/* ---------- Enquiry forms (blocks/form, blocks/field) ---------- */

/* Questions in a two-column grid, so two "half width" questions can sit side
   by side; everything else (and every question on phones) is full width. */
.bc-form__fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--40);
}

.bc-form__fields > * {
	grid-column: 1 / -1;
	margin: 0;
}

/* A sub-heading part-way down starts a new section: a little more room above. */
.bc-form__fields > .wp-block-heading:not(:first-child) {
	margin-top: var(--wp--preset--spacing--30);
}

@media (min-width: 600px) {
	.bc-form__fields > .bc-field--half {
		grid-column: auto;
	}
}

.bc-field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.bc-field__label {
	padding: 0;
	font-weight: 700;
}

/* "(required)" in words, not just a star, so everyone can tell. */
.bc-field__required {
	font-weight: 400;
	color: #4a5a4e;
}

.bc-field__help {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	color: #4a5a4e;
}

/* Inputs: a clear dark border (well over 3:1 against white), large text and
   a 48px touch target. */
.bc-field input:not([type="checkbox"], [type="radio"]),
.bc-field select,
.bc-field textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	padding: 0.6rem 0.75rem;
	font: inherit;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--white);
	border: 2px solid #5f6f63;
	border-radius: var(--wp--custom--radius--small);
}

.bc-field textarea {
	min-height: 9rem;
	resize: vertical;
}

.bc-field input[type="file"] {
	padding: 0.5rem;
	background: var(--wp--preset--color--cream);
}

.bc-field__choices {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.bc-field__choice {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	min-height: 44px;
	padding-top: 0.25rem;
}

.bc-field__choice input {
	flex: none;
	width: 1.5rem;
	height: 1.5rem;
	margin: 0.1rem 0 0;
	accent-color: var(--wp--preset--color--green-700);
}

.bc-field--checkbox .bc-field__choice label {
	font-weight: 700;
}

/* Problems: dark red (over 7:1 on white), in words, not just colour. */
.bc-field__error {
	margin: 0;
	font-weight: 700;
	color: #a4161a;
}

.bc-field.has-error input:not([type="checkbox"], [type="radio"]),
.bc-field.has-error select,
.bc-field.has-error textarea {
	border-color: #a4161a;
	border-width: 3px;
}

.bc-form__errors {
	margin-block-end: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--40);
	border: 3px solid #a4161a;
	border-radius: var(--wp--custom--radius--small);
	background: var(--wp--preset--color--white);
}

.bc-form__errors-title {
	margin: 0 0 0.5rem;
	font-size: var(--wp--preset--font-size--large);
}

.bc-form__errors ul {
	margin: 0;
	padding-left: 1.25rem;
}

.bc-form__errors a {
	color: #a4161a;
	font-weight: 700;
}

.bc-form__actions {
	margin-block-start: var(--wp--preset--spacing--40);
}

/* The thank-you message after sending. */
.bc-form__sent {
	padding: var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--large);
	background: var(--wp--preset--color--cream);
	border: 2px solid var(--wp--preset--color--green-700);
	border-radius: var(--wp--custom--radius--large);
}

.bc-form__sent > :first-child {
	margin-top: 0;
}

.bc-form__sent > :last-child {
	margin-bottom: 0;
}

/* The spam trap: off-screen, so people never see or reach it. */
.bc-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Funders & supporters (blocks/supporters) ---------- */

/* A sideways-scrolling row. The side padding lets the first and last logos
   reach the middle, and scroll-snap settles each one there. */
.bc-supporters {
	--bc-supporter-width: 14rem;
}

.bc-supporters__track {
	position: relative; /* view.js measures items against this. */
	display: flex;
	gap: var(--wp--preset--spacing--40);
	margin: 0;
	padding: var(--wp--preset--spacing--30) calc(50% - var(--bc-supporter-width) / 2);
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none; /* Scrolls by trackpad, touch or keys; no bar needed. */
	/* Soft fade at both ends so the tiles cut off at the edges look intended. */
	-webkit-mask-image: linear-gradient(to right, transparent, #000 4rem, #000 calc(100% - 4rem), transparent);
	mask-image: linear-gradient(to right, transparent, #000 4rem, #000 calc(100% - 4rem), transparent);
}

.bc-supporters__track::-webkit-scrollbar {
	display: none;
}

.bc-supporter {
	flex: 0 0 var(--bc-supporter-width);
	scroll-snap-align: center;
	text-align: center;
	transition: transform 0.3s ease;
}

.bc-supporter__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	height: 8rem;
	margin: 0;
	padding: var(--wp--preset--spacing--30);
	background: var(--wp--preset--color--white);
	border: 2px solid var(--wp--preset--color--lime);
	border-radius: var(--wp--custom--radius--large);
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.bc-supporter__logo img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	transition: opacity 0.3s ease, filter 0.3s ease;
}

/* No logo: the name sits in the tile instead. */
.bc-supporter__logo--text {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
	line-height: 1.25;
}

.bc-supporter__name {
	margin: var(--wp--preset--spacing--20) 0 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 1.3;
}

/* Once view.js is running: the middle logo is full colour, slightly larger
   and outlined; the rest are softened. Only the logo images fade, never the
   names, so all text keeps full contrast. */
.bc-supporters.is-enhanced .bc-supporter:not(.is-current) .bc-supporter__logo img {
	opacity: 0.6;
	filter: grayscale(1);
}

.bc-supporters.is-enhanced .bc-supporter.is-current {
	transform: scale(1.08);
}

.bc-supporters.is-enhanced .bc-supporter.is-current .bc-supporter__logo {
	border-color: var(--wp--preset--color--green-600);
	box-shadow: 0 6px 18px rgb(28 43 32 / 0.15);
}

/* view.js sets this for a frame while it swaps a copy for the real logo. */
.bc-supporters__track.is-jumping,
.bc-supporters__track.is-jumping * {
	transition: none !important;
}

@media (max-width: 600px) {
	.bc-supporters {
		--bc-supporter-width: 11rem;
	}

	.bc-supporter__logo {
		height: 6.5rem;
	}
}

/* ---------- Charity Bank note (patterns/charity-bank.php) ---------- */

/* Logo and sentence side by side; the sentence drops under the logo when
   there isn't room for both (it needs about 18rem). */
.bc-charity-bank .bc-charity-bank__logo {
	flex: 0 0 auto;
	margin: 0;
}

.bc-charity-bank .bc-charity-bank__logo img {
	border-radius: 0;
}

.bc-charity-bank .bc-charity-bank__text {
	flex: 1 1 18rem;
	max-width: 30rem;
	margin: 0;
}

@media (max-width: 600px) {
	.bc-charity-bank .bc-charity-bank__text {
		text-align: center;
	}
}

/* ---------- Footer ---------- */

/* The logo file has a white background, so it sits on a small white panel
   that hugs the logo instead of stretching across the column. */
.bc-logo-panel {
	width: fit-content;
	max-width: 100%;
}

/* Logo on the right of the footer on wider screens. Below 782px (where
   WordPress stacks columns) it sits under the text, on the left. */
@media (min-width: 782px) {
	.bc-footer-logo .bc-logo-panel {
		margin-left: auto;
		margin-right: 0;
	}
}

.bc-logo-panel .wp-block-site-logo img {
	max-width: 100%;
	height: auto;
}

/* ---------- Print (and "Save as PDF") ---------- */

/* Just the page content: no header, menu, sidebar, footer or buttons, black
   on white, photos kept. Used by the Download as PDF button when no file is
   picked. */
@media print {
	body {
		background: #fff !important;
		color: #000 !important;
		font-size: 12pt;
	}

	header.wp-block-template-part,
	footer.wp-block-template-part,
	.bc-sidebar-column,
	.bc-download-pdf,
	.bc-post-nav,
	.wp-block-buttons,
	.wp-block-navigation,
	.skip-link,
	#wpadminbar {
		display: none !important;
	}

	.bc-with-sidebar > .bc-main-column {
		flex-basis: 100% !important;
	}

	.bc-page {
		padding: 0 !important;
	}

	a {
		color: #000 !important;
	}

	/* The page header photo prints as a plain title. */
	.bc-hero {
		min-height: 0 !important;
		padding: 0 !important;
	}

	.bc-hero .wp-block-cover__image-background,
	.bc-hero .wp-block-cover__background {
		display: none;
	}

	.bc-hero .bc-hero-panel {
		padding: 0 !important;
		background: none !important;
		color: #000 !important;
	}

	.bc-hero .bc-hero-panel * {
		color: #000 !important;
		text-align: left !important;
	}

	h2,
	h3 {
		break-after: avoid;
	}

	img,
	figure {
		break-inside: avoid;
	}
}

/* ---------- Reduced motion ---------- */

@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;
	}
}
