/*
Theme Name: West Palm Rehab Guide
Author: SEO ALGORITHMS
Author URI: https://seoalgorithms.com/
Description: Independent local guide to drug rehab in West Palm Beach.
Version: 1.0.0
Text Domain: wprg
*/

:root {
	--ink: #0f2a24;
	--body: #2a3b36;
	--muted: #4d5c57;
	--accent: #d12f18;
	--bg: #fff;
	--paper: #f7f6f4;
	--fog: #eff0eb;
	--rule: #c4c7c7;
	--ocean: #cfe0ee;
	--display: "Instrument Serif", Georgia, serif;
	--sans: "Instrument Sans", system-ui, sans-serif;
	--mono: "Courier Prime", "Courier New", monospace;
	--gutter: clamp(16px, 4.5vw, 64px);
	--wrap: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--body);
	font: 400 1.0625rem/1.6 var(--sans);
	overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, h4 { color: var(--ink); font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0 0 .5em; }
h2 { font-size: clamp(2.25rem, 4.2vw, 3.75rem); }
h3 { font-size: clamp(1.45rem, 2vw, 1.75rem); }
p { margin: 0 0 1em; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip {
	position: absolute; left: 8px; top: -60px; z-index: 50;
	background: var(--ink); color: #fff; padding: 10px 14px;
}
.skip:focus { top: 8px; color: #fff; }
.label { font-family: var(--mono); font-size: .9375rem; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Crisis bar */
.crisis { background: var(--fog); border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: .9375rem; }
.crisis .wrap { display: flex; justify-content: space-between; gap: 6px 24px; flex-wrap: wrap; padding-block: 8px; }
.crisis p { margin: 0; color: var(--ink); }
.crisis a { color: #b52712; font-weight: 700; text-decoration: none; }
.crisis a:hover { text-decoration: underline; }

/* Header */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 22px; }
.brand { font: 400 clamp(1.6rem, 2.7vw, 2.25rem)/1 var(--display); color: var(--ink); text-decoration: none; white-space: nowrap; }
.site-nav ul { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); list-style: none; margin: 0; padding: 0; }
.site-nav a { font-size: .9688rem; text-decoration: none; }
.site-nav a:hover, .site-nav .current-menu-item > a { color: var(--accent); }
.site-nav .nav-facilities { border-left: 1px solid var(--rule); padding-left: clamp(16px, 2vw, 24px); }
.site-nav .nav-facilities a { color: var(--accent); }
.nav-toggle {
	display: none; background: none; border: 1px solid var(--ink); border-radius: 2px;
	color: var(--ink); font: 500 .9375rem var(--sans); padding: 8px 12px; cursor: pointer;
}

/* Buttons */
.btn, .wp-block-button__link {
	display: inline-block; border: 1px solid var(--ink); border-radius: 3px;
	font: 500 1.0625rem/1.2 var(--sans); padding: 15px 24px; text-decoration: none;
	transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.btn-solid, .is-style-fill .wp-block-button__link, .wp-block-button__link { background: var(--ink); color: #fff; }
.btn-solid:hover, .wp-block-button__link:hover { background: #1d4a40; color: #fff; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--fog); color: var(--ink); }
.site-cta-hover:hover { transform: translateY(-1px); }

/* Hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 64px); align-items: center; padding-block: clamp(28px, 5vw, 72px) clamp(40px, 6vw, 88px); }
.hero h1 { font-size: clamp(3.25rem, 7vw, 6.5rem); line-height: 1.04; letter-spacing: -.005em; margin-bottom: .36em; }
.hero h1 span { display: block; }
.hero-sub { font-size: clamp(1.125rem, 1.5vw, 1.3125rem); line-height: 1.45; max-width: 31em; color: var(--ink); margin-bottom: 1.4em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; }
.sheet { position: relative; aspect-ratio: 1024 / 1152; background: url("assets/images/paper.webp") center / contain no-repeat; }
.sheet-text { position: absolute; inset: 11% 16% 11% 15%; transform: rotate(2.2deg); font-family: var(--mono); color: var(--ink); font-size: clamp(.9rem, 1.32vw, 1.2rem); line-height: 1.3; }
.sheet-title { text-align: center; letter-spacing: .08em; font-size: 1.15em; margin-bottom: 1em; }
.sheet ol { list-style: none; margin: 0; padding: 0; }
.sheet li { display: grid; grid-template-columns: 1fr 2.4em; gap: 10px; align-items: center; border-bottom: 1px solid #4d5c57; padding-block: .72em; }
.sheet li:last-child { border-bottom: 0; }
.tick { width: 2.4em; height: 2.4em; overflow: visible; }
.tick path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tick rect { fill: none; stroke: var(--ink); stroke-width: 1.5; }

/* Sponsored */
.sponsor-panel { min-height: clamp(220px, 21vw, 300px); border: 1px solid var(--muted); border-radius: 3px; padding: clamp(24px, 3vw, 44px) clamp(20px, 3.4vw, 52px) clamp(28px, 3.4vw, 52px); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 16px 32px; }
.sponsor-tag { grid-column: 1 / -1; justify-self: start; background: var(--accent); color: #fff; font: 500 1.0625rem/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; padding: 11px 20px; border-radius: 2px; }
.sponsor-panel h2 { font-size: clamp(2.5rem, 4.4vw, 4rem); margin-bottom: .22em; }
.sponsor-panel p { margin: 0; max-width: 34em; font-size: clamp(1.125rem, 1.5vw, 1.3125rem); line-height: 1.4; }
.sponsor-link { color: var(--accent); white-space: nowrap; text-decoration: none; font-family: var(--display); font-size: clamp(1.375rem, 2vw, 1.75rem); }
.sponsor-link:hover { text-decoration: underline; }

/* Sections */
.band { padding-block: clamp(44px, 5.6vw, 84px); }
.band + .band { position: relative; }
.band + .band::before { content: ""; position: absolute; top: 0; left: max(var(--gutter), calc((100% - var(--wrap)) / 2)); right: max(var(--gutter), calc((100% - var(--wrap)) / 2)); border-top: 1px solid var(--rule); }

/* Five checks */
.five { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; margin: clamp(20px, 3vw, 40px) 0 0; padding: 0; }
.five li { padding: 8px clamp(14px, 2vw, 28px) 12px; border-left: 1px solid var(--rule); font: 400 clamp(1.5rem, 2.5vw, 2.25rem)/1.15 var(--display); color: var(--ink); }
.five li:first-child { border-left: 0; padding-left: 0; }
.five a { text-decoration: none; }
.num { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 24px; border: 2px solid var(--accent); border-radius: 50%; color: var(--accent); font-size: 1.625rem; }

/* Programs */
.note { font-family: var(--mono); font-size: .9375rem; color: var(--ink); margin-top: -.35em; }
.rows { width: 100%; border-collapse: collapse; margin-top: 8px; }
.rows th, .rows td { text-align: left; padding: 16px 0; font-weight: 400; border-top: 1px solid var(--rule); vertical-align: baseline; }
.rows tr:last-child th, .rows tr:last-child td { border-bottom: 1px solid var(--rule); }
.rows th { color: var(--ink); font: 400 clamp(1.5rem, 2.2vw, 2rem)/1.15 var(--display); }
.rows td { color: var(--body); font-size: clamp(1.0625rem, 1.4vw, 1.25rem); width: 38%; }
.center { text-align: center; margin: 32px 0 0; }
.btn-small { padding: 14px 40px; font: 400 1.5rem/1.1 var(--display); }

/* Levels */
.levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(12px, 1.8vw, 24px); list-style: none; margin: 14px 0 0; padding: 0; }
.levels a { display: flex; flex-direction: column; align-items: center; text-align: center; height: 100%; padding: 26px 18px 30px; border: 1px solid var(--rule); border-radius: 3px; text-decoration: none; color: var(--body); transition: border-color .18s ease; }
.levels a:hover { border-color: var(--ink); color: var(--body); }
.levels h3 { min-height: 2.3em; display: flex; align-items: center; justify-content: center; font-size: clamp(1.5rem, 2vw, 1.875rem); line-height: 1.12; margin-bottom: .35em; }
.levels svg { width: 80px; height: 80px; margin: 0 0 18px; stroke: var(--ink); stroke-width: 1.25; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.levels svg .hot { stroke: var(--accent); }
.levels p { font-size: 1.0625rem; line-height: 1.4; margin: 0; }

/* Cost */
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(16px, 2.4vw, 32px); }
.cols > div { padding-inline: clamp(16px, 3vw, 44px); border-left: 1px solid var(--rule); }
.cols > div:first-child { padding-left: 0; border-left: 0; }
.cols svg { width: 64px; height: 64px; margin-bottom: 16px; stroke: var(--accent); stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cols svg .hot { stroke: var(--accent); }
.cols h3 { font-size: clamp(1.625rem, 2.3vw, 2.125rem); margin-bottom: .3em; }
.cols p { font-size: clamp(1.0625rem, 1.4vw, 1.25rem); line-height: 1.45; margin: 0; }

/* Money and map */
.money-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr); gap: clamp(20px, 3vw, 44px); align-items: stretch; }
.money-grid .money { padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--rule); }
.money-grid .money p { font-size: clamp(1.0625rem, 1.4vw, 1.25rem); margin: 0; }
.towns { display: flex; flex-wrap: wrap; gap: 8px 10px; list-style: none; margin: 14px 0 0; padding: 0; }
.towns a { display: inline-block; border: 1px solid var(--rule); border-radius: 2px; padding: 6px 12px; font-size: .9375rem; text-decoration: none; }
.towns a:hover { border-color: var(--ink); }
.map { position: relative; min-height: 500px; background: var(--ocean) url("assets/images/map.webp") 70% 50% / cover no-repeat; overflow: hidden; }
.pin { position: absolute; display: flex; align-items: center; gap: 9px; font: 400 1.5rem/1 var(--display); color: var(--ink); white-space: nowrap; }
.pin::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.pin.is-main { font-size: 2rem; }
.pin.is-main::before { width: 11px; height: 11px; background: var(--accent); }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr); gap: clamp(20px, 3vw, 44px); align-items: center; }
.faq details, .wp-block-details { border-bottom: 1px solid var(--rule); }
.faq summary, .wp-block-details summary { position: relative; cursor: pointer; list-style: none; padding: 18px 40px 18px 0; font: 400 clamp(1.5rem, 2.1vw, 1.875rem)/1.2 var(--display); color: var(--ink); }
.faq summary::-webkit-details-marker, .wp-block-details summary::-webkit-details-marker { display: none; }
.faq summary::after, .wp-block-details summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 11px; height: 11px; border-right: 1.75px solid var(--accent); border-bottom: 1.75px solid var(--accent); transform: translateY(-70%) rotate(45deg); }
.faq details[open] summary::after, .wp-block-details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { font-size: 1rem; }

/* Close and footer */
.close-band { background: var(--fog); border-block: 1px solid var(--rule); text-align: center; padding: clamp(48px, 6.4vw, 96px) var(--gutter); }
.close-band p { font: 400 clamp(2.5rem, 5.4vw, 5rem)/1.08 var(--display); color: var(--ink); margin: 0 0 26px; }
.site-footer { padding-block: 34px 38px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) auto; align-items: center; gap: 16px 32px; }
.footer-legal { font-family: var(--mono); font-size: .9375rem; line-height: 1.35; color: var(--ink); max-width: 34em; margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; font-family: var(--display); font-size: 1.3125rem; }
.footer-links li { padding-inline: clamp(14px, 2.2vw, 30px); border-left: 1px solid var(--rule); }
.footer-links a { text-decoration: none; }
.footer-links .mail { color: var(--accent); font-family: var(--sans); font-size: 1rem; }

/* Reveal */
.js .site-fade-on-scroll { opacity: 0; transform: translateY(10px); transition: opacity .55s ease, transform .55s ease; }
.js .site-fade-on-scroll.is-in { opacity: 1; transform: none; }
.js .site-tick { stroke-dasharray: 60; stroke-dashoffset: 60; transition: stroke-dashoffset .5s ease; }
.js .is-in .site-tick { stroke-dashoffset: 0; }
.sheet li:nth-child(2) .site-tick { transition-delay: .15s; }
.sheet li:nth-child(3) .site-tick { transition-delay: .3s; }
.sheet li:nth-child(4) .site-tick { transition-delay: .45s; }
.sheet li:nth-child(5) .site-tick { transition-delay: .6s; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.js .site-fade-on-scroll, .js .site-tick { opacity: 1; transform: none; stroke-dashoffset: 0; transition: none; }
	.btn, .site-cta-hover:hover { transition: none; transform: none; }
}

@media (max-width: 1080px) {
	.nav-toggle { display: block; }
	.site-nav { display: none; position: absolute; left: 0; right: 0; z-index: 30; background: #fff; border-block: 1px solid var(--rule); padding: 12px var(--gutter) 18px; }
	.site-nav.is-open { display: block; }
	.site-nav ul { flex-direction: column; align-items: flex-start; gap: 4px; }
	.site-nav a { display: block; padding: 8px 0; font-size: 1.0625rem; }
	.site-nav .nav-facilities { border-left: 0; padding-left: 0; }
	.site-header { position: relative; }
	.levels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
	.crisis { position: sticky; top: 0; z-index: 40; font-size: .875rem; }
	.hero .wrap, .money-grid, .faq-grid { grid-template-columns: minmax(0, 1fr); }
	.sheet { max-width: 560px; width: 100%; margin-inline: auto; }
	.sheet-text { inset: 9% 16% 8% 15%; font-size: clamp(.75rem, 3.2vw, 1.0625rem); line-height: 1.2; }
	.sheet-title { margin-bottom: .4em; }
	.sheet li { padding-block: .4em; }
	.tick { width: 2em; height: 2em; }
	.sponsor-panel { grid-template-columns: minmax(0, 1fr); }
	.five { grid-template-columns: minmax(0, 1fr); margin-top: 8px; }
	.five li, .five li:first-child { display: flex; align-items: center; gap: 14px; border-left: 0; padding: 14px 0; border-top: 1px solid var(--rule); }
	.num { margin: 0; flex: 0 0 48px; width: 48px; height: 48px; font-size: 1.375rem; }
	.cols { grid-template-columns: minmax(0, 1fr); gap: 24px; }
	.cols > div { padding: 0; border-left: 0; }
	.map { display: none; }
	.footer-grid { grid-template-columns: minmax(0, 1fr); }
	.footer-links { flex-direction: column; gap: 8px; }
	.footer-links li { padding: 0; border-left: 0; }
}
@media (max-width: 620px) {
	.levels { grid-template-columns: minmax(0, 1fr); }
	.levels h3 { min-height: 0; }
	.rows tr { display: block; padding: 9px 0; border-top: 1px solid var(--rule); }
	.rows tr:last-child { border-bottom: 1px solid var(--rule); }
	.rows th, .rows td, .rows tr:last-child th, .rows tr:last-child td { display: block; width: auto; border: 0; padding: 0; }
	.hero-cta .btn { flex: 1 1 100%; text-align: center; }
}

/* Conversion layer */
.hero-trust { font-family: var(--mono); font-size: .9375rem; color: var(--ink); margin: 18px 0 0; }
.close-band p.close-paths { font: 400 .9688rem/1.4 var(--mono); margin: 18px 0 0; }

/* Footer guide links */
.footer-more { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 18px; }
.footer-more ul { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; margin: 0; padding: 0; font-size: .9375rem; }
.footer-more a { text-decoration: none; }
.footer-more a:hover { text-decoration: underline; }

/* Footer layout: links first, operator line on its own row */
.footer-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.footer-links { order: 1; }
.footer-more { order: 2; border-top: 0; padding-top: 0; }
.footer-more ul { font-size: .875rem; gap: 6px 18px; }
.footer-legal { order: 3; max-width: none; border-top: 1px solid var(--rule); padding-top: 16px; font-size: .875rem; }
@media (min-width: 821px) {
	.footer-links { align-items: baseline; }
	.footer-links li:first-child { padding-left: 0; border-left: 0; }
	.footer-links li:last-child { margin-left: auto; padding-right: 0; border-left: 0; }
	.footer-more ul { justify-content: space-between; }
}
