/*
Theme Name: Fort Worth HVAC Service
Theme URI: https://fortworthhvacservice.com
Author: Fort Worth HVAC Service
Description: Premium native WordPress theme for a local HVAC lead-generation website. Pure PHP, no page builders, no build step, no frameworks. Optimized for conversion (phone calls), trust/E-E-A-T, speed, and SEO.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: fwhvac
*/

/* ==========================================================================
   1. CSS CUSTOM PROPERTIES
   ========================================================================== */
:root {
    --navy: #1B2A4A;
    --accent: #E8552F;
    --accent-dark: #C74523;
    --bg: #FFFFFF;
    --bg-alt: #F6F7F9;
    --text: #26303B;
    --muted: #5B6B7C;
    --success: #1E8E5A;
    --border: #E6EAF0;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;

    --h1-size: clamp(1.9rem, 4vw, 2.7rem);
    --h2-size: clamp(1.5rem, 3vw, 2rem);
    --h3-size: 1.2rem;
    --body-size: 1.06rem;
    --small-size: 0.92rem;

    --radius-btn: 8px;
    --radius-card: 12px;

    --section-padding: clamp(3rem, 7vw, 5.5rem);
    --card-padding: 1.5rem;
    --gap: 1.25rem;

    --transition: 180ms ease;
    --max-text-width: 68ch;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--body-size);
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    padding-bottom: 56px; /* space for sticky call bar on mobile */
}

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

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; margin: 0 0 0.6em; font-weight: 700; }
h1 { font-size: var(--h1-size); font-weight: 800; }
h2 { font-size: var(--h2-size); }
h3 { font-size: var(--h3-size); }

p { margin: 0 0 1em; max-width: var(--max-text-width); }

.container p { max-width: var(--max-text-width); }

ul, ol { padding-left: 1.25em; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.section {
    padding: var(--section-padding) 0;
}

.section-alt {
    background: var(--bg-alt);
}

.small { font-size: var(--small-size); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }

/* Skip link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--navy);
    color: #fff;
    padding: 0.75em 1.25em;
    z-index: 10000;
    border-radius: 0 0 8px 0;
}
.skip-link:focus {
    left: 0;
}

/* Focus visibility (AA) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ==========================================================================
   3. BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: 48px;
    padding: 0.75em 1.5em;
    border-radius: var(--radius-btn);
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-dark);
    color: #fff;
    box-shadow: 0 6px 16px rgba(232, 85, 47, 0.35);
}

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

.btn-block { width: 100%; }

.cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

/* ==========================================================================
   4. HEADER
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    max-width: 1180px;
    margin: 0 auto;
}

.site-logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--navy);
    line-height: 1.2;
}
.site-logo span { color: var(--accent); }

.primary-nav {
    display: none;
}

.primary-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.primary-nav a {
    color: var(--text);
    font-weight: 600;
}

.header-cta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-weight: 800;
    color: var(--navy);
}
.header-phone svg { fill: var(--accent); width: 20px; height: 20px; }

.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    cursor: pointer;
}
.menu-toggle svg { width: 22px; height: 22px; fill: var(--navy); }

.mobile-nav {
    display: none;
    background: var(--bg);
    border-top: 1px solid var(--border);
}
.mobile-nav.is-open { display: block; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0.5rem 1.25rem 1rem; }
.mobile-nav li { border-bottom: 1px solid var(--border); }
.mobile-nav a { display: block; padding: 0.85em 0; font-weight: 600; color: var(--text); }

@media (min-width: 900px) {
    .primary-nav { display: block; }
    .menu-toggle { display: none; }
    .mobile-nav { display: none !important; }
}

/* ==========================================================================
   5. TRUST STRIP
   ========================================================================== */
.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4em 0.9em;
    font-size: var(--small-size);
    font-weight: 600;
    color: var(--text);
}
.trust-badge svg { width: 16px; height: 16px; fill: var(--success); flex-shrink: 0; }

/* ==========================================================================
   6. HERO
   ========================================================================== */
.hero {
    background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
    padding: clamp(2.5rem, 6vw, 4.5rem) 0;
    text-align: center;
}
.hero .container { max-width: 860px; }
.hero h1 { margin-bottom: 0.5em; }
.hero .subhead {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 62ch;
    margin: 0 auto 1.5em;
}
.hero .cta-group { justify-content: center; }

/* ==========================================================================
   7. CARDS / SERVICES GRID
   ========================================================================== */
.grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: var(--card-padding);
    transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
    box-shadow: 0 10px 30px rgba(27, 42, 74, 0.08);
    transform: translateY(-3px);
}
.card h3 { margin-bottom: 0.4em; }
.card p { color: var(--muted); }
.card .card-link { font-weight: 700; display: inline-block; margin-top: 0.5em; }

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(232, 85, 47, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75em;
}
.card-icon svg { width: 24px; height: 24px; fill: var(--accent); }

/* ==========================================================================
   8. AI-ANSWER / COST BLOCK
   ========================================================================== */
.ai-answer {
    background: var(--bg-alt);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-card) var(--radius-card) 0;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}
.ai-answer p:last-child { margin-bottom: 0; }
.ai-answer .disclaimer {
    font-size: var(--small-size);
    color: var(--muted);
    margin-top: 0.75em;
}

/* ==========================================================================
   9. WHY US
   ========================================================================== */
.why-us { list-style: none; padding: 0; margin: 1.5rem 0; }
.why-us li {
    display: flex;
    gap: 0.75em;
    align-items: flex-start;
    padding: 0.6em 0;
}
.why-us svg { width: 22px; height: 22px; fill: var(--success); flex-shrink: 0; margin-top: 2px; }

/* ==========================================================================
   10. PROBLEMS LIST
   ========================================================================== */
.problems-list { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 0.75rem; }
.problems-list li {
    background: var(--bg-alt);
    border-radius: var(--radius-card);
    padding: 1em 1.25em;
    border: 1px solid var(--border);
}

/* ==========================================================================
   11. PRICING TABLE
   ========================================================================== */
.pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--border);
}
.pricing-table th, .pricing-table td {
    text-align: left;
    padding: 0.85em 1em;
    border-bottom: 1px solid var(--border);
}
.pricing-table thead th {
    background: var(--navy);
    color: #fff;
}
.pricing-table tbody tr:nth-child(even) { background: var(--bg-alt); }

@media (max-width: 640px) {
    .pricing-table, .pricing-table thead, .pricing-table tbody, .pricing-table th, .pricing-table td, .pricing-table tr {
        display: block;
    }
    .pricing-table thead { display: none; }
    .pricing-table tr { margin-bottom: 1rem; border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
    .pricing-table td {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid var(--border);
    }
    .pricing-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--navy);
        margin-right: 1em;
    }
}

/* ==========================================================================
   12. PROCESS STEPS
   ========================================================================== */
.process-steps {
    display: grid;
    gap: var(--gap);
    counter-reset: step;
    margin: 1.5rem 0;
}
@media (min-width: 640px) { .process-steps { grid-template-columns: repeat(3, 1fr); } }
.process-steps .step {
    background: var(--bg-alt);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    position: relative;
    border: 1px solid var(--border);
}
.process-steps .step::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    margin-bottom: 0.75em;
}

/* ==========================================================================
   13. COVERAGE / SERVICE AREAS
   ========================================================================== */
.coverage-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, 1fr);
    margin: 1.5rem 0;
}
@media (min-width: 640px) { .coverage-grid { grid-template-columns: repeat(3, 1fr); } }
.coverage-grid a {
    display: block;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    padding: 0.85em 1em;
    color: var(--navy);
    font-weight: 700;
    text-align: center;
    transition: background var(--transition), color var(--transition);
}
.coverage-grid a:hover { background: var(--navy); color: #fff; }

/* ==========================================================================
   14. E-E-A-T BLOCK
   ========================================================================== */
.eeat-block {
    background: var(--navy);
    color: #fff;
    border-radius: var(--radius-card);
    padding: 2rem;
    margin: 1.5rem 0;
}
.eeat-block h2, .eeat-block h3 { color: #fff; }
.eeat-stats {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(2, 1fr);
    text-align: center;
    margin-top: 1rem;
}
@media (min-width: 640px) { .eeat-stats { grid-template-columns: repeat(4, 1fr); } }
.eeat-stats .stat-num { font-size: 1.9rem; font-weight: 800; color: var(--accent); display: block; }
.eeat-stats .stat-label { font-size: var(--small-size); color: #cfd6e4; }

/* ==========================================================================
   15. TESTIMONIALS
   ========================================================================== */
.testimonial-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: var(--card-padding);
}
.testimonial-card .stars { color: var(--accent); margin-bottom: 0.5em; letter-spacing: 2px; }
.testimonial-card p { color: var(--text); font-style: italic; }
.testimonial-card .author { font-weight: 700; color: var(--navy); font-style: normal; margin-top: 0.75em; }

/* ==========================================================================
   16. CASE STUDY
   ========================================================================== */
.case-study {
    background: var(--bg-alt);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

/* ==========================================================================
   17. FAQ ACCORDION
   ========================================================================== */
.faq { margin: 1.5rem 0; }
.faq details {
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
}
.faq summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    color: var(--navy);
    padding: 0.75em 0;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-left: 1em;
    transition: transform var(--transition);
}
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq .faq-answer { padding: 0 0 1em; color: var(--muted); }

/* ==========================================================================
   18. CTA BANNER
   ========================================================================== */
.cta-banner {
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-card);
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}
.cta-banner h2, .cta-banner h3 { color: #fff; }
.cta-banner .btn-primary { background: #fff; color: var(--accent-dark); }
.cta-banner .btn-primary:hover { background: var(--navy); color: #fff; }

/* ==========================================================================
   19. QUOTE FORM
   ========================================================================== */
.quote-form {
    background: var(--bg);
    border-radius: var(--radius-card);
    padding: 2rem;
    max-width: 480px;
    margin: 0 auto;
    border: 1px solid var(--border);
    text-align: left;
}
.quote-form .form-row { margin-bottom: 1rem; }
.quote-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.4em;
    color: var(--navy);
    font-size: var(--small-size);
}
.quote-form input,
.quote-form select {
    width: 100%;
    min-height: 48px;
    padding: 0.6em 0.9em;
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
}
.quote-form input:focus,
.quote-form select:focus {
    border-color: var(--accent);
}
.form-honeypot { position: absolute; left: -9999px; }
.form-message {
    padding: 0.85em 1em;
    border-radius: var(--radius-btn);
    margin-bottom: 1rem;
    font-weight: 600;
}
.form-message.success { background: rgba(30, 142, 90, 0.12); color: var(--success); }
.form-message.error { background: rgba(232, 85, 47, 0.12); color: var(--accent-dark); }

/* ==========================================================================
   20. STICKY MOBILE CALL BAR
   ========================================================================== */
.sticky-call-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.sticky-call-bar a {
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.6em;
    width: 100%;
    height: 100%;
    justify-content: center;
}
.sticky-call-bar svg { width: 20px; height: 20px; fill: #fff; }

@media (min-width: 900px) {
    .sticky-call-bar { display: none; }
    body { padding-bottom: 0; }
}

/* ==========================================================================
   21. BLOG / ARCHIVE
   ========================================================================== */
.blog-intro { max-width: 760px; margin: 0 auto 2rem; text-align: center; }
.blog-grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: 1fr;
    max-width: 1180px;
    margin: 0 auto;
}
@media (min-width: 640px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card { display: flex; flex-direction: column; }
.post-card .post-thumb {
    aspect-ratio: 16 / 10;
    background: var(--bg-alt);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    overflow: hidden;
    margin: calc(var(--card-padding) * -1) calc(var(--card-padding) * -1) 1rem;
}
.post-card .post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .post-category {
    color: var(--accent);
    font-weight: 700;
    font-size: var(--small-size);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.post-card .post-date { color: var(--muted); font-size: var(--small-size); }
.post-card .post-excerpt { color: var(--muted); }

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 0.75em;
    border-radius: var(--radius-btn);
    border: 1px solid var(--border);
    color: var(--navy);
    font-weight: 600;
}
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ==========================================================================
   22. SINGLE POST
   ========================================================================== */
.single-post-wrap { max-width: 760px; margin: 0 auto; }
.post-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: var(--small-size);
    margin-bottom: 1.5rem;
}
.post-featured-image {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-card);
    overflow: hidden;
    margin-bottom: 2rem;
}
.post-featured-image img { width: 100%; height: 100%; object-fit: cover; }

.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 0.6em 0.9em; text-align: left; }
.entry-content blockquote {
    border-left: 4px solid var(--accent);
    margin: 1.5rem 0;
    padding: 0.5rem 1.25rem;
    color: var(--muted);
    font-style: italic;
    background: var(--bg-alt);
    border-radius: 0 var(--radius-card) var(--radius-card) 0;
}
.entry-content a { text-decoration: underline; font-weight: 600; }

/* Author box */
.author-box {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--bg-alt);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    margin: 2rem 0;
    border: 1px solid var(--border);
}
.author-box img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-box .author-name { font-weight: 800; color: var(--navy); margin-bottom: 0.2em; }
.author-box .author-credentials { color: var(--muted); font-size: var(--small-size); }

/* Related posts */
.related-posts { margin: 2.5rem 0; }
.related-posts .grid { margin-top: 1rem; }

/* ==========================================================================
   23. FOOTER
   ========================================================================== */
.site-footer {
    background: var(--navy);
    color: #cfd6e4;
    padding: var(--section-padding) 0 0;
}
.footer-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}
@media (min-width: 720px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }

.site-footer h3 { color: #fff; font-size: 1.05rem; margin-bottom: 1em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.6em; }
.site-footer a { color: #cfd6e4; }
.site-footer a:hover { color: #fff; }
.footer-nap p { margin-bottom: 0.5em; color: #cfd6e4; }
.footer-phone { font-weight: 800; color: #fff !important; font-size: 1.1rem; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 2.5rem;
    padding: 1.5rem 0;
    text-align: center;
    font-size: var(--small-size);
    color: #9fabc0;
}

/* ==========================================================================
   24. 404
   ========================================================================== */
.error-404 { text-align: center; padding: var(--section-padding) 0; }
.error-404 .error-code { font-size: 5rem; font-weight: 800; color: var(--accent); line-height: 1; }

/* ==========================================================================
   25. SEARCH FORM
   ========================================================================== */
.search-form { display: flex; gap: 0.5rem; max-width: 480px; margin: 0 auto; }
.search-form input[type="search"] {
    flex: 1;
    min-height: 48px;
    padding: 0.6em 0.9em;
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 1rem;
}
.search-form button {
    min-height: 48px;
    padding: 0 1.25em;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    font-weight: 700;
    cursor: pointer;
}
.search-form button:hover { background: var(--accent-dark); }

/* ==========================================================================
   26. BREADCRUMBS
   ========================================================================== */
.breadcrumbs {
    font-size: var(--small-size);
    color: var(--muted);
    margin-bottom: 1.5rem;
}
.breadcrumbs a { color: var(--muted); font-weight: 600; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 0.4em; }
.breadcrumbs .current { color: var(--text); }

/* ==========================================================================
   27. UTILITIES
   ========================================================================== */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px,1px,1px,1px);
    white-space: nowrap;
}
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
