/**
 * Petworth component styles.
 * Tokens (colours, fonts, sizes) come from theme.json as --wp--preset--* vars.
 * Loaded on the front end and in the editor.
 */

:root {
	--pw-radius: 8px;
	--pw-gutter: 24px;
	--pw-c-paper: var(--wp--preset--color--paper);
	--pw-c-cream: var(--wp--preset--color--cream);
	--pw-c-sand: var(--wp--preset--color--sand);
	--pw-c-line: var(--wp--preset--color--line);
	--pw-c-gold: var(--wp--preset--color--gold);
	--pw-c-bronze: var(--wp--preset--color--bronze);
	--pw-c-stone: var(--wp--preset--color--stone);
	--pw-c-mist: var(--wp--preset--color--mist);
	--pw-c-slate: var(--wp--preset--color--slate);
	--pw-c-charcoal: var(--wp--preset--color--charcoal);
	--pw-c-deep: var(--wp--preset--color--deep);
	--pw-c-ink: var(--wp--preset--color--ink);
	--pw-c-night: var(--wp--preset--color--night);
	--pw-font-display: var(--wp--preset--font-family--display);
	/* Every navy title band (theme pages, directory, What's On, events) is this tall,
	   gold rule included, with its content centred. Longer content still grows it. */
	--pw-band-height: 240px;
}

@media (max-width: 781px) {
	:root { --pw-band-height: 250px; }
}

@media (max-width: 600px) {
	:root {
		--pw-gutter: 16px;
		--wp--style--root--padding-left: 16px;
		--wp--style--root--padding-right: 16px;
	}
}

/* -----------------------------------------------------------------
 * Page transitions (cross-document View Transitions).
 * The admin bar, member bar and header never move. Between two pages that
 * open with a navy title band, the band stays solid and only its words
 * change: the old ones fade, the new ones rise in. Everything below fades
 * out, then the new page rises gently into place.
 * When the visitor has scrolled down or has a menu or search open,
 * functions.php adds .pw-vt-plain just before leaving, so the whole page
 * simply fades instead (no header sliding in from off-screen).
 * Browsers without support, or with reduced motion, just load the page.
 * -------------------------------------------------------------- */
@view-transition { navigation: auto; }

#wpadminbar { view-transition-name: pw-adminbar; }
.site-utility { view-transition-name: pw-utility; }
.site-header { view-transition-name: pw-header; }
:is(header.pw-band, .pwd-dir-head, .pwd-listing-head, .pw-whatson__band, .pw-event-page__band) { view-transition-name: pw-band; }
:is(.pw-band__inner, .pwd-dir-head > .pwd-wrap, .pwd-listing-head > .pwd-wrap, .pw-whatson__band-inner, .pw-event-page__header) { view-transition-name: pw-band-text; }
/* Leaving from the Explore dropdown: functions.php gives it its own layer
   (pw-megamenu), which fades out on top while the band and page move. */
::view-transition-group(pw-megamenu) { z-index: 10; animation: none; }
::view-transition-old(pw-megamenu) { animation: 260ms cubic-bezier(.4, 0, 1, 1) both pw-vt-out; }
html.pw-vt-plain :is(#wpadminbar, .site-utility, .site-header, header.pw-band, .pwd-dir-head, .pwd-listing-head, .pw-whatson__band, .pw-event-page__band, .pw-band__inner, .pwd-wrap, .pw-whatson__band-inner, .pw-event-page__header) { view-transition-name: none; }

/* Behind the snapshots: the page colour, never a white flash. (Clicking during a
   transition is handled in functions.php: Chrome sends every click to the page itself
   while one runs, whatever pointer-events says, so the script ends it and clicks through.) */
::view-transition { background: var(--pw-c-paper); }

/* The page below: out quickly, then in with a short rise. */
::view-transition-old(root) { animation: 200ms cubic-bezier(.4, 0, 1, 1) both pw-vt-out; }
::view-transition-new(root) { animation: 520ms cubic-bezier(.16, 1, .3, 1) 140ms both pw-vt-in; }

/* The navy band.
   On both pages: it is the same, so it holds still.
   Arriving (the last page had none): it drops down out of the header like a blind.
   Leaving (the next page has none): it rolls back up into the header.
   A snapshot that is an :only-child has no partner on the other page. */
::view-transition-group(pw-band) { animation-duration: 520ms; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
::view-transition-old(pw-band),
::view-transition-new(pw-band) { animation: none; }
::view-transition-old(pw-band):not(:only-child) { display: none; }
::view-transition-new(pw-band):only-child { animation: 620ms cubic-bezier(.16, 1, .3, 1) both pw-band-down; }
::view-transition-old(pw-band):only-child { animation: 560ms cubic-bezier(.65, 0, .35, 1) 60ms both pw-band-up; }

/* As the band rolls up, the new page rides up attached to its bottom edge,
   with the same timing, rather than appearing underneath it. functions.php
   sets the type and the band's height (--pw-vt-band). */
html:active-view-transition-type(band-leave)::view-transition-old(root) { animation: 140ms linear both pw-vt-out; }
html:active-view-transition-type(band-leave)::view-transition-new(root) { animation: 560ms cubic-bezier(.65, 0, .35, 1) 60ms both pw-vt-ride-up; }
/* The reverse: as the band drops in, the new page rides down beneath its bottom edge. */
html:active-view-transition-type(band-enter)::view-transition-old(root) { animation: 140ms linear both pw-vt-out; }
html:active-view-transition-type(band-enter)::view-transition-new(root) { animation: 620ms cubic-bezier(.16, 1, .3, 1) both pw-vt-ride-down; }
@keyframes pw-vt-ride-down {
	from { transform: translateY(calc(-1 * var(--pw-vt-band, 240px))); opacity: 0; }
	30% { opacity: 1; }
	to { transform: none; opacity: 1; }
}
@keyframes pw-vt-ride-up {
	from { transform: translateY(var(--pw-vt-band, 240px)); opacity: 0; }
	30% { opacity: 1; }
	to { transform: none; opacity: 1; }
}

/* The band's words: the old ones fade, the new ones rise in a moment later.
   When the band is dropping in, they wait until it has nearly landed. */
::view-transition-group(pw-band-text) { animation-duration: 520ms; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
::view-transition-old(pw-band-text) { animation: 160ms cubic-bezier(.4, 0, 1, 1) both pw-vt-out; }
::view-transition-new(pw-band-text) { animation: 560ms cubic-bezier(.16, 1, .3, 1) 100ms both pw-vt-in-text; }
::view-transition-new(pw-band-text):only-child { animation: 600ms cubic-bezier(.16, 1, .3, 1) 300ms both pw-vt-in-text; }
::view-transition-old(pw-band-text):only-child { animation: 120ms linear both pw-vt-out; }

@keyframes pw-band-down { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes pw-band-up { from { clip-path: inset(0); } to { clip-path: inset(0 0 100% 0); } }
/* Keep the words their real size, top-left, while the box resizes: no stretching. */
::view-transition-old(pw-band-text),
::view-transition-new(pw-band-text) { width: auto; height: auto; object-fit: none; object-position: left top; }

@keyframes pw-vt-out { to { opacity: 0; } }
@keyframes pw-vt-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes pw-vt-in-text { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
	@view-transition { navigation: none; }
}

/* Editor only: an empty featured image shows a placeholder box there, while the
   website shows nothing. Hide it so the editor matches (set one from the sidebar). */
.wp-block-post-featured-image:has(> .components-placeholder) { display: none; }

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

:where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--pw-c-gold);
	outline-offset: 2px;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/* Short pages: the footer still sits at the bottom of the window. */
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.wp-site-blocks > main { flex: 1 0 auto; }
.admin-bar .wp-site-blocks { min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px)); min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px)); }

/* Main content sits flush with header and footer. */
.wp-site-blocks > main { margin-block-start: 0; }
.wp-site-blocks > footer,
.wp-site-blocks > .wp-block-template-part:last-child { margin-block-start: 0; }

/* -----------------------------------------------------------------
 * Buttons
 * -------------------------------------------------------------- */

.wp-block-button.is-style-gold .wp-block-button__link {
	background: var(--pw-c-gold);
	color: var(--pw-c-night);
}
.wp-block-button.is-style-gold .wp-block-button__link:hover {
	background: var(--pw-c-cream);
	color: var(--pw-c-night);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--pw-c-cream);
	color: var(--pw-c-ink);
}

/* Arrow link ("See all →") used in section headers. */
.pw-more-link {
	font-size: 0.875rem;
	font-weight: 600;
}
.pw-section-head .pw-more-link { margin: 0; }
.pw-more-link a,
.pw-band .pw-more-link a { text-decoration: underline; text-underline-offset: 3px; }

/* -----------------------------------------------------------------
 * Header
 * -------------------------------------------------------------- */

/* Utility bar above the header: the member link, kept apart from the visitor nav. */
.site-utility { margin-block-start: 0; }
.site-utility + .site-header { margin-block-start: 0; }
.site-utility > .site-utility__member {
	/* Wide, not the narrow content width, so it lines up with the header's right edge. */
	max-width: var(--wp--style--global--wide-size);
}
.site-utility__member {
	margin: 0;
	font-size: 13px;
	line-height: 36px;
}
.site-utility__member a {
	display: inline-block;
	min-height: 36px;
	margin-left: 12px;
	color: var(--pw-c-gold);
	font-weight: 600;
	text-decoration: none;
}
.site-utility__member a:hover { color: var(--pw-c-cream); }
@media (max-width: 600px) {
	/* One line, 44px tall (the link's tap height): the question on the left, the link on the right. */
	.site-utility__member { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; font-size: 12px; line-height: 44px; }
	.site-utility__member a { min-height: 44px; margin-left: 0; }
}
/* The narrowest phones (320–360px): slimmer page margins, and a smaller header, so all of it fits. */
@media (max-width: 360px) {
	body { --wp--style--root--padding-left: 16px; --wp--style--root--padding-right: 16px; }
	.site-utility__member { font-size: 11px; }
	.site-header__inner { gap: 8px !important; }
	.site-brand__name { font-size: 18px !important; }
}

.site-header__inner { align-items: center; }

.site-brand { flex: none; }
.site-brand__logo img { height: 54px; width: auto; }
.site-brand__wordmark {
	margin: 0;
	line-height: 1;
	font-family: var(--pw-font-display);
	text-transform: uppercase;
}
.site-brand__wordmark a {
	display: flex;
	flex-direction: column;
	text-decoration: none;
}
/* The large "P" of Petworth has built-in space on its left (about 0.08em), so
   "Discover" is nudged across by the same amount to line up with its ink. */
.site-brand__kicker {
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.32em;
	padding-left: 2px;
	color: var(--pw-c-cream);
}
.site-brand__name {
	font-size: 26px;
	font-weight: 400;
	letter-spacing: 0.14em;
	color: var(--pw-c-cream);
	margin-top: 4px;
}

.site-nav .wp-block-navigation-item__content { text-decoration: none; }
.site-nav .wp-block-navigation-item__content:hover { color: var(--pw-c-gold); }
.site-nav .wp-block-navigation__submenu-icon { color: var(--pw-c-gold); }
.site-nav .wp-block-navigation__submenu-container {
	background: var(--pw-c-charcoal) !important;
	border: 1px solid var(--pw-c-deep) !important;
	border-radius: var(--pw-radius);
	padding: 8px 0;
}
.site-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 10px 18px;
}

/* Mega menu (desktop only): the Explore submenu drops as a full-width paper panel
   under the header, its links lined up with the header content. It opens by click
   or tap (the navigation block's "open submenus on click"), so "Explore" is a
   button, not a link. Below 600px the core overlay menu takes over and the
   is-menu-open rules further down apply. */
/* Above the page: its view-transition-name makes it a layer of its own, so
   without a z-index the mega menu would sit behind positioned page content. */
.site-header { position: relative; z-index: 100; }
.site-nav .wp-block-navigation-submenu__toggle { cursor: pointer; }
.site-nav .wp-block-navigation-submenu__toggle[aria-expanded="true"] { color: var(--pw-c-gold); }
@media (min-width: 600px) {
	/* Unposition everything between the header and the submenu, so the panel
	   is placed against the header rather than its own menu item. */
	.site-nav,
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open),
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__responsive-close,
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__responsive-dialog,
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__responsive-container-content,
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container,
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation-item.has-child {
		position: static;
	}

	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .has-child > .wp-block-navigation__submenu-container {
		top: 100% !important;
		left: 0 !important;
		right: 0;
		flex-direction: column;
		align-items: flex-start;
		padding: 36px max(var(--wp--style--root--padding-left, 24px), calc((100% - var(--wp--style--global--wide-size, 1192px)) / 2)) 44px !important;
		background: var(--pw-c-paper) !important;
		border: 0 !important;
		border-top: 3px solid var(--pw-c-gold) !important;
		border-bottom: 1px solid var(--pw-c-line) !important;
		border-radius: 0;
		color: var(--pw-c-ink) !important;
		/* Float shadow, plus a scrim over the page below. The clip stops the scrim
		   from also darkening the header above the panel. */
		box-shadow: 0 8px 24px rgba(33, 33, 33, 0.12), 0 0 0 100vmax rgba(33, 33, 33, 0.45);
		clip-path: inset(0 -100vmax -100vmax -100vmax);
	}
	/* Column heading. The only submenu is Explore, so its name is written here. */
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .has-child > .wp-block-navigation__submenu-container::before {
		content: "Explore";
		display: block;
		width: 220px;
		padding-bottom: 12px;
		margin-bottom: 6px;
		border-bottom: 1px solid var(--pw-c-line);
		font-size: 12px;
		font-weight: 600;
		letter-spacing: 0.2em;
		text-transform: uppercase;
		color: var(--pw-c-bronze);
	}
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .has-child > .wp-block-navigation__submenu-container .wp-block-navigation-item {
		width: 220px;
	}
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .has-child > .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		display: flex;
		align-items: center;
		min-height: 44px;
		padding: 0 !important;
		font-size: 15px;
		color: var(--pw-c-ink) !important;
	}
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .has-child > .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
		color: var(--pw-c-bronze) !important;
		text-decoration: underline;
		text-underline-offset: 4px;
	}
}

/* Current section (marked in functions.php): a fine gold line under the item
   on desktop, which also draws in on hover; gold text in the open phone menu
   and the Explore panel. */
@media (min-width: 600px) {
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content { position: relative; }
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: -7px;
		height: 1px;
		background: var(--pw-c-gold);
		transform: scaleX(0);
		transform-origin: left center;
		transition: transform 320ms cubic-bezier(.16, 1, .3, 1);
	}
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover::after,
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .is-current-section > .wp-block-navigation-item__content::after { transform: scaleX(1); }
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .is-current-section > .wp-block-navigation-item__content::after { height: 2px; }
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .has-child > .wp-block-navigation__submenu-container .is-current-section > .wp-block-navigation-item__content { color: var(--pw-c-bronze) !important; font-weight: 600; }
}
@media (prefers-reduced-motion: reduce) {
	.site-nav .wp-block-navigation-item__content::after { transition: none !important; }
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .is-current-section > .wp-block-navigation-item__content { color: var(--pw-c-gold); }

/* Search (petworth-search): the round button takes the header's cream; it opens full-screen search. */
.site-header .pws-open { color: var(--pw-c-cream); }
/* As search opens, the member bar slides up while the header grows into its space (petworth-search draws the bar). */
.site-utility { transition: transform 260ms cubic-bezier(.2, .7, .2, 1); }
html.pws-header-raised .site-utility { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) {
	.site-utility { transition: none; }
}
.site-header__cta { flex: none; }

@media (max-width: 1080px) {
	.wp-block-buttons.site-header__cta { display: none; }
}
@media (max-width: 600px) {
	.site-header { padding-top: 10px !important; padding-bottom: 10px !important; }
	.site-brand__logo img { height: 40px; }
	.site-brand__kicker { font-size: 10px; letter-spacing: 0.28em; padding-left: 1.5px; }
	.site-brand__name { font-size: 20px; margin-top: 3px; }
	/* Phones keep the search button, after the Menu button; "See what's on" is hidden (above). */
	.site-header .site-header__actions { order: 3; }
}

/* -----------------------------------------------------------------
 * Mobile menu: a labelled button and a full-screen list.
 * -------------------------------------------------------------- */

/* "☰" and "✕ Close". The open button is the icon alone, as the header is tight on
   phones (core gives it the accessible name "Open menu"); the close button keeps
   its word, as the open menu has room. Icons sit on the content edge; the tap area is 44px. */
/* No `display` here: core shows the open button only below 600px, and setting it
   would override that and show the button on desktop too. */
.site-nav .wp-block-navigation__responsive-container-open,
.site-nav .wp-block-navigation__responsive-container-close {
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 0 0 10px;
	color: var(--pw-c-cream);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
}
.site-nav .wp-block-navigation__responsive-container-open {
	min-width: 44px;
	justify-content: flex-end;
}
.site-nav .wp-block-navigation__responsive-container-close::after { content: "Close"; }
.site-nav .wp-block-navigation__responsive-container-open svg,
.site-nav .wp-block-navigation__responsive-container-close svg {
	width: 24px;
	height: 24px;
}
.site-nav .wp-block-navigation__responsive-container-open:hover,
.site-nav .wp-block-navigation__responsive-container-close:hover {
	color: var(--pw-c-gold);
}

/* The open menu: left-aligned, large display-font links with dividers;
   Explore's pages listed underneath it in smaller text. */
.site-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: 10px var(--pw-gutter) 40px;
}
.site-nav .wp-block-navigation__responsive-close {
	max-width: 1240px;
	margin: 0 auto;
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog {
	display: flex;
	flex-direction: column;
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	position: static;
	align-self: flex-end;
	margin-bottom: 16px;
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: stretch !important;
	padding-top: 0;
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: stretch !important;
	gap: 0 !important;
	width: 100%;
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item {
	align-items: stretch !important;
	border-bottom: 1px solid #4A4D55;
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	display: block;
	padding: 14px 0 !important;
	font-family: var(--pw-font-display);
	font-size: 1.75rem;
	font-weight: 300;
	line-height: 1.2;
	text-align: left;
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover,
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:focus-visible {
	color: var(--pw-c-gold);
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	align-self: stretch;
	width: 100%;
	border: 0 !important;
	padding: 0 0 16px !important;
	gap: 0 !important;
	align-items: stretch !important;
	background: transparent !important;
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item {
	align-items: stretch !important;
	width: 100%;
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	display: block;
	padding: 8px 0 8px 16px !important;
	border-left: 2px solid var(--pw-c-gold);
	font-size: 1rem;
	color: var(--pw-c-mist);
	text-align: left;
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-icon {
	display: none;
}

/* -----------------------------------------------------------------
 * Section scaffolding
 * -------------------------------------------------------------- */

.pw-section-head {
	align-items: flex-end;
	margin-bottom: 28px;
}
.pw-section-head h2 { margin: 0; }

.pw-lede {
	color: var(--pw-c-slate);
	font-size: var(--wp--preset--font-size--large);
	max-width: 520px;
}

/* -----------------------------------------------------------------
 * Hero
 * -------------------------------------------------------------- */

.pw-hero__cols { gap: 48px; }
.pw-hero__media { margin: 0; }
.pw-hero__media img {
	width: 100%;
	height: 440px !important; /* !important: the editor puts an inline height:auto on images */
	object-fit: cover;
	border-radius: var(--pw-radius);
	display: block;
}

@media (max-width: 781px) {
	.pw-hero { padding-top: 0 !important; padding-bottom: 28px !important; }
	.pw-hero__cols { flex-direction: column-reverse; gap: 24px; }
	.pw-hero__media {
		margin-left: calc(-1 * var(--wp--style--root--padding-left));
		margin-right: calc(-1 * var(--wp--style--root--padding-right));
	}
	.pw-hero__media img { height: 240px !important; border-radius: 0; }

	/* Home page: the welcome ("Explore Petworth") first, the picture under it. */
	.home .pw-hero { padding-top: 28px !important; }
	.home .pw-hero__cols { flex-direction: column; }
}

/* Pill search (hero) */
.wp-block-search.is-style-pill { max-width: 540px; }
.wp-block-search.is-style-pill .wp-block-search__inside-wrapper {
	background: #fff;
	border: 1px solid var(--pw-c-stone);
	border-radius: 999px;
	padding: 6px 6px 6px 22px;
	align-items: center;
}
.wp-block-search.is-style-pill .wp-block-search__input {
	border: 0;
	background: transparent;
	font-size: 15px;
	color: var(--pw-c-ink);
	padding: 8px 0;
	min-width: 0;
}
.wp-block-search.is-style-pill .wp-block-search__input:focus { outline: none; }
.wp-block-search.is-style-pill .wp-block-search__inside-wrapper:focus-within {
	outline: 2px solid var(--pw-c-gold);
	outline-offset: 2px;
}
.wp-block-search.is-style-pill .wp-block-search__button {
	margin: 0 0 0 8px;
	border: 0;
	border-radius: 999px;
	padding: 13px 22px;
	background: var(--pw-c-charcoal);
	color: var(--pw-c-cream);
	font-size: 0.875rem;
	font-weight: 600;
}
.wp-block-search.is-style-pill .wp-block-search__button:hover { background: var(--pw-c-night); }

@media (max-width: 600px) {
	.wp-block-search.is-style-pill .wp-block-search__inside-wrapper { padding: 4px 4px 4px 16px; }
	.wp-block-search.is-style-pill .wp-block-search__button { padding: 11px 16px; }
}

/* -----------------------------------------------------------------
 * Cards (group style: Card)
 * The first link inside a card stretches to cover the whole card.
 * -------------------------------------------------------------- */

.wp-block-group.is-style-card {
	position: relative;
	background: #fff;
	border: 1px solid var(--pw-c-line);
	border-radius: var(--pw-radius);
	overflow: hidden;
	transition: border-color 0.15s ease;
}
.wp-block-group.is-style-card:hover { border-color: var(--pw-c-gold); }
.wp-block-group.is-style-card > .wp-block-image { margin: 0; }
.wp-block-group.is-style-card > .wp-block-image img {
	width: 100%;
	height: 200px !important; /* The editor puts an inline height:auto on images. */
	object-fit: cover;
	display: block;
	border-radius: 0;
}
.wp-block-group.is-style-card > :where(h2, h3, h4, p) {
	margin: 0;
	padding: 20px 20px 22px;
}
.wp-block-group.is-style-card a {
	color: inherit;
	text-decoration: none;
}
.wp-block-group.is-style-card :where(h2, h3, h4) a::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* A card with a line of description under its title. */
.wp-block-group.is-style-card > :where(h2, h3, h4):has(+ .pw-card__text) { padding-bottom: 6px; }
.wp-block-group.is-style-card > .pw-card__text {
	padding-top: 0;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
	color: var(--pw-c-slate);
}

/* Category cards become compact rows on phones. */
@media (max-width: 600px) {
	.pw-cards .wp-block-group.is-style-card {
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: 14px;
	}
	.pw-cards .wp-block-group.is-style-card > .wp-block-image { flex: none; }
	.pw-cards .wp-block-group.is-style-card > .wp-block-image img { width: 96px; height: 72px !important; }
	.pw-cards .wp-block-group.is-style-card > :where(h2, h3, h4) {
		flex: 1;
		padding: 0 40px 0 0;
		font-size: 1.375rem;
		background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%232B2D33' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") no-repeat right 14px center;
	}
	.pw-cards .wp-block-group.is-style-card > .pw-card__text { display: none; }
	.pw-cards { gap: 10px !important; }
}

/* Gold top-line links ("More to explore"). */
.wp-block-group.is-style-topline {
	position: relative;
	border-top: 2px solid var(--pw-c-gold);
	padding: 20px 0;
}
.wp-block-group.is-style-topline > * { margin: 0; }
.wp-block-group.is-style-topline a {
	color: var(--pw-c-ink);
	text-decoration: none;
}
.wp-block-group.is-style-topline a::after { content: ""; position: absolute; inset: 0; }
.wp-block-group.is-style-topline:hover a { color: var(--pw-c-bronze); }

/* -----------------------------------------------------------------
 * "This week" band + events block
 * -------------------------------------------------------------- */

.pw-band h2 { color: var(--pw-c-cream); }
.pw-band .pw-more-link a { color: var(--pw-c-gold); }
.pw-band .pw-more-link a:hover { color: var(--pw-c-cream); }

.pw-events__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 20px;
}
.pw-event { position: relative; } /* contains the screen-reader-only date */
.pw-event__link {
	height: 100%;
	box-sizing: border-box;
	display: flex;
	gap: 16px;
	padding: 18px 18px 20px;
	background: var(--pw-c-deep);
	border: 1px solid transparent;
	border-radius: var(--pw-radius);
	color: var(--pw-c-cream);
	text-decoration: none;
	transition: border-color 0.15s ease;
}
.pw-event__link:hover { border-color: var(--pw-c-gold); color: var(--pw-c-cream); }
.pw-event__date {
	flex: none;
	width: 52px;
	padding-right: 14px;
	border-right: 1px solid #85888F;
	text-align: center;
	display: flex;
	flex-direction: column;
	text-transform: uppercase;
}
.pw-event__dow { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; color: var(--pw-c-gold); }
.pw-event__day { font-family: var(--pw-font-display); font-weight: 300; font-size: 32px; line-height: 1.1; }
.pw-event__mon { font-size: 11px; letter-spacing: 0.12em; color: var(--pw-c-mist); }
.pw-event__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pw-event__cat { min-height: 1lh; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pw-c-gold); }
.pw-event__title { font-size: 1rem; font-weight: 600; line-height: 1.35; }
.pw-event__meta { font-size: 13px; color: var(--pw-c-mist); line-height: 1.4; }
.pw-events__empty { color: var(--pw-c-mist); }

/* Horizontal scroller on phones. */
@media (max-width: 600px) {
	.pw-events__list {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		gap: 12px;
		margin: 0 calc(-1 * var(--pw-gutter));
		padding: 0 var(--pw-gutter) 4px;
		scrollbar-width: none;
	}
	.pw-events__list::-webkit-scrollbar { display: none; }
	.pw-event { flex: none; width: 260px; scroll-snap-align: start; }
	.pw-event__link { padding: 16px; gap: 14px; }
}

/* -----------------------------------------------------------------
 * Town map
 * -------------------------------------------------------------- */

.pw-map__cols { gap: 48px; }
.pw-map__image { margin: 0; }
.pw-map__image img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--pw-c-line);
	border-radius: var(--pw-radius);
}

/* -----------------------------------------------------------------
 * Press quote
 * -------------------------------------------------------------- */

.pw-quote {
	border-top: 1px solid var(--pw-c-line);
	border-bottom: 1px solid var(--pw-c-line);
}
.pw-quote .wp-block-pullquote {
	border: 0;
	padding: 0;
	margin: 0 auto;
	max-width: 900px;
	text-align: center;
}
.pw-quote .wp-block-pullquote blockquote::before {
	content: "";
	display: block;
	width: 40px;
	height: 40px;
	margin: 0 auto 20px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A5800' stroke-width='1.5'%3E%3Cpath d='M7 7h4v4c0 3-1.5 5-4 6M14 7h4v4c0 3-1.5 5-4 6'/%3E%3C/svg%3E") no-repeat center / contain;
}
.pw-quote .wp-block-pullquote p {
	font-family: var(--pw-font-display);
	font-weight: 300;
	font-size: var(--wp--preset--font-size--quote);
	line-height: 1.25;
	margin: 0;
}
.pw-quote .wp-block-pullquote cite {
	display: block;
	margin-top: 20px;
	font-size: 13px;
	font-style: normal;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--pw-c-bronze);
}

/* -----------------------------------------------------------------
 * News cards (Query Loop)
 * -------------------------------------------------------------- */

.pw-news-card.is-layout-flex { position: relative; gap: 14px; align-items: stretch; }
.pw-news-card .wp-block-post-featured-image { margin: 0; }
.pw-news-card .wp-block-post-featured-image img {
	height: 170px !important; /* The editor puts an inline height on images. */
	width: 100%;
	object-fit: cover;
	border-radius: var(--pw-radius);
}
.pw-news-card .wp-block-post-title {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
	line-height: 1.4;
	margin: 0;
}
.pw-news-card .wp-block-post-title a { color: var(--pw-c-ink); text-decoration: none; }
.pw-news-card .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; }
.pw-news-card:hover .wp-block-post-title a { color: var(--pw-c-bronze); }
.pw-news-card .pw-news-card__date { margin: -8px 0 0; font-size: 13px; color: var(--pw-c-slate); }
.pw-news-card .pw-read-more {
	font-size: 13px;
	font-weight: 600;
	color: var(--pw-c-bronze);
	margin: 0;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Posts without a featured image get a quiet placeholder block. (Tested on the
   image, not the block: the editor keeps an empty featured-image block there.) */
.pw-news-card:not(:has(.wp-block-post-featured-image img))::before {
	content: "";
	display: block;
	height: 170px;
	border-radius: var(--pw-radius);
	/* --pw-crest is set in the page (functions.php), where it is rewritten to the WebP copy. */
	background: var(--pw-c-sand) var(--pw-crest) no-repeat center / auto 60%;
	opacity: 0.9;
}

/* -----------------------------------------------------------------
 * Newsletter
 * -------------------------------------------------------------- */

.pw-newsletter__form {
	display: flex;
	gap: 8px;
	flex: 1 1 420px;
	max-width: 520px;
	min-width: 0; /* Else the email field's default width pushed the button off a 320px screen. */
}
.pw-newsletter__form input[type="email"] {
	flex: 1;
	min-width: 0;
	border: 1px solid var(--pw-c-stone);
	border-radius: 999px;
	padding: 14px 20px;
	font: inherit;
	font-size: 15px;
	background: #fff;
	color: var(--pw-c-ink);
}
.pw-newsletter__form button {
	border: 0;
	border-radius: 999px;
	padding: 14px 24px;
	background: var(--pw-c-charcoal);
	color: var(--pw-c-cream);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
}
.pw-newsletter__form button:hover { background: var(--pw-c-night); }

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

.site-footer p { margin: 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .site-brand__wordmark a:hover { text-decoration: none; }
.site-footer__heading {
	font-family: var(--wp--preset--font-family--body);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--pw-c-gold);
	margin: 0 0 2px;
}
.site-footer__base { color: var(--pw-c-mist); }
/* The footer's link lists are Navigation menus (editable under Appearance → Editor →
   Navigation). They read as footer text, not the header's menu style from theme.json. */
.site-footer__nav { font-size: inherit; font-weight: 400; letter-spacing: normal; line-height: 1.65; }
.site-footer .wp-block-social-links .wp-social-link:hover { color: var(--pw-c-cream); }

/* -----------------------------------------------------------------
 * Generic page content
 * -------------------------------------------------------------- */

.pw-page-header { border-bottom: 1px solid var(--pw-c-line); }

/* The navy title band every page except the home page opens with (as the section pages' and What's On's). */
.pw-band { margin-block-start: 0 !important; }
header.pw-band { padding-top: 48px; padding-bottom: 40px; }
header.pw-band + * { margin-block-start: var(--wp--preset--spacing--60) !important; }
/* The home page's "This week" band: the next section's own padding is the gap. */
div.pw-band + * { margin-block-start: 0 !important; }
.pw-band__inner { display: flex; flex-direction: column; gap: 12px; }
.pw-band__inner > * { margin: 0 !important; }
/* The title band's crest watermark and gold rule (design A). --pw-crest is set in functions.php. */
/* overflow-x: clip: on phones the crest hangs off the right edge (cropped on purpose); unclipped it widened the page, so it scrolled sideways. */
header.pw-band { position: relative; overflow-x: clip; border-bottom: 3px solid var(--pw-c-gold); }
/* One height for every title band (--pw-band-height); the title sits in the middle. */
header.pw-band { box-sizing: border-box; min-height: var(--pw-band-height); display: flex; flex-direction: column; justify-content: center; }
header.pw-band > * { width: 100%; box-sizing: border-box; }
header.pw-band::before {
	content: "";
	position: absolute;
	top: 0;
	right: max(24px, calc((100% - 1240px) / 2 + 20px));
	bottom: 0;
	width: 300px;
	background: var(--pw-crest, none) no-repeat center -40px / 300px auto;
	opacity: 0.07;
	pointer-events: none;
}
header.pw-band > * { position: relative; }
.pw-band__back a { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; }
.pw-band h1 { color: var(--pw-c-cream); font-family: var(--pw-font-display); font-size: 56px; font-weight: 300; line-height: 1.05; }
header.pw-band p,
header.pw-band .wp-block-post-date { color: var(--pw-c-mist); font-size: 17px; max-width: 620px; }
header.pw-band a { color: var(--pw-c-gold); font-weight: 600; font-size: 14px; text-decoration: none; }
header.pw-band a:hover { color: var(--pw-c-cream); }
@media (max-width: 781px) {
	header.pw-band { padding-top: 32px; padding-bottom: 28px; }
	.pw-band h1 { font-size: 40px; }
	header.pw-band::before { right: -40px; width: 180px; background-position: center -20px; background-size: 180px auto; }
}
/* 404: the search box and link, under the heading. */
.pw-404__actions > * + * { margin-block-start: 20px; }
.entry-content > * + h2 { margin-top: 2.5rem; }
.wp-block-post-date { color: var(--pw-c-slate); font-size: var(--wp--preset--font-size--small); }

.wp-block-query-pagination a { text-decoration: none; font-weight: 600; }

/* A page that ends with the newsletter band (What's On): the band meets the footer. */
main:has(> .wp-block-post-content > .pw-newsletter:last-child) { padding-bottom: 0 !important; }
.wp-block-post-content > .pw-newsletter:last-child { margin-block-start: var(--wp--preset--spacing--60); }

/* Phones: less air above and below the home page's town map block. */
@media (max-width: 600px) {
	.pw-map { padding-top: 40px !important; padding-bottom: 48px !important; }
}

/* -----------------------------------------------------------------
 * Plan a Visit (pattern petworth/plan-a-visit)
 * -------------------------------------------------------------- */

/* The page's sections butt together: paper, white, paper, charcoal. */
.wp-block-post-content > :is(.pw-visit-getting, .pw-visit-around, .pw-visit-about) { margin-block-start: 0 !important; }
.pw-visit-hero .pw-visit-hero__media img { height: 400px !important; }

/* Four quick facts under the hero. */
.pw-key-fact { padding: 18px 20px 20px; border: 1px solid var(--pw-c-line); border-radius: var(--pw-radius); background: #fff; }
.pw-key-fact > * { margin: 0 !important; }
.pw-key-fact__title { font-family: var(--pw-font-display); font-size: 26px; font-weight: 300; line-height: 1.15; color: var(--pw-c-ink); }
.pw-key-fact__text { margin-top: 6px !important; font-size: 13px; line-height: 1.45; color: var(--pw-c-slate); }
/* Key facts (patterns/key-facts.php) straight after a hero sit 40px under its photo, as one block. */
:is(.pw-hero, .pw-visit-hero):has(+ .pw-key-facts-section) { padding-bottom: 40px !important; }
:is(.pw-hero, .pw-visit-hero) + .pw-key-facts-section { padding-top: 0 !important; margin-block-start: 0 !important; }

/* Tabs: the core Tabs block in the site's look, wherever it is used (Plan a Visit's
   "Getting here"). Core's own tab styles use :where(), so these win without !important. */
.wp-block-tab-list { gap: 4px; margin-bottom: 4px; border-bottom: 1px solid var(--pw-c-line); overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.wp-block-tab-list button { flex: none; margin-bottom: -1px; padding: 12px 14px; border-bottom: 2px solid transparent; color: var(--pw-c-slate); font-size: 14px; font-weight: 600; }
.wp-block-tab-list button:hover { color: var(--pw-c-ink); }
.wp-block-tab-list button[aria-selected="true"] { color: var(--pw-c-ink); border-bottom-color: var(--pw-c-gold); }
.wp-block-tab-list button[aria-selected="true"]::before { content: none; } /* Core's underline: ours is the gold border. */
.wp-block-tab-list button:focus-visible { outline: 2px solid var(--pw-c-gold); outline-offset: -2px; }
.wp-block-tab-panel:focus-visible { outline: 2px solid var(--pw-c-gold); outline-offset: 4px; }
.wp-block-tabs > * + * { margin-block-start: 0; }
.wp-block-tab-panel > * + * { margin-block-start: 20px; }

/* Label-and-detail rows (the tabs' tables). */
.wp-block-table.pw-facts { margin: 0; }
.pw-facts table { width: 100%; border-collapse: collapse; }
.pw-facts td { padding: 16px 0; border: 0; border-bottom: 1px solid var(--pw-c-line); vertical-align: top; font-size: 14px; color: var(--pw-c-slate); }
.pw-facts td:first-child { width: 30%; padding-right: 24px; font-weight: 600; color: var(--pw-c-ink); }

/* Parking card. */
.pw-parking { overflow: hidden; border: 1px solid var(--pw-c-line); border-radius: var(--pw-radius); background: var(--pw-c-paper); }
.pw-parking__map { margin: 0; }
.pw-parking__map img { display: block; width: 100%; height: 200px !important; object-fit: cover; }
.pw-parking__body { padding: 20px 22px 24px; }
.pw-parking__body > * { margin-block-end: 0; }
.pw-parking__body h3 { font-size: 24px; }
.pw-parking__name { font-size: 14px; font-weight: 600; color: var(--pw-c-ink); }
.pw-parking__body p { font-size: 14px; }
.wp-block-table.pw-parking__charges { margin-top: 14px !important; padding-top: 10px; border-top: 1px solid var(--pw-c-line); }
.pw-parking__charges table { width: 100%; border-collapse: collapse; }
.pw-parking__charges td { padding: 4px 0; border: 0; font-size: 13px; color: var(--pw-c-slate); }
.pw-parking__charges td:last-child { text-align: right; font-weight: 600; color: var(--pw-c-ink); }
.pw-parking .wp-block-buttons { margin-top: 16px !important; }
.pw-parking .pw-more-link { margin-top: 12px !important; font-size: 12px; }

/* Around town: amenity chips, then arrow lists. */
.pw-amenities { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.pw-amenities li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--pw-c-line); border-radius: var(--pw-radius); background: #fff; font-size: 14px; font-weight: 600; color: var(--pw-c-ink); }
.pw-amenities strong { display: inline-flex; flex: none; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 6px; background: var(--pw-c-charcoal); color: var(--pw-c-cream); font-size: 11px; font-weight: 700; }
/* Editor only: the item's text sits in an extra editable <div> there; lay it out like the item. */
.pw-amenities li > .block-editor-rich-text__editable { display: flex; align-items: center; gap: inherit; }
.pw-visit-around__title { font-size: 30px; font-weight: 300; }
.pw-arrow-list { margin: 0; padding: 0; list-style: none; }
.pw-arrow-list li { border-bottom: 1px solid var(--pw-c-line); }
.pw-arrow-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; color: var(--pw-c-slate); font-size: 14px; text-decoration: none; }
.pw-arrow-list a::after { content: "→"; flex: none; color: var(--pw-c-bronze); }
.pw-arrow-list a:hover { color: var(--pw-c-ink); text-decoration: underline; text-underline-offset: 3px; }
.pw-arrow-list.is-large a { padding: 18px 0; font-size: 15px; font-weight: 600; color: var(--pw-c-ink); }
.pw-arrow-list.is-columns { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 32px; }

/* About Petworth: the charcoal band. */
.pw-visit-about h3 { color: var(--pw-c-cream); font-family: var(--pw-font-display); font-size: 28px; font-weight: 300; }
.pw-visit-about p:not(.pw-more-link) { color: var(--pw-c-mist); font-size: 15px; }

/* The pen-and-ink sketches of the town, last on the page. */
.wp-block-image.pw-sketches { margin-block-start: 48px !important; margin-bottom: 0; }
.pw-sketches img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; } /* The drawings' white paper takes the page colour. */

@media (max-width: 781px) {
	.pw-visit-hero { padding-top: 0 !important; padding-bottom: 40px !important; }
	.pw-visit-hero .pw-visit-hero__media img { height: 260px !important; }
	.pw-key-facts-section { padding-top: 40px !important; padding-bottom: 40px !important; }
	.pw-key-facts { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
	.pw-key-fact { padding: 14px 14px 16px; }
	.pw-key-fact__title { font-size: 21px; }
	.pw-visit-getting,
	.pw-visit-around { padding-top: 48px !important; padding-bottom: 48px !important; }
	.pw-facts td { display: block; width: auto !important; padding: 0; border: 0; }
	.pw-facts td:first-child { padding-top: 14px; }
	.pw-facts td:last-child { padding: 4px 0 14px; border-bottom: 1px solid var(--pw-c-line); }
	.pw-arrow-list.is-columns { grid-template-columns: 1fr 1fr; column-gap: 20px; }
	.wp-block-tab-list { gap: 0; }
	.wp-block-tab-list button { padding: 12px 9px; font-size: 13px; }
	.pw-amenities { grid-template-columns: 1fr 1fr; gap: 8px; }
	.pw-amenities li { gap: 10px; padding: 10px; font-size: 13px; }
	.wp-block-image.pw-sketches { margin-block-start: 32px !important; }
}
