/* Core Button equivalents of bundle.css's .pku-btn treatments. */
.wp-block-group:is(.is-style-court, .is-style-ink), .pku-on-dark {
	--pbu-button-border: var(--ball);
	--pbu-ghost-fill: transparent;
	--pbu-ghost-ink: var(--on-court);
	--pbu-ghost-hover-ink: var(--ink);
}
.wp-block-group:is(.is-style-paper, .is-style-canvas, .is-style-white) {
	--pbu-button-border: var(--ink);
	--pbu-ghost-fill: var(--white);
	--pbu-ghost-ink: var(--ink);
	--pbu-ghost-hover-ink: var(--ball);
}
.wp-block-button:is(.is-style-ball, .is-style-ink, .is-style-ghost) .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 14px 22px 13px;
	border: 2px solid var(--pbu-button-border, var(--ink));
	border-radius: var(--radius-md);
	background: var(--white);
	color: var(--ink);
	font-stretch: 75%;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.wp-block-button.is-style-ball .wp-block-button__link { background: var(--ball); }
.wp-block-button.is-style-ink .wp-block-button__link { background: var(--ink); color: var(--ball); }
.wp-block-button.is-style-ghost .wp-block-button__link { background: var(--pbu-ghost-fill, var(--white)); color: var(--pbu-ghost-ink, var(--ink)); border-color: var(--pbu-ghost-ink, var(--ink)); }
/* The owner chose the brand book's ink/ball hover to preserve AA contrast. */
.wp-block-button.is-style-ball .wp-block-button__link:hover { background: var(--ink); color: var(--ball); }
.wp-block-button.is-style-ghost .wp-block-button__link:hover { background: var(--pbu-ghost-ink, var(--ink)); color: var(--pbu-ghost-hover-ink, var(--ball)); }
.wp-block-button.is-style-ink .wp-block-button__link:hover { background: var(--court-raised); }
.wp-block-button:is(.is-style-ball, .is-style-ink, .is-style-ghost) .wp-block-button__link:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) {
	.wp-block-button:is(.is-style-ball, .is-style-ink, .is-style-ghost) .wp-block-button__link { transition: none; transform: none; }
	.wp-block-button:is(.is-style-ball, .is-style-ink, .is-style-ghost) .wp-block-button__link:active { transform: none; }
}

/* Site shell (#6). WordPress prints .wp-site-blocks, so it plays bundle.css's .pku-site,
   and main and the footer are the .pku-main containers. The header keeps its banner role:
   it is the sticky element (a sticky top bar inside it would stop at its edge); from 1200px
   the top bar is hidden and the sidebar is fixed, so the header takes no space. */
.wp-site-blocks > header.wp-block-template-part { position: sticky; top: 0; z-index: 20; }
.wp-site-blocks > :is(main, footer) { container: main / inline-size; min-width: 0; }
.wp-site-blocks > footer { margin-block-start: 0; }
.wp-site-blocks aside.pku-sidebar { display: none; }
/* Blocks bring flow margins; the shell spaces its children with gaps, as in bundle.css. */
:is(.pku-topbar, .pku-sidebar, .pku-menu__bar, .pku-footer__cols, .pku-footer__brand, .pku-footer__base) > *,
:is(.pku-topbar, .pku-sidebar, .pku-footer__brand) .wp-block-image { margin-block: 0; }
.pku-sidebar .wp-block-button__link { width: 100%; }
/* bundle.css gives .pku-topbar__logo its 44px touch target, but here that class sits on the figure, so the home link needs it too. */
.pku-topbar__logo a { display: flex; align-items: center; min-height: 44px; }
.pku-footer__base p { font-size: inherit; }
@media (min-width: 1200px) {
	.wp-site-blocks { padding-inline-start: 320px; }
	.wp-site-blocks .pku-topbar { display: none; }
	.wp-site-blocks aside.pku-sidebar { display: flex; position: fixed; inset-block: var(--wp-admin--admin-bar--height, 0) 0; inset-inline-start: 0; min-height: 0; overflow-y: auto; }
}

/* Mobile menu: a native dialog showing the sidebar full screen (ADR 0012). */
dialog.pku-menu { max-width: none; max-height: none; height: 100%; margin: 0; border: 0; overflow-y: auto; }
dialog.pku-menu:not([open]) { display: none; }
html:has(dialog.pku-menu[open]) { overflow: hidden; }

/* Polylang's dropdown wrapper is a full-width flex row; the design's .pku-lang hugs the select. */
.pll-switcher.pku-lang { display: inline-flex; width: auto; flex-wrap: nowrap; }

/* Core block wrappers for section patterns; measurements follow bundle.css. */
.pku-section .is-layout-flow:not(.pku-prose) > *, .pku-pagetitle > * { margin-block-start: 0; }
.wp-site-blocks > main, main > :is(.pku-section, .wp-block-post-content) { margin-block: 0; }
/* bundle.css starts the section after a hanging featured image at 48px; in WordPress that section sits inside Post Content. */
.pku-pagetitle:has(.pku-pagetitle__media img) + .wp-block-post-content > .pku-section:first-child { padding-top: 48px; }
/* Keep bundle.css's 24px above the featured image against the flow-layout reset above. */
.pku-section .pku-pagetitle__inner > .pku-pagetitle__media { margin-block-start: 24px; }
:where(.pku-section .wp-block-image) { margin-block: 0; }
.pku-section .wp-block-buttons { gap: 12px; }
.pku-section .wp-block-button__link { font-size: 20px; line-height: 1; font-family: var(--font-display); font-weight: 700; }
.pku-intro__media > .wp-block-image:not(.pku-sticker) img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); }
.pku-intro__media > .pku-sticker--badge img { width: 100%; height: 100%; object-fit: contain; }
.pku-intro__body .wp-block-buttons { display: flex; }
.pku-intro__body .wp-block-button { flex: 1 1 220px; }
.pku-intro__body .wp-block-button__link { width: 100%; }
/* shortcut: saved Group cards have no li wrapper; retain their four-card layout until the record-driven block replaces them (#57). */
.pku-sessions__grid > .pku-session { grid-column: span 12; }
@container main (min-width: 600px) { .pku-sessions__grid > .pku-session { grid-column: span 6; } }
@container main (min-width: 1080px) { .pku-sessions__grid > .pku-session { grid-column: span 3; } }
.pku-session__media > .wp-block-image { position: absolute; inset: 0; height: 100%; }
.pku-session__body > .wp-block-buttons { margin-top: auto; }
.pku-session__body .wp-block-button, .pku-session__body .wp-block-button__link { width: 100%; }
.pku-session__over .pku-tag { justify-self: start; }
.wp-block-image.pku-ballart img { width: 100%; height: 100%; object-fit: contain; }
.pku-place .pku-place__address { font-size: 15px; line-height: 1.5; }
.pku-place__address a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-underline-offset: 4px; }
.wp-block-columns.pku-locations__grid { display: grid; }
.wp-block-columns.pku-locations__grid > .wp-block-column { min-width: 0; }
.pku-map img { width: 100%; }
.pku-map figcaption { margin: 0; }
.pku-post .wp-block-post-featured-image { margin: 0; }
.pku-post .wp-block-post-featured-image img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.pku-post .wp-block-read-more { min-height: 44px; }
.pku-post__body .wp-block-post-excerpt { margin: 0; }
.pku-news-query .wp-block-post-template.pku-posts { display: grid; }

/* Gallery figures replace li > figure; match core Gallery's ID specificity. */
.wp-block-gallery.has-nested-images.is-style-pku-polaroid { display: flex; flex-wrap: nowrap; gap: 16px; margin: 0; padding: 20px 16px 40px; overflow-x: auto; scroll-snap-type: x mandatory; }
.wp-block-gallery.has-nested-images.is-style-pku-polaroid > figure.wp-block-image:not(#individual-image) { position: relative; flex: none; display: block; width: 74%; max-width: 300px; margin: 0; padding: 12px 12px 0; border-radius: var(--radius-xs); background: var(--white); box-shadow: var(--shadow-polaroid); scroll-snap-align: center; transition: transform .25s ease, rotate .25s ease; }
.wp-block-gallery.has-nested-images.is-style-pku-polaroid > figure.wp-block-image:not(#individual-image) img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-xs); }
.wp-block-gallery.has-nested-images.is-style-pku-polaroid > figure.wp-block-image:not(#individual-image) figcaption { position: static; display: block; max-height: none; margin: 0; padding: 12px 4px 18px; background: none; color: var(--body); font-family: var(--font-hand); font-size: 17px; line-height: 1.3; text-align: start; overflow: visible; }
.is-style-pku-polaroid figcaption strong { color: var(--ink); font-weight: 600; font-size: 22px; line-height: 1.15; }
.is-style-pku-polaroid > figure:nth-child(odd)::before { content: ""; position: absolute; z-index: 1; top: -6px; left: 50%; width: 92px; height: 26px; margin-left: -46px; background: color-mix(in srgb, var(--ball) 70%, transparent); transform: rotate(-4deg); }
.is-style-pku-polaroid > figure:nth-child(6n+1) { rotate: -3deg; }
.is-style-pku-polaroid > figure:nth-child(6n+2) { rotate: 2deg; }
.is-style-pku-polaroid > figure:nth-child(6n+3) { rotate: -1.5deg; }
.is-style-pku-polaroid > figure:nth-child(6n+4) { rotate: 3deg; }
.is-style-pku-polaroid > figure:nth-child(6n+5) { rotate: -2.5deg; }
.is-style-pku-polaroid > figure:nth-child(6n) { rotate: 1.5deg; }
.is-style-pku-polaroid > figure:hover { rotate: 0deg; transform: scale(1.04); z-index: 5; }
@container main (min-width: 720px) {
	.pku-intro__media > .wp-block-image:not(.pku-sticker) img { aspect-ratio: 16 / 8; }
	.wp-block-gallery.has-nested-images.is-style-pku-polaroid { flex-wrap: wrap; justify-content: center; overflow: visible; padding: 24px clamp(16px, 5cqi, 64px) 48px; gap: 0; }
	.wp-block-gallery.has-nested-images.is-style-pku-polaroid > figure.wp-block-image:not(#individual-image) { width: 31%; margin: 0 -1% 24px; }
	.is-style-pku-polaroid > figure:nth-child(even) { transform: translateY(28px); }
	.is-style-pku-polaroid > figure:nth-child(even):hover { transform: translateY(28px) scale(1.04); }
}
@container main (min-width: 900px) {
	.pku-intro__body .wp-block-buttons { flex-direction: column; align-items: stretch; }
	.pku-intro__body .wp-block-button { flex: none; }
}
@container main (min-width: 1080px) {
	.wp-block-gallery.has-nested-images.is-style-pku-polaroid { flex-wrap: nowrap; max-width: 1280px; margin-inline: auto; padding-bottom: 72px; }
	.wp-block-gallery.has-nested-images.is-style-pku-polaroid > figure.wp-block-image:not(#individual-image) { width: 18.5%; margin: 0 -1.2%; }
	.is-style-pku-polaroid > figure:nth-child(6n+1) { rotate: -6deg; transform: translateY(36px); }
	.is-style-pku-polaroid > figure:nth-child(6n+2) { rotate: 4deg; transform: translateY(-6px); }
	.is-style-pku-polaroid > figure:nth-child(6n+3) { rotate: -2deg; transform: translateY(58px); }
	.is-style-pku-polaroid > figure:nth-child(6n+4) { rotate: 6deg; transform: translateY(8px); }
	.is-style-pku-polaroid > figure:nth-child(6n+5) { rotate: -4deg; transform: translateY(44px); }
	.is-style-pku-polaroid > figure:nth-child(6n) { rotate: 3deg; transform: translateY(-4px); }
	.is-style-pku-polaroid > figure:hover { rotate: 0deg; transform: translateY(16px) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
	.is-style-pku-polaroid > figure { transition: none; }
	.is-style-pku-polaroid > figure:hover { transform: none; }
}
/* Core's flow rules are printed after stylesheets, and `.pku-section .is-layout-flow:not(.pku-prose) > *` zeroes
   every child's top margin (specificity 0,3,0). Retain the explicit preview gaps by matching that selector. */
.pku-section .pku-wrap .pku-head { margin-bottom: clamp(32px, 5cqi, 56px); }
.pku-section .is-layout-flow:not(.pku-prose) > .pku-intro__body { margin-top: clamp(28px, 4cqi, 48px); }
.pku-section .is-layout-flow:not(.pku-prose) > .pku-onrequest { margin-top: clamp(16px, 2.2cqi, 24px); }
.pku-section .is-layout-flow:not(.pku-prose) > .pku-times { margin-top: 6px; }
.pku-section .pku-cta__inner.is-layout-flow:not(.pku-prose) > .pku-note { margin-top: 4px; }
.pku-scrollcue a { display: flex; flex-direction: column; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
@media (max-width: 1199px) { .pku-section[id] { scroll-margin-top: 80px; } }
/* The owner chose 44px targets over the preview's smaller link heights (#7). */
.pku-section :is(.pku-slot__row a, .wp-block-post-terms:not(.pku-terms) a, .pku-head__link a, .pku-map figcaption a, .pku-post .pku-h-title a) { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
.pku-onrequest p.pku-tag { color: var(--ink); }

/* Pages made of sections (#9): post content is a constrained, padded column; sections fill the main container. */
.wp-block-post-content.has-global-padding:has(> .pku-section) { padding-inline: 0; }
.wp-block-post-content > .pku-section { max-width: none; margin-block: 0; margin-inline: 0; }

/* Match the Reviews preview quote spacing. */
.pku-review blockquote p { margin: 0; }

/* Inner pages (#12). The PageTitle lead is Post Excerpt. */
.pku-pagetitle .wp-block-post-excerpt__excerpt { margin: 0; }
.pku-pagetitle__meta > * { margin: 0; }
/* Core Breadcrumbs (#36): bundle.css draws the ball dots between items, not core's separator. */
.wp-block-breadcrumbs.pku-crumbs li::after { content: none; }
.pku-prose .wp-block-table :is(th, td) { border-width: 0 0 1px; border-color: var(--line); }
.pku-prose .wp-block-table th { border-bottom: 2px solid var(--ink); }
.pku-prose .wp-block-table thead { border: 0; }

/* Twenty Twenty-Five draws a 2px box on any :focus, so a click or tap left a box on menu links and on the review and polaroid strips (#59, #53).
   The outline is for keyboard focus only (the :focus-visible rule in bundle.css keeps it). */
.wp-site-blocks :focus:not(:focus-visible) { outline: none; }
/* The polaroid strip is full width inside an overflow:hidden section, so draw its keyboard outline inside the strip or the sides are cut off. */
.wp-block-gallery.is-style-pku-polaroid:focus-visible { outline-offset: -3px; }
