/*
Theme Name: Big Ball 2027
Template: twentytwentyfive
Description: One-page site for The Big Ball 2027 in support of Calgary Health Foundation. A child theme of Twenty Twenty-Five: every section is made of normal WordPress blocks, so text, images and links can be edited in the page editor.
Version: 1.0.2
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bigball
*/

/*
 * Loaded on the site and in the editor. Front-end-only rules (desktop/mobile
 * visibility, hidden sections, "Read more") are in assets/css/front.css.
 * Mobile layout is anything under 782px, the width where WordPress stacks columns.
 */

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

/* Sections sit flush against each other. */
.bb-section {
	margin-block: 0;
}

.bb-section p:empty {
	display: none;
}

.bb-section .wp-block-heading {
	text-wrap: balance;
}

/* ---------- Textures (desktop and mobile crops) ---------- */

.bb-bg-burgundy-leopard,
.bb-bg-olive-leopard,
.bb-bg-offwhite-zebra,
.bb-bg-orange-zebra {
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

.bb-bg-burgundy-leopard {
	background-image: url(assets/images/bg-burgundy-leopard-mobile.webp);
}

.bb-bg-olive-leopard {
	background-image: url(assets/images/bg-olive-leopard-mobile.webp);
}

.bb-bg-offwhite-zebra {
	background-image: url(assets/images/bg-offwhite-zebra-mobile.webp);
}

.bb-bg-orange-zebra {
	background-image: url(assets/images/bg-orange-zebra-mobile.webp);
}

@media (min-width: 782px) {
	.bb-bg-burgundy-leopard {
		background-image: url(assets/images/bg-burgundy-leopard-desktop.webp);
	}

	.bb-bg-olive-leopard {
		background-image: url(assets/images/bg-olive-leopard-desktop.webp);
	}

	.bb-bg-offwhite-zebra {
		background-image: url(assets/images/bg-offwhite-zebra-desktop.webp);
	}

	.bb-bg-orange-zebra {
		background-image: url(assets/images/bg-orange-zebra-desktop.webp);
	}
}

/* ---------- Shared text treatments ---------- */

.bb-kicker {
	font-weight: 700;
	line-height: 1.15;
	text-transform: uppercase;
}

.bb-caps {
	text-transform: uppercase;
}

.bb-logo img {
	display: block;
	height: auto;
	margin-inline: auto;
	width: min(100%, 30rem);
}

.wp-block-button__link {
	transition: filter 0.15s ease;
}

.wp-block-button__link:hover {
	filter: brightness(1.08);
}

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

.bb-header {
	padding-block: var(--wp--preset--spacing--50);
	padding-inline: max(var(--wp--preset--spacing--50), (100% - var(--wp--style--global--wide-size)) / 2);
}

.bb-header > *,
.bb-header .bb-nav > *,
.bb-header__title > * {
	margin-block: 0;
}

.bb-header .bb-logo img {
	width: min(70%, 16rem);
}

.bb-site-title {
	font-size: clamp(2rem, 1.6rem + 1.6vw, 3.25rem);
	letter-spacing: 0.01em;
	line-height: 1.1;
}

.bb-nav a {
	display: block;
	font-weight: 600;
	text-decoration: none;
	text-transform: uppercase;
}

.bb-nav a:hover,
.bb-nav a:focus-visible {
	color: var(--wp--preset--color--light-blue);
}

@media (min-width: 782px) {
	.bb-header {
		align-items: center;
		column-gap: var(--wp--preset--spacing--50);
		display: grid;
		grid-template-columns: 1fr auto 1fr;
	}

	.bb-header .bb-nav {
		display: flex;
		gap: clamp(1.5rem, 4vw, 5rem);
		grid-row: 1;
	}

	.bb-header .bb-nav--left {
		grid-column: 1;
	}

	.bb-header__title {
		grid-column: 2;
		grid-row: 1;
		text-align: center;
	}

	.bb-header .bb-nav--right {
		grid-column: 3;
		justify-content: flex-end;
	}
}

@media (max-width: 781px) {
	.bb-header {
		align-items: center;
		display: flex;
		flex-direction: column;
		text-align: center;
	}

	.bb-header .bb-logo {
		margin-bottom: var(--wp--preset--spacing--50);
	}

	.bb-header__title {
		margin-bottom: var(--wp--preset--spacing--50) !important;
		order: 1;
	}

	/* The two link groups merge into one list: Tickets, Donate, Stay the Night, Contact. */
	.bb-header .bb-nav {
		display: contents;
	}

	.bb-header .bb-nav > * {
		border-top: 1px solid var(--wp--preset--color--light-blue);
		width: min(100%, 18rem);
	}

	.bb-header .bb-nav a {
		padding-block: 1.1rem;
	}

	.bb-nav--right > :nth-child(1) {
		order: 2;
	}

	.bb-nav--left > :nth-child(1) {
		order: 3;
	}

	.bb-nav--right > :nth-child(2) {
		order: 4;
	}

	.bb-nav--left > :nth-child(2) {
		order: 5;
	}

	.bb-header .bb-nav--left > :last-child {
		border-bottom: 1px solid var(--wp--preset--color--light-blue);
	}
}

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

.bb-hero .wp-block-separator {
	margin-block: 1.5rem;
	width: 100%;
}

@media (max-width: 781px) {
	.bb-hero {
		text-align: center;
	}

	.bb-hero .wp-block-buttons {
		align-items: center;
		flex-direction: column;
		justify-content: center;
	}
}

/* ---------- Video bands ---------- */

.bb-video {
	overflow: hidden;
}

.bb-video-band .bb-video {
	min-height: 56.25vw;
}

@media (max-width: 781px) {
	.bb-video-band .bb-video {
		min-height: 177vw;
	}
}

.bb-video-toggle {
	background: rgb(23 24 25 / 0.55);
	border: 1px solid rgb(239 233 202 / 0.6);
	border-radius: 50%;
	bottom: 1rem;
	cursor: pointer;
	height: 2.75rem;
	opacity: 0.75;
	position: absolute;
	right: 1rem;
	transition: opacity 0.15s ease;
	width: 2.75rem;
	z-index: 2;
}

.bb-video-toggle:hover,
.bb-video-toggle:focus-visible {
	opacity: 1;
}

/* Pause icon: two bars. Play icon (when paused): a triangle. */
.bb-video-toggle::before {
	border-inline: 4px solid #efe9ca;
	content: "";
	height: 14px;
	left: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 12px;
}

.is-paused > .bb-video-toggle::before {
	border-block: 8px solid transparent;
	border-inline: 13px solid #efe9ca;
	border-right-width: 0;
	height: 0;
	transform: translate(-35%, -50%);
	width: 0;
}

/* ---------- Event details bar ---------- */

.bb-details .wp-block-column > * {
	margin-block: 0;
}

.bb-details .wp-block-column > * + * {
	margin-top: 0.6em;
}

.bb-details .wp-block-column > h3 + * {
	margin-top: 1.5rem;
}

@media (min-width: 782px) {
	.bb-details .wp-block-column + .wp-block-column {
		border-left: 1px solid rgb(239 233 202 / 0.6);
	}
}

@media (max-width: 781px) {
	.bb-details .wp-block-column + .wp-block-column {
		border-top: 1px solid rgb(239 233 202 / 0.6);
		margin-inline: auto;
		padding-top: var(--wp--preset--spacing--50);
		width: min(100%, 18rem);
	}
}

/* ---------- Split sections (image or video beside text) ---------- */

.bb-split > .wp-block-column {
	min-width: 0;
}

@media (min-width: 782px) {
	.bb-media-fill {
		position: relative;
	}

	.bb-media-fill > .wp-block-image {
		inset: 0;
		margin: 0;
		position: absolute;
	}

	.bb-media-fill img {
		height: 100%;
		object-fit: cover;
		width: 100%;
	}
}

.bb-split .wp-block-image.bb-mobile-only {
	margin: 0;
}

.bb-split .wp-block-image.bb-mobile-only img {
	display: block;
	width: 100%;
}

.bb-chf__logo img {
	width: min(100%, 20rem);
}

@media (max-width: 781px) {
	.bb-chf__text {
		text-align: center;
	}

	.bb-chf__text .wp-block-buttons {
		justify-content: center;
	}

	.bb-chf__logo img {
		margin-inline: auto;
		width: min(70%, 14rem);
	}
}

/* ---------- Co-chairs ---------- */

.bb-intro {
	margin-inline: auto;
	max-width: 52rem;
}

.bb-person__media img {
	display: block;
	height: auto;
	margin-inline: auto;
	max-height: 46rem;
	max-width: min(100%, 33rem);
	width: auto;
}

@media (min-width: 782px) {
	.bb-person--reverse .bb-person__text {
		text-align: right;
	}
}

@media (max-width: 781px) {
	/* Name above the photo, bio below it. */
	.wp-block-columns.bb-person {
		row-gap: 1rem;
		text-align: center;
	}

	.bb-person__text {
		display: contents;
	}

	.bb-person__text > * {
		flex-basis: 100%;
		margin-block: 0;
		order: 3;
	}

	.bb-person__text > :first-child {
		order: 1;
	}

	.bb-person__media {
		order: 2;
	}

	.bb-person__media img {
		max-height: 28rem;
		max-width: min(80%, 19rem);
	}
}

/* ---------- Culinary Crown chefs ---------- */

.bb-crown .bb-chefs.alignwide {
	max-width: 1460px;
}

.bb-chefs > .bb-chef {
	margin-block: 0;
}

.bb-chefs > .bb-chef + .bb-chef {
	margin-top: var(--wp--preset--spacing--60);
}

.bb-chef__media img {
	aspect-ratio: 518 / 470;
	display: block;
	object-fit: cover;
	width: 100%;
}

.bb-chef__media .wp-block-image {
	margin: 0;
}

.bb-chef__text > * {
	margin-block: 0;
}

.bb-chef__text > * + * {
	margin-top: 1.25rem;
}

.bb-chef__restaurant {
	font-weight: 700;
	text-transform: uppercase;
}

.bb-clamp > * {
	margin-block: 0;
}

.bb-clamp > * + * {
	margin-top: 0.75em;
}

.bb-clamp__toggle {
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	font: inherit;
	font-size: 0.85em;
	font-weight: 700;
	letter-spacing: 0.06em;
	margin-top: 0.75rem;
	padding: 0;
	text-decoration: underline;
	text-transform: uppercase;
	text-underline-offset: 0.25em;
}

@media (min-width: 782px) {
	.bb-chef {
		align-items: flex-start;
	}

	.bb-chef__text {
		border-top: 2px solid currentColor;
		padding: 3rem 0 0 clamp(2rem, 5vw, 5.5rem);
	}

	/* Every second chef flips so photos alternate left and right. */
	.bb-chefs > .bb-chef:nth-child(even of .bb-chef:not(.is-style-bb-hidden)) {
		flex-direction: row-reverse;
	}

	.bb-chefs > .bb-chef:nth-child(even of .bb-chef:not(.is-style-bb-hidden)) .bb-chef__text {
		padding-left: 1rem;
		padding-right: clamp(2rem, 5vw, 5.5rem);
	}
}

@media (max-width: 781px) {
	.bb-chef {
		border-bottom: 2px solid currentColor;
		padding-bottom: var(--wp--preset--spacing--50);
		text-align: center;
	}

	.bb-chef__media img {
		margin-inline: auto;
		width: min(80%, 19rem);
	}

	.bb-clamp {
		--bb-clamp-lines: 5;
	}
}

/* ---------- Countdown ---------- */

.bb-countdown {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
	gap: var(--wp--preset--spacing--40);
	text-align: center;
}

.bb-see-you .bb-countdown {
	max-width: var(--wp--style--global--wide-size);
}

.bb-countdown__unit {
	display: flex;
	flex-direction: column;
	min-width: 7rem;
}

.bb-countdown__num {
	font-size: clamp(5rem, 4rem + 4.5vw, 9.5rem);
	font-variant-numeric: tabular-nums;
	font-weight: 400;
	line-height: 1.05;
}

.bb-countdown__label {
	font-size: var(--wp--preset--font-size--medium);
	text-transform: uppercase;
}

.bb-countdown__ended,
.bb-countdown__error {
	font-size: var(--wp--preset--font-size--large);
	text-align: center;
	text-transform: uppercase;
}

@media (max-width: 781px) {
	.bb-countdown {
		flex-direction: column;
		gap: var(--wp--preset--spacing--50);
	}
}

/* ---------- Stay the night ---------- */

/* The textured column fills the section height; its text sits in the middle. */
.bb-stay__text {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.bb-stay__text > * {
	width: 100%;
}

.bb-stay__media {
	display: flex;
	flex-direction: column;
}

.bb-stay__media > .wp-block-cover {
	flex: 1;
	margin: 0;
	min-height: 165vw;
}

@media (min-width: 782px) {
	.bb-stay__media > .wp-block-cover {
		min-height: max(36rem, 58vw);
	}
}

@media (max-width: 781px) {
	.bb-stay__text {
		text-align: center;
	}

	.bb-stay__text .wp-block-buttons {
		justify-content: center;
	}
}

/* ---------- Be part of the legacy (accordions) ---------- */

.bb-accordions > .wp-block-details {
	border-bottom: 2px solid currentColor;
	margin-block: 0;
}

.bb-accordions > .wp-block-details:first-child {
	border-top: 2px solid currentColor;
}

.bb-accordion summary {
	align-items: center;
	cursor: pointer;
	display: flex;
	font-family: var(--wp--preset--font-family--instrument-serif);
	font-size: var(--wp--preset--font-size--x-large);
	font-style: italic;
	gap: 1rem;
	justify-content: space-between;
	line-height: 1;
	list-style: none;
	padding-block: clamp(1rem, 2.5vw, 3rem);
	text-transform: uppercase;
}

.bb-accordion summary::-webkit-details-marker {
	display: none;
}

.bb-accordion summary::after {
	border-bottom: 2px solid currentColor;
	border-right: 2px solid currentColor;
	content: "";
	flex: none;
	height: 0.35em;
	margin-right: 0.3em;
	transform: translateY(-25%) rotate(45deg);
	transition: transform 0.2s ease;
	width: 0.35em;
}

.bb-accordion[open] summary::after {
	transform: translateY(25%) rotate(-135deg);
}

.bb-accordion > :not(summary) {
	margin-top: 0;
	padding-bottom: clamp(1rem, 2.5vw, 2.5rem);
}

@media (min-width: 782px) {
	.bb-legacy__text {
		text-align: right;
	}

	.bb-legacy__text .wp-block-buttons {
		justify-content: flex-end;
	}
}

@media (max-width: 781px) {
	/* Heading and text first, then the accordions. */
	.bb-legacy__cols {
		flex-direction: column-reverse;
	}

	.bb-legacy__text {
		text-align: center;
	}

	.bb-legacy__text .wp-block-buttons {
		justify-content: center;
	}
}

/* ---------- Sponsors ---------- */

.bb-tier {
	padding-block: var(--wp--preset--spacing--60);
}

.bb-tiers > .bb-tier {
	margin-block: 0;
}

.bb-tiers > .bb-tier + .bb-tier {
	border-top: 2px solid currentColor;
}

.bb-tier .wp-block-heading {
	font-style: normal;
}

.wp-block-gallery.bb-logos {
	align-items: center;
	gap: var(--wp--preset--spacing--50);
	justify-content: center;
	margin-top: var(--wp--preset--spacing--50);
}

.wp-block-gallery.bb-logos.has-nested-images figure.wp-block-image {
	flex-grow: 0 !important;
	width: auto !important;
}

.wp-block-gallery.bb-logos.has-nested-images figure.wp-block-image img {
	height: auto;
	max-height: 7.5rem;
	max-width: min(100%, 16rem);
	object-fit: contain;
	width: auto;
}

.wp-block-gallery.bb-logos--lg.has-nested-images figure.wp-block-image img {
	max-height: 11rem;
	max-width: min(100%, 28rem);
}

@media (max-width: 781px) {
	.wp-block-gallery.bb-logos--lg.has-nested-images figure.wp-block-image img {
		max-width: min(100%, 16rem);
	}
}

/* ---------- Connect (footer) ---------- */

.bb-connect > * {
	margin-block: 0;
}

.bb-connect__name {
	margin-top: var(--wp--preset--spacing--60) !important;
	text-transform: none;
}

.bb-connect__contact {
	font-weight: 300;
	margin-top: 1.5rem !important;
	overflow-wrap: anywhere;
}

/* Keeps the long address on one line on phones. */
.bb-connect__email {
	font-size: min(var(--wp--preset--font-size--medium), 3.1vw);
}

.bb-connect__contact a {
	text-decoration: none;
}

.bb-connect__contact a:hover,
.bb-connect__contact a:focus-visible {
	text-decoration: underline;
}

.bb-connect .bb-logo {
	margin-top: var(--wp--preset--spacing--60) !important;
}

.bb-connect .bb-logo img {
	width: min(60%, 15rem);
}

.bb-connect .bb-handle {
	margin-top: 1.25rem !important;
}
