/*
Theme Name: Recovery Growth Partners
Author: SEO ALGORITHMS
Author URI: https://seoalgorithms.com/
Theme URI: https://recoverygrowthpartners.com
Description: Custom theme for Recovery Growth Partners. Clinical Trust style: deep teal, Newsreader + Mulish.
Version: 1.0.0
Requires at least: 6.4
Text Domain: rgp
*/

:root {
	--teal: #0B4F5C;
	--teal-dark: #083A44;
	--teal-tint: #E7F0F1;
	--ink: #0F2A33;
	--muted: #4A5F66;
	--sage: #5E8C7A;
	--mist: #F4F8F9;
	--white: #FFFFFF;
	--border: #DCE6E8;
	--serif: "Newsreader", Georgia, "Times New Roman", serif;
	--sans: "Mulish", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--r-sm: 4px;
	--r-md: 8px;
	--r-lg: 12px;
	--wrap: 1200px;
	--gutter: 24px;
	--sec-y: 96px;
	--shadow: 0 1px 2px rgba(15, 42, 51, .06);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--white);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--teal-dark); }

:focus-visible { outline: 3px solid var(--sage); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 {
	font-family: var(--serif);
	font-weight: 500;
	color: var(--ink);
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin: 0 0 .5em;
	text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 4.6vw, 3.6rem); font-weight: 400; }
h2 { font-size: clamp(1.85rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.35rem; line-height: 1.25; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
	position: absolute; left: 16px; top: -60px; z-index: 100;
	background: var(--teal); color: var(--white); padding: 10px 16px; border-radius: var(--r-md);
	font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--white); }

.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Buttons (theme + block) ---------- */
.btn,
.wp-block-button .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 48px; padding: 12px 22px;
	border-radius: var(--r-md);
	font-family: var(--sans); font-size: 1rem; font-weight: 700; line-height: 1.2;
	text-decoration: none; white-space: nowrap;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
	cursor: pointer;
}
a.btn-primary, button.btn-primary,
.wp-block-button.btn-primary .wp-block-button__link,
.wp-block-button:not(.btn-ghost) .wp-block-button__link {
	background: var(--teal); color: var(--white); border: 1px solid var(--teal);
}
a.btn-primary:hover, button.btn-primary:hover,
.wp-block-button.btn-primary .wp-block-button__link:hover,
.wp-block-button:not(.btn-ghost) .wp-block-button__link:hover {
	background: var(--teal-dark); border-color: var(--teal-dark); color: var(--white);
}
a.btn-ghost,
.wp-block-button.btn-ghost .wp-block-button__link {
	background: transparent; color: var(--teal); border: 1px solid var(--teal);
}
a.btn-ghost:hover,
.wp-block-button.btn-ghost .wp-block-button__link:hover { background: var(--teal-tint); color: var(--teal-dark); }

.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.wp-block-buttons > .wp-block-button { margin: 0; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, .96);
	backdrop-filter: saturate(1.4) blur(8px);
	border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 32px; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name { font-family: var(--serif); font-size: 1.25rem; font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; }
.brand-name span { color: var(--teal); }
.primary-nav { margin-left: auto; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.primary-nav a {
	color: var(--ink); text-decoration: none; font-weight: 600; font-size: .975rem;
	padding: 8px 0; border-bottom: 2px solid transparent;
}
.primary-nav a:hover { color: var(--teal); }
.primary-nav .current-menu-item > a,
.primary-nav a[aria-current="page"] { color: var(--teal); border-bottom-color: var(--teal); }
.header-cta { flex-shrink: 0; min-height: 44px; padding: 10px 18px; }
.nav-toggle {
	display: none; margin-left: auto;
	min-height: 44px; min-width: 44px; padding: 8px 14px;
	background: var(--white); color: var(--ink);
	border: 1px solid var(--border); border-radius: var(--r-md);
	font: 700 .95rem var(--sans); cursor: pointer;
}

@media (max-width: 1180px) {
	.header-inner { height: 68px; gap: 12px; }
	.nav-toggle { display: inline-flex; align-items: center; }
	.header-cta { display: none; }
	.primary-nav {
		display: none;
		position: absolute; left: 0; right: 0; top: 100%;
		background: var(--white); border-bottom: 1px solid var(--border);
		padding: 8px var(--gutter) 20px;
	}
	.primary-nav.is-open { display: block; }
	.primary-nav ul { flex-direction: column; gap: 0; }
	.primary-nav a { display: block; padding: 14px 0; border-bottom: 1px solid var(--border); }
	.primary-nav .current-menu-item > a,
	.primary-nav a[aria-current="page"] { border-bottom-color: var(--border); }
	.primary-nav a.nav-cta,
	.primary-nav a.nav-cta:hover {
		display: flex; margin-top: 16px; width: 100%; padding: 12px 22px;
		color: var(--white); border: 1px solid var(--teal);
	}
	.primary-nav a.nav-cta:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
}
@media (min-width: 1181px) { .primary-nav .nav-cta { display: none; } }

/* ---------- Sections (block groups) ---------- */
.site-main { display: block; }
.sec { padding: var(--sec-y) var(--gutter); }
/* Classic themes wrap group content in an inner container; let its children lay out as the group's own. */
.wp-block-group__inner-container { display: contents; }
.sec > *,
.sec > .wp-block-group__inner-container > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.sec > .wp-block-group__inner-container { max-width: none; }
.sec .narrow { max-width: 760px; }
.sec-mist { background: var(--mist); }
.sec-tight { padding-top: 0; }

.eyebrow {
	font-family: var(--sans); font-size: .8125rem; font-weight: 700;
	letter-spacing: .08em; text-transform: uppercase; color: var(--teal);
	margin-bottom: 16px;
}
.lede { font-size: 1.1875rem; color: var(--muted); max-width: 620px; }
.muted { color: var(--muted); }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head h2 { margin-bottom: 16px; }

.wp-block-columns { display: flex; gap: 32px; margin: 0; }
.wp-block-column { min-width: 0; }
@media (max-width: 781px) {
	.wp-block-columns { flex-direction: column; gap: 24px; }
}

/* Hero */
.hero { background: var(--mist); padding-top: 88px; padding-bottom: 96px; border-bottom: 1px solid var(--border); }
.hero h1 { margin-bottom: 20px; max-width: 13ch; }
.hero-cols { align-items: center; gap: 64px; }
.hero-cols > .wp-block-column:first-child { flex: 1.25; }
.hero-cols > .wp-block-column:last-child { flex: 1; }
.page-hero { background: var(--mist); padding-top: 80px; padding-bottom: 72px; border-bottom: 1px solid var(--border); }
.page-hero h1 { max-width: 18ch; margin-bottom: 18px; }

/* At-a-glance panel */
.glance {
	background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg);
	padding: 32px; box-shadow: var(--shadow);
}
.glance h2, .glance h3 { font-size: 1.25rem; margin-bottom: 8px; }
.glance .wp-block-list { list-style: none; margin: 0; padding: 0; }
.glance .wp-block-list li { padding: 16px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 1rem; }
.glance .wp-block-list li:first-child { border-top: 0; }
.glance .wp-block-list li strong { display: block; color: var(--ink); font-size: 1.0625rem; margin-bottom: 2px; }

/* Split header + stacked rows (problem section) */
.split { gap: 64px; }
.split > .wp-block-column:first-child { flex: .9; }
.split > .wp-block-column:last-child { flex: 1.1; }
.rows .row { padding: 28px 0; border-top: 1px solid var(--border); }
.rows .row:last-child { padding-bottom: 0; }
.rows .row h3 { margin-bottom: 6px; }
.rows .row p { color: var(--muted); }

/* Sequence (how it works) */
.sequence { gap: 0; counter-reset: seq; }
.sequence > .wp-block-column {
	position: relative; padding: 32px 32px 0 0; margin-right: 32px;
	border-top: 2px solid var(--teal);
	counter-increment: seq;
}
.sequence > .wp-block-column:last-child { margin-right: 0; }
.sequence > .wp-block-column::before {
	content: counter(seq);
	position: absolute; top: -17px; left: 0;
	width: 32px; height: 32px; border-radius: 50%;
	background: var(--teal); color: var(--white);
	font: 700 .9rem/32px var(--sans); text-align: center;
}
.sequence h3 { margin-bottom: 10px; }
.sequence p { color: var(--muted); }
@media (max-width: 781px) {
	.sequence { gap: 40px; }
	.sequence > .wp-block-column { margin-right: 0; padding-right: 0; }
}

/* Bento (pillars) */
.bento { gap: 24px; }
.bento > .wp-block-column:first-child { flex: 1.2; }
.bento > .wp-block-column:last-child { flex: 1; display: flex; flex-direction: column; gap: 24px; }
.tile {
	border: 1px solid var(--border); border-radius: var(--r-lg);
	padding: 36px; background: var(--white); height: 100%;
}
.tile h3 { font-size: 1.5rem; margin-bottom: 10px; }
.tile p { color: var(--muted); }
.tile-feature { background: var(--teal-tint); border-color: #CFE0E2; display: flex; flex-direction: column; justify-content: center; min-height: 320px; }
.tile-feature h3 { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 400; }
.tile-feature p { color: var(--ink); font-size: 1.125rem; max-width: 46ch; }
.bento > .wp-block-column:last-child > .tile { height: auto; flex: 1; }

/* Comparison table */
.wp-block-table.compare { margin: 0 auto; overflow-x: auto; }
.compare table { width: 100%; border-collapse: collapse; font-size: 1rem; min-width: 640px; }
.compare th, .compare td { text-align: left; padding: 18px 20px; vertical-align: top; border: 0; }
.compare thead th {
	font-family: var(--sans); font-size: .8125rem; font-weight: 700; letter-spacing: .06em;
	text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink);
}
.compare thead th:nth-child(2) { color: var(--teal); }
.compare tbody td { border-bottom: 1px solid var(--border); color: var(--muted); }
.compare tbody td:first-child { color: var(--ink); font-weight: 700; width: 22%; }
.compare tbody td:nth-child(2) { color: var(--ink); background: var(--teal-tint); }
.compare tbody tr:last-child td { border-bottom: 0; }

/* Photos */
.wp-block-image.photo { margin: 0; }
.wp-block-image.photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-lg); }
.prose .wp-block-image.photo { margin: 0 0 48px; }
.split .wp-block-image.photo { margin-top: 32px; }
.photo-split { gap: 64px; align-items: center; }
.photo-split > .wp-block-column { flex: 1; }
.photo-split .big-quote {
	font-family: var(--serif); font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.2;
	color: var(--teal); margin: 0 0 20px; font-weight: 400;
}
.photo-split p:not(.big-quote) { color: var(--muted); font-size: 1.125rem; }

/* Statement */
.statement { text-align: center; }
.statement .big-quote {
	font-family: var(--serif); font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.2;
	color: var(--teal); max-width: 22ch; margin: 0 auto 24px; font-weight: 400;
}
.statement p:not(.big-quote) { color: var(--muted); max-width: 640px; margin-left: auto; margin-right: auto; font-size: 1.125rem; }

/* FAQ */
.faq-cols { gap: 64px; }
.faq-cols > .wp-block-column:first-child { flex: .8; }
.faq-cols > .wp-block-column:last-child { flex: 1.2; }
.wp-block-details { border-top: 1px solid var(--border); padding: 0; margin: 0; }
.wp-block-details:last-child { border-bottom: 1px solid var(--border); }
.wp-block-details summary {
	list-style: none; cursor: pointer; position: relative;
	padding: 22px 48px 22px 0; font-weight: 700; font-size: 1.0625rem; color: var(--ink);
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
	content: ""; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px;
	border-right: 2px solid var(--teal); border-bottom: 2px solid var(--teal);
	transform: translateY(-75%) rotate(45deg); transition: transform .2s ease;
}
.wp-block-details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.wp-block-details > p { color: var(--muted); padding: 0 48px 24px 0; margin: 0; }

/* CTA box */
.cta-box {
	background: var(--teal-tint); border: 1px solid #CFE0E2; border-radius: var(--r-lg);
	padding: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 28px 56px;
}
@media (max-width: 900px) { .cta-box { grid-template-columns: minmax(0, 1fr); } }
.cta-box h2 { margin-bottom: 8px; }
.cta-box p { color: var(--muted); max-width: 52ch; }
.cta-box .wp-block-buttons { margin: 0; }
.cta-box .cta-copy p { margin-bottom: 0; }

/* Prose pages */
.prose { max-width: 760px; }
.prose h2 { margin-top: 56px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 32px; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1.25em; }
.prose li { margin-bottom: .5em; }
.callout {
	border-left: 3px solid var(--teal); background: var(--mist);
	padding: 24px 28px; border-radius: 0 var(--r-md) var(--r-md) 0; margin: 32px 0;
}
.callout p { color: var(--ink); }

/* Two-col info (about, pricing page) */
.info-cols { gap: 64px; align-items: flex-start; }
.info-cols > .wp-block-column:first-child { flex: 1.3; }
.info-cols > .wp-block-column:last-child { flex: .9; }
.side-card {
	border: 1px solid var(--border); border-radius: var(--r-lg); padding: 32px; background: var(--white);
}
.side-card h3 { margin-bottom: 12px; }
.side-card ol, .side-card ul { margin: 0; padding-left: 1.2em; color: var(--muted); }
.side-card li { margin-bottom: 12px; }
.side-card li:last-child { margin-bottom: 0; }
.side-card + .side-card { margin-top: 24px; }

/* ---------- Contact ---------- */
.email-card {
	background: var(--teal-tint); border: 1px solid #CFE0E2; border-radius: var(--r-lg);
	padding: 36px;
}
.email-card h2 { margin-bottom: 8px; }
.email-big { font-family: var(--serif); font-size: clamp(1.25rem, 2.4vw, 1.75rem); line-height: 1.25; margin-bottom: 24px; overflow-wrap: break-word; }
.email-notes { margin-top: 48px; }
.email-notes h2 { font-size: 1.5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--teal-dark); color: #D3E2E4; padding: 72px 0 32px; font-size: .975rem; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 0.9fr 1.5fr; gap: 40px; }
@media (max-width: 1100px) and (min-width: 861px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand .brand { color: var(--white); margin-bottom: 16px; }
.footer-brand .brand-name span { color: #9CC6C9; }
.footer-brand p { max-width: 38ch; }
.footer-email { overflow-wrap: break-word; font-weight: 600; }
.site-footer h2 {
	font-family: var(--sans); font-size: .8125rem; font-weight: 700; letter-spacing: .08em;
	text-transform: uppercase; color: #9CC6C9; margin-bottom: 16px;
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 10px; }
.site-footer .btn-light { background: var(--white); color: var(--teal-dark); border: 1px solid var(--white); margin-top: 8px; }
.site-footer .btn-light:hover { background: var(--teal-tint); text-decoration: none; }
.footer-help {
	margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .16);
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: .9rem; color: #B9D0D3;
}
.footer-help p { margin: 0; max-width: 72ch; }
.footer-help strong { color: var(--white); }
@media (max-width: 860px) {
	.footer-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* ---------- Generic page / fallback ---------- */
.entry-fallback { padding: var(--sec-y) var(--gutter); }
.entry-fallback > * { max-width: 760px; margin-left: auto; margin-right: auto; }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease-out, transform .5s ease-out; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 781px) {
	:root { --sec-y: 64px; --gutter: 16px; }
	.hero { padding-top: 56px; padding-bottom: 64px; }
	.hero-cols, .split, .faq-cols, .info-cols { gap: 40px; }
	.page-hero { padding-top: 56px; padding-bottom: 48px; }
	.tile, .glance, .side-card { padding: 24px; }
	.tile-feature { min-height: 0; }
	.cta-box { padding: 32px 24px; }
	.wp-block-buttons .wp-block-button { flex: 1 1 100%; }
	.wp-block-buttons .wp-block-button__link, .rgp-form .form-foot .btn { width: 100%; }
	.cta-box { gap: 28px; }
	.wp-block-table.compare::before { content: "Swipe sideways to compare"; display: block; font-size: .8125rem; color: var(--muted); margin-bottom: 8px; }
	.section-head { margin-bottom: 32px; }
}

/* Card-level headings that are h2 for outline order but sized like h3 */
.glance h2, .sequence h2, .side-card h2 { font-size: 1.35rem; line-height: 1.25; }
.sequence h2 { margin-bottom: 10px; }
.side-card h2 { margin-bottom: 12px; }

/* Intro callout that sits above another block in the same section */
.prose-intro { margin-bottom: 72px; }
.prose-intro .callout { margin: 0; }
@media (max-width: 781px) { .prose-intro { margin-bottom: 48px; } }

/* Comparison tables: even data columns, fixed label column */
.compare table { table-layout: fixed; }
.compare thead th:first-child, .compare tbody td:first-child { width: 22%; }

/* Email button placed by the [rgp_email_button] shortcode */
.page-hero .email-btn-wrap { margin-top: 28px; }
.cta-box .email-btn-wrap, .email-card .email-btn-wrap { margin: 0; }
