/*
Theme Name: Adam Vending
Author: Adam Vending
Description: Black-and-gold block theme for Adam Vending, locally owned vending in Roseville, Rocklin and Placer County. Two pages: a Home page built around the Request a Machine form, and a Service Area page with a Google map of Placer County. Includes brand fonts, colors and reusable patterns.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.3.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: adam-vending
Tags: block-patterns, full-site-editing, one-column, custom-colors, editor-style, wide-blocks
*/

/* ---------- Brand block styles ---------- */

/* Paragraph › "Location line": white letterspaced caps with a white rule each side */
.is-style-av-location {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.25rem;
	max-width: min(var(--wp--style--global--wide-size, 1240px), 100%) !important;
	margin-inline: auto;
	font-family: var(--wp--preset--font-family--oswald);
	font-weight: 500;
	font-size: clamp(0.9rem, 0.7rem + 0.8vw, 1.35rem);
	line-height: 1.3;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	text-align: center;
	color: var(--wp--preset--color--white);
}

.is-style-av-location::before,
.is-style-av-location::after {
	content: "";
	flex: 0 0 clamp(1.5rem, 6vw, 6.5rem);
	height: 2px;
	background: currentColor;
}

/* letter-spacing leaves a trailing gap after the last letter; even it out */
.is-style-av-location::before {
	margin-right: 0.3em;
}

.is-style-av-location.av-location-xl {
	font-size: clamp(1rem, 0.6rem + 1.6vw, 2.1rem);
}

.is-style-av-location.av-location-start {
	justify-content: flex-start;
	text-align: left;
	margin-inline: 0;
	font-size: 0.85rem;
}

.is-style-av-location.av-location-start::before {
	display: none;
}

@media (max-width: 600px) {
	.is-style-av-location,
	.is-style-av-location.av-location-xl,
	.is-style-av-location.av-location-start {
		font-size: 0.8rem;
		letter-spacing: 0.16em;
		gap: 0.6rem;
	}

	.is-style-av-location::before,
	.is-style-av-location::after {
		flex-basis: 1rem;
	}

	.is-style-av-location::before {
		margin-right: 0.16em;
	}
}

@media (max-width: 480px) {
	.is-style-av-location,
	.is-style-av-location.av-location-xl,
	.is-style-av-location.av-location-start {
		font-size: 0.75rem;
		letter-spacing: 0.14em;
		gap: 0.5rem;
	}

	.is-style-av-location::before,
	.is-style-av-location::after {
		flex-basis: 0.75rem;
	}

	.is-style-av-location::before {
		margin-right: 0.14em;
	}
}

/* Group › "White frame": the single white border from the social headers */
.is-style-av-frame {
	border: 3px solid var(--wp--preset--color--white);
}

/* ---------- Shared bits ---------- */

.av-eyebrow {
	font-family: var(--wp--preset--font-family--oswald);
	font-weight: 500;
	font-size: 0.875rem;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold);
}

.av-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
	color: var(--wp--preset--color--mist);
}

.av-section {
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--60);
}

.av-section--panel {
	background: var(--wp--preset--color--panel);
	border-top: 1px solid var(--wp--preset--color--line);
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.av-section-title {
	margin-top: 0.5rem;
}

.av-card {
	background: var(--wp--preset--color--panel);
	border: 1px solid var(--wp--preset--color--line);
	padding: clamp(1.5rem, 3vw, 2.25rem);
}

.av-section--panel .av-card {
	background: var(--wp--preset--color--ink);
}

.av-card > :first-child {
	margin-top: 0;
}

.av-card p {
	color: var(--wp--preset--color--mist);
}

.av-cards,
.av-steps {
	margin-top: var(--wp--preset--spacing--50);
	gap: 1.5rem;
}

.av-step-number {
	font-family: var(--wp--preset--font-family--oswald);
	font-weight: 500;
	font-size: 2.75rem;
	line-height: 1;
	color: var(--wp--preset--color--gold);
	margin-bottom: 0.75rem;
}

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

.av-header {
	padding-top: 1.1rem;
	padding-bottom: 1.1rem;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.av-header-inner {
	gap: 1rem 2rem;
}

.av-header-logo {
	margin: 0;
}

.av-header-logo img {
	display: block;
	width: clamp(150px, 18vw, 200px);
	height: auto;
	aspect-ratio: 480 / 116;
}

.av-header-actions {
	gap: 1.75rem;
}

.av-header-button .wp-block-button__link {
	padding: 0.7rem 1.2rem;
	font-size: 0.9rem;
}

.av-nav a {
	text-decoration: none;
}

.av-nav a:hover,
.av-nav a:focus {
	color: var(--wp--preset--color--gold);
}

/* The header button moves into the mobile menu on small screens */
@media (min-width: 600px) {
	.av-nav .av-nav-request {
		display: none;
	}
}

@media (max-width: 599px) {
	.wp-block-buttons.av-header-button {
		display: none;
	}
}

/* ---------- Home intro ---------- */

/* The home page shows the large logo, so the small header logo steps aside there */
.av-is-home .av-header-logo {
	visibility: hidden;
}

.av-home-intro {
	padding-top: var(--wp--preset--spacing--50);
}

.av-home-logo {
	width: min(720px, 100%);
	margin: 0 auto !important;
}

.av-home-logo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1600 / 386;
}

.av-home-intro .is-style-av-location {
	margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.av-home-intro h1 {
	margin-top: clamp(2rem, 4vw, 3rem);
}

.av-request {
	padding-top: 0;
}

/* ---------- Service area ---------- */

.av-map {
	padding: 0;
	line-height: 0;
}

.av-map .av-map-image {
	margin: 0;
}

.av-map .av-map-image a {
	display: block;
	cursor: zoom-in;
}

.av-map .av-map-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
}

.av-cities {
	margin-top: 1.5rem;
	gap: 1.5rem;
}

.av-city .av-eyebrow {
	margin-bottom: 0.5rem;
}

.av-city-name {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0;
}

.av-city-name::before {
	content: "";
	flex: none;
	width: 0.75em;
	height: 1em;
	background: var(--wp--preset--color--gold);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 0C5.4 0 0 5.3 0 11.9 0 20.8 12 32 12 32s12-11.2 12-20.1C24 5.3 18.6 0 12 0zm0 17a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 0C5.4 0 0 5.3 0 11.9 0 20.8 12 32 12 32s12-11.2 12-20.1C24 5.3 18.6 0 12 0zm0 17a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.av-city p:last-child {
	margin-bottom: 0;
}

.av-cta {
	padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
	text-align: center;
}

/* ---------- Contact details ---------- */

.av-card > p + p {
	margin-block-start: 0.5rem;
}

.av-card .av-contact-name,
.av-footer .av-contact-name {
	font-family: var(--wp--preset--font-family--oswald);
	font-weight: 500;
	font-size: 1.15rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--white);
}

.av-card .av-contact-role {
	margin-block-start: 0.1rem;
	margin-bottom: 0.9rem;
	font-size: var(--wp--preset--font-size--small);
}

.av-call-button {
	margin-top: 1.25rem;
}

.av-call-button .wp-block-button__link {
	padding: 0.75rem 1.25rem;
	font-size: 0.9rem;
}

.av-card .av-city-list {
	font-family: var(--wp--preset--font-family--oswald);
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--white);
}

/* ---------- Inner page hero ---------- */

.av-page-hero {
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--40);
	text-align: center;
}

.av-page-hero h1 {
	margin-top: 1.25rem;
}

.av-page {
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--60);
}

/* ---------- Request form layout ---------- */

.av-request-columns {
	gap: 1.5rem;
}

.av-request-side {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.av-request-side > * {
	margin: 0;
}

.av-steps-list {
	padding-left: 1.25rem;
	color: var(--wp--preset--color--mist);
}

.av-steps-list li + li {
	margin-top: 0.6rem;
}

.av-steps-list li::marker {
	font-family: var(--wp--preset--font-family--oswald);
	color: var(--wp--preset--color--gold);
}

/* ---------- Request form ---------- */

.av-form {
	display: grid;
	gap: 1.25rem;
	color-scheme: dark;
}

.av-form p {
	margin: 0;
}

.av-form__row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.25rem;
}

@media (max-width: 640px) {
	.av-form__row {
		grid-template-columns: minmax(0, 1fr);
	}
}

.av-field label,
.av-field legend {
	display: block;
	margin-bottom: 0.5rem;
	font-family: var(--wp--preset--font-family--oswald);
	font-weight: 500;
	font-size: 0.85rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--white);
}

.av-required {
	color: var(--wp--preset--color--gold);
}

.av-field input,
.av-field select,
.av-field textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	padding: 0.8rem 1rem;
	font: inherit;
	font-size: 1rem;
	color: var(--wp--preset--color--white);
	background: var(--wp--preset--color--ink);
	border: 1px solid #4A505B;
	border-radius: 0;
}

.av-field textarea {
	min-height: 140px;
	resize: vertical;
}

.av-field input::placeholder,
.av-field textarea::placeholder {
	color: #8A8F99;
}

.av-field input:focus,
.av-field select:focus,
.av-field textarea:focus,
.av-choice input:focus-visible {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 2px;
	border-color: var(--wp--preset--color--gold);
}

.av-choices {
	margin: 0;
	padding: 0;
	border: 0;
}

.av-choices legend {
	padding: 0;
}

.av-field .av-choice {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	min-height: 44px;
	margin: 0 1.5rem 0 0;
	font-family: inherit;
	font-weight: 400;
	font-size: 1rem;
	letter-spacing: normal;
	text-transform: none;
	color: var(--wp--preset--color--white);
	cursor: pointer;
}

.av-choice input {
	width: 1.15rem;
	height: 1.15rem;
	margin: 0;
	accent-color: var(--wp--preset--color--gold);
}

.av-form__actions {
	margin-top: 0.5rem;
}

.av-form__submit {
	cursor: pointer;
	width: 100%;
}

.av-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.av-form-notice {
	margin-bottom: 1.5rem;
	padding: 1rem 1.25rem;
	border: 2px solid var(--wp--preset--color--gold);
}

.av-form-notice p {
	margin: 0;
	color: var(--wp--preset--color--white);
}

.av-form-notice--error {
	border-color: #FF8C82;
}

/* ---------- Footer ---------- */

.av-footer {
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--line);
}

.av-footer-top {
	gap: 2.5rem 3rem;
}

.av-footer-logo {
	margin: 0;
}

.av-footer-logo img {
	display: block;
	width: 220px;
	height: auto;
	aspect-ratio: 480 / 116;
}

.av-footer .av-footer-contact,
.av-footer .av-footer-links {
	gap: 0.5rem;
}

/* Headshot sits just left of the "Get in touch" details */
.av-footer .av-footer-person {
	gap: 1.5rem;
	align-items: flex-start;
}

.av-footer-photo {
	flex: none;
	margin: 0;
}

.av-footer-photo img {
	display: block;
	width: 132px;
	height: 132px;
	aspect-ratio: 1;
	object-fit: cover;
	border: 3px solid var(--wp--preset--color--white);
	border-radius: 50%;
}

@media (max-width: 600px) {
	.av-footer-photo img {
		width: 96px;
		height: 96px;
	}
}

.av-footer-contact p,
.av-footer-links p {
	margin: 0;
	color: var(--wp--preset--color--mist);
}

.av-footer-contact .av-eyebrow,
.av-footer-links .av-eyebrow {
	margin-bottom: 0.4rem;
}

.av-footer .av-footer-legal {
	max-width: var(--wp--style--global--wide-size, 1240px) !important;
}

.av-footer-legal {
	margin-top: var(--wp--preset--spacing--50);
	padding-top: 1.5rem;
	border-top: 1px solid var(--wp--preset--color--line);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--mist);
}

/* ---------- Accessibility ---------- */

:where(a, button, input, select, textarea, .wp-element-button):focus-visible {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 3px;
}

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

html {
	scroll-behavior: smooth;
}
