/*
Theme Name: Fixture Lite
Theme URI: https://mainstaythemes.com/themes/fixture-lite/
Author: Mainstay Themes
Author URI: https://mainstaythemes.com/
Description: A bold block theme in club colours for UK grassroots sports clubs, with ready-made pages.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fixture-lite
Tags: one-column, custom-colors, custom-menu, editor-style, featured-images, full-site-editing, block-patterns, translation-ready, wide-blocks, block-styles, style-variations
*/

/* Focus ring: two tones, so it shows on both light and dark sections. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.wp-block-button__link:focus-visible {
	outline: var(--wp--custom--focus--width) solid var(--wp--preset--color--contrast);
	outline-offset: var(--wp--custom--focus--width);
	box-shadow: 0 0 0 var(--wp--custom--focus--width) var(--wp--preset--color--base);
}

/* Form fields: a visible edge in every style. */
input:not([type="submit"], [type="button"], [type="checkbox"], [type="radio"]),
select,
textarea {
	border: var(--wp--custom--line--thin) solid var(--wp--preset--color--muted);
	border-radius: var(--wp--custom--radius--button);
}

/* Header, main content, footer and full-width sections sit flush against each other. */
.wp-site-blocks > *,
.wp-block-post-content > .alignfull,
main > .alignfull {
	margin-block: 0;
}

/* Card block style. */
.is-style-mainstay-card {
	height: 100%;
	padding: var(--wp--preset--spacing--40);
	background-color: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--card);
}

.has-surface-background-color .is-style-mainstay-card {
	background-color: var(--wp--preset--color--base);
}

/* FAQ rows. */
.wp-block-details {
	padding-block: var(--wp--preset--spacing--30);
	border-block-end: var(--wp--custom--line--thin) solid var(--wp--preset--color--border);
}

.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
}

/* Left and right aligned content stays inside the text column on full-width pages. */
.wp-block-post-content.alignfull > .alignleft {
	margin-inline-start: max(0%, calc((100% - var(--wp--style--global--content-size)) / 2));
}

.wp-block-post-content.alignfull > .alignright {
	margin-inline-end: max(0%, calc((100% - var(--wp--style--global--content-size)) / 2));
}

/* Long words, big images and code never push the page sideways. */
body {
	overflow-wrap: break-word;
}

img {
	max-width: 100%;
	height: auto;
}

.wp-caption {
	max-width: 100%;
}

pre {
	white-space: pre-wrap;
}

table {
	max-width: 100%;
}

/* Buttons and menu icons are big enough to tap comfortably. */
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
}

.wp-block-navigation__responsive-container-open svg {
	width: 2rem;
	height: 2rem;
}

/* When the menu has to wrap below the site name, it stays on the right. */
.mainstay-header-row:not(.is-vertical) > .mainstay-header-actions {
	margin-inline-start: auto;
}

/* Links that stand on their own, such as a phone number, are comfortable to tap. */
.wp-block-site-title a,
footer p > a:only-child,
.is-style-mainstay-card p > a:only-child {
	display: inline-block;
	padding-block: 0.125rem;
}

/* The open phone menu has large, well spaced links. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	padding-block: var(--wp--preset--spacing--20);
	font-size: var(--wp--preset--font-size--x-large);
}

/* Phones: the site name and menu icon share the first row, so the page starts sooner. */
@media (max-width: 37.4375rem) {
	.mainstay-header-row {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		justify-items: start;
		gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
		width: 100%;
	}

	.mainstay-header-row .wp-block-site-title {
		text-align: start;
	}

	.mainstay-header-actions {
		display: contents !important;
	}

	/* The page's own button is just below, so the header's waits for bigger screens. */
	.mainstay-header-row .wp-block-buttons {
		display: none;
	}

	/* Where the button is the point, such as a phone number, it gets its own full-width row. */
	.mainstay-keep-cta .wp-block-buttons {
		display: flex;
		grid-column: 1 / -1;
		width: 100%;
	}

	.mainstay-keep-cta .wp-block-button,
	.mainstay-keep-cta .wp-block-button__link {
		width: 100%;
	}

	/* Main buttons fill the width, so they are easy to hit with a thumb. */
	main .wp-block-buttons > .wp-block-button {
		flex-grow: 1;
	}

	main .wp-block-buttons > .wp-block-button > .wp-block-button__link {
		width: 100%;
	}
}

/* Small capitals used as labels. */
.fixture-label {
	margin-block-end: 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* The next match sits in a scoreboard panel. */
.fixture-score {
	padding: var(--wp--preset--spacing--40);
	border-block-start: 0.5rem solid var(--wp--preset--color--on-accent);
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Mown stripes across the welcome, in the club's colour. */
.fixture-stripes {
	background-image: repeating-linear-gradient(90deg, color-mix(in srgb, var(--wp--preset--color--on-accent) 8%, transparent) 0 5rem, transparent 5rem 10rem);
}

/* Tables read like a league table. */
.fixture-table table {
	table-layout: auto;
}

.fixture-table th,
.fixture-table td {
	padding-block: var(--wp--preset--spacing--20);
	padding-inline: var(--wp--preset--spacing--20);
	border: 0;
	border-block-end: var(--wp--custom--line--thin) solid currentColor;
	text-align: start;
}

.fixture-table th {
	font-family: var(--wp--preset--font-family--oswald);
	font-weight: 500;
	text-transform: uppercase;
}

/* On phones, tighter tables so that team names keep whole words. */
@media (max-width: 40rem) {
	.fixture-table table {
		font-size: var(--wp--preset--font-size--small);
	}

	.fixture-table th,
	.fixture-table td {
		padding-inline: 0.25rem;
		overflow-wrap: normal;
	}
}

/* Scores stand out, like numbers on a scoreboard. */
.fixture-board td:nth-child(3) {
	font-family: var(--wp--preset--font-family--oswald);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 600;
	white-space: nowrap;
}

/* Sponsor logos stay small and tidy. */
.wp-block-gallery.columns-6 img {
	border-radius: var(--wp--custom--radius--card);
}
