/* ==========================================================================
   1. Core Variables & Global Resets
   ========================================================================== */
:root {
    --color-slate: #1f242d;        /* Main dark brand text */
    --color-teal: #0084b0;         /* Kidwell Plumbing Blue */
    --color-coral: #e84e38;        /* Kidwell Heating Orange */
    --color-light-bg: #f8fafc;
    --color-text: #475569;
    --font-main: 'Segoe UI', system-ui, sans-serif;
    --radius-premium: 24px;
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.04);
    --shadow-smooth: 0 20px 40px rgba(0,0,0,0.04);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: var(--font-main); 
    color: var(--color-text); 
    background-color: #ffffff; 
    overflow-x: hidden; 
    -webkit-font-smoothing: antialiased; 
}

.container { 
    width: 92%; 
    max-width: 1200px; 
    margin: 0 auto; 
    position: relative; 
}

.text-center { text-align: center; }
.m-b-20 { margin-bottom: 20px; }
.m-t-40 { margin-top: 40px; }
.m-r-5 { margin-right: 5px; }
.icon-inline { width: 16px; height: 16px; vertical-align: middle; display: inline-block; }

/* ==========================================================================
   2. Layout Structure & Main Elements
   ========================================================================== */

/* --- Top Contact Strap --- */
.top-strap {
    background: linear-gradient(90deg, var(--color-teal) 0%, var(--color-coral) 100%);
    color: #ffffff;
    text-align: center;
    padding: 12px 0;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}
.top-strap a { color: #ffffff; text-decoration: none; margin: 0 8px; font-weight: 700; }

/* --- Premium Navbar --- */
.main-header { background-color: var(--color-slate); padding: 16px 0; position: relative; z-index: 50; }
.header-flex { display: flex; justify-content: space-between; align-items: center; }
.logo-badge-container { background-color: #ffffff; padding: 10px 18px; border-radius: 8px; display: inline-block; }
.site-logo { height: 55px; width: auto; display: block; }
.nav-menu { display: flex; align-items: center; }
.nav-menu a { color: #ffffff; text-decoration: none; margin-left: 28px; font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
.nav-menu a:hover { color: var(--color-teal); }

/* --- UI Buttons (Fixed Hover Issue) --- */
.btn { display: inline-block; padding: 12px 28px; border-radius: 30px; font-weight: 700; text-decoration: none; font-size: 0.9rem; cursor: pointer; border: none; transition: all 0.2s ease; }
.btn-primary { background-color: var(--color-coral); color: #ffffff !important; }
.btn-primary:hover { background-color: #c93b26; color: #ffffff !important; transform: translateY(-1px); }
.btn-secondary { background-color: var(--color-teal); color: #ffffff !important; }
.btn-secondary:hover { background-color: #007299; color: #ffffff !important; transform: translateY(-1px); } 

/* --- Hero Layout --- */
.hero-section { background-color: #f8fafc; padding: 90px 0 90px; }
.hero-grid-layout { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero-text-block h1 { font-size: 3rem; font-weight: 800; line-height: 1.15; color: var(--color-slate); margin-bottom: 25px; letter-spacing: -0.5px; }
.hero-text-block p { font-size: 1.15rem; color: #64748b; margin-bottom: 35px; line-height: 1.6; }
.hero-cta-group { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.cta-separator { font-weight: 800; font-size: 0.85rem; color: #94a3b8; }
.hero-image-wrapper { display: flex; justify-content: center; }
.hero-boiler-img { width: 100%; max-width: 460px; height: auto; border-radius: var(--radius-premium); box-shadow: var(--shadow-premium); object-fit: cover; }

/* --- Upgraded Cohesive Trust Panel (Fixed Margin) --- */
.trust-accreditation-panel {
    padding: 0 0 30px; /* Creates natural whitespace below the hero banner */
    background-color: var(--color-light-bg); /* Sits softly on the page */
    margin-top: 0; /* Removed the negative overlap */
    position: relative;
    z-index: 20;
}
.trust-panel-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px 40px;
    display: grid;
    grid-template-columns: 1fr auto 1.5fr; /* widened to hold 4 logos comfortably */
    align-items: center;
    gap: 35px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.03);
}
.trust-panel-text h3 { font-size: 1.2rem; font-weight: 800; color: var(--color-slate); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.trust-panel-text p { font-size: 0.95rem; color: #64748b; line-height: 1.5; }
.trust-panel-divider { width: 1px; height: 50px; background-color: #e2e8f0; }
.trust-logos-row { display: flex; gap: 16px; align-items: center; justify-content: flex-end; }
.logo-badge-wrapper { 
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    padding: 2px 12px; /* Reduced padding removes dead space */
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    height: 52px; 
}
.logo-badge-wrapper.bg-yellow { background-color: #fffde6; border-color: #fef08a; }
.logo-badge-wrapper.sm { height: 42px; padding: 4px 12px; }
.logo-badge-wrapper img { 
    height: 100%; 
    width: auto; 
    object-fit: contain; 
    transform: scale(1.25); /* Visually expands the logo within the box */
}

/* --- Horizontal Services Ribbon --- */
.services-ribbon-bar { background: #ffffff; padding: 60px 0 0 0; border-bottom: 0px solid #e2e8f0; }
.ribbon-flex-row { display: flex; justify-content: space-around; align-items: center; flex-wrap: wrap; gap: 20px; }
.ribbon-item { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--color-slate); }
.ribbon-icon { width: 22px; height: 22px; }

/* --- Premium Editorial "Hi I'm Jack" Section --- */
.about-section { padding: 50px 0; background-color: #ffffff; }
.about-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 70px; align-items: center; }
.about-image-frame.clean-border-frame { position: relative; padding: 12px; background-color: #ffffff; border: 1px solid #e2e8f0; border-radius: var(--radius-premium); box-shadow: var(--shadow-premium); }
.about-image-frame.clean-border-frame::before { content: ''; position: absolute; inset: 0; border: 2px dashed rgba(0, 132, 176, 0.15); border-radius: var(--radius-premium); pointer-events: none; }
.jack-profile-img { width: 100%; border-radius: calc(var(--radius-premium) - 10px); display: block; object-fit: cover; }
.about-text-content.editorial-style h2 { font-size: 2.8rem; font-weight: 800; color: var(--color-slate); margin-bottom: 20px; letter-spacing: -0.5px; }
.about-text-content.editorial-style .lead-paragraph { font-size: 1.25rem; font-weight: 600; color: var(--color-teal); line-height: 1.5; margin-bottom: 25px; }
.about-text-content.editorial-style p { font-size: 1.05rem; color: #475569; line-height: 1.7; margin-bottom: 25px; }
.editorial-quote { font-size: 1.25rem; font-weight: 700; font-style: italic; color: var(--color-slate); border-left: 4px solid var(--color-coral); padding-left: 20px; margin: 35px 0; line-height: 1.5; }

/* --- Services Section Architecture --- */
.features-section { padding: 110px 0; background-color: var(--color-light-bg); }
.features-title-header { text-align: center; max-width: 650px; margin: 0 auto 50px auto; }
.features-title-header h2 { font-size: 2.4rem; font-weight: 800; color: var(--color-slate); margin-bottom: 12px; letter-spacing: -0.5px; }
.features-title-header p { font-size: 1.05rem; color: #64748b; }
.features-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 70px; align-items: center; }

/* --- Image Collage Frame --- */
.collage-container { position: relative; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; height: 500px; }
.collage-img { background-size: cover; background-position: center; border-radius: var(--radius-premium); box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.img-tall { grid-row: span 2; }
.img-top { height: 230px; }
.img-bottom { height: 250px; }
.floating-badge { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: #ffffff; padding: 24px 45px; border-radius: var(--radius-premium); box-shadow: 0 15px 40px rgba(0,0,0,0.08); text-align: center; z-index: 10; }
.floating-badge span { display: block; font-size: 1.4rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.floating-badge hr { border: 0; height: 1px; background-color: #e2e8f0; margin: 10px 0; }
.text-slate { color: var(--color-slate); }
.text-teal { color: var(--color-teal); }
.text-coral { color: var(--color-coral); }

.features-content { display: flex; flex-direction: column; gap: 35px; }
.feature-item { display: flex; gap: 22px; }
.feature-icon { font-size: 1.6rem; color: var(--color-teal); line-height: 1; }
.feature-icon svg { width: 32px; height: 32px; }
.feature-text h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; color: var(--color-slate); }
.feature-text p { color: #475569; font-size: 0.95rem; }

/* --- Reviews Section --- */
.reviews-section { padding: 110px 0; background-color: #ffffff; border-top: 1px solid #e2e8f0; }
.reviews-display-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 25px; margin-top: 40px; }
.premium-review-card { background-color: #ffffff; border: 1px solid #e2e8f0; padding: 35px; border-radius: 16px; box-shadow: var(--shadow-premium); position: relative; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.premium-review-card:hover { transform: translateY(-3px); box-shadow: 0 30px 60px -15px rgba(0,0,0,0.06); }
.review-meta-line { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.reviewer-profile-info { display: flex; flex-direction: column; }
.profile-name-text { font-weight: 700; color: var(--color-slate); font-size: 1rem; }
.profile-badge-text { font-size: 0.75rem; color: var(--color-teal); font-weight: 700; text-transform: uppercase; display: flex; align-items: center; gap: 4px; margin-top: 20px; }
.profile-badge-text svg { width: 14px; height: 14px; color: #ea4335; }
.star-rating-row { color: #f59e0b; font-size: 1rem; letter-spacing: 1px; }
.review-content-p { color: #475569; font-size: 0.95rem; font-style: italic; line-height: 1.65; }
.trust-link-btn { display: inline-block; padding: 12px 26px; border-radius: 30px; border: 1px solid #cbd5e1; color: #475569; text-decoration: none; font-weight: 600; font-size: 0.85rem; transition: all 0.2s; }
.trust-link-btn:hover { background-color: var(--color-slate); color: #ffffff; border-color: var(--color-slate); }

/* --- Contacts & Maps --- */
.contact-section { padding: 110px 0; background-color: var(--color-light-bg); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.map-area h3, .form-area h3 { font-size: 1.6rem; font-weight: 800; margin-bottom: 10px; color: var(--color-slate); }
.map-frame { margin-top: 25px; box-shadow: var(--shadow-smooth); border-radius: var(--radius-premium); overflow: hidden; }
.form-area { background: #ffffff; padding: 45px; border-radius: var(--radius-premium); box-shadow: var(--shadow-smooth); }
.form-group { margin-bottom: 22px; }
.form-group label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 8px; color: #475569; }
.form-group input, .form-group textarea { width: 100%; padding: 12px 16px; border: 1px solid #cbd5e1; border-radius: 8px; font-family: var(--font-main); font-size: 0.95rem; }

/* --- Footer Elements --- */
.main-footer { background: linear-gradient(135deg, #13171f 0%, var(--color-slate) 100%); position: relative; color: #ffffff; padding: 90px 0 40px; }
.main-footer::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, var(--color-teal), var(--color-coral)); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 0.9fr 0.9fr; gap: 60px; }
.footer-grid h4 { font-size: 1.1rem; color: var(--color-teal); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 22px; font-weight: 700; }
.footer-grid p { opacity: 0.8; font-size: 0.95rem; margin-bottom: 12px; }
.footer-accreditations-row { display: flex; gap: 12px; margin-top: 20px; }
.footer-keywords-list { list-style: none; }
.footer-keywords-list li { font-size: 0.9rem; opacity: 0.8; margin-bottom: 8px; position: relative; padding-left: 15px; }
.footer-keywords-list li::before { content: '•'; color: var(--color-coral); position: absolute; left: 0; font-weight: bold; }
.footer-contact-list { list-style: none; }
.footer-contact-list li { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 15px; font-size: 0.95rem; opacity: 0.8; }
.footer-contact-list li svg { width: 18px; height: 18px; color: var(--color-teal); flex-shrink: 0; margin-top: 2px; }
.footer-contact-list a { color: #ffffff; text-decoration: none; transition: color 0.2s; }
.footer-contact-list a:hover { color: var(--color-coral); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.06); padding-top: 25px; font-size: 0.85rem; opacity: 0.5; }


/* ==========================================================================
   Modal / Popup Form Styles
   ========================================================================== */
.modal-overlay {
    display: none; /* Hidden by default; JavaScript turns this to 'flex' */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(19, 23, 31, 0.85); /* Deep slate frosted background */
    z-index: 1000; /* Ensures it sits on top of everything else */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px); /* Premium frosted glass effect */
}

.modal-content {
    background: #ffffff;
    padding: 40px;
    border-radius: var(--radius-premium);
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-premium);
    animation: modalFadeIn 0.3s ease-out forwards;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--color-coral);
}

.modal-form {
    margin-top: 20px;
}

/* Modal specific form spacing */
.modal-form .form-group {
    margin-bottom: 18px;
}

/* Simple animation so the modal pops in smoothly rather than jarringly */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   3. Tablet Responsive Adjustments (Max 960px)
   ========================================================================== */
@media (max-width: 960px) {
    .hero-grid-layout, 
    .about-grid, 
    .features-grid, 
    .contact-grid, 
    .footer-grid { 
        grid-template-columns: 1fr; 
        gap: 40px; 
    }

    /* Flip Jack's block smoothly so the framed photo scales gracefully over text labels */
    .about-grid { 
        display: flex; 
        flex-direction: column; 
    }
    
    .about-image-frame.clean-border-frame {
        width: 100%;
        max-width: 450px;
        margin: 0 auto;
    }

    .trust-panel-card { 
        grid-template-columns: 1fr; 
        text-align: center; 
        justify-content: center; 
        padding: 30px 20px; 
        gap: 20px;
    }
    
    .trust-panel-divider { 
        display: none; 
    }
    
    .trust-logos-row { 
        justify-content: center; 
        flex-wrap: wrap;
    }

    .collage-container { 
        height: 420px; 
    }
    
    .img-top, 
    .img-bottom { 
        height: 190px; 
    }
}


/* ==========================================================================
   4. Smartphone Responsive Adjustments (Max 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* --- Top Contact Strap Mobile Scaling --- */
    .top-strap {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    .top-strap p {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    /* --- Header & Navbar Navigation Stack --- */
    .main-header {
        padding: 12px 0;
    }
    
    .header-flex {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .nav-menu a {
        margin: 0 10px;
        font-size: 0.9rem;
    }

    /* Compact Mobile Conversion Button Layout */
    .nav-menu .btn-primary {
        margin-left: 0;
        padding: 10px 20px;
        font-size: 0.85rem;
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
    
    /* Force navbar buttons to stay white on hover */
    .nav-menu .btn-primary:hover { color: #ffffff !important; }

    /* --- Hero Text Scaling --- */
    .hero-section {
        padding: 50px 0 70px;
        text-align: center;
    }
    
    .hero-text-block h1 {
        font-size: 2.1rem;
        line-height: 1.2;
    }
    
    .hero-text-block p {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .hero-cta-group {
        justify-content: center;
    }

    .hero-boiler-img {
        max-width: 320px;
        margin-top: 20px;
    }

    /* --- The Horizontal Services Ribbon (Centered Matrix) --- */
    .services-ribbon-bar {
        padding: 25px 0;
    }
    
    .ribbon-flex-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr); 
        gap: 20px 10px;
        justify-items: center; 
        align-items: center;
    }

    .ribbon-item {
        justify-content: center;
        width: 100%;
        font-size: 0.95rem;
        text-align: center;
    }
    
    .ribbon-item:nth-child(5) {
        grid-column: span 2;
    }

    /* --- About Jack Editorial Tuning --- */
    .about-section {
        padding: 60px 0;
    }
    
    .about-text-content.editorial-style h2 {
        font-size: 2.2rem;
        text-align: center;
    }

    .about-text-content.editorial-style .lead-paragraph {
        font-size: 1.1rem;
        text-align: center;
    }

    /* --- Form Container Padding Tweaks --- */
    .form-area {
        padding: 25px 20px;
    }
}

/* --- Aggregate Review Score Styling --- */
.aggregate-score-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
}
.big-score {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-slate);
    line-height: 1;
}
.aggregate-stars {
    display: flex;
    gap: 4px;
    color: #f59e0b; /* Golden Star Color */
    margin: 8px 0;
}
.aggregate-stars svg, .star-rating-row svg {
    fill: #f59e0b; /* Fills the star solid */
    width: 20px;
    height: 20px;
}
.score-text {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 600;
}
.star-rating-row {
    display: flex;
    gap: 2px;
}
.star-rating-row svg {
    width: 16px;
    height: 16px;
}

/* --- Google Branding Additions --- */
.google-aggregate-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.google-brand-icon {
    /* We swap out the Lucide icon for the official Google 'G' logo via a background image for authenticity */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="%23EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"/><path fill="%234285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"/><path fill="%23FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"/><path fill="%2334A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    width: 32px;
    height: 32px;
    color: transparent; /* Hides the underlying lucide icon stroke */
}