/*
Theme Name: PL Business
Theme URI: https://www.ploperations.ca
Author: PL Business Solutions
Description: Block theme for PL Business Solutions (ploperations.ca). One light serif, navy and gold, pill buttons. Colours, fonts and spacing are edited in Appearance > Editor > Styles. Every page section is also a block pattern under "PL Business".
Version: 1.0.0
Requires at least: 6.5
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: pl-business
*/

/*
 * Layout glue only. Colours, fonts and the five text sizes live in theme.json.
 * Rule: this file never sets a raw font-size. Use the presets (h1, h2, h3, body, small).
 */

/* Phone sizes for the five text presets, and the section padding. */
@media (max-width: 820px) {
	body {
		--wp--preset--font-size--h-1: 42px;
		--wp--preset--font-size--h-2: 34px;
		--wp--preset--font-size--h-3: 24px;
		--wp--preset--font-size--body: 19px;
		--wp--preset--spacing--section: 72px;
	}
}

body {
	-webkit-font-smoothing: antialiased;
	font-variant-numeric: lining-nums;
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--navy);
	outline-offset: 3px;
}
:is(.has-navy-background-color, .has-navy-deep-background-color, .wp-block-cover) :focus-visible {
	outline-color: var(--wp--preset--color--white);
}

/* Reading width and heading balance */
p,
li {
	max-width: 65ch;
}
p.has-text-align-center {
	margin-inline: auto;
}
h1,
h2,
h3 {
	text-wrap: balance;
}

/* No gaps between header, main and footer, or between full-width sections. */
body .wp-site-blocks > * {
	margin-block-start: 0;
}
.wp-block-post-content > .alignfull {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* Headings on white / light sections use the darker ink colour. */
.has-white-background-color :is(h1, h2, h3, h4),
.has-light-background-color :is(h1, h2, h3, h4) {
	color: var(--wp--preset--color--ink);
}

/* Dark section headings get the thin underline, like Aspire's "Our Services". */
.pl-underline {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 10px;
}

/* ---------- Buttons ---------- */
.wp-block-button__link {
	transition: transform 0.2s, background-color 0.2s;
}
.wp-block-button__link:hover {
	transform: translateY(-1px);
}
.wp-block-button.is-style-on-dark .wp-block-button__link {
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
}
.wp-block-button.is-style-on-dark .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--light);
	color: var(--wp--preset--color--ink);
}

@media (max-width: 820px) {
	.wp-block-button .wp-block-button__link.wp-element-button,
	.pl-form__submit {
		padding-left: 28px;
		padding-right: 28px;
	}
}

/* ---------- Header: slim, sticky, navy deep ---------- */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--position-offset, 0px);
	z-index: 20;
}
.pl-brand a {
	text-decoration: none;
}
.pl-brand__name {
	letter-spacing: 0.06em;
	line-height: 1.05;
	margin: 0;
}
.pl-brand__tag {
	letter-spacing: 0.2em;
	line-height: 1.05;
	text-transform: uppercase;
	margin: 0;
}
.pl-header .wp-block-navigation {
	letter-spacing: 0.05em;
}
.pl-header .wp-block-navigation a {
	text-decoration: none;
}
.pl-header .wp-block-navigation-item__content {
	padding-bottom: 3px;
	border-bottom: 1px solid transparent;
}
.pl-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	border-bottom: 0;
	padding: 8px 20px;
}
.pl-header .wp-block-navigation-item__content:hover,
.pl-header .current-menu-item > .wp-block-navigation-item__content,
.pl-header .wp-block-navigation-item__content[aria-current="page"] {
	border-bottom-color: currentColor;
}
.pl-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.pl-header .wp-block-navigation__submenu-container .current-menu-item > .wp-block-navigation-item__content {
	border-bottom-color: transparent;
	text-decoration: underline;
}
.pl-header .wp-block-navigation .wp-block-navigation__submenu-container {
	background-color: var(--wp--preset--color--navy-deep);
	color: var(--wp--preset--color--white);
	border: 1px solid rgba(255, 255, 255, 0.18);
	min-width: 200px;
	padding: 8px 0;
}
.pl-header .wp-block-navigation__responsive-container-open {
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 300px;
	padding: 8px 14px;
}

/* Collapse the menu at 820px (core default is 600px). */
@media (min-width: 600px) and (max-width: 820px) {
	.pl-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
	.pl-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

/* ---------- Columns stack under 820px ---------- */
@media (max-width: 820px) {
	.wp-block-columns {
		flex-wrap: wrap !important;
	}
	.wp-block-columns > .wp-block-column {
		flex-basis: 100% !important;
	}
}

/* ---------- Hero (Cover) ---------- */
.wp-block-cover.has-custom-content-position.pl-hero > .wp-block-cover__inner-container.wp-block-cover__inner-container,
.wp-block-cover.has-custom-content-position.pl-banner > .wp-block-cover__inner-container.wp-block-cover__inner-container,
.wp-block-cover.has-custom-content-position.pl-page-head > .wp-block-cover__inner-container.wp-block-cover__inner-container {
	width: 100%;
	max-width: 1240px;
	margin-inline: auto;
}
.wp-block-cover.pl-hero {
	min-height: clamp(560px, calc(100vh - 80px), 860px);
	padding-bottom: 130px;
}
.pl-hero .pl-hero__copy {
	max-width: 660px;
	margin-left: 0 !important;
	margin-right: auto !important;
}
.pl-hero .pl-hero__copy p {
	max-width: 40ch;
}
.wp-block-cover.pl-banner {
	min-height: 440px;
}
.wp-block-cover.pl-banner .pl-banner__copy {
	max-width: 760px;
	margin-left: 0 !important;
	margin-right: auto !important;
}
.wp-block-cover.pl-page-head {
	min-height: 380px;
}
@media (max-width: 820px) {
	.wp-block-cover.pl-hero {
		min-height: 520px;
		padding-bottom: 90px;
	}
	.pl-hero .wp-block-cover__background.has-background-gradient {
		background: rgba(10, 26, 61, 0.72) !important;
	}
	.wp-block-cover.pl-banner,
	.wp-block-cover.pl-page-head {
		min-height: 340px;
	}
}

/* ---------- Overlapping card, "since 2017" line, results row ---------- */
.pl-card {
	margin-top: -110px;
	position: relative;
	z-index: 2;
	padding: 56px 64px;
	box-shadow: 0 18px 50px rgba(10, 26, 61, 0.16);
}
.pl-card__text {
	flex: 1 1 520px;
	max-width: 760px;
}
@media (max-width: 820px) {
	.pl-card {
		margin-top: -70px;
		padding: 36px 24px;
	}
}
.pl-since {
	text-align: center;
}
.pl-since figure {
	margin: 0;
}
.pl-since img {
	display: block;
	height: auto;
}
.pl-results.is-layout-grid {
	text-align: center;
}
.pl-results p {
	margin: 0 auto;
}
@media (max-width: 820px) {
	.pl-results.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: 40px;
	}
}

/* ---------- Photos ---------- */
.wp-block-image img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* ---------- Testimonials ---------- */
.pl-slider {
	text-align: center;
	max-width: 980px;
	margin-inline: auto;
}
.pl-slider .pl-slide + .pl-slide {
	margin-top: 56px;
}
.pl-slider blockquote {
	margin: 0;
	padding: 0;
}
.pl-slider blockquote p {
	max-width: none;
	line-height: 1.45;
	color: var(--wp--preset--color--ink);
}
.pl-slider cite {
	display: block;
	margin-top: 28px;
	font-style: normal;
}
.pl-slider--js .pl-slide {
	display: none;
	margin-top: 0 !important;
}
.pl-slider--js .pl-slide.is-active {
	display: block;
}
.pl-slider__controls {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 22px;
	margin-top: 40px;
}
.pl-slider__btn {
	display: grid;
	place-items: center;
	padding: 0;
	background: none;
	border: 1px solid var(--wp--preset--color--ink);
	color: var(--wp--preset--color--ink);
	width: 46px;
	height: 46px;
	border-radius: 50%;
	font: inherit;
	line-height: 1;
	cursor: pointer;
}
.pl-slider__count {
	font-size: var(--wp--preset--font-size--small);
	min-width: 56px;
}
.pl-testimonials__label {
	letter-spacing: 0.08em;
	margin-bottom: 34px;
}

/* ---------- Representative experience cards ---------- */
.pl-case {
	border-top: 1px solid rgba(255, 255, 255, 0.35);
	padding-top: 22px;
}
@media (max-width: 820px) {
	.pl-cases.is-layout-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------- Rules between stacked services ---------- */
.wp-block-separator {
	color: var(--wp--preset--color--line);
	border-width: 1px 0 0;
	opacity: 1;
	max-width: none;
}
.pl-stack-item h3 {
	margin: 0 0 8px;
}

/* ---------- FAQ accordion ---------- */
.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.wp-block-details:first-of-type {
	border-top: 1px solid var(--wp--preset--color--line);
}
.wp-block-details summary {
	cursor: pointer;
	list-style: none;
	position: relative;
	padding: 24px 56px 24px 0;
	font-size: var(--wp--preset--font-size--h-3);
	color: var(--wp--preset--color--ink);
}
.wp-block-details summary::-webkit-details-marker {
	display: none;
}
.wp-block-details summary::after {
	content: "+";
	position: absolute;
	right: 6px;
	top: 18px;
	font-size: var(--wp--preset--font-size--h-2);
	line-height: 1;
}
.wp-block-details[open] summary::after {
	content: "\2013";
}
.wp-block-details > :not(summary) {
	padding-bottom: 26px;
	margin: 0;
}

/* ---------- Contact form ---------- */
.pl-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	width: 100%;
	max-width: 720px;
}
.pl-form .pl-form__full {
	grid-column: 1 / -1;
}
.pl-form label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: var(--wp--preset--font-size--small);
}
.pl-form input[type="text"],
.pl-form input[type="email"],
.pl-form textarea {
	font: inherit;
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.4;
	padding: 14px 16px;
	border: 1px solid #7b8494;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	border-radius: 0;
	width: 100%;
}
.pl-form input,
.pl-form textarea {
	box-sizing: border-box;
	max-width: 100%;
}
.pl-form textarea {
	min-height: 150px;
	resize: vertical;
}
.pl-form__trap {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.pl-form__submit {
	font: inherit;
	font-size: var(--wp--preset--font-size--body);
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.04em;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
	border: 0;
	border-radius: 300px;
	padding: 17px 42px;
	cursor: pointer;
	transition: transform 0.2s, background-color 0.2s;
}
.pl-form__submit:hover {
	background: var(--wp--preset--color--navy-deep);
	transform: translateY(-1px);
}
.pl-form-note {
	font-size: var(--wp--preset--font-size--small);
	padding: 14px 16px;
	border-left: 3px solid var(--wp--preset--color--navy);
	background: var(--wp--preset--color--light);
	margin: 0 0 16px;
}
.pl-form-note--error {
	border-left-color: #9b1c1c;
}
@media (max-width: 620px) {
	.pl-form {
		grid-template-columns: 1fr;
	}
}

/* ---------- Footer ---------- */
.pl-footer .pl-footer__social a {
	text-decoration: underline;
	text-underline-offset: 5px;
	text-decoration-thickness: 1px;
}
.pl-footer .pl-footer__social a + a {
	margin-left: 26px;
}
.pl-footer .pl-footer__social a:hover {
	text-decoration-color: var(--wp--preset--color--gold);
}
.pl-footer .pl-footer__copy {
	margin-block-start: 32px;
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}

/* Small flag next to "since 2017" */
.pl-since__flag img {
	width: 40px;
	height: auto;
}
