/*
Theme Name: Pro Home Insulation
Theme URI: https://prohomeinsulation.com/
Author: CastGlobe
Author URI: https://castglobe.com/
Description: Fast, text-first theme for Pro Home Insulation. Includes a one-click setup (Appearance → Pro Home Setup) that creates all service, rebate, city and guide pages, menus, SEO titles, meta descriptions, schema, llms.txt and a lead form.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: prohome
*/

/* ---------- Tokens ---------- */
:root {
	--ph-navy: #0e2a3b;
	--ph-navy-2: #16394f;
	--ph-green: #23803a;
	--ph-green-dark: #1b6a2f;
	--ph-green-soft: #e9f5ec;
	--ph-amber: #f4b400;
	--ph-ink: #1c2b36;
	--ph-muted: #5a6b77;
	--ph-line: #dbe4ea;
	--ph-bg: #f5f8fa;
	--ph-white: #fff;
	--ph-radius: 10px;
	--ph-shadow: 0 6px 24px rgba(14, 42, 59, .08);
	--ph-max: 1180px;
	--ph-read: 760px;
	--ph-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--ph-font); font-size: 17px; line-height: 1.65; color: var(--ph-ink); background: var(--ph-white); }
img { max-width: 100%; height: auto; }
a { color: var(--ph-green-dark); text-underline-offset: 2px; }
a:hover { color: var(--ph-navy); }
h1, h2, h3, h4 { color: var(--ph-navy); line-height: 1.25; margin: 1.6em 0 .55em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); margin-top: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--ph-amber); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto; background: #fff; padding: 10px 14px; border-radius: 6px; }
.ph-container { width: 100%; max-width: var(--ph-max); margin: 0 auto; padding: 0 20px; }

/* ---------- Buttons ---------- */
.ph-btn { white-space: nowrap; display: inline-flex; align-items: center; gap: .5em; padding: .8em 1.3em; border-radius: 999px; font-weight: 700; text-decoration: none; border: 2px solid transparent; transition: background .15s, color .15s, border-color .15s; line-height: 1.2; }
.ph-btn--primary { background: var(--ph-green); color: #fff; }
.ph-btn--primary:hover { background: var(--ph-green-dark); color: #fff; }
.ph-btn--ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.ph-btn--ghost:hover { background: #fff; color: var(--ph-navy); }
.ph-btn--outline { border-color: var(--ph-green); color: var(--ph-green-dark); background: #fff; }
.ph-btn--outline:hover { background: var(--ph-green); color: #fff; }
.ph-btn--block { width: 100%; justify-content: center; }

/* ---------- Top bar ---------- */
.ph-topbar { background: var(--ph-navy); color: #dfe9ef; font-size: .9rem; }
.ph-topbar .ph-container { display: flex; justify-content: space-between; gap: 12px; padding-top: 7px; padding-bottom: 7px; flex-wrap: wrap; }
.ph-topbar a { color: #fff; font-weight: 600; }
.ph-topbar__badge { background: var(--ph-amber); color: var(--ph-navy); font-weight: 800; border-radius: 4px; padding: 0 6px; margin-right: 6px; }

/* ---------- Header ---------- */
.ph-header { background: #fff; border-bottom: 1px solid var(--ph-line); position: sticky; top: 0; z-index: 50; }
.ph-header .ph-container, .ph-topbar .ph-container { max-width: 1340px; }
.ph-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 74px; }
.ph-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ph-navy); font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; }
.ph-logo__mark { width: 38px; height: 38px; border-radius: 9px; background: var(--ph-green); display: grid; place-items: center; color: #fff; font-size: 1.1rem; }
.ph-logo > span:last-child { white-space: nowrap; }
.ph-logo small { display: block; font-size: .72rem; font-weight: 600; color: var(--ph-muted); letter-spacing: .02em; }
.custom-logo { max-height: 56px; width: auto; }
.ph-header__cta { display: flex; align-items: center; gap: 12px; }
.ph-phone { font-weight: 800; color: var(--ph-navy); text-decoration: none; white-space: nowrap; }
.ph-phone span { display: block; font-size: .72rem; font-weight: 600; color: var(--ph-muted); }

/* Nav */
.ph-nav ul { list-style: none; margin: 0; padding: 0; }
.ph-nav > ul { display: flex; gap: 2px; }
.ph-nav li { position: relative; }
.ph-nav a { white-space: nowrap; display: flex; align-items: center; padding: .55em .8em; color: var(--ph-navy); text-decoration: none; font-weight: 600; border-radius: 6px; font-size: .97rem; }
.ph-nav a:hover, .ph-nav .current-menu-item > a, .ph-nav .current-menu-ancestor > a { background: var(--ph-green-soft); color: var(--ph-green-dark); }
.ph-nav .menu-item-has-children > a::after { content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.ph-nav .sub-menu { position: absolute; top: 100%; left: 0; min-width: 260px; background: #fff; border: 1px solid var(--ph-line); border-radius: var(--ph-radius); box-shadow: var(--ph-shadow); padding: 8px; display: none; z-index: 60; }
.ph-nav li:hover > .sub-menu, .ph-nav li:focus-within > .sub-menu { display: block; }
.ph-nav .sub-menu a { font-weight: 500; }
.ph-menu-toggle { display: none; background: none; border: 2px solid var(--ph-line); border-radius: 8px; padding: 8px 12px; font-weight: 700; color: var(--ph-navy); cursor: pointer; }

/* ---------- Hero (front page) ---------- */
.ph-hero { background: linear-gradient(135deg, var(--ph-navy) 0%, var(--ph-navy-2) 60%, #1d5a45 100%); color: #e8f0f4; padding: 64px 0 56px; }
.ph-hero h1 { color: #fff; max-width: 820px; }
.ph-hero__lead { font-size: 1.15rem; max-width: 720px; margin-bottom: 1.6em; }
.ph-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.ph-trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px; }
.ph-trust div { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: var(--ph-radius); padding: 14px 16px; }
.ph-trust strong { display: block; color: #fff; font-size: 1.25rem; }
.ph-trust span { font-size: .9rem; }

/* ---------- Sections ---------- */
.ph-section { padding: 56px 0; }
.ph-section--alt { background: var(--ph-bg); }
.ph-section__head { max-width: 720px; margin-bottom: 26px; }
.ph-section__head h2 { margin-top: 0; }
.ph-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.ph-card { background: #fff; border: 1px solid var(--ph-line); border-radius: var(--ph-radius); padding: 20px; text-decoration: none; color: var(--ph-ink); transition: box-shadow .15s, transform .15s, border-color .15s; display: block; }
.ph-card:hover { box-shadow: var(--ph-shadow); transform: translateY(-2px); border-color: var(--ph-green); color: var(--ph-ink); }
.ph-card h3 { margin: 0 0 .35em; font-size: 1.08rem; }
.ph-card p { margin: 0; color: var(--ph-muted); font-size: .95rem; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-chips a { background: #fff; border: 1px solid var(--ph-line); border-radius: 999px; padding: .4em .95em; text-decoration: none; color: var(--ph-navy); font-weight: 600; font-size: .95rem; }
.ph-chips a:hover { border-color: var(--ph-green); color: var(--ph-green-dark); }

/* ---------- Page header ---------- */
.ph-pagehead { background: var(--ph-bg); border-bottom: 1px solid var(--ph-line); padding: 34px 0 30px; }
.ph-pagehead h1 { margin-bottom: .3em; }
.ph-breadcrumb { font-size: .88rem; color: var(--ph-muted); margin-bottom: 12px; }
.ph-breadcrumb a { color: var(--ph-muted); }
.ph-breadcrumb span[aria-hidden] { margin: 0 6px; }
.ph-meta { font-size: .9rem; color: var(--ph-muted); }

/* ---------- Layout ---------- */
.ph-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; padding: 40px 20px 64px; }
.ph-layout--full { grid-template-columns: minmax(0, 1fr); max-width: calc(var(--ph-read) + 40px); }
.ph-content { min-width: 0; max-width: var(--ph-read); }
.ph-sidebar { position: relative; }
.ph-sidebar__sticky { position: sticky; top: 100px; display: grid; gap: 16px; }

/* ---------- Entry content ---------- */
.ph-content > *:first-child { margin-top: 0; }
.ph-content h2 { padding-top: .2em; border-top: 1px solid var(--ph-line); padding-top: 1.1em; }
.ph-content h2:first-of-type { border-top: 0; padding-top: 0; }
.ph-content h2, .ph-content h3 { scroll-margin-top: 100px; }
.ph-content ul, .ph-content ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.ph-content li { margin-bottom: .45em; }
.ph-content ol > li::marker { color: var(--ph-green); font-weight: 800; }
.ph-content blockquote { margin: 0 0 1.6em; }
.ph-quick-answer { background: var(--ph-green-soft); border: 1px solid #cfe7d6; border-left: 5px solid var(--ph-green); border-radius: var(--ph-radius); padding: 18px 22px; font-size: 1.05rem; }
.ph-quick-answer p:last-child { margin-bottom: 0; }
.ph-quick-answer em { color: var(--ph-muted); }
.ph-content blockquote:not(.ph-quick-answer) { border-left: 4px solid var(--ph-line); padding: 4px 18px; color: var(--ph-muted); }

/* Checklists */
.ph-content li.ph-check { list-style: none; position: relative; padding-left: 1.9em; margin-left: -1.3em; }
.ph-content li.ph-check::before { content: ""; position: absolute; left: 0; top: .25em; width: 1.1em; height: 1.1em; border: 2px solid var(--ph-green); border-radius: 4px; background: #fff; }

/* Tables */
.ph-table-wrap { overflow-x: auto; margin: 0 0 1.6em; border: 1px solid var(--ph-line); border-radius: var(--ph-radius); -webkit-overflow-scrolling: touch; }
.ph-table-wrap table { margin: 0; border: 0; }
.ph-content table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 520px; }
.ph-content th, .ph-content td { padding: .7em .9em; text-align: left; border-bottom: 1px solid var(--ph-line); vertical-align: top; }
.ph-content th { background: var(--ph-navy); color: #fff; font-weight: 700; }
.ph-content tr:nth-child(even) td { background: var(--ph-bg); }
.ph-content tr:last-child td { border-bottom: 0; }

/* FAQ block styling (h3 questions after the FAQ heading) */
.ph-faq-q { background: #fff; border: 1px solid var(--ph-line); border-radius: 8px 8px 0 0; padding: .75em 1em; margin: 1.2em 0 0; font-size: 1.05rem; }
.ph-faq-q + p { border: 1px solid var(--ph-line); border-top: 0; border-radius: 0 0 8px 8px; padding: .8em 1em; background: var(--ph-bg); }

/* Table of contents */
.ph-toc { border: 1px solid var(--ph-line); border-radius: var(--ph-radius); padding: 12px 18px; margin: 0 0 1.8em; background: #fff; }
.ph-toc summary { font-weight: 700; color: var(--ph-navy); cursor: pointer; }
.ph-toc ol { margin: .7em 0 .2em; padding-left: 1.3em; columns: 2; column-gap: 28px; font-size: .95rem; }
.ph-toc li { break-inside: avoid; }

/* ---------- Sidebar widgets ---------- */
.ph-box { background: #fff; border: 1px solid var(--ph-line); border-radius: var(--ph-radius); padding: 20px; }
.ph-box h3 { margin: 0 0 .5em; font-size: 1.1rem; }
.ph-box p { font-size: .95rem; }
.ph-box ul { list-style: none; padding: 0; margin: 0; font-size: .95rem; }
.ph-box li { padding: .35em 0; border-bottom: 1px solid var(--ph-line); }
.ph-box li:last-child { border-bottom: 0; }
.ph-box--cta { background: var(--ph-navy); color: #e3edf2; border: 0; }
.ph-box--cta h3 { color: #fff; }
.ph-box--cta .ph-phone-big { display: block; font-size: 1.5rem; font-weight: 800; color: #fff; text-decoration: none; margin: .2em 0 .7em; }
.ph-box--rebate { background: #fffbeb; border-color: #f6dc8a; }
.ph-box--rebate strong.ph-big { font-size: 2rem; color: var(--ph-navy); display: block; line-height: 1.1; }

/* ---------- CTA band ---------- */
.ph-ctaband { background: var(--ph-green); color: #fff; padding: 44px 0; }
.ph-ctaband .ph-container { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.ph-ctaband h2 { color: #fff; margin: 0 0 .2em; }
.ph-ctaband p { margin: 0; color: #e7f5ea; }
.ph-ctaband .ph-btn--primary { background: #fff; color: var(--ph-green-dark); }
.ph-ctaband .ph-btn--primary:hover { background: var(--ph-navy); color: #fff; }

/* ---------- Footer ---------- */
.ph-footer { background: var(--ph-navy); color: #c4d3dc; font-size: .94rem; padding: 52px 0 0; }
.ph-footer a { color: #e8f0f4; text-decoration: none; }
.ph-footer a:hover { color: #fff; text-decoration: underline; }
.ph-footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.6fr; gap: 32px; }
.ph-footer h4 { color: #fff; margin: 0 0 .8em; font-size: 1rem; }
.ph-footer ul { list-style: none; margin: 0; padding: 0; }
.ph-footer li { margin-bottom: .4em; }
.ph-footer__areas ul { columns: 2; column-gap: 18px; }
.ph-footer__bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 40px; padding: 18px 0 90px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .85rem; }

/* ---------- Mobile call bar ---------- */
.ph-callbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: #fff; border-top: 1px solid var(--ph-line); box-shadow: 0 -4px 18px rgba(0,0,0,.08); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 10px; }
.ph-callbar a { flex: 1; justify-content: center; }

/* ---------- Forms ---------- */
.ph-form { display: grid; gap: 14px; background: var(--ph-bg); border: 1px solid var(--ph-line); border-radius: var(--ph-radius); padding: 22px; margin: 0 0 1.6em; }
.ph-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ph-form label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; color: var(--ph-navy); }
.ph-form input, .ph-form select, .ph-form textarea { width: 100%; padding: .7em .8em; border: 1px solid #c3d0d8; border-radius: 8px; font: inherit; background: #fff; }
.ph-form textarea { min-height: 120px; }
.ph-form .ph-hp { position: absolute; left: -9999px; }
.ph-form small { color: var(--ph-muted); }
.ph-notice { padding: 14px 18px; border-radius: 8px; margin: 0 0 1.4em; font-weight: 600; }
.ph-notice--ok { background: var(--ph-green-soft); color: var(--ph-green-dark); border: 1px solid #bfe0c8; }
.ph-notice--err { background: #fdecec; color: #9b1c1c; border: 1px solid #f3c2c2; }

/* ---------- Posts / archive ---------- */
.ph-post-list { display: grid; gap: 18px; }
.ph-post-list article { border-bottom: 1px solid var(--ph-line); padding-bottom: 18px; }
.ph-post-list h2 { margin: 0 0 .3em; font-size: 1.3rem; border: 0; padding: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
	.ph-header__cta .ph-btn { display: none; }
}
@media (max-width: 1280px) {
	.ph-phone span { display: none; }
	.ph-nav a { padding: .5em .6em; }
}
@media (max-width: 1080px) {
	.ph-layout { grid-template-columns: minmax(0, 1fr); }
	.ph-sidebar__sticky { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
	.ph-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
	.ph-menu-toggle { display: inline-block; }
	.ph-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--ph-line); box-shadow: var(--ph-shadow); max-height: calc(100vh - 120px); overflow: auto; }
	.ph-nav.is-open { display: block; }
	.ph-nav > ul { flex-direction: column; padding: 10px 20px 20px; }
	.ph-nav .sub-menu { position: static; display: block; box-shadow: none; border: 0; padding: 0 0 0 14px; min-width: 0; }
	.ph-nav .menu-item-has-children > a::after { display: none; }
	.ph-header__cta .ph-btn { display: none; }
	.ph-trust { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
	body { font-size: 16px; }
	.ph-topbar .ph-container > span:last-child { display: none; }
	.ph-header__cta .ph-phone { display: none; }
	.ph-logo { font-size: 1.1rem; }
	.ph-logo small { display: none; }
	.ph-header__inner { min-height: 62px; }
	.ph-callbar .ph-btn { padding: .75em .8em; font-size: .95rem; }
	.ph-hero { padding: 44px 0 40px; }
	.ph-form__row { grid-template-columns: 1fr; }
	.ph-toc ol { columns: 1; }
	.ph-footer__grid { grid-template-columns: 1fr; }
	.ph-callbar { display: flex; }
	.ph-layout { padding-top: 28px; }
}
@media print {
	.ph-topbar, .ph-header, .ph-sidebar, .ph-callbar, .ph-footer, .ph-ctaband { display: none !important; }
}
