/* ==========================================================================
   Big State Roof Solutions — prototype stylesheet
   ========================================================================== */

/* ---- reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
	font-family: var(--font-body);
	font-size: var(--step-0);
	line-height: 1.65;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--red-600); text-decoration-thickness: 1px; text-underline-offset: 2px; }

:focus-visible { outline: 2px solid var(--red-600); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- typography ---------------------------------------------------------- */
h1, h2, h3, h4 {
	font-family: var(--font-heading);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--navy-800);
	text-wrap: balance;
}
h1 { font-size: var(--step-6); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p  { text-wrap: pretty; }

.eyebrow {
	font-family: var(--font-heading);
	font-size: var(--step--1);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--red-600);
	margin-bottom: var(--sp-3);
}
.lede { font-size: var(--step-1); color: var(--text-muted); }

/* ---- layout -------------------------------------------------------------- */
.wrap { width: min(var(--wrap), 100% - var(--gutter) * 2); margin-inline: auto; }
.wrap-tight { width: min(var(--wrap-tight), 100% - var(--gutter) * 2); margin-inline: auto; }
.section { padding-block: var(--section-y); }
.section-alt { background: var(--surface-alt); }
.section-navy { background: var(--navy-800); color: #fff; }
.section-navy h2, .section-navy h3 { color: #fff; }
.section-head { max-width: 60ch; margin-bottom: var(--sp-7); }
.section-head.center { margin-inline: auto; text-align: center; }

.grid { display: grid; gap: var(--sp-5); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.sr-only {
	position: absolute; width: 1px; height: 1px; padding: 0;
	margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- buttons ------------------------------------------------------------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
	font-family: var(--font-heading); font-weight: 700; font-size: var(--step-0);
	line-height: 1; text-decoration: none; cursor: pointer;
	padding: 1rem 1.6rem; border: 2px solid transparent; border-radius: var(--radius);
	transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease),
	            transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.btn:hover { transform: translateY(-2px); }

/*
 * Every variant below is written as .btn.btn-x, not .btn-x.
 *
 * RSForm! Pro loads Joomla's bundled Bootstrap 5.3 on any page carrying a
 * form, and it loads AFTER this stylesheet. Bootstrap defines .btn-primary,
 * .btn-secondary and .btn-lg, so on equal specificity it won the cascade and
 * the hero CTA on /contact turned Bootstrap blue while "Call or text" lost
 * its border and went dark-on-navy - invisible.
 *
 * Doubling the class is enough to win without !important, and it keeps
 * working wherever a form, module or plugin pulls Bootstrap in.
 */
.btn:active { transform: translateY(0); }

.btn.btn-primary { background: var(--red-600); color: #fff; border-color: var(--red-600);
	box-shadow: var(--shadow-sm); }
.btn.btn-primary:hover { background: var(--red-700); border-color: var(--red-700);
	box-shadow: var(--shadow); }

.btn.btn-secondary { background: transparent; color: var(--navy-800); border-color: var(--navy-800); }
.btn.btn-secondary:hover { background: var(--navy-800); color: #fff; }

.btn.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.btn.btn-ghost-light:hover { background: #fff; color: var(--navy-800); border-color: #fff; }

.btn.btn-lg { padding: 1.15rem 2rem; font-size: var(--step-1); }
.btn.btn-block { width: 100%; }

/* ---- top bar ------------------------------------------------------------- */
.topbar {
	background: var(--navy-900); color: rgba(255, 255, 255, 0.85);
	font-size: var(--step--1);
}
.topbar-inner {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: var(--sp-3); padding-block: 0.5rem;
}
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar-meta { display: flex; flex-wrap: wrap; gap: var(--sp-5); }
.topbar-phone { font-family: var(--font-heading); font-weight: 700; }

/* ---- header -------------------------------------------------------------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, 0.97);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}
.header-inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: var(--sp-5); padding-block: var(--sp-3);
}
.brand { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; flex-shrink: 0; }
.brand img { width: 62px; height: auto; }
.brand-text { font-family: var(--font-heading); line-height: 1.05; }
.brand-name { display: block; font-weight: 800; font-size: 1.05rem; color: var(--navy-800); letter-spacing: -0.01em; }
.brand-tag  { display: block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em;
              text-transform: uppercase; color: var(--red-600); }

.nav { display: flex; align-items: center; gap: var(--sp-5); }
/* The header CTA never wraps or shrinks. It is a flex item inside .nav, so
   when the bar got tight it was squeezed to ~200px and broke onto two lines
   ("Free / Inspection") - at 1366 and 1440 as well as at the narrow end.
   The tightening rule for 1101-1320px used to target .header-inner > .btn,
   which never matched anything, because the button is not a direct child of
   .header-inner. It targets .nav > .btn now. */
.nav > .btn { white-space: nowrap; flex-shrink: 0; }
.nav-list { display: flex; align-items: center; gap: var(--sp-5); list-style: none; padding: 0; margin: 0; }
.nav-list > li { position: relative; }
.nav-list > li > a {
	font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem;
	color: var(--navy-800); text-decoration: none; padding-block: var(--sp-3);
	display: inline-flex; align-items: center; gap: 0.3rem;
}
.nav-list > li > a:hover { color: var(--red-600); }
.nav-caret { width: 9px; height: 9px; fill: currentColor; opacity: 0.6; }

/* mega menu — the 14 services are grouped visually here, while the Joomla
   menu tree stays flat so URLs remain /services/<slug> */
.mega {
	position: absolute; top: 100%; left: 50%; translate: -50% 0;
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg); padding: var(--sp-6);
	display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)); gap: var(--sp-6);
	opacity: 0; visibility: hidden; translate: -50% 8px;
	transition: opacity var(--speed) var(--ease), translate var(--speed) var(--ease), visibility var(--speed);
}
/* Only bind hover-to-open where a real pointer exists and there is room for the
   panel. Without the media guard this rule out-specifies the mobile reset below
   and drags the panel half its own width off the left edge. */
@media (hover: hover) and (min-width: 1101px) {
	.nav-list > li:hover .mega,
	.nav-list > li:focus-within .mega { opacity: 1; visibility: visible; translate: -50% 0; }
}
/*
 * Menu, footer and sidebar labels are styled <p>s, not headings.
 *
 * They were <h4>s and <h3>s, which put "Roofing / Home Exterior / Energy &
 * Upkeep" into every page's heading outline ABOVE the h1, three more footer
 * labels after the content, and filed the sidebar's "In a hurry?" under
 * whichever h2 came last. Screen-reader users navigate by headings, so they
 * met the menu before the page title. These classes carry the heading font
 * the elements used to inherit, so nothing changes on screen.
 */
.mega-heading,
.footer-heading,
.rail-title {
	font-family: var(--font-heading);
	font-weight: 800;
	line-height: 1.1;
	text-wrap: balance;
}
.mega-heading {
	font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
	color: var(--red-600); margin-bottom: var(--sp-3);
}
.mega-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.mega-col a {
	color: var(--navy-800); text-decoration: none; font-size: 0.93rem;
	display: block; padding: 0.3rem 0.5rem; margin-inline: -0.5rem; border-radius: var(--radius-sm);
}
.mega-col a:hover { background: var(--navy-100); color: var(--red-600); }

.nav-toggle {
	display: none; background: none; border: 0; padding: var(--sp-2);
	cursor: pointer; color: var(--navy-800);
}

/* ---- hero ---------------------------------------------------------------- */
.hero { position: relative; background: var(--navy-800); color: #fff; overflow: hidden; }
.hero::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(100deg, var(--navy-900) 0%, rgba(3, 32, 47, 0.94) 45%, rgba(3, 32, 47, 0.55) 100%);
}
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-inner { position: relative; z-index: 2; padding-block: clamp(3.5rem, 2rem + 6vw, 7rem); }
.hero-content { max-width: 40rem; }
.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; color: var(--red-500); }
.hero-lede { font-size: var(--step-1); color: rgba(255, 255, 255, 0.85); margin-top: var(--sp-5); }

.hero-badge {
	display: inline-flex; align-items: center; gap: var(--sp-3);
	background: var(--red-600); color: #fff;
	font-family: var(--font-heading); font-weight: 700; font-size: var(--step--1);
	letter-spacing: 0.04em; padding: 0.5rem 1rem; border-radius: 100px; margin-bottom: var(--sp-5);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-7); }
.hero-note { margin-top: var(--sp-4); font-size: var(--step--1); color: rgba(255, 255, 255, 0.6); }

/* ---- trust strip --------------------------------------------------------- */
.trust { background: var(--navy-900); border-top: 1px solid rgba(255, 255, 255, 0.08); }
.trust-list {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	list-style: none; padding: 0; margin: 0;
}
.trust-item {
	display: flex; align-items: center; gap: var(--sp-3);
	padding: var(--sp-5) var(--sp-4); color: rgba(255, 255, 255, 0.9);
	font-size: var(--step--1); border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.trust-item:last-child { border-right: 0; }
.trust-item strong { display: block; font-family: var(--font-heading); color: #fff; font-size: var(--step-0); }
.trust-icon { flex-shrink: 0; width: 26px; height: 26px; fill: var(--red-500); }

/* ---- service cards ------------------------------------------------------- */
.card {
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
	overflow: hidden; display: flex; flex-direction: column;
	transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
	            border-color var(--speed) var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--navy-100); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: scale var(--speed) var(--ease); }
.card:hover .card-media img { scale: 1.04; }
.card-body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.card-body p { color: var(--text-muted); font-size: 0.97rem; }
.card-link {
	margin-top: auto; font-family: var(--font-heading); font-weight: 700;
	font-size: 0.95rem; color: var(--red-600); text-decoration: none;
	display: inline-flex; align-items: center; gap: 0.4rem;
}
.card-link::after { content: "→"; transition: translate var(--speed) var(--ease); }
.card:hover .card-link::after { translate: 4px 0; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }

/* ---- guarantee band ------------------------------------------------------ */
.guarantee { background: var(--red-600); color: #fff; }
.guarantee-inner {
	display: grid; grid-template-columns: 1fr auto; gap: var(--sp-6);
	align-items: center; padding-block: var(--sp-7);
}
.guarantee h2 { color: #fff; font-size: var(--step-3); }
.guarantee p { color: rgba(255, 255, 255, 0.9); margin-top: var(--sp-3); }

/* ---- areas --------------------------------------------------------------- */
.area-list { display: flex; flex-wrap: wrap; gap: var(--sp-3); list-style: none; padding: 0; margin: 0; }
.area-list a {
	display: inline-block; padding: 0.6rem 1.1rem;
	background: #fff; border: 1px solid var(--line); border-radius: 100px;
	font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem;
	color: var(--navy-800); text-decoration: none;
	transition: background var(--speed) var(--ease), color var(--speed) var(--ease),
	            border-color var(--speed) var(--ease);
}
.area-list a:hover { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ---- testimonials -------------------------------------------------------- */
.quote {
	background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--red-600);
	border-radius: var(--radius); padding: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-4);
}
.stars { display: flex; gap: 2px; }
.stars svg { width: 17px; height: 17px; fill: var(--star); }
.quote blockquote { font-size: 1rem; color: var(--text); }
.quote figcaption { font-family: var(--font-heading); font-weight: 700; color: var(--navy-800); font-size: 0.95rem; }
.quote figcaption span { display: block; font-weight: 400; font-family: var(--font-body);
                         font-size: 0.85rem; color: var(--ink-soft); }

/* ---- team ---------------------------------------------------------------- */
.person { display: grid; gap: var(--sp-4); }
.person-photo {
	aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden;
	background: var(--navy-100); max-width: 220px;
}
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-role { font-family: var(--font-heading); font-weight: 700; color: var(--red-600); font-size: 0.9rem;
               text-transform: uppercase; letter-spacing: 0.08em; }

/* ---- final CTA ----------------------------------------------------------- */
.cta { background: var(--navy-800); color: #fff; text-align: center; }
.cta h2 { color: #fff; }
.cta p { color: rgba(255, 255, 255, 0.82); margin-top: var(--sp-4); }
.cta-actions { display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: center; margin-top: var(--sp-6); }

/* ---- footer -------------------------------------------------------------- */
.site-footer { background: var(--navy-900); color: rgba(255, 255, 255, 0.72); font-size: 0.95rem; }
.footer-grid {
	display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--sp-6);
	padding-block: var(--sp-8);
}
.footer-heading { color: #fff; font-size: 0.8rem; letter-spacing: 0.12em;
                  text-transform: uppercase; margin-bottom: var(--sp-4); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.site-footer a { color: rgba(255, 255, 255, 0.72); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-brand img { width: 84px; margin-bottom: var(--sp-4); }
.footer-phone {
	font-family: var(--font-heading); font-weight: 800; font-size: var(--step-2);
	color: #fff; text-decoration: none; display: inline-block; margin-block: var(--sp-2);
}
.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.1); padding-block: var(--sp-5);
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-4);
	font-size: 0.86rem;
}

/* ---- sticky mobile call bar ---------------------------------------------- */
.callbar { display: none; }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 960px) {
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.guarantee-inner { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
	.nav-toggle { display: block; }
	.nav { display: none; }
	.nav.open {
		display: block; position: absolute; top: 100%; left: 0; right: 0;
		background: #fff; border-bottom: 1px solid var(--line);
		box-shadow: var(--shadow); padding: var(--sp-5); max-height: 75vh; overflow-y: auto;
	}
	.nav.open .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
	.nav.open .nav-list > li > a { padding: var(--sp-4) 0; border-bottom: 1px solid var(--line); }
	/* accordion, not a floating panel: 14 services will not fit on a phone screen */
	.nav.open .mega {
		position: static; translate: none; opacity: 1; visibility: visible;
		box-shadow: none; border: 0; border-radius: 0;
		padding: 0 0 var(--sp-4) var(--sp-4);
		grid-template-columns: 1fr; gap: var(--sp-4);
		display: none;
	}
	.nav.open .has-sub.is-open > .mega { display: grid; }
	.nav.open .has-sub > a { justify-content: space-between; }
	.nav.open .has-sub > a .nav-caret { width: 12px; height: 12px; transition: rotate var(--speed) var(--ease); }
	.nav.open .has-sub.is-open > a .nav-caret { rotate: 180deg; }
	.nav .btn { margin-top: var(--sp-4); width: 100%; }
	.trust-item { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }

	.callbar {
		display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
		position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
		background: var(--line); box-shadow: 0 -4px 16px rgba(3, 32, 47, 0.18);
	}
	.callbar a {
		display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
		padding: 0.95rem; font-family: var(--font-heading); font-weight: 700;
		text-decoration: none; font-size: 0.95rem;
	}
	.callbar .call  { background: var(--navy-800); color: #fff; }
	.callbar .quote-cta { background: var(--red-600); color: #fff; }
	body { padding-bottom: 3.5rem; }
}

@media (max-width: 560px) {
	.footer-grid { grid-template-columns: 1fr; }
	.topbar-meta { gap: var(--sp-4); }
	.hero-actions .btn { width: 100%; }
}

/* ---- feature photo (owner / job spotlight) ------------------------------- */
.feature-photo { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.feature-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.feature-photo figcaption {
	position: absolute; inset-inline: 0; bottom: 0; padding: var(--sp-6) var(--sp-5) var(--sp-5);
	background: linear-gradient(to top, rgba(2, 21, 33, 0.92), rgba(2, 21, 33, 0));
	color: #fff;
}
.feature-photo figcaption strong {
	display: block; font-family: var(--font-heading); font-size: var(--step-2); line-height: 1.15;
}
.feature-photo .person-role { color: #fff; opacity: 0.85; }
.feature-note { display: block; margin-top: var(--sp-2); font-size: 0.9rem; color: rgba(255, 255, 255, 0.75); }

/* ==========================================================================
   Interior page components
   ========================================================================== */

.nav-list > li > a.is-current { color: var(--red-600); }

/* ---- page hero ----------------------------------------------------------- */
.page-hero { position: relative; background: var(--navy-800); color: #fff; overflow: hidden; }
.page-hero::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(95deg, var(--navy-900) 5%, rgba(3, 32, 47, 0.93) 55%, rgba(3, 32, 47, 0.6) 100%);
}
.page-hero-media { position: absolute; inset: 0; }
.page-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.page-hero-inner {
	position: relative; z-index: 2;
	padding-block: clamp(2rem, 1.2rem + 3.5vw, 4.5rem);
	max-width: 46rem;
}
.page-hero h1 { color: #fff; font-size: var(--step-5); }
.page-hero-lede { font-size: var(--step-1); color: rgba(255, 255, 255, 0.85); margin-top: var(--sp-4); }
.page-hero .hero-actions { margin-top: var(--sp-6); }

/* ---- breadcrumbs --------------------------------------------------------- */
.crumbs { margin-bottom: var(--sp-4); font-size: var(--step--1); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0; margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.45rem; color: rgba(255, 255, 255, 0.4); }
.crumbs a { color: rgba(255, 255, 255, 0.75); text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs [aria-current] { color: rgba(255, 255, 255, 0.55); }

/* ---- body + sticky rail -------------------------------------------------- */
.layout-aside { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: var(--sp-8); align-items: start; }

.prose > * + * { margin-top: var(--sp-4); }
.prose h2 { margin-top: var(--sp-7); font-size: var(--step-3); }
.prose h3 { font-size: var(--step-1); }
.prose p  { color: var(--text-muted); }
.prose .lede { color: var(--text); font-weight: 500; }
.prose a { font-weight: 500; }

.ticks { list-style: none; padding: 0; display: grid; gap: var(--sp-3); }
.ticks li { position: relative; padding-left: 1.9rem; color: var(--text-muted); }
.ticks li::before {
	content: ""; position: absolute; left: 0; top: 0.45em;
	width: 1.1rem; height: 0.6rem; border-left: 2.5px solid var(--red-600);
	border-bottom: 2.5px solid var(--red-600); rotate: -45deg;
}

.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: var(--sp-5); }
.steps li { position: relative; padding-left: 3.4rem; counter-increment: step; }
.steps li::before {
	content: counter(step); position: absolute; left: 0; top: 0;
	width: 2.4rem; height: 2.4rem; display: grid; place-items: center;
	background: var(--navy-800); color: #fff; border-radius: 50%;
	font-family: var(--font-heading); font-weight: 800; font-size: 0.95rem;
}
.steps h3 { margin-bottom: var(--sp-1); }
.steps p { color: var(--text-muted); }

.rail { position: sticky; top: 6.5rem; display: grid; gap: var(--sp-5); }
.rail-card {
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
	padding: var(--sp-5); box-shadow: var(--shadow-sm);
}
/* .rail-card .rail-title, not .rail-title: as a <p> it now also matches
   .rail-card > p (muted grey, 0.95rem), which outranked a single class and
   turned the title into body text. */
.rail-card .rail-title { font-size: var(--step-1); letter-spacing: -0.02em;
                         color: var(--navy-800); margin-bottom: var(--sp-2); }
.rail-card > p { color: var(--text-muted); font-size: 0.95rem; }
.rail-card-navy { background: var(--navy-800); border-color: var(--navy-800); color: rgba(255, 255, 255, 0.85); }
.rail-card-navy > p { color: rgba(255, 255, 255, 0.85); }
.rail-card-navy strong { color: #fff; }
.rail-badge {
	font-family: var(--font-heading); font-weight: 700; font-size: 0.72rem;
	letter-spacing: 0.12em; text-transform: uppercase; color: var(--red-500);
	margin-bottom: var(--sp-3);
}
.card-link-light { color: #fff; margin-top: var(--sp-4); display: inline-flex; }

/* ---- form ---------------------------------------------------------------- */
.quote-form { display: grid; gap: var(--sp-3); margin-top: var(--sp-4); }
.quote-form label { display: grid; gap: 0.3rem; }
.quote-form label > span {
	font-family: var(--font-heading); font-weight: 600; font-size: 0.82rem; color: var(--navy-800);
}
.quote-form input, .quote-form textarea {
	width: 100%; padding: 0.7rem 0.85rem; border: 1px solid var(--line);
	border-radius: var(--radius-sm); background: var(--surface-alt);
	transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.quote-form input:focus, .quote-form textarea:focus {
	outline: none; border-color: var(--red-600); background: #fff; box-shadow: var(--ring);
}
.quote-form textarea { resize: vertical; }
.form-note { font-size: 0.85rem; color: var(--ink-soft); text-align: center; margin-top: var(--sp-1); }

/* ---- feature quote ------------------------------------------------------- */
.quote-feature { border-left-width: 5px; padding: var(--sp-7); }
.quote-feature blockquote { font-size: var(--step-1); line-height: 1.5; }

@media (max-width: 900px) {
	.layout-aside { grid-template-columns: 1fr; gap: var(--sp-7); }
	.rail { position: static; }
}

/* ==========================================================================
   Blog, contact and shared interior bits
   ========================================================================== */

/* plain (image-less) page hero */
.page-hero-plain { background: var(--navy-800); }
.page-hero-plain::after { display: none; }
.page-hero-plain h1 { font-size: var(--step-4); }

/* ---- mini cards (service links inside prose) ----------------------------- */
.mini-card {
	display: grid; gap: 0.3rem; text-decoration: none;
	background: var(--surface-alt); border: 1px solid var(--line);
	border-radius: var(--radius); padding: var(--sp-4) var(--sp-5);
	transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease),
	            transform var(--speed) var(--ease);
}
.mini-card:hover { background: #fff; border-color: var(--red-600); transform: translateY(-2px); }
.mini-card strong { font-family: var(--font-heading); color: var(--navy-800); font-size: 1.02rem; }
.mini-card span { color: var(--text-muted); font-size: 0.92rem; }

/* ---- blog ---------------------------------------------------------------- */
.post-feature {
	display: grid; grid-template-columns: 1.1fr 1fr; gap: 0;
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
	overflow: hidden; text-decoration: none;
	transition: box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.post-feature:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.post-feature-media { overflow: hidden; }
.post-feature-media img { width: 100%; height: 100%; object-fit: cover; min-height: 260px; }
.post-feature-body { padding: var(--sp-7); display: flex; flex-direction: column; justify-content: center; gap: var(--sp-3); }
.post-feature-body h2 { font-size: var(--step-3); }
.post-feature-body p { color: var(--text-muted); }

.post-meta {
	font-family: var(--font-heading); font-weight: 700; font-size: 0.72rem;
	letter-spacing: 0.12em; text-transform: uppercase; color: var(--red-600);
}
.post-byline { color: rgba(255, 255, 255, 0.65); font-size: var(--step--1); margin-top: var(--sp-4); }
.post-hero { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--sp-6); }
.post-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.prose-article { max-width: 68ch; }

.pager {
	display: flex; gap: var(--sp-2); justify-content: center; align-items: center;
	margin-top: var(--sp-8);
}
.pager a, .pager-current {
	display: grid; place-items: center; min-width: 2.6rem; height: 2.6rem; padding-inline: 0.8rem;
	border: 1px solid var(--line); border-radius: var(--radius-sm);
	font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem;
	color: var(--navy-800); text-decoration: none;
}
.pager a:hover { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.pager-current { background: var(--red-600); color: #fff; border-color: var(--red-600); }

.rail-links { list-style: none; padding: 0; margin: var(--sp-3) 0 0; display: grid; gap: 0.6rem; }
.rail-links a { color: var(--navy-800); text-decoration: none; font-size: 0.95rem; }
.rail-links a:hover { color: var(--red-600); text-decoration: underline; }

/* ---- contact ------------------------------------------------------------- */
.contact-card {
	display: grid; gap: 0.3rem; justify-items: start; text-decoration: none;
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
	padding: var(--sp-6);
	transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
	            transform var(--speed) var(--ease);
}
.contact-card:not(.contact-card-static):hover {
	border-color: var(--red-600); box-shadow: var(--shadow); transform: translateY(-3px);
}
.contact-card svg { width: 30px; height: 30px; fill: var(--red-600); margin-bottom: var(--sp-2); }
.contact-card strong {
	font-family: var(--font-heading); font-size: 0.75rem; letter-spacing: 0.12em;
	text-transform: uppercase; color: var(--ink-soft);
}
.contact-value { font-family: var(--font-heading); font-weight: 800; font-size: var(--step-1); color: var(--navy-800); }
.contact-note { color: var(--text-muted); font-size: 0.9rem; }

.hours { list-style: none; padding: 0; margin: var(--sp-3) 0 0; display: grid; gap: 0.5rem; }
.hours li { display: flex; justify-content: space-between; gap: var(--sp-4); font-size: 0.95rem; }
.hours span { color: var(--text-muted); }
.hours strong { font-family: var(--font-heading); color: var(--navy-800); }

.quote-form-wide { gap: var(--sp-4); margin-top: var(--sp-5); max-width: 42rem; }
.quote-form-wide .btn { justify-self: start; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.quote-form select {
	width: 100%; padding: 0.7rem 0.85rem; border: 1px solid var(--line);
	border-radius: var(--radius-sm); background: var(--surface-alt);
}
.quote-form select:focus { outline: none; border-color: var(--red-600); background: #fff; box-shadow: var(--ring); }

@media (max-width: 860px) {
	.post-feature { grid-template-columns: 1fr; }
	.post-feature-media img { min-height: 200px; }
}
@media (max-width: 560px) {
	.field-row { grid-template-columns: 1fr; }
}

/* ---- submenu toggle ------------------------------------------------------ */
/* Desktop opens on hover, so the button is decorative there; on touch and
   narrow screens it becomes the real control. */
.has-sub { display: flex; align-items: center; gap: 0.25rem; }
.sub-toggle {
	background: none; border: 0; padding: 0.35rem; cursor: pointer;
	color: var(--navy-800); display: inline-flex; align-items: center;
}
.sub-toggle:hover { color: var(--red-600); }

@media (max-width: 1100px) {
	.nav.open .has-sub { flex-wrap: wrap; justify-content: space-between; }
	.nav.open .has-sub > a { flex: 1; border-bottom: 0; }
	.nav.open .has-sub { border-bottom: 1px solid var(--line); }
	.nav.open .sub-toggle { padding: var(--sp-4) 0 var(--sp-4) var(--sp-4); }
	.nav.open .sub-toggle .nav-caret { width: 13px; height: 13px; transition: rotate var(--speed) var(--ease); }
	.nav.open .has-sub.is-open .sub-toggle .nav-caret { rotate: 180deg; }
	.nav.open .mega { flex-basis: 100%; }
}

/* ---- trust badge strip (Shared: Trust Badges module) --------------------- */
.badges { background: var(--surface-alt); border-top: 1px solid var(--line); }
.badge-row {
	list-style: none; margin: 0; padding: var(--sp-6) 0;
	display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-5);
	text-align: center;
}
.badge-row strong {
	display: block; font-family: var(--font-heading); font-weight: 800;
	color: var(--navy-800); font-size: 1.02rem;
}
.badge-row span { display: block; color: var(--text-muted); font-size: 0.9rem; margin-top: 0.2rem; }

/* ---- Joomla pagination ---------------------------------------------------
   getPagesLinks() emits <nav class="pagination__wrapper"><ul class="pagination">
   <li class="page-item"><a class="page-link">. Styling only .pager left this as
   a bulleted vertical list. Cassiopeia's FontAwesome is NOT loaded in this
   child template, so the arrow icons rendered as empty boxes — they are given
   text glyphs below rather than pulling in an icon font for four characters. */
.pagination__wrapper { margin-top: var(--sp-8); }

.pagination {
	display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center;
	list-style: none; padding: 0; margin: 0;
}
.pagination .page-item { margin: 0; }

/* on page 1 the first/prev controls are disabled and empty — hide rather than
   show two dead boxes */
.pagination .page-item.disabled { display: none; }

.pagination .page-link {
	display: grid; place-items: center;
	min-width: 2.6rem; height: 2.6rem; padding-inline: 0.8rem;
	border: 1px solid var(--line); border-radius: var(--radius-sm);
	font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem;
	color: var(--navy-800); text-decoration: none;
	transition: background var(--speed) var(--ease), color var(--speed) var(--ease),
	            border-color var(--speed) var(--ease);
}
a.page-link:hover { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.pagination .page-item.active .page-link,
.pagination .page-link[aria-current] {
	background: var(--red-600); color: #fff; border-color: var(--red-600);
}

/* text arrows in place of the missing icon font */
.pagination [class^="icon-"], .pagination [class*=" icon-"] { font-style: normal; line-height: 1; }
.pagination .icon-angle-double-left::before  { content: "\00AB"; }
.pagination .icon-angle-left::before         { content: "\2039"; }
.pagination .icon-angle-right::before        { content: "\203A"; }
.pagination .icon-angle-double-right::before { content: "\00BB"; }

/* Joomla ships Bootstrap utility classes on the list; neutralise the ones that
   fight our spacing */
.pagination.ms-0 { margin-inline-start: 0; }
.pagination.mb-4 { margin-bottom: 0; }

/* ---- plain dropdown (About, Service Areas, Financing) -------------------- */
/* Services needs three grouped columns for 14 items; 3-6 children read better
   as one plain column. */
.mega.mega-plain {
	grid-template-columns: minmax(200px, 1fr);
	padding: var(--sp-4);
	left: 0;
	translate: 0 8px;
}
@media (hover: hover) and (min-width: 1101px) {
	.nav-list > li:hover .mega.mega-plain,
	.nav-list > li:focus-within .mega.mega-plain { translate: 0 0; }
}
.mega-plain .mega-col a { padding: 0.5rem 0.6rem; font-size: 0.95rem; }

/* ---- text-only hub cards ------------------------------------------------- */
/* Used where no honest photo exists — warranties, guarantees, referrals. */
.card-text { border-left: 3px solid var(--red-600); }
.card-text .card-body { padding: var(--sp-6) var(--sp-5); }

/* Top-level nav labels must not wrap — "Service Areas" was breaking across two
   lines and pushing its caret away from the text. */
.nav-list > li > a { white-space: nowrap; }
.nav-list > li.has-sub { flex-wrap: nowrap; }

/* ---- image gallery -------------------------------------------------------
   The imported WordPress bodies stacked full-width photos vertically - eight
   in a row on /about/why-choose-us - so the copy started two screens down.
   BsrTemplate::galleries() collapses any run of 2+ images into this strip.

   It is a plain scroll-snap container, so it swipes on touch and scrolls with
   shift+wheel WITHOUT JavaScript. site.js adds arrows and a counter on top;
   with JS blocked you lose the buttons, not the photos. */
.gallery { position: relative; margin: var(--sp-6) 0; container-type: inline-size; }

.gallery-track {
	display: flex;
	gap: var(--sp-3);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	border-radius: var(--radius);
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track:focus-visible { outline: 2px solid var(--red-600); outline-offset: 3px; }

.gallery-item {
	flex: 0 0 100%;
	scroll-snap-align: start;
	margin: 0;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--navy-100);
}
/* Two photos per view wherever the column can take them, sized so a pair fits
   exactly. The old fixed 420px basis overflowed an ~820px column by ~36px, so
   site.js showed arrows that could only scroll those few pixels. */
@container (min-width: 560px) {
	.gallery-item { flex-basis: calc((100% - var(--sp-3)) / 2); }
}
.gallery-item img {
	width: 100%;
	height: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
}

/* Arrows are injected by site.js, so they only exist when they can work. */
.gallery-nav {
	position: absolute;
	top: 50%;
	translate: 0 -50%;
	z-index: 2;
	width: 2.75rem;
	height: 2.75rem;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: var(--navy-900);
	color: #fff;
	cursor: pointer;
	opacity: 0.9;
	transition: opacity var(--speed) var(--ease), scale var(--speed) var(--ease);
}
.gallery-nav:hover { opacity: 1; scale: 1.06; }
.gallery-nav[disabled] { opacity: 0; pointer-events: none; }
.gallery-prev { left: var(--sp-3); }
.gallery-next { right: var(--sp-3); }
.gallery-nav::before { font-size: 1.1rem; line-height: 1; }
.gallery-prev::before { content: "\2039"; }
.gallery-next::before { content: "\203A"; }

/* Set by site.js when every photo is already in view. */
.gallery--static .gallery-count { display: none; }

.gallery-count {
	margin-top: var(--sp-2);
	font-size: 0.85rem;
	color: var(--text-muted);
	text-align: right;
}

/* ---- team cards ----------------------------------------------------------
   /about/team was five full-bleed portraits each stacked above its own bio,
   which ran to roughly five screens. Same content, one scannable grid. */
.team-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: var(--sp-5);
	margin: var(--sp-6) 0;
}

.team-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	overflow: hidden;
	transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.team-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.team-photo { aspect-ratio: 1 / 1; overflow: hidden; background: var(--navy-100); }
.team-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.team-photo img { object-position: center 60%; }   /* was: top center */

.team-body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); }
.team-body h3 { font-size: var(--step-2); }
.team-body p { font-size: 0.95rem; color: var(--text-muted); }
.team-role {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 0.8rem !important;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--red-600) !important;
}

/* ---- branded placeholder tile --------------------------------------------
   A card with no honest photo keeps its media box and shows the logo mark on
   navy. Dropping the box instead made the card look like a failed image load
   - the gap in the Services grid was reported as a bug within a minute.
   Remove a tile by adding that alias to BsrTemplate::IMAGES. */
.card-media-brand {
	display: grid;
	place-items: center;
	background:
		radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.06), transparent 60%),
		var(--navy-900);
}
.card-media-brand img {
	width: auto;
	height: auto;
	max-width: 58%;
	max-height: 46%;
	object-fit: contain;
	opacity: 0.85;
	transition: none;
}
.card:hover .card-media-brand img { scale: 1; }

/* ---- nav fit -------------------------------------------------------------
   Eight top-level items, a two-word one among them, plus a 200px CTA. At the
   old 860px breakpoint the desktop bar was asked to do that from 861px up, so
   "Service Areas" wrapped onto a second line and dragged its caret with it.

   Two changes: the hamburger now takes over below 1100px, and in the band
   between there and a roomy desktop the bar tightens instead of breaking.
   nowrap is the backstop - a label may be cramped, never split. */
.nav-list > li > a { white-space: nowrap; }
.nav-list > li.has-sub { flex-wrap: nowrap; }
.header-inner { flex-wrap: nowrap; }

@media (min-width: 1101px) and (max-width: 1320px) {
	.nav-list { gap: var(--sp-3); }
	.nav-list > li > a { font-size: 0.9rem; }
	.brand img { width: 52px; }
	.brand-name { font-size: 0.95rem; }
	.nav > .btn { padding-inline: var(--sp-4); font-size: 0.88rem; }
}

/* ---- instant estimator ---------------------------------------------------
   Roofr's address-lookup tool on /free-inspection. It is a whole third-party
   app in an iframe, so it gets a fixed aspect on mobile and a tall fixed
   height on desktop - its internal six-step flow needs the room, and an
   iframe cannot size itself to its content across origins.

   Rendered from the template, not the article body: TinyMCE strips iframes
   and would delete it on the first save. See BsrTemplate::ROOFR_EMBED. */
.estimator { margin: var(--sp-7) 0 var(--sp-6); }
.estimator h2 { margin-bottom: var(--sp-3); }
.estimator > p { color: var(--text-muted); margin-bottom: var(--sp-5); }

.estimator-frame {
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	overflow: hidden;
	background: var(--surface-alt);
}
.estimator-frame iframe {
	display: block;
	width: 100%;
	height: 760px;
	border: 0;
}
@media (max-width: 680px) {
	.estimator-frame iframe { height: 620px; }
}

/* ---- homepage hero heading -----------------------------------------------
   The H1 and the big display line swapped roles. The slogan used to BE the
   h1, which spent the strongest heading on the site on a sentence naming
   neither the service nor the place. Now the h1 carries "Roofers in Sugar
   Land & Missouri City, TX" and the slogan keeps every bit of its visual
   weight directly underneath, so the page reads exactly as before. */
.hero-h1 {
	font-size: var(--step-2);
	font-weight: 700;
	letter-spacing: 0.01em;
	color: rgba(255, 255, 255, 0.92);
	margin-bottom: var(--sp-2);
}

.hero-slogan {
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: var(--step-6);
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: #fff;
	text-wrap: balance;
}
.hero-slogan em { font-style: normal; color: var(--red-500); }

/* ---- RSForm! Pro ---------------------------------------------------------
   Scoped to #userForm, which RSForm uses for every form it renders, so this
   covers the contact form and the inspection request without touching
   anything else.

   An ID also wins cleanly over the Bootstrap that RSForm drags in: its
   .form-control and .btn rules are class-level, so there is no !important
   here and none needed.

   The card is the point - the form used to run straight on from the body copy
   with nothing marking where the page stops talking and starts asking. */
#userForm {
	background: var(--surface-alt);
	border: 1px solid var(--line);
	border-top: 3px solid var(--red-600);
	border-radius: var(--radius-lg);
	padding: var(--sp-6);
	margin: var(--sp-6) 0;
	box-shadow: var(--shadow-sm);
}

/* The grid RSForm's Bootstrap 5 layout expects. Bootstrap itself is kept off
   the page (see index.php), so these few classes are supplied here, scoped to
   the form: one column on phones, the form's own 2- and 3-up rows from 768px. */
#userForm .row {
	display: flex;
	flex-wrap: wrap;
	margin-inline: calc(var(--sp-5) / -2);
}
#userForm .row > [class*="col-"] {
	flex: 0 0 100%;
	max-width: 100%;
	padding-inline: calc(var(--sp-5) / 2);
}
/* .row > .col-md-x, not .col-md-x: the base rule above carries an attribute
   selector, so a bare class lost to it and every field stayed full width. */
@media (min-width: 768px) {
	#userForm .row > .col-md-12 { flex-basis: 100%;     max-width: 100%; }
	#userForm .row > .col-md-6  { flex-basis: 50%;      max-width: 50%; }
	#userForm .row > .col-md-4  { flex-basis: 33.3333%; max-width: 33.3333%; }
}
#userForm .mb-3 { margin-bottom: var(--sp-4); }

/* Section headers RSForm emits as free-text blocks ("Your Contact
   Information", "Your Address"). */
#userForm .rsform-type-freetext h3 {
	font-size: var(--step-1);
	margin: var(--sp-6) 0 var(--sp-4);
	padding-bottom: var(--sp-2);
	border-bottom: 1px solid var(--line);
}
#userForm #rsform_4_page_0 > .row:first-child .rsform-type-freetext h3,
#userForm #rsform_3_page_0 > .row:first-child .rsform-type-freetext h3 { margin-top: 0; }

#userForm .formControlLabel {
	display: block;
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 0.88rem;
	color: var(--navy-800);
	margin-bottom: var(--sp-2);
}
#userForm .formRequired {
	color: var(--red-600);
	font-weight: 700;
	margin-left: 0.2rem;
}

#userForm .form-control {
	width: 100%;
	padding: 0.72rem 0.85rem;
	font: inherit;
	color: var(--text);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
#userForm .form-control:focus {
	outline: none;
	border-color: var(--red-600);
	box-shadow: var(--ring);
}
#userForm textarea.form-control { min-height: 9rem; resize: vertical; }

#userForm .rsform-submit-button { margin-top: var(--sp-2); }

/* RSForm's own validation messages, which otherwise arrive unstyled. */
#userForm .formNoError { display: none; }
#userForm .formError,
#userForm .rsform-error-message {
	color: var(--red-700);
	font-size: 0.85rem;
	margin-top: var(--sp-2);
}

@media (max-width: 560px) {
	#userForm { padding: var(--sp-5) var(--sp-4); }
}
