/*
Theme Name: FenceWorks
Theme URI: https://www.fenceworksofga.com/
Author: FenceWorks of Georgia
Author URI: https://www.fenceworksofga.com/
Description: Block theme for FenceWorks of Georgia. Warm, premium, photo-led home-services design — deep greens, warm sand, amber conversion CTAs, Playfair Display over Inter. Mobile-first.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fenceworks
Tags: full-site-editing, block-patterns, custom-colors, custom-logo, business, one-column
*/

/* Design tokens live in theme.json. This file carries only what theme.json
   cannot express. Keep it small — if a rule belongs in theme.json, put it there. */

/* -----------------------------------------------------------------------------
   Metrics-matched fallback for Inter.

   Without this, the swap from the fallback face to Inter resizes text and
   reflows whatever sits below it — measured at CLS ~0.10 on the static site's
   hero, which is a Core Web Vitals failure. These overrides size Arial to
   occupy exactly Inter's box, so the swap is visually invisible and shifts
   nothing. Values derived from inter-400-latin.woff2 measured against Arial.
   Preloading the font alone does NOT fix this.
   -------------------------------------------------------------------------- */
@font-face {
	font-family: 'Inter Fallback';
	src: local('Arial'), local('Liberation Sans'), local('Helvetica');
	size-adjust: 107.47%;
	ascent-override: 90.14%;
	descent-override: 22.45%;
	line-gap-override: 0%;
}

/* -----------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Sentence case is a brand rule — WordPress core and many blocks default to
   uppercase treatments in places. Neutralize them. */
.wp-block-post-terms,
.wp-block-query-title,
.wp-block-tag-cloud a {
	text-transform: none;
	letter-spacing: normal;
}

/* Keyboard focus must stay clearly visible against both light and dark bands. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--amber);
	outline-offset: 2px;
	border-radius: 3px;
}

/* Media never overflows its column. */
img, svg, video, canvas {
	max-width: 100%;
	height: auto;
}

/* -----------------------------------------------------------------------------
   Skip link — WordPress injects this; core's default styling is unbranded.
   -------------------------------------------------------------------------- */
.skip-link.screen-reader-text {
	background: var(--wp--preset--color--amber);
	color: #fff;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.875rem;
	font-weight: 500;
	padding: 12px 22px;
	border-radius: 0 0 8px 0;
	text-decoration: none;
}

/* -----------------------------------------------------------------------------
   Buttons — theme.json styles the fill; these are the variants it can't reach.
   -------------------------------------------------------------------------- */

/* Outline buttons need to invert on dark bands, which theme.json has no
   selector for. */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border-width: 1.5px;
	box-shadow: none;
}

.has-green-deep-background-color .wp-block-button.is-style-outline > .wp-block-button__link,
.has-ink-background-color .wp-block-button.is-style-outline > .wp-block-button__link {
	color: #fff;
	border-color: var(--wp--custom--hairline-light);
}

.has-green-deep-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover,
.has-ink-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background-color: rgba(255, 255, 255, 0.10);
	border-color: rgba(255, 255, 255, 0.42);
}

/* The amber CTA is the loudest element in any viewport — brand rule. Give it a
   real hover lift so it reads as the primary action. */
.wp-block-button:not(.is-style-outline) > .wp-block-button__link {
	transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover {
	transform: translateY(-1px);
	box-shadow: var(--wp--preset--shadow--md);
}

/* -----------------------------------------------------------------------------
   Dark bands — invert text colors for any band using a dark brand background.
   -------------------------------------------------------------------------- */
.has-green-deep-background-color,
.has-ink-background-color,
.has-green-background-color {
	color: var(--wp--preset--color--text-light);
}

.has-green-deep-background-color :where(h1, h2, h3, h4, h5, h6),
.has-ink-background-color :where(h1, h2, h3, h4, h5, h6),
.has-green-background-color :where(h1, h2, h3, h4, h5, h6) {
	color: #fff;
}

.has-green-deep-background-color :where(a:not(.wp-block-button__link)),
.has-ink-background-color :where(a:not(.wp-block-button__link)),
.has-green-background-color :where(a:not(.wp-block-button__link)) {
	color: #fff;
}

/* -----------------------------------------------------------------------------
   Cards — restrained elevation with a small hover lift (brand: "restrained
   depth, used consistently").
   -------------------------------------------------------------------------- */
.is-style-fw-card {
	background: #fff;
	border: 1px solid var(--wp--custom--hairline);
	border-radius: var(--wp--custom--radius);
	box-shadow: var(--wp--preset--shadow--sm);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.is-style-fw-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--wp--preset--shadow--md);
}

/* Blog pagination — the current page is aria-current-marked but core gives it
   no visual state; a restrained green pill makes "where am I" readable. */
.wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--wp--preset--color--green);
	color: #fff;
	border-radius: 6px;
	padding: 2px 10px;
	font-weight: 600;
}

/* -----------------------------------------------------------------------------
   Brand — the FenceWorks logo lockup (patterns/brand.php), ported verbatim from
   the approved static site. The whole lockup scales from ONE font-size on
   .fwg-logo (all internal units are em): header 1.55px, footer 1.7px.
   "of Georgia" is intentionally smaller than "FenceWorks" (Option C) — don't
   equalize them.
   -------------------------------------------------------------------------- */
.brand {
	text-decoration: none; /* theme.json underlines/greens all links */
}

.fwg-logo {
	display: inline-flex;
	align-items: center;
	gap: 3em;
	color: var(--fwg-ink, #4e4e4e);
	font-family: var(--wp--preset--font-family--logo);
	line-height: 1;
}

.fwg-logo__mark {
	height: 30em;
	width: auto;
	display: block;
	flex: none;
}

.fwg-logo__type {
	width: 82.4em;
	display: flex;
	flex-direction: column;
	gap: 1.4em;
}

.fwg-logo__line {
	text-align: center;
	white-space: nowrap;
	font-weight: 800;
	font-size: 13.9em;
	letter-spacing: 0;
}

.fwg-logo__line--top {
	line-height: 0.92;
}

.fwg-logo__line:not(.fwg-logo__line--top) {
	font-size: 12.6em;
}

.fwg-logo__est {
	display: flex;
	align-items: center;
	gap: 2.2em;
	width: 100%;
	margin-top: 0.2em;
}

.fwg-logo__rule {
	flex: 1;
	height: 0.6em;
	background: var(--fwg-ink, #4e4e4e);
}

.fwg-logo__estlabel {
	font-weight: 800;
	font-size: 5em;
	letter-spacing: 0.4em;
	white-space: nowrap;
}

.brand .fwg-logo {
	font-size: 1.55px;
}

.fw-footer .fwg-logo {
	font-size: 1.7px;
	--fwg-ink: #eef3e9;
	margin-bottom: 12px;
}

/* -----------------------------------------------------------------------------
   Header — sticky, so the phone number and quote CTA stay reachable at all
   times (brand rule: the conversion path is never more than a tap away).
   -------------------------------------------------------------------------- */
.fw-header {
	position: sticky;
	top: 0;
	z-index: 100;
	border-bottom: 1px solid var(--wp--custom--hairline);
	background: linear-gradient(180deg, #efe8d8, #e9e1cf);
}

.fw-header__actions {
	gap: clamp(14px, 2vw, 26px);
}

.fw-header__phone a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	white-space: nowrap;
}

.fw-header__phone a:hover {
	color: var(--wp--preset--color--green);
	text-decoration: underline;
}

.fw-nav a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.fw-nav a:hover {
	color: var(--wp--preset--color--green);
	text-decoration: underline;
}

/* The nav is right-justified, so core's `.items-justified-right … __submenu-
   container { left:auto; right:0 }` opens submenus right-aligned — pushing the
   leftmost dropdowns (Residential/Commercial/Gates) off the left edge and
   clipping their labels. All three parents sit on the left, so open them
   rightward from the parent's left edge instead. Core's selector is 0,5,0; a
   specificity match would hinge on load order, and WP Rocket combines/reorders
   CSS on this site — so !important is the load-order-proof fix. */
.fw-nav .wp-block-navigation__submenu-container {
	left: 0 !important;
	right: auto !important;
}

/* Below the nav's mobile breakpoint the bar gets crowded. The CTA is the one
   thing that must survive, so the phone number folds into the burger menu. */
@media (max-width: 600px) {
	.fw-header__phone { display: none; }
}

/* -----------------------------------------------------------------------------
   Footer link columns — curated lists, not the all-pages wp:page-list. The
   dark-band rule already whitens the anchors; strip the list chrome and give
   the links a quiet hover so the deep-green footer stays calm.
   -------------------------------------------------------------------------- */
.fw-footer__links {
	list-style: none;
	margin: 0;
}

.fw-footer__links li {
	margin: 0;
}

.fw-footer__links a {
	text-decoration: none;
	color: var(--wp--preset--color--text-light);
}

.fw-footer__links a:hover {
	color: #fff;
	text-decoration: underline;
}

/* -----------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.fw-hero .fw-rating-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 7px 15px;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.10);
	color: #fff;
	backdrop-filter: blur(3px);
}

.fw-hero .fw-rating-pill span[aria-hidden] {
	color: var(--wp--preset--color--amber);
	letter-spacing: 1px;
}

/* The cover block centers its inner container. The hero copy reads left. */
.fw-hero .wp-block-cover__inner-container > .fw-hero__copy {
	margin-left: 0;
}

/* -----------------------------------------------------------------------------
   Proof strip — four facts, forced to stay in one row on desktop but allowed
   to break 2x2 on phones rather than squeezing to unreadable widths.

   The block is marked is-not-stacked-on-mobile so core doesn't collapse it to a
   single column. Core enforces that with
       .wp-block-columns.is-not-stacked-on-mobile { flex-wrap: nowrap !important }
   which is two classes — so this override must also carry two classes to win on
   specificity. `.fw-proof__row` alone loses even with !important.
   -------------------------------------------------------------------------- */
@media (max-width: 782px) {
	.wp-block-columns.fw-proof__row {
		flex-wrap: wrap !important;
	}
	.wp-block-columns.fw-proof__row > .wp-block-column {
		flex-basis: calc(50% - var(--wp--preset--spacing--20)) !important;
		flex-grow: 0 !important;
	}
}

/* -----------------------------------------------------------------------------
   Section heading rule — the hairline flourish used above section kickers.
   -------------------------------------------------------------------------- */
.fw-kicker {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	color: var(--wp--preset--color--amber);
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
}

.fw-kicker::before,
.fw-kicker::after {
	content: "";
	height: 1px;
	width: clamp(24px, 8vw, 64px);
	background: currentColor;
	opacity: 0.5;
}

@media (max-width: 600px) {
	.fw-kicker::before,
	.fw-kicker::after { display: none; }
}

/* -----------------------------------------------------------------------------
   Fence-style cards — photo edge-to-edge at the top, copy padded below.
   -------------------------------------------------------------------------- */
.fw-style-card {
	overflow: hidden; /* clip the photo to the card's rounded corners */
	display: flex;
	flex-direction: column;
}

.fw-style-card__img,
.fw-style-card__img img {
	display: block;
	width: 100%;
	margin: 0;
}

.fw-style-card__body {
	flex: 1;
}

.fw-style-card__body h3 a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.fw-style-card:hover .fw-style-card__body h3 a {
	color: var(--wp--preset--color--green);
}

/* WordPress's grid layout emits a fixed column count, which is unusable on a
   phone. Step it down rather than let four columns squeeze. */
@media (max-width: 1099px) {
	.fw-styles__grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

/* Stays two-up on phones, matching the approved static design (its `sizes` attr
   resolves to 50vw below 680px). Dropping to one column here would double the
   scroll depth through eight cards for no gain. */
@media (max-width: 860px) {
	.fw-styles__grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Only the narrowest handsets, where two-up genuinely stops being legible. */
@media (max-width: 359px) {
	.fw-styles__grid { grid-template-columns: 1fr !important; }
}

/* -----------------------------------------------------------------------------
   Reviews — translucent cards on the deep-green band.
   -------------------------------------------------------------------------- */
.fw-review-card {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--wp--custom--hairline-light);
	color: var(--wp--preset--color--text-light);
	display: flex;
	flex-direction: column;
}

.fw-review-card__stars,
.fw-reviews__stars {
	color: var(--wp--preset--color--amber);
}

.fw-review-card__text {
	flex: 1;
}

.fw-review-card__by {
	color: #fff;
}

.fw-review-card__date {
	color: #a8bea3;
	font-weight: 400;
}

@media (max-width: 900px) {
	.fw-reviews__grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 620px) {
	.fw-reviews__grid { grid-template-columns: 1fr !important; }
}

/* -----------------------------------------------------------------------------
   FAQ — native <details> accordions, styled as a hairline-divided list.
   -------------------------------------------------------------------------- */
.fw-faq__item {
	border-bottom: 1px solid var(--wp--custom--hairline);
	padding: 0;
}

.fw-faq__item summary {
	cursor: pointer;
	list-style: none;
	padding: 18px 44px 18px 0;
	position: relative;
	font-weight: 500;
	font-size: 1.0625rem;
	color: var(--wp--preset--color--ink);
}

.fw-faq__item summary::-webkit-details-marker { display: none; }

.fw-faq__item summary:hover { color: var(--wp--preset--color--green); }

/* Chevron, rotated when open. Drawn in CSS so there's no icon asset to ship. */
.fw-faq__item summary::after {
	content: "";
	position: absolute;
	right: 8px;
	top: 50%;
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--wp--preset--color--green);
	border-bottom: 2px solid var(--wp--preset--color--green);
	transform: translateY(-70%) rotate(45deg);
	transition: transform 0.18s ease;
}

.fw-faq__item[open] summary::after {
	transform: translateY(-30%) rotate(-135deg);
}

.fw-faq__item[open] summary { color: var(--wp--preset--color--green); }

.fw-faq__item > p {
	padding: 0 44px 20px 0;
	margin: 0;
}

/* -----------------------------------------------------------------------------
   Financing — icon treatment.
   -------------------------------------------------------------------------- */
.fw-trust-ic {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--wp--preset--color--green-tint);
	color: var(--wp--preset--color--green);
}

/* -----------------------------------------------------------------------------
   Prototype-port shims — WP-generated layout vs the verbatim prototype CSS
   (assets/css/site.css). The prototype renders <main> flush under the sticky
   header; WP's root block-gap adds a margin the static site never had.
   -------------------------------------------------------------------------- */
main.wp-block-group {
	margin-block-start: 0;
}

/* Ported prototype sections are adjacent <section>s with zero margin in the
   static site; WP's root block-gap would wedge 32px between their alignfull
   wrappers. Sections space themselves with their own padding, as designed. */
main.wp-block-group > .wp-block-group.alignfull {
	margin-block: 0;
}

/* Same block-gap, one level up: WP wedges 32px above the root-level
   header/footer template-part wrappers (outside <main>, so the rules
   above can't reach it) — seen as a white bar between the dark final
   CTA and the dark green footer. The prototype butts them together. */
.wp-site-blocks > header.wp-block-template-part,
.wp-site-blocks > footer.wp-block-template-part {
	margin-block-start: 0;
}

/* Same block-gap once more, inside a pattern: the picket .section-divider is a
   direct child of its pattern's flow group (a sibling of the <section>, not a
   group), so WP's child block-gap put 32px above it — a white strip between
   the sand difference band and the sand fence-styles band. */
.wp-block-group > .section-divider {
	margin-block: 0;
}

/* -----------------------------------------------------------------------------
   BBB A+ rating badge (footer seals row) — deliberate post-port addition.
   Austin's supplied artwork (white torch + red A+ Rating stamp, transparent),
   optimized to WebP at assets/img/badge-bbb-aplus-white*.webp. Rating-only
   claim: accreditation is lapsed, so the "Accredited Business" seal wording
   must NOT appear. 48px sits between the 36px Angi and the 56px TrustDALE.
   -------------------------------------------------------------------------- */
.footer-seals .seal-bbb {
	display: block;
	width: auto;
	height: 48px;
}
