/*
Theme Name: Formula Plus
Theme URI: https://formulaplusllc.com/
Author: Formula Plus LLC
Description: Block theme for Formula Plus LLC, an automotive, industrial and architectural paint supplier in Elizabeth, NJ. Built for the WordPress Site Editor, no page builder required.
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: formulaplus
*/

/* ---------- Base ---------- */
body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3,
.fp-footer-mark,
.wp-block-site-title {
	font-stretch: var(--wp--custom--stretch--display, 125%);
}

:where(a, button, input, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--red);
	outline-offset: 3px;
	border-radius: 2px;
}

.fp-measure { max-width: 62ch; }

/* Outline button */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	border: 2px solid var(--wp--preset--color--graphite);
	color: var(--wp--preset--color--graphite);
	padding-top: calc(0.85rem - 2px);
	padding-bottom: calc(0.85rem - 2px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--graphite);
	color: var(--wp--preset--color--white);
}

/* Sections sit flush against each other; each one sets its own padding. */
.wp-site-blocks > *,
main.wp-block-group > * {
	margin-block-start: 0;
}

/* ---------- Header ---------- */
.fp-site-header {
	position: sticky;
	top: 0;
	z-index: 50;
}
.admin-bar .fp-site-header { top: var(--wp-admin--admin-bar--height, 32px); }

.fp-brand:has(.wp-block-site-logo img) .wp-block-site-title { display: none; }
.fp-brand .wp-block-site-title a { text-decoration: none; color: var(--wp--preset--color--graphite); }
.fp-brand .wp-block-site-logo img { height: auto; max-height: 56px; width: auto; }

.fp-header .wp-block-navigation a { text-decoration: none; }
.fp-header .wp-block-navigation a:hover { color: var(--wp--preset--color--red); }

@media (max-width: 781px) {
	.fp-header .fp-header-cta { display: none; }
}

/* ---------- Hero ---------- */
.fp-display {
	font-size: var(--wp--preset--font-size--huge);
	font-weight: 850;
	line-height: 0.95;
	letter-spacing: -0.02em;
	max-width: 11ch;
	text-wrap: balance;
}

/* Paint chip fan deck */
.fp-deck {
	position: relative;
	height: clamp(20rem, 36vw, 28rem);
	max-width: 30rem;
	margin-inline: auto;
}
.fp-deck .fp-chip {
	--r: 0deg;
	position: absolute;
	left: calc(50% - 2.9rem);
	bottom: 0;
	width: 5.8rem;
	height: 92%;
	margin: 0;
	padding: 1rem 0.7rem;
	border-radius: 6px;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 10px 24px -14px rgba(30, 35, 39, 0.55);
	transform-origin: 50% 90%;
	transform: rotate(var(--r));
	animation: fp-fan 900ms cubic-bezier(.2, .8, .2, 1) 150ms both;
}
.fp-deck .fp-chip p {
	margin: 0;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	font-size: 0.8125rem;
	font-weight: 600;
	font-stretch: var(--wp--custom--stretch--label, 82%);
	white-space: nowrap;
	position: absolute;
	left: 0.55rem;
	top: 1rem;
}
.fp-deck .fp-chip:nth-child(1) { --r: -36deg; }
.fp-deck .fp-chip:nth-child(2) { --r: -24deg; }
.fp-deck .fp-chip:nth-child(3) { --r: -12deg; }
.fp-deck .fp-chip:nth-child(4) { --r: 0deg; }
.fp-deck .fp-chip:nth-child(5) { --r: 12deg; }
.fp-deck .fp-chip:nth-child(6) { --r: 24deg; }
.fp-deck .fp-chip:nth-child(7) { --r: 36deg; }
/* The rivet that holds the deck together */
.fp-deck::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: calc(8% * 0.92 + 0.2rem);
	width: 1.1rem;
	height: 1.1rem;
	margin-left: -0.55rem;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #fff, #9aa1a7 70%);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
	z-index: 10;
}

@keyframes fp-fan {
	from { transform: rotate(0deg); }
	to { transform: rotate(var(--r)); }
}
@media (prefers-reduced-motion: reduce) {
	.fp-deck .fp-chip { animation: none; }
}
@media (max-width: 781px) {
	.fp-deck { height: 18rem; margin-top: 1rem; }
	.fp-deck .fp-chip { width: 4.4rem; left: calc(50% - 2.2rem); }
}

/* ---------- Color matching steps ---------- */
.fp-step {
	border-top: 3px solid var(--wp--preset--color--graphite);
	padding-top: 1.25rem;
}
.fp-step-num {
	font-size: 3.5rem;
	font-weight: 850;
	font-stretch: 125%;
	line-height: 1;
	color: var(--wp--preset--color--red);
	margin: 0 0 0.75rem;
}
.fp-step h3 { margin-top: 0; }

/* ---------- Markets ---------- */
@media (min-width: 782px) {
	.fp-sticky { align-self: flex-start; position: sticky; top: 7rem; }
}
.fp-market-row {
	border-top: 1px solid var(--wp--preset--color--line);
	padding-block: 1.5rem;
	align-items: baseline;
	margin-block-start: 0 !important;
}
.fp-market-row:last-child { border-bottom: 1px solid var(--wp--preset--color--line); }
.fp-market-row h3,
.fp-market-row p { margin: 0; }

/* ---------- Brands ---------- */
.fp-brands h2 { margin: 0; }
.fp-logo-grid { gap: 0 !important; border-top: 1px solid #3A4147; border-left: 1px solid #3A4147; }
.fp-logo-grid .fp-logo {
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem 1.25rem;
	min-height: 6.5rem;
	border-right: 1px solid #3A4147;
	border-bottom: 1px solid #3A4147;
}
.fp-logo-grid .fp-logo img {
	max-height: 44px;
	max-width: 100%;
	width: auto;
	object-fit: contain;
	opacity: 0.9;
}
.fp-brands a { color: var(--wp--preset--color--white); }

/* ---------- Photos ---------- */
.fp-photo img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--wp--custom--radius);
}
.fp-photo-grid .fp-photo { margin: 0; }
.fp-photo-grid .fp-photo img { aspect-ratio: 4 / 5; }
@media (max-width: 781px) {
	.fp-photo-grid { grid-template-columns: 1fr !important; }
	.fp-photo-grid .fp-photo img { aspect-ratio: 4 / 3; }
}

/* ---------- Visit / contact ---------- */
.fp-contact-list p {
	display: grid;
	grid-template-columns: 4.5rem 1fr;
	gap: 1rem;
	margin: 0;
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.fp-contact-list p:first-child { border-top: 1px solid var(--wp--preset--color--line); }
.fp-contact-list span {
	color: var(--wp--preset--color--steel);
	font-size: var(--wp--preset--font-size--small);
	padding-top: 0.15em;
}
.fp-contact-list a { font-weight: 600; color: var(--wp--preset--color--graphite); }
.fp-map iframe {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 22rem;
	border: 0;
	border-radius: var(--wp--custom--radius);
	filter: grayscale(0.35);
}

/* ---------- Page heads ---------- */
.fp-page-head .fp-display { max-width: 14ch; }
/* Keep narrow intro blocks on the left edge of the wide column instead of centered. */
.fp-page-head > :is(.fp-display, .fp-measure, .fp-filter, .wp-block-html) {
	margin-left: max(0px, calc((100% - 1240px) / 2)) !important;
	margin-right: auto !important;
}

/* ---------- Products directory ---------- */
.fp-filter { margin-top: 2rem; max-width: 36rem; }
.fp-filter label {
	display: block;
	font-weight: 700;
	margin-bottom: 0.5rem;
}
.fp-filter input {
	width: 100%;
	box-sizing: border-box;
	font: inherit;
	font-size: 1.125rem;
	padding: 0.9rem 1rem;
	border: 2px solid var(--wp--preset--color--graphite);
	border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--graphite);
}
.fp-filter-status {
	margin: 0.5rem 0 0;
	min-height: 1.5em;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--steel);
}
.fp-dept { margin-top: var(--wp--preset--spacing--50); }
.fp-dept > h2 {
	border-bottom: 3px solid var(--wp--preset--color--graphite);
	padding-bottom: 0.5rem;
	margin-bottom: 1.25rem;
}
.fp-cat-grid { gap: 0.75rem !important; align-items: start; }
.fp-cat {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
	margin: 0;
}
.fp-cat summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.9rem 1rem;
	font-weight: 700;
	line-height: 1.3;
}
.fp-cat summary::-webkit-details-marker { display: none; }
.fp-cat summary::after {
	content: "+";
	font-weight: 400;
	font-size: 1.25rem;
	line-height: 1;
	color: var(--wp--preset--color--steel);
}
.fp-cat[open] summary::after { content: "–"; }
.fp-cat[open] { border-color: var(--wp--preset--color--graphite); }
.fp-count {
	margin-left: auto;
	color: var(--wp--preset--color--steel);
	font-weight: 500;
	font-size: var(--wp--preset--font-size--small);
}
.fp-brand-list {
	margin: 0;
	padding: 0 1rem 1rem;
	color: var(--wp--preset--color--steel);
	font-size: 0.9375rem;
}
.fp-brand-list mark {
	background: #F6E3A1;
	color: inherit;
	padding: 0 0.1em;
}

/* ---------- Spectrum TDS ---------- */
.fp-tds {
	padding: 1.25rem;
	border-radius: var(--wp--custom--radius);
	border: 1px solid var(--wp--preset--color--line);
}
.fp-tds figure { margin: 0 0 1rem; }
.fp-tds img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.fp-tds h3 { margin: 0 0 0.25rem; }
.fp-tds p { margin: 0; }

/* ---------- Footer ---------- */
.fp-plain-list { list-style: none; padding: 0; margin: 0; }
.fp-plain-list li { padding: 0.2rem 0; }
.fp-footer a { text-decoration-color: rgba(255, 255, 255, 0.4); }
.fp-footer a:hover { text-decoration-color: currentColor; }

/* Mobile call bar */
.fp-callbar { display: none; }
@media (max-width: 781px) {
	.fp-callbar {
		display: grid;
		grid-template-columns: 1fr 2fr;
		position: fixed;
		inset: auto 0 0 0;
		z-index: 60;
		box-shadow: 0 -6px 20px -10px rgba(0, 0, 0, 0.45);
	}
	.fp-callbar a {
		padding: 1rem;
		text-align: center;
		font-weight: 700;
		text-decoration: none;
		color: var(--wp--preset--color--white);
		background: var(--wp--preset--color--graphite);
	}
	.fp-callbar a + a { background: var(--wp--preset--color--red); }
	body { padding-bottom: 3.5rem; }
}
