/*
Theme Name: Atlas
Theme URI: https://atlasmarketingsolutions.com
Author: Atlas Marketing Solutions
Description: Agency parent block theme for local business sites. Client branding lives in a child theme (colors, fonts, custom sections); this theme provides layout, templates and the local-SEO section library.
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.1
Version: 0.1.1
License: Proprietary
Text Domain: atlas
*/

/* ---------------------------------------------------------------
   Everything that can live in theme.json does. This file holds
   only what theme.json can't express: section styles, cards,
   header/footer layout, the mobile call bar and small polish.
   --------------------------------------------------------------- */

:root {
	--atlas-radius: var(--wp--custom--radius--medium, 10px);
	--atlas-radius-small: var(--wp--custom--radius--small, 6px);
	--atlas-shadow: var(--wp--preset--shadow--card, 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .06));
	--atlas-callbar-height: 64px;
}

/* ---------- Page frame ---------- */

/* Header, main and footer sit flush; sections bring their own spacing. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* ---------- Type polish ---------- */

h1, h2, h3, h4 {
	text-wrap: balance;
}

p, li {
	text-wrap: pretty;
}

/* ---------- Section styles (Group / Columns / Cover) ---------- */

.is-style-section-alt {
	background-color: var(--wp--preset--color--base-2);
	color: var(--wp--preset--color--contrast);
}

.is-style-section-primary {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary-contrast);
}

.is-style-section-dark {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Headings, links and the site title follow the section's text color.
   These need real specificity to beat the global heading/link colors. */
.is-style-section-primary :is(h1, h2, h3, h4, h5, h6),
.is-style-section-dark :is(h1, h2, h3, h4, h5, h6),
.is-style-section-primary a:where(:not(.wp-element-button)),
.is-style-section-dark a:where(:not(.wp-element-button)),
.is-style-section-primary .wp-block-site-title a,
.is-style-section-dark .wp-block-site-title a {
	color: inherit;
}

:where(.is-style-section-primary, .is-style-section-dark) .has-contrast-2-color {
	color: inherit !important;
	opacity: .82;
}

/* Brand-color text (e.g. eyebrows) would vanish on a brand-color ground. */
:where(.is-style-section-primary, .is-style-section-dark) .has-primary-color {
	color: var(--wp--preset--color--accent) !important;
}

/* Primary buttons sit on the accent color inside colored sections
   so they never disappear into the background. */
:where(.is-style-section-primary, .is-style-section-dark) .wp-block-button:not(.is-style-outline) .wp-block-button__link {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent-contrast);
}

:where(.is-style-section-primary, .is-style-section-dark) .wp-block-button.is-style-outline .wp-block-button__link {
	border-color: currentColor;
	color: inherit;
}

/* ---------- Eyebrow label ---------- */

.atlas-eyebrow {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

/* ---------- Card ---------- */

.is-style-card {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--atlas-radius);
	box-shadow: var(--atlas-shadow);
}

.is-style-card > :last-child {
	margin-block-end: 0;
}

/* Cards in a grid share their height and keep any button at the bottom. */
.is-layout-grid > .is-style-card {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.is-layout-grid > .is-style-card > .wp-block-buttons:last-child,
.is-layout-grid > .is-style-card > p:last-child:has(> a:only-child) {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--20);
}

/* ---------- Lists ---------- */

.is-style-checklist {
	list-style: none;
	padding-left: 0;
}

.is-style-checklist li {
	position: relative;
	padding-left: 1.75em;
}

.is-style-checklist li + li {
	margin-top: .45em;
}

.is-style-checklist li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .3em;
	width: 1.1em;
	height: 1.1em;
	border-radius: 50%;
	background-color: var(--wp--preset--color--accent);
}

.is-style-checklist li::after {
	content: "";
	position: absolute;
	left: .38em;
	top: .52em;
	width: .32em;
	height: .58em;
	border: solid var(--wp--preset--color--accent-contrast);
	border-width: 0 .14em .14em 0;
	transform: rotate(45deg);
}

.is-style-inline-list {
	list-style: none;
	padding-left: 0;
	display: flex;
	flex-wrap: wrap;
	gap: .5em 1.5em;
}

/* ---------- Reviews ---------- */

.wp-block-quote.is-style-review {
	margin: 0;
	padding: var(--wp--preset--spacing--40);
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--atlas-radius);
	box-shadow: var(--atlas-shadow);
	display: flex;
	flex-direction: column;
	height: 100%;
	box-sizing: border-box;
}

.wp-block-quote.is-style-review::before {
	content: "★★★★★";
	color: var(--wp--preset--color--accent);
	letter-spacing: .12em;
	font-size: 1.05rem;
	margin-bottom: var(--wp--preset--spacing--20);
}

.wp-block-quote.is-style-review p {
	font-size: var(--wp--preset--font-size--base);
	font-style: normal;
}

.wp-block-quote.is-style-review cite {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--20);
	font-style: normal;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast-2);
}

/* ---------- FAQ (Details block) ---------- */

.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding-block: var(--wp--preset--spacing--30);
}

.wp-block-details:first-of-type {
	border-top: 1px solid var(--wp--preset--color--border);
}

.wp-block-details summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--medium);
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	content: "+";
	flex: none;
	font-weight: 400;
	font-size: 1.4em;
	line-height: 1;
	color: var(--wp--preset--color--primary);
	transition: transform .2s ease;
}

.wp-block-details[open] summary::after {
	transform: rotate(45deg);
}

.wp-block-details > :not(summary) {
	margin-top: var(--wp--preset--spacing--20);
}

/* ---------- Stats (trust bar) ---------- */

.atlas-stat {
	text-align: center;
}

.atlas-stat .atlas-stat__value {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	line-height: 1.1;
	margin: 0;
}

.atlas-stat .atlas-stat__label {
	margin-top: .35em;
	font-size: var(--wp--preset--font-size--small);
}

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

.atlas-topbar {
	font-size: var(--wp--preset--font-size--small);
}

.atlas-topbar a {
	text-decoration: none;
	font-weight: 600;
}

.atlas-header-main .wp-block-site-title a {
	text-decoration: none;
}

.atlas-header-main .wp-block-navigation {
	font-weight: 500;
}

@media (max-width: 781px) {
	.atlas-topbar .atlas-topbar__areas,
	.atlas-header-main .atlas-header__cta {
		display: none;
	}
}

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

.atlas-footer a {
	text-decoration: none;
}

.atlas-footer a:hover,
.atlas-footer a:focus-visible {
	text-decoration: underline;
}

.atlas-footer .atlas-business-links,
.atlas-footer .atlas-business-hours {
	font-size: var(--wp--preset--font-size--small);
}

/* ---------- Mobile call bar ---------- */

.atlas-callbar {
	display: none;
}

@media (max-width: 781px) {
	.atlas-callbar {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 50;
		gap: 0;
		margin: 0 !important;
		padding: 0 0 env(safe-area-inset-bottom, 0) !important;
		background-color: var(--wp--preset--color--contrast);
		box-shadow: 0 -4px 16px rgba(0, 0, 0, .18);
	}

	.atlas-callbar .wp-block-button {
		flex: 1 1 50%;
		width: auto;
	}

	.atlas-callbar .atlas-callbar__quote .wp-block-button__link {
		background-color: var(--wp--preset--color--accent);
		color: var(--wp--preset--color--accent-contrast);
	}

	.atlas-callbar .wp-block-button__link {
		width: 100%;
		min-height: var(--atlas-callbar-height);
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 0;
		box-sizing: border-box;
	}

	body {
		padding-bottom: calc(var(--atlas-callbar-height) + env(safe-area-inset-bottom, 0px));
	}
}

/* ---------- Placeholder media ---------- */

.atlas-placeholder img {
	background-color: var(--wp--preset--color--base-2);
	border-radius: var(--atlas-radius);
}

/* ---------- Accessibility & polish ---------- */

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

.wp-element-button {
	transition: filter .15s ease, transform .15s ease;
}

.wp-element-button:hover {
	filter: brightness(1.08);
}

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