/*
Theme Name: Trades Showcase Lite
Theme URI: https://mainstaythemes.com/themes/trades-showcase-lite/
Author: Mainstay Themes
Author URI: https://mainstaythemes.com/
Description: A bold, high-contrast block theme for UK tradespeople, with big buttons and 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: trades-showcase-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%;
	}
}

/* A hazard stripe along the foot of the welcome banner. */
.trades-hero {
	position: relative;
}

.trades-hero::after {
	position: absolute;
	inset-block-end: 0;
	inset-inline: 0;
	height: 0.75rem;
	background-image: repeating-linear-gradient(-45deg, var(--wp--preset--color--accent) 0 1.25rem, var(--wp--preset--color--base) 1.25rem 2.5rem);
	content: "";
}

/* Phones: the call button stays on screen as people scroll. */
@media (max-width: 37.4375rem) {
	.wp-site-blocks > header {
		position: sticky;
		inset-block-start: 0;
		z-index: 10;
		background-color: var(--wp--preset--color--base);
	}

	.trades-topbar {
		display: none;
	}
}

/* A sharp angled edge on the photo, on screens wide enough to show it. */
@media (min-width: 48.875rem) {
	.trades-cut img {
		clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
	}
}

/* Keep the call button easy to tap on phones. */
header .wp-block-button__link {
	white-space: nowrap;
}
