/*
 Theme Name: JD Heating Solutions
 Theme URI: https://example.com/
 Author: JD Heating Solutions
 Author URI: https://example.com/
 Description: Lightweight, SEO-friendly theme for a local gas & heating company in Chester.
 Version: 1.1.0
 License: GNU General Public License v2 or later
 License URI: https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: jdheating
*/

/* =========================================
   1. CSS VARIABLES (Color System)
   ========================================= */
:root {
    /* Brand Colors */
    --color-primary: #0d71c4;       /* Main Blue */
    --color-primary-dark: #07518d;  /* Darker Blue (Hover) */
    --color-secondary: #f5a623;     /* Accent Orange/Gold */
    
    /* Text Colors */
    --color-text-main: #1f2933;     /* Dark Grey body text */
    --color-text-heading: #111827;  /* Almost Black headings */
    --color-text-light: #6b7280;    /* Muted text */
    --color-white: #ffffff;
    
    /* Backgrounds */
    --color-bg-page: #f3f4f6;
    --color-bg-hero-start: #eff6ff;
    --color-bg-hero-end: #dbeafe;
    
    /* UI Elements */
    --border-radius-pill: 999px;
    --border-radius-card: 20px;
    --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.08);
    --container-width: 1120px;
}

/* =========================================
   2. GLOBAL RESETS & BASE
   ========================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif; /* Added Helvetica fallback */
    background: var(--color-bg-page);
    color: var(--color-text-main);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased; /* Makes fonts look sharper on Mac */
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-heading);
    margin-top: 0;
    line-height: 1.2;
}

h1 { margin-bottom: 1rem; }
h2 { margin-bottom: 0.75rem; }

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

/* Accessibility: Keyboard Focus */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 4px;
}

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

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* =========================================
   3. HEADER
   ========================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    gap: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-title {
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0;
    color: var(--color-white);
}

.site-description {
    margin: 0;
    font-size: 0.85rem;
    color: #dbeafe;
}

/* Navigation */
.nav-toggle {
    display: none; /* Hidden on desktop by default */
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.main-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.main-menu a {
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    color: var(--color-white);
    padding: 0.5rem 0;
}

/* Underline animation */
.main-menu a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--color-white);
    transition: width 0.2s ease;
}

.main-menu a:hover::after,
.main-menu .current-menu-item > a::after {
    width: 100%;
}

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

.header-phone {
    font-weight: 600;
    white-space: nowrap;
    color: var(--color-white);
}

/* =========================================
   4. BUTTONS
   ========================================= */

.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.4rem;
    border-radius: var(--border-radius-pill);
    border: 2px solid transparent; /* Added for outline consistency */
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(13, 113, 196, 0.25);
}

.btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
}

/* Outline button variant */
.btn-outline {
    background: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* Special header button style */
.site-header .btn-outline {
    background: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}

.site-header .btn-outline:hover {
    background: var(--color-white);
    color: var(--color-primary);
}

/* =========================================
   5. HERO SECTION
   ========================================= */

.hero {
    padding: 3.5rem 0 2.5rem;
    background: linear-gradient(135deg, var(--color-bg-hero-start), var(--color-bg-hero-end));
}

.hero-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    align-items: center;
}

/* Flex child management */
.hero-inner > * {
    flex: 1 1 400px; /* Elements won't shrink below 400px before wrapping */
}

.hero-eyebrow {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-secondary);
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem); /* Fluid typography */
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-intro {
    font-size: 1.1rem;
    color: #4b5563;
    max-width: 34rem;
    margin-bottom: 1.5rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Hero Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.7rem;
    border-radius: var(--border-radius-pill);
    background: #e0f2fe;
    color: #075985;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 1rem;
}

/* Hero Card */
.hero-card {
    background: var(--color-white);
    border-radius: var(--border-radius-card);
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

.hero-image-wrap {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1rem;
    aspect-ratio: 16/9; /* Ensures image maintains ratio */
}

.hero-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================
   6. SECTIONS & SERVICES
   ========================================= */

.section {
    padding: 4rem 0;
    background: var(--color-white);
}

.section-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-intro {
    color: var(--color-text-light);
    max-width: 36rem;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.service-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.service-card {
    background: var(--color-white);
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    flex: 1 1 300px; /* Responsive flex basis */
}

.service-card:hover {
    box-shadow: var(--shadow-card);
    transform: translateY(-3px);
    border-color: rgba(13, 113, 196, 0.25);
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* =========================================
   7. UTILITIES & LISTS (Fixed Section)
   ========================================= */

.split {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: flex-start;
}

.split > * {
    flex: 1 1 400px;
}

/* The previously broken list style - Fixed */
.list-check {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.list-check li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-main);
}

.list-check li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 2px;
    color: var(--color-primary);
    font-weight: bold;
    font-size: 1.1em;
}

/* =========================================
   8. MOBILE RESPONSIVENESS
   ========================================= */

@media (max-width: 900px) {
    /* Stack the header elements */
    .header-inner {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .main-nav {
        width: 100%;
        justify-content: center;
    }
    
    .hero {
        padding: 2rem 0;
        text-align: center;
    }
    
    .hero-inner {
        justify-content: center;
    }
    
    .hero-intro {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-actions {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    /* Smaller adjustments for phones */
    .main-menu {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .header-cta {
        display: none; /* Hide phone number on very small screens to save space */
    }
    
    .service-card {
        flex: 1 1 100%; /* Force cards to full width */
    }
}