/*
Theme Name:        Perth Archery Club 2026
Theme URI:         https://pertharcheryclub.org
Description:       Block theme for Perth Archery Club. Colours from the osprey badge, self-hosted fonts, no page builder or third-party framework.
Author:            Winter's Computing
Author URI:        https://www.winterscomputing.co.uk
Version:           1.4.0
Requires at least: 6.6
Tested up to:      7.0
Requires PHP:      7.4
License:           GPL-2.0-or-later
Text Domain:       pac-2026
*/

/* Everything that can live in theme.json does. This file covers what it can't. */

:root {
	--pac-focus: #F3CE1F;
	--pac-radius: 4px;
}

/* The header, main and footer manage their own spacing, and the footer sits at the
   bottom of the window on short pages. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.wp-site-blocks > * + * {
	margin-block-start: 0;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

/* ---------- Accessibility basics ---------- */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--pac-focus);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--wp--preset--color--ring);
	border-radius: 2px;
}

.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

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

.pac-header .wp-block-site-logo img {
	display: block;
	width: 56px;
	height: 56px;
	border-radius: 50%;
}

.pac-header .wp-block-site-title a {
	color: inherit;
	text-decoration: none;
}

.pac-header .wp-block-site-tagline {
	margin: 0.15rem 0 0;
	color: color-mix(in srgb, #fff 72%, transparent);
	font-size: 0.875rem;
	line-height: 1.2;
}

.pac-header .wp-block-navigation a {
	text-decoration: none;
}

.pac-header .wp-block-navigation .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--gold);
}

.pac-header .wp-block-navigation .current-menu-item > a,
.pac-header .wp-block-navigation .current-menu-ancestor > a {
	box-shadow: inset 0 -3px 0 var(--wp--preset--color--gold);
}

/* Dropdowns: light panels under the dark bar. */
.pac-header .wp-block-navigation__submenu-container {
	min-width: 15rem !important;
	padding: 0.4rem 0 !important;
	border: 0 !important;
	border-radius: var(--pac-radius);
	box-shadow: 0 10px 30px rgb(20 53 64 / 0.22);
	background: #fff !important;
	color: var(--wp--preset--color--ink) !important;
	font-weight: 500;
}

.pac-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.55rem 1.1rem !important;
}

.pac-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--sky);
	color: var(--wp--preset--color--ring);
}

/* Mobile overlay menu. */
.pac-header .wp-block-navigation__responsive-container.is-menu-open {
	--navigation-layout-justification-setting: flex-start;
	--navigation-layout-justify: flex-start;
	text-align: left;
	background: var(--wp--preset--color--ring-deep) !important;
	color: #fff !important;
	padding: 1.5rem;
}

.pac-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	box-shadow: none;
	background: transparent !important;
	color: color-mix(in srgb, #fff 85%, transparent) !important;
	padding: 0 0 0.5rem 1rem !important;
	font-weight: 400;
}

.pac-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover {
	background: transparent;
	color: var(--wp--preset--color--gold);
}

.pac-header .wp-block-navigation__responsive-container.is-menu-open :is(.wp-block-navigation__container, .wp-block-navigation-item) {
	/* The desktop "justify right" setting is also stamped on the inner list; reset it for the overlay. */
	--navigation-layout-justification-setting: flex-start;
	--navigation-layout-justify: flex-start;
	align-items: flex-start;
	width: 100%;
}

.pac-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	gap: 0.9rem;
	font-size: 1.25rem;
}

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

.pac-hero.wp-block-cover {
	min-height: min(78vh, 680px);
	align-items: flex-end;
}

.pac-hero .wp-block-cover__image-background {
	object-position: 50% 62%;
}

/* A shallow fade at the bottom where the text sits; the sky stays untouched. */
.pac-hero .wp-block-cover__background {
	background: linear-gradient(180deg, rgb(20 53 64 / 0) 30%, rgb(20 53 64 / 0.55) 62%, rgb(20 53 64 / 0.92) 100%) !important;
	opacity: 1 !important;
}

.pac-hero h1 {
	max-width: 13ch;
	margin: 0;
	color: #fff;
	text-wrap: balance;
	line-height: 0.95;
	letter-spacing: -0.01em;
}

.pac-hero p {
	max-width: 46ch;
	color: color-mix(in srgb, #fff 92%, transparent);
	text-wrap: pretty;
}

.pac-hero .wp-block-button.is-style-outline .wp-block-button__link {
	border: 2px solid #fff;
	color: #fff;
	background: transparent;
}

.pac-hero .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: #fff;
	color: var(--wp--preset--color--ring);
}

/* ---------- Coming up (fixture tiles) ---------- */

/* Full fixture list from the plugin, retuned to the theme. */
.pac-fixtures,
.pac-honours,
.pac-upcoming {
	--pac-accent: var(--wp--preset--color--ring);
	--pac-muted: var(--wp--preset--color--slate);
	--pac-line: var(--wp--preset--color--line);
	--pac-highlight: var(--wp--preset--color--gold);
	--pac-highlight-text: var(--wp--preset--color--ink);
}

.pac-upcoming__tile {
	font-family: var(--wp--preset--font-family--display);
}

.pac-fixtures .pac-badge {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
}

.pac-fixtures .pac-fixture.is-next {
	background: color-mix(in srgb, var(--wp--preset--color--gold) 22%, transparent);
}

.pac-fixtures .pac-fixture.is-competition {
	box-shadow: inset 4px 0 0 var(--wp--preset--color--badge-red);
}

.pac-fixtures__month-title,
.pac-honours__title {
	font-family: var(--wp--preset--font-family--display);
}

.pac-honours__title {
	font-size: var(--wp--preset--font-size--large);
}

/* ---------- Venue list ---------- */

.pac-venue {
	padding-left: 1rem;
	border-left: 4px solid var(--wp--preset--color--gold);
}

.pac-venue h3 {
	margin-bottom: 0.25rem;
}

.pac-venue p {
	margin: 0;
}

/* ---------- Steps ---------- */

.pac-steps {
	counter-reset: pac-step;
}

.pac-step {
	counter-increment: pac-step;
	position: relative;
	padding-top: 3.75rem;
}

.pac-step::before {
	content: counter(pac-step);
	position: absolute;
	top: 0;
	left: 0;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background: var(--wp--preset--color--badge-red);
	color: #fff;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.5rem;
	font-weight: 700;
}

.pac-step h3 {
	margin-top: 0;
}

/* ---------- News ---------- */

.pac-news .wp-block-post {
	padding-top: 1rem;
	border-top: 3px solid var(--wp--preset--color--ring);
}

.pac-news .wp-block-post-title a {
	text-decoration: none;
}

.pac-news .wp-block-post-title a:hover {
	text-decoration: underline;
}

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

/* A post that is only a link becomes an embed; in a list of excerpts just show the link. */
.wp-block-post-excerpt iframe.wp-embedded-content {
	display: none;
}

.wp-block-post-excerpt blockquote.wp-embedded-content {
	margin: 0;
	padding: 0;
	border: 0;
}

.pac-post-list .wp-block-post + .wp-block-post {
	margin-top: var(--wp--preset--spacing--40);
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--line);
}

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

/* ---------- Members strip ---------- */

.pac-members a {
	color: #fff;
}

.pac-members a:hover {
	color: var(--wp--preset--color--gold);
}

.pac-members .wp-block-list {
	columns: 2 14rem;
	column-gap: 2rem;
	padding: 0;
	list-style: none;
}

.pac-members .wp-block-list li {
	break-inside: avoid;
	padding: 0.45rem 0;
	border-bottom: 1px solid rgb(255 255 255 / 0.18);
}

/* ---------- Page title band ---------- */

.pac-page-head {
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.pac-page-head h1 {
	margin: 0;
	text-wrap: balance;
}

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

.pac-footer a {
	color: inherit;
	text-decoration-color: rgb(255 255 255 / 0.4);
	text-underline-offset: 0.2em;
}

.pac-footer a:hover {
	color: var(--wp--preset--color--gold);
}

.pac-footer h2 {
	color: #fff;
}

.pac-footer .wp-block-site-logo img {
	width: 88px;
	height: 88px;
	border-radius: 50%;
}

.pac-footer__base {
	border-top: 1px solid rgb(255 255 255 / 0.18);
}

/* ---------- Content from the old theme ----------
 * Older pages were written with Bootstrap 3 classes (row, col-md-*, table-striped,
 * embed-responsive). Enough of that is reproduced here for them to lay out
 * sensibly until they're rebuilt with blocks.
 */

.entry-content .row {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	margin-block: 1.5rem;
}

.entry-content .row > [class*="col-md-"] {
	flex: 1 1 100%;
	min-width: 0;
}

@media (min-width: 782px) {
	.entry-content .row > .col-md-3 { flex-basis: calc(25% - 1.5rem); }
	.entry-content .row > .col-md-4 { flex-basis: calc(33.333% - 1.5rem); }
	.entry-content .row > .col-md-6 { flex-basis: calc(50% - 1.5rem); }
	.entry-content .row > .col-md-12 { flex-basis: 100%; }
}

.entry-content .row img {
	max-width: 100%;
	height: auto;
}

.entry-content .table-responsive {
	overflow-x: auto;
	margin-block: 1.5rem;
}

.entry-content table:not(.pac-honours__table):not(.pac-weather__hours) {
	width: 100%;
	border-collapse: collapse;
	font-size: 1rem;
}

.entry-content table:not(.pac-honours__table):not(.pac-weather__hours) :where(th, td) {
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid var(--wp--preset--color--line);
	text-align: left;
	vertical-align: top;
}

.entry-content table:not(.pac-honours__table):not(.pac-weather__hours) thead th {
	border-bottom: 2px solid var(--wp--preset--color--ring);
}

.entry-content .table-striped tbody tr:nth-child(odd) {
	background: color-mix(in srgb, var(--wp--preset--color--sky) 45%, transparent);
}

.entry-content .embed-responsive {
	position: relative;
	aspect-ratio: 4 / 3;
}

.entry-content .embed-responsive iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.entry-content iframe {
	max-width: 100%;
}

/* Classic-editor leftovers: indents and pasted fonts/sizes from Word or other sites. */
.entry-content :where(p, li, span, div)[style*="padding-left"] {
	padding-left: 0 !important;
}

.entry-content [style*="font-family"] {
	font-family: inherit !important;
}

.entry-content :where(p, span, li)[style*="font-size"] {
	font-size: inherit !important;
}

/* Mailchimp's embedded sign-up form (its own CSS fixes it at 600px wide). */
.entry-content #mc_embed_signup {
	width: auto !important;
	max-width: 36rem;
	padding: 1.5rem;
	border-radius: var(--pac-radius);
	background: var(--wp--preset--color--sky);
}

.entry-content #mc_embed_signup :where(input[type="text"], input[type="email"]) {
	width: 100%;
	padding: 0.6rem 0.7rem;
	border: 1px solid #9DB2B7;
	border-radius: var(--pac-radius);
	font: inherit;
	background: #fff;
}

.entry-content #mc_embed_signup *,
.entry-content #mc_embed_signup *::before,
.entry-content #mc_embed_signup *::after {
	box-sizing: border-box;
	max-width: 100%;
}

.entry-content #mc_embed_signup .mc-field-group {
	margin-bottom: 0.9rem;
}

.entry-content #mc_embed_signup label {
	display: block;
	margin-bottom: 0.25rem;
	font-weight: 600;
}

.entry-content #mc_embed_signup :where(input[type="submit"], .button) {
	padding: 0.7rem 1.3rem;
	border: 0;
	border-radius: var(--pac-radius);
	background: var(--wp--preset--color--badge-red);
	color: #fff;
	font: inherit;
	font-weight: 650;
	cursor: pointer;
}

/* ---------- Utilities ---------- */

@media (max-width: 599px) {
	.pac-hide-mobile {
		display: none !important;
	}
}

/* Small screens: the text block is taller than the photo's foreground, so darken earlier. */
@media (max-width: 599px) {
	.pac-hero.wp-block-cover {
		min-height: 600px !important;
	}

	.pac-hero .wp-block-cover__background {
		background: linear-gradient(180deg, rgb(20 53 64 / 0) 18%, rgb(20 53 64 / 0.7) 45%, rgb(20 53 64 / 0.94) 100%) !important;
	}
}

/* Notes under a holiday line are information, not decoration: keep them readable. */
.pac-upcoming__item.is-off .pac-upcoming__meta {
	color: var(--wp--preset--color--slate);
}

/* ---------- Beginners' courses ([pac_courses]) ---------- */

.pac-courses {
	--pac-accent: var(--wp--preset--color--ring);
	--pac-highlight: var(--wp--preset--color--gold);
	--pac-muted: var(--wp--preset--color--slate);
	--pac-line: var(--wp--preset--color--line);
}

.pac-course__title {
	font-size: var(--wp--preset--font-size--large);
}

.pac-course__price strong {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.5rem;
	color: var(--wp--preset--color--ring);
}

.pac-course .pac-course__button.is-secondary {
	color: var(--wp--preset--color--ring) !important;
}

.pac-course .pac-course__button.is-secondary:hover {
	background: var(--wp--preset--color--ring) !important;
	color: #fff !important;
}

/* ---------- Tablet header ----------
 * WordPress only switches to the hamburger menu below 600px. With the club name,
 * tagline and six menu items, the bar wraps onto two lines below ~900px, so use
 * the hamburger up to 1023px (iPad portrait); iPad landscape and up keep the full menu.
 */
@media (min-width: 600px) and (max-width: 1023px) {
	.pac-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.pac-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}

	.pac-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
		display: flex;
	}
}

/* ---------- Weather ([pac_weather]) ---------- */

.pac-weather,
.pac-weather-line {
	--pac-accent: var(--wp--preset--color--ring);
	--pac-highlight: var(--wp--preset--color--gold);
	--pac-muted: var(--wp--preset--color--slate);
	--pac-line: var(--wp--preset--color--line);
}

.pac-weather__title {
	font-size: var(--wp--preset--font-size--large);
}

.pac-weather__subtitle {
	font-size: 1.125rem;
}

/* On the home page the line sits inside the outdoor venue box. */
.pac-venue .pac-weather-line {
	color: var(--wp--preset--color--ink);
}

/* Bare URLs pasted as link text (common in older pages) must wrap on phones. */
.entry-content a {
	overflow-wrap: anywhere;
}

/* ---------- Panels (Group block styles) ----------
 * Rounded coloured boxes for splitting up long pages. Applied in the editor via
 * Group → Styles. Children get their own spacing; headings inside panels are tighter.
 */
.wp-block-group:is(.is-style-panel-sky, .is-style-panel-gold, .is-style-panel-teal, .is-style-panel-outline) {
	padding: clamp(1.25rem, 3vw, 2rem);
	border-radius: 14px;
}

.wp-block-group:is(.is-style-panel-sky, .is-style-panel-gold, .is-style-panel-teal, .is-style-panel-outline) > :first-child {
	margin-top: 0;
}

.wp-block-group:is(.is-style-panel-sky, .is-style-panel-gold, .is-style-panel-teal, .is-style-panel-outline) > :last-child {
	margin-bottom: 0;
}

.wp-block-group:is(.is-style-panel-sky, .is-style-panel-gold, .is-style-panel-teal, .is-style-panel-outline) :is(h2, h3, h4) {
	margin-top: 0;
	margin-bottom: 0.5rem;
}

.wp-block-group.is-style-panel-sky {
	background: var(--wp--preset--color--sky);
}

.wp-block-group.is-style-panel-gold {
	background: color-mix(in srgb, var(--wp--preset--color--gold) 28%, #fff);
	box-shadow: inset 5px 0 0 var(--wp--preset--color--gold);
}

.wp-block-group.is-style-panel-teal {
	background: var(--wp--preset--color--ring);
	color: #fff;
}

.wp-block-group.is-style-panel-teal :is(h2, h3, h4, a:not(.wp-element-button)) {
	color: #fff;
}

.wp-block-group.is-style-panel-teal a:not(.wp-element-button):hover {
	color: var(--wp--preset--color--gold);
}

.wp-block-group.is-style-panel-outline {
	border: 2px solid var(--wp--preset--color--line);
}

/* Columns of panels: equal heights, so a row of boxes lines up. */
.wp-block-columns > .wp-block-column > .wp-block-group[class*="is-style-panel-"]:only-child {
	height: 100%;
}

/* Lists inside panels read as checklists rather than bullet points. */
.wp-block-group[class*="is-style-panel-"] .wp-block-list.is-style-plain li {
	padding: 0.35rem 0;
	border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}

.wp-block-group[class*="is-style-panel-"] .wp-block-list.is-style-plain li:last-child {
	border-bottom: 0;
}

/* The Mailchimp form when it already sits in a panel: no second box. */
.wp-block-group[class*="is-style-panel-"] #mc_embed_signup {
	padding: 0;
	background: transparent;
}

.wp-block-group[class*="is-style-panel-"] #mc_embed_signup h2 {
	display: none;
}

/* Mailchimp's stylesheet forces small Helvetica; use the site's type instead. */
.entry-content #mc_embed_signup,
.entry-content #mc_embed_signup :is(label, p, span, input, .indicates-required, .content__gdpr, .content__gdprLegal) {
	font-family: inherit !important;
	font-size: 1rem !important;
}

.entry-content #mc_embed_signup :is(.indicates-required, .content__gdprLegal p) {
	font-size: 0.875rem !important;
}
