/*
 * Projects map (inc/nld-projects-map.php). Loaded only on pages that show a map.
 *
 * Dot colors were run through the dataviz palette validator (all pairs, light surface):
 * windows #1f5fc4, siding #62a516 (the brand green), roofing #c62828, everything else slate.
 * Brand orange beside brand green fails for color-blind visitors, so roofing is red.
 * Sharp corners throughout, per the 2FL design rule; only the data dots are round.
 *
 * Built by NLD.
 */

.fl-projects,
.fl-embed {
	--fl-navy: #132c52;
	--fl-ink: #475468;
	--fl-ink-soft: #6b778a;
	--fl-line: #dde3eb;
	--fl-tint: #f0f4fa;
	--fl-land: #f3f5f9;
	--fl-w: #1f5fc4;
	--fl-s: #62a516;
	--fl-r: #c62828;
	--fl-m: #6b778a;
	--fl-stack: 16px;
	--fl-stack: clamp(16px, 1.8vw, 24px);
	--fl-block: 24px;
	--fl-block: clamp(24px, 3vw, 40px);
}

.fl-projects {
	background: #f7f9fc;
	padding: 40px 16px;
	padding: clamp(40px, 6vw, 88px) 16px;
	color: var(--fl-ink);
	font-family: "aeroportregular", system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.6;
}
.fl-projects *,
.fl-embed * { box-sizing: border-box; }
.fl-projects button,
.fl-embed button { font: inherit; color: inherit; margin: 0; }

.fl-wrap { max-width: 1204px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--fl-block); }

.fl-head { display: flex; flex-direction: column; gap: 12px; max-width: 980px; }
.fl-projects .fl-eyebrow { margin: 0; font-size: 15px; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase; color: var(--fl-ink); display: flex; align-items: center; gap: 12px; }
.fl-projects .fl-eyebrow::before { content: ""; width: 32px; height: 3px; background: linear-gradient(90deg, #89c635, #62a516); flex: none; }
.fl-projects .fl-title { margin: 0; font-family: "Poppins", sans-serif; font-weight: 600; font-size: 30px; font-size: clamp(30px, 4.2vw, 54px); line-height: 1.12; letter-spacing: -.01em; color: var(--fl-navy); text-wrap: balance; }
.fl-projects .fl-lead { margin: 0; font-size: 17px; line-height: 1.65; max-width: 760px; color: var(--fl-ink); }

/* Service chips: legend and filter in one row */
.fl-chips { display: flex; flex-wrap: wrap; gap: 16px; }
.fl-chip { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px; background: #fff; border: 1px solid var(--fl-line); border-radius: 0; cursor: pointer; font-size: 15px; line-height: 1.3; color: var(--fl-navy); transition: border-color .15s, background-color .15s; }
.fl-chip:hover { border-color: #b8c3d3; }
.fl-chip[aria-pressed="true"] { border-color: var(--fl-navy); background: var(--fl-navy); color: #fff; }
.fl-chip .short { display: none; }
.fl-count { font-variant-numeric: tabular-nums; opacity: .7; }
.fl-key { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--fl-m); box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(19, 44, 82, .18); flex: none; }
.fl-key--windows { background: var(--fl-w); }
.fl-key--siding { background: var(--fl-s); }
.fl-key--roofing { background: var(--fl-r); }
.fl-key--more { background: var(--fl-m); }
.fl-key--doors, .fl-key--gutters, .fl-key--painting, .fl-key--decking { background: var(--fl-navy); }
.fl-chip:focus-visible, .fl-area:focus-visible, .fl-town:focus-visible, .fl-btn:focus-visible { outline: 3px solid #89c635; outline-offset: 2px; }

/* The map */
.fl-map-frame { position: relative; border: 1px solid var(--fl-line); background: var(--fl-land); }
.fl-map { width: 100%; height: 480px; height: clamp(440px, 66vh, 680px); background: var(--fl-land); }
.fl-projects--local .fl-map { height: 440px; height: clamp(400px, 58vh, 560px); }
.fl-areas { position: absolute; z-index: 3; top: 16px; left: 16px; display: flex; background: #fff; border: 1px solid var(--fl-line); box-shadow: 0 6px 20px rgba(19, 44, 82, .10); }
.fl-area { border: 0; border-right: 1px solid var(--fl-line); border-radius: 0; background: #fff; padding: 10px 14px; min-height: 40px; cursor: pointer; font-size: 14px; line-height: 1.25; color: var(--fl-navy); white-space: nowrap; }
.fl-area:last-child { border-right: 0; }
.fl-area[aria-pressed="true"] { background: var(--fl-tint); box-shadow: inset 0 -3px 0 #62a516; }
.fl-area .short { display: none; }

.fl-tip { position: absolute; z-index: 4; pointer-events: none; background: #fff; border: 1px solid var(--fl-line); box-shadow: 0 10px 28px rgba(19, 44, 82, .16); padding: 12px 16px; min-width: 190px; max-width: 260px; display: flex; flex-direction: column; gap: 4px; }
.fl-tip[hidden] { display: none; }
.fl-tip-svc { display: flex; align-items: center; gap: 10px; font-family: "Poppins", sans-serif; font-weight: 600; font-size: 15px; line-height: 1.35; color: var(--fl-navy); }
.fl-tip-svc::before { content: ""; width: 14px; height: 3px; background: var(--c, var(--fl-navy)); flex: none; }
.fl-tip-meta { font-size: 14px; line-height: 1.45; color: var(--fl-ink); padding-left: 24px; }
.fl-fallback { margin: 0; padding: 24px; font-size: 15px; color: var(--fl-ink); }

/* Towns and the quote box */
.fl-below { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: var(--fl-block); align-items: start; }
.fl-towns { display: flex; flex-direction: column; gap: 16px; }
.fl-projects .fl-towns-title { margin: 0; font-family: "Poppins", sans-serif; font-weight: 600; font-size: 22px; line-height: 1.3; color: var(--fl-navy); }
.fl-projects .fl-town-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 40px; }
.fl-projects .fl-town-list li { margin: 0; padding: 0; border-bottom: 1px solid var(--fl-line); }
.fl-projects .fl-town-list li::before { content: none; }
.fl-town { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; background: none; border: 0; border-radius: 0; cursor: pointer; text-align: left; color: var(--fl-navy); font-size: 16px; }
.fl-town:hover .fl-town-name { text-decoration: underline; text-decoration-color: #89c635; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.fl-town-count { font-variant-numeric: tabular-nums; color: var(--fl-ink); }
.fl-projects .fl-more { margin: 0; font-size: 15px; color: var(--fl-ink-soft); }

.fl-cta { background: var(--fl-navy); color: #fff; padding: 24px; padding: clamp(24px, 2.6vw, 36px); display: flex; flex-direction: column; gap: 16px; }
.fl-projects .fl-cta p { margin: 0; color: #fff; }
.fl-projects .fl-cta-kicker { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.fl-projects .fl-cta-big { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 30px; line-height: 1.15; }
.fl-projects .fl-cta-text { font-size: 16px; line-height: 1.6; opacity: .85; }
.fl-projects .fl-btn { display: inline-flex; justify-content: center; align-items: center; min-height: 52px; padding: 14px 20px; color: #fff; text-decoration: none; background: linear-gradient(91.95deg, #89c635 0%, #62a516 100%); box-shadow: 10px 10px 30px rgba(0, 38, 97, .2); font-size: 17px; }
.fl-projects .fl-phone { color: #fff; font-size: 16px; text-align: center; text-decoration: none; opacity: .9; }
.fl-projects .fl-phone:hover { text-decoration: underline; }

.fl-projects .fl-note { margin: 0; font-size: 14px; line-height: 1.6; color: var(--fl-ink-soft); max-width: 820px; }
.fl-projects .fl-note a { color: var(--fl-navy); text-decoration: underline; text-underline-offset: 3px; }

/* City landing pages: the map fills the box the Google map used to */
.responsive-map-container .fl-embed { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
/* On a phone that box was sized for the Google iframe (30vh, about 250px), which leaves the dots
   a strip under the count card. Give the map real height wherever it replaced the iframe. */
@media (max-width: 1024px) {
	.responsive-map-container:has(> .fl-embed) { height: 460px; padding: 0; }
}
.fl-embed { position: relative; background: var(--fl-land); border: 1px solid var(--fl-line); overflow: hidden; }
.fl-embed .fl-map { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; }
.fl-badge { position: absolute; z-index: 3; top: 16px; left: 16px; display: flex; flex-direction: column; gap: 2px; max-width: calc(100% - 32px); background: #fff; border: 1px solid var(--fl-line); box-shadow: 0 6px 20px rgba(19, 44, 82, .12); padding: 12px 16px; }
.fl-badge strong { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 18px; line-height: 1.3; color: var(--fl-navy); }
.fl-badge span { font-size: 14px; line-height: 1.4; color: var(--fl-ink); }
.fl-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--fl-line); font-size: 13px; line-height: 1.3; color: var(--fl-navy); }
.fl-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.fl-legend .fl-key { width: 10px; height: 10px; }

/* The office pin: a square, so it never reads as a job dot */
.fl-office { display: flex; align-items: center; gap: 8px; pointer-events: none; }
.fl-office-dot { width: 18px; height: 18px; background: var(--fl-navy, #132c52); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(19, 44, 82, .35), 0 4px 10px rgba(19, 44, 82, .3); }
.fl-office-label { background: #132c52; color: #fff; font-family: "Poppins", sans-serif; font-weight: 600; font-size: 12px; line-height: 1; padding: 6px 8px; letter-spacing: .02em; white-space: nowrap; }

/* MapLibre's own controls, squared off to match */
.fl-projects .maplibregl-ctrl-group,
.fl-embed .maplibregl-ctrl-group { border-radius: 0; border: 1px solid var(--fl-line); box-shadow: 0 6px 20px rgba(19, 44, 82, .10); }
.fl-projects .maplibregl-ctrl-group button,
.fl-embed .maplibregl-ctrl-group button { width: 40px; height: 40px; border-radius: 0; }
.fl-projects .maplibregl-ctrl-attrib,
.fl-embed .maplibregl-ctrl-attrib,
.fl-projects .maplibregl-ctrl-attrib-button,
.fl-embed .maplibregl-ctrl-attrib-button { border-radius: 0; }
.fl-projects .maplibregl-ctrl-top-right { top: 6px; right: 6px; }
.fl-projects .maplibregl-cooperative-gesture-screen,
.fl-embed .maplibregl-cooperative-gesture-screen { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 18px; line-height: 1.4; background: rgba(19, 44, 82, .72); }

@media (max-width: 900px) {
	.fl-below { grid-template-columns: minmax(0, 1fr); }
	.fl-projects .fl-town-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
}
@media (max-width: 560px) {
	.fl-map { height: 70vh; min-height: 420px; max-height: 560px; }
	.fl-projects--local .fl-map { height: 60vh; min-height: 380px; max-height: 500px; }
	.fl-areas { top: 12px; left: 12px; right: 12px; }
	.fl-area { flex: 1 1 0; min-width: 0; padding: 10px 8px; white-space: normal; text-align: center; }
	.fl-area .long { display: none; }
	.fl-area .short { display: inline; }
	.fl-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.fl-chip { padding: 10px 12px; justify-content: flex-start; }
	.fl-chip[data-f="more"] { grid-column: 1 / -1; }
	.fl-badge { top: 12px; left: 12px; padding: 10px 12px; }
	.fl-badge strong { font-size: 16px; }
	.fl-legend { gap: 4px 10px; font-size: 12px; }
}
@media (max-width: 360px) {
	.fl-chip { font-size: 14px; padding: 10px; gap: 8px; }
	.fl-chip .long { display: none; }
	.fl-chip .short { display: inline; }
}
