/*
Theme Name: Pella XC
Description: Block theme for the Pella Cross Country website. Design tokens live in theme.json; this file holds the few styles theme.json can't express, plus the theme header.
Version: 0.5.0
Requires at least: 6.6
Requires PHP: 7.4
Author: Pella Cross Country
Text Domain: pellaxc
License: GPL-2.0-or-later
*/

/* Brand colors come from theme.json (Pella Green #1E4D2B, Pella Gray #C1C6C8). */

/* Header ------------------------------------------------------------ */
.pxc-header {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 4px solid var(--wp--preset--color--green);
}
.admin-bar .pxc-header { top: 32px; }
.pxc-brand { position: relative; }
.pxc-logo { margin: 0; }
.pxc-logo img { display: block; }
/* The text is the single link; stretch it over the mark so the whole brand
   lockup is clickable without a second, duplicate link. */
.pxc-brand-text {
	margin: 0;
	font-size: 1.75rem;
	line-height: 1;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.01em;
}
.pxc-brand-text a { color: var(--wp--preset--color--green); text-decoration: none; }
.pxc-brand-text a::after { content: ""; position: absolute; inset: 0; }
@media (max-width: 480px) {
	.pxc-brand-text { font-size: var(--wp--preset--font-size--large); }
}
.pxc-header .wp-block-navigation a { text-decoration: none; }
.pxc-header .wp-block-navigation .current-menu-item > a,
.pxc-header .wp-block-navigation a:hover { color: var(--wp--preset--color--green); }
.pxc-header .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--gray);
}
/* Dropdown is Pella Green, so the green hover/current color above would vanish. */
.pxc-header .wp-block-navigation__submenu-container .current-menu-item > a,
.pxc-header .wp-block-navigation__submenu-container a:hover,
.pxc-header .wp-block-navigation__submenu-container a:focus-visible { color: var(--wp--preset--color--gray); }

/* Mobile menu: full-screen Pella Green panel with left-aligned rows and
   dividers; submenu groups are always shown, indented under their label. Core's
   right-justify rules are specific, hence the !important on alignment. */
.pxc-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: 0;
	background-color: var(--wp--preset--color--green);
	color: var(--wp--preset--color--white);
}
.pxc-header .is-menu-open::before {
	content: "";
	position: absolute;
	top: 1rem;
	left: 1.5rem;
	width: 56px;
	height: 48px;
	background: url("assets/images/pella-p-white.png") no-repeat left center / contain;
}
.pxc-header .is-menu-open .wp-block-navigation__responsive-container-close {
	top: 1.25rem;
	right: 1.25rem;
	color: var(--wp--preset--color--white);
}
.pxc-header .is-menu-open .wp-block-navigation__responsive-container-content {
	padding: 7rem 1.5rem 2.5rem !important;
	align-items: stretch;
}
.pxc-header .is-menu-open .wp-block-navigation__container {
	width: 100%;
	align-items: stretch !important;
	justify-content: flex-start !important;
	gap: 0;
}
.pxc-header .is-menu-open .wp-block-navigation-item {
	width: 100%;
	align-items: stretch !important;
	justify-content: flex-start !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
.pxc-header .is-menu-open .wp-block-navigation-item__content {
	width: 100%;
	padding: 1rem 0;
	text-align: left !important;
	justify-content: flex-start !important;
	font-size: 1.375rem;
	color: var(--wp--preset--color--white);
}
.pxc-header .is-menu-open .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--gray); }
.pxc-header .is-menu-open .wp-block-navigation__submenu-icon { display: none; }

/* A group label (Roster, History) with its pages indented below it. */
.pxc-header .is-menu-open .has-child > .wp-block-navigation-item__content {
	padding-bottom: 0.6rem;
	color: var(--wp--preset--color--gray);
	font-size: 1rem;
	letter-spacing: 0.12em;
	pointer-events: none;
}
.pxc-header .is-menu-open .wp-block-navigation__submenu-container {
	width: 100% !important;
	margin: 0 0 1rem !important;
	padding: 0 0 0 1rem !important;
	border: 0 !important;
	border-left: 3px solid var(--wp--preset--color--gray) !important;
	background: transparent !important;
	align-items: flex-start !important;
	min-width: 0 !important;
}
.pxc-header .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item { border-bottom: 0; }
.pxc-header .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.6rem 0;
	font-size: 1.1875rem;
	letter-spacing: 0.03em;
	color: var(--wp--preset--color--white);
	pointer-events: auto;
}

/* Content text measure; tables and wide blocks use the full 1200px. Text is
   left-aligned to the same edge as columns and images (constrained layouts
   center children with !important margins, so match that). */
.pxc-content > :where(p, ul, ol, h2, h3, h4, h5, blockquote, .wp-block-heading, .wp-block-list) {
	max-width: 760px;
	margin-left: 0 !important;
	margin-right: auto !important;
}
.pxc-article-head > * { margin-left: 0 !important; margin-right: auto !important; }

/* Headings are green by default; inside a white-text (dark) group they would
   vanish, so they follow the group's text color unless given their own. */
:where(.has-white-color) :is(h1, h2, h3, h4, h5, h6):not(.has-text-color) { color: inherit; }

/* Notice box (converted from Avada alerts). */
.pxc-notice {
	background: var(--wp--preset--color--gray-light);
	border-left: 4px solid var(--wp--preset--color--gray);
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}
.pxc-notice > :first-child { margin-top: 0; }
.pxc-notice > :last-child { margin-bottom: 0; }

/* Converted testimonial quotes. */
.pxc-testimonials { display: grid; gap: var(--wp--preset--spacing--40); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pxc-testimonials .wp-block-quote { margin: 0; border-left: 4px solid var(--wp--preset--color--green); padding-left: var(--wp--preset--spacing--30); }
.pxc-testimonials cite { display: block; margin-top: 0.5rem; font-style: normal; font-weight: 600; }

/* Home slideshow ------------------------------------------------------ */
.pxc-slideshow { position: relative; margin-block-start: 0; }
.pxc-slides .wp-block-post-template {
	display: flex;
	flex-wrap: nowrap;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}
.pxc-slides .wp-block-post-template::-webkit-scrollbar { display: none; }
.pxc-slides .wp-block-post-template > li {
	flex: 0 0 100%;
	margin: 0;
	scroll-snap-align: start;
}
.pxc-slide { min-height: var(--wp--custom--slideshow--height) !important; }
.pxc-slide .wp-block-cover__inner-container { padding-bottom: var(--wp--preset--spacing--50); }
.pxc-slide .wp-block-post-title {
	margin: 0.25em 0;
	max-width: 34ch;
	font-size: clamp(1.25rem, 1rem + 1.4vw, 2rem);
	line-height: 1.15;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
.pxc-slide .wp-block-post-title a { text-decoration: none; }
.pxc-slide-kicker a {
	color: var(--wp--preset--color--white);
	background: var(--wp--preset--color--green);
	padding: 0.25em 0.6em;
	text-decoration: none;
	font-family: var(--wp--preset--font-family--heading);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.pxc-slide-controls {
	z-index: 2;
	position: absolute;
	right: var(--wp--preset--spacing--40);
	bottom: var(--wp--preset--spacing--40);
	display: flex;
	gap: 0.5rem;
}
.pxc-slide-controls button {
	width: 2.75rem;
	height: 2.75rem;
	border: 2px solid var(--wp--preset--color--white);
	background: rgba(0, 0, 0, 0.55);
	color: var(--wp--preset--color--white);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
}
.pxc-slide-controls button:hover { background: var(--wp--preset--color--green); }

/* News band (home), cards ------------------------------------------------ */
.pxc-main,
.pxc-slideshow + .pxc-main { margin-block-start: 0 !important; }
.pxc-news { margin-block-start: 0; }
.pxc-news-list .wp-block-post-template { list-style: none; padding: 0; margin: 0 0 var(--wp--preset--spacing--40); }
.pxc-news-list .wp-block-post-template > li { margin: 0; border-bottom: 1px solid rgba(0, 0, 0, 0.2); }
.pxc-news--dark .pxc-news-list .wp-block-post-template > li { border-bottom-color: rgba(255, 255, 255, 0.25); }
.pxc-news--light .wp-block-post-date { opacity: 0.75; }
.pxc-news-item { gap: var(--wp--preset--spacing--30); padding: var(--wp--preset--spacing--30) 0; }
.pxc-news-item .wp-block-post-featured-image { flex: 0 0 120px; margin: 0; }
.pxc-news-item .wp-block-post-featured-image img { display: block; width: 100%; border: 2px solid rgba(255, 255, 255, 0.9); }
.pxc-news-text { flex: 1 1 auto; min-width: 0; }
.pxc-news-text .wp-block-post-title {
	margin: 0 0 0.25rem;
	text-transform: none;
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	line-height: 1.3;
}
.pxc-news-text .wp-block-post-title a { text-decoration: none; }
.pxc-news-text .wp-block-post-title a:hover { text-decoration: underline; }
.pxc-news-text .wp-block-post-date { margin: 0; }
.pxc-news--dark .wp-block-button__link:hover {
	background: var(--wp--preset--color--gray);
	color: var(--wp--preset--color--green-dark);
}
@media (max-width: 480px) {
	.pxc-news-item .wp-block-post-featured-image { flex-basis: 96px; }
}
.pxc-card .wp-block-post-title { text-transform: none; font-family: var(--wp--preset--font-family--body); font-weight: 600; margin: 0.5rem 0 0.25rem; }
.pxc-card .wp-block-post-featured-image img { display: block; }
.pxc-kicker a { text-decoration: none; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* Legacy of success (home) ---------------------------------------------- */
.pxc-legacy { margin-block-start: 0; }
/* constrained layouts center children with !important margins, so match that */
.pxc-legacy-intro { margin: 0 auto 0 0 !important; max-width: 60ch; }

/* Hero: two photos side by side with the title over a top gradient. */
.pxc-legacy-hero { position: relative; margin-block-start: 0; }
.pxc-legacy-hero::after {
	content: "";
	position: absolute;
	inset: 0 0 45% 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0) 100%);
	pointer-events: none;
	z-index: 1;
}
.pxc-legacy-hero-title {
	position: absolute;
	top: var(--wp--preset--spacing--50);
	left: 0;
	right: 0;
	z-index: 2;
	box-sizing: border-box;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0;
}
.pxc-legacy-hero-title > * { margin-left: 0 !important; margin-right: 0 !important; max-width: 44ch; }
.pxc-legacy-hero-title h2 { margin: 0 0 0.25rem; color: var(--wp--preset--color--white); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
.pxc-legacy-hero-title .pxc-legacy-intro { text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }
.pxc-legacy-photos { margin: 0; gap: 0; }
.pxc-legacy-photos .wp-block-column + .wp-block-column { border-left: 4px solid var(--wp--preset--color--white); }
.pxc-hero-photo { min-height: 460px; }
.pxc-hero-chip {
	display: inline-block;
	margin: 0;
	padding: 0.3em 0.8em;
	background: var(--wp--preset--color--green);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--medium);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
@media (max-width: 781px) {
	.pxc-legacy-hero::after { display: none; }
	.pxc-legacy-hero-title {
		position: static;
		max-width: none;
		background: var(--wp--preset--color--green);
		padding: var(--wp--preset--spacing--40);
	}
	.pxc-legacy-hero-title > * { max-width: none; }
	.pxc-legacy-photos .wp-block-column + .wp-block-column { border-left: 0; border-top: 4px solid var(--wp--preset--color--white); }
	.pxc-hero-photo { min-height: 300px !important; }
}

.pxc-legacy-card {
	border-top: 6px solid var(--wp--preset--color--green);
	padding: var(--wp--preset--spacing--40);
	height: 100%;
	box-sizing: border-box;
}
.pxc-legacy-card h3 { margin-top: 0; }
.pxc-legacy-card h4 {
	margin: var(--wp--preset--spacing--40) 0 var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--medium);
}
.pxc-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--30);
	margin: var(--wp--preset--spacing--30) 0 0;
}
.pxc-stat { display: block; }
.pxc-stat-n {
	display: block;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: clamp(2.25rem, 2rem + 1vw, 3rem);
	line-height: 1;
	color: var(--wp--preset--color--green);
}
.pxc-stat-l {
	display: block;
	margin-top: 0.25rem;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.25;
}
.pxc-finishes { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.pxc-chip {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	min-width: 3.6rem;
	padding: 0.35rem 0.4rem;
	background: var(--wp--preset--color--gray-light);
	color: var(--wp--preset--color--black);
	border: 2px solid transparent;
	line-height: 1.15;
}
.pxc-chip-place {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 1.15rem;
}
.pxc-chip-year { font-size: 0.75rem; }
/* Medal colors: gold and bronze are not brand colors; silver is Pella Gray. */
.pxc-chip.is-gold { background: #e3b93c; color: var(--wp--preset--color--black); }
.pxc-chip.is-silver { background: var(--wp--preset--color--gray); color: var(--wp--preset--color--black); }
.pxc-chip.is-bronze { background: #c98a4b; color: var(--wp--preset--color--black); }
.pxc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-top: var(--wp--preset--spacing--40); }
.pxc-legend .pxc-chip { min-width: 0; padding: 0.15rem 0.5rem; flex-direction: row; }
.pxc-legend .pxc-chip-place { font-size: 0.9rem; }
.pxc-legend .pxc-chip:not(.is-gold):not(.is-silver):not(.is-bronze) { background: var(--wp--preset--color--white); border-color: var(--wp--preset--color--gray); }
.pxc-legacy .wp-block-details { margin-top: var(--wp--preset--spacing--20); border-top: 1px solid var(--wp--preset--color--gray); padding-top: var(--wp--preset--spacing--20); }
.pxc-legacy .wp-block-details summary { cursor: pointer; font-weight: 600; }
.pxc-legacy .wp-block-details p { margin: 0.5rem 0 0; }
@media (max-width: 600px) {
	.pxc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--wp--preset--spacing--40); }
}

/* Film promo (Drive for Five) ---------------------------------------------- */
.pxc-film { margin-block-start: 0; }
.pxc-film-kicker {
	margin: 0 0 var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--gray);
	font-family: var(--wp--preset--font-family--heading);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.pxc-film h2 { margin-top: 0; font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.75rem); }
.pxc-film-poster { margin: 0; }
.pxc-film-poster img { display: block; width: 100%; height: auto; }
.pxc-film-poster a { display: block; }
.pxc-film .pxc-btn-light .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--white);
	border: 2px solid var(--wp--preset--color--white);
}
.pxc-film .pxc-btn-light .wp-block-button__link:hover { background: var(--wp--preset--color--white); color: var(--wp--preset--color--black); }
@media (max-width: 781px) {
	.pxc-film .wp-block-columns { flex-direction: column-reverse; }
}

/* Home YouTube player: size the iframe ourselves (16:9). Core's and Avada's
   embed rules both add padding boxes and fight over positioning, so these use
   !important on purpose; the Avada wrapper goes away at launch. */
.pxc-video .wp-block-embed { margin: 0; }
.pxc-video .wp-block-embed .wp-block-embed__wrapper {
	position: relative !important;
	width: 100%;
	height: auto !important;
	aspect-ratio: 16 / 9;
	padding: 0 !important;
}
.pxc-video .wp-block-embed .wp-block-embed__wrapper::before { display: none !important; content: none !important; }
.pxc-video .video-shortcode { display: contents; }
.pxc-video .wp-block-embed__wrapper iframe {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	border: 0;
}

/* Tables: core table block and TablePress ----------------------------- */
.wp-block-table table,
table.tablepress {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small);
}
.wp-block-table th, .wp-block-table td,
table.tablepress th, table.tablepress td {
	padding: 0.55rem 0.75rem;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--gray);
	text-align: left;
}
.wp-block-table thead th,
table.tablepress thead th,
table.tablepress tfoot th {
	background: var(--wp--preset--color--green);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.wp-block-table tbody tr:nth-child(even) td,
table.tablepress tbody tr:nth-child(even) td { background: var(--wp--preset--color--gray-light); }
table.tablepress tbody tr:hover td { background: var(--wp--preset--color--gray); }
@media (max-width: 782px) {
	table.tablepress { display: block; max-width: 100%; overflow-x: auto; white-space: nowrap; }
}

/* Footer -------------------------------------------------------------- */
.pxc-footer a { color: var(--wp--preset--color--white); }
.pxc-footer-mark { margin: 0 0 var(--wp--preset--spacing--20); }
.pxc-footer-mark img { display: block; }
.pxc-footer-name { margin: 0 0 0.5rem; font-family: var(--wp--preset--font-family--heading); font-weight: 700; text-transform: uppercase; }
.pxc-footer-links { list-style: none; padding: 0; margin: 0; }
.pxc-footer-links li { margin: 0 0 0.4rem; }
.pxc-footer .wp-block-separator { opacity: 0.4; }

/* Accessibility ------------------------------------------------------- */
:where(a, button):focus-visible {
	outline: 3px solid var(--wp--preset--color--gray);
	outline-offset: 2px;
}
.pxc-footer :where(a):focus-visible { outline-color: var(--wp--preset--color--white); }
@media (prefers-reduced-motion: reduce) {
	.pxc-slides .wp-block-post-template { scroll-behavior: auto; }
}
