/* ===================================================================
 * HOMEPAGE-SPECIFIC STYLES - FINAL VERSION
 * Uses: CSS Variables, Utility Classes, and a mobile-first approach.
 * =================================================================== */

/* ===================================================================
   1. LAYOUT SWITCHING (Legacy Fallback)
=================================================================== */
.desktop-layout-only,
.desktop-only-p {
    display: none;
}

.mobile-layout-only,
.mobile-only-p {
    display: block;
}

/* ===================================================================
   2. CORE COMPONENTS & ANIMATIONS
=================================================================== */
/*
  NOTE: @keyframes fadeIn, .hero-animated-content, and .check-item
  have been moved to global-styles.css to become reusable utilities.
*/


/* ===================================================================
   3. COMPONENT STYLES (Mobile-First)
=================================================================== */

/* --- 3.1 Hero Section --- */
.roofing-services.hp {
    position: relative;
    z-index: 2;
    background-color: transparent;
    color: var(--color-light);
    text-align: center;
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-xl);
}

.roofing-services.hp::before {
    content: '';
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    z-index: -1;
    background: #000 url('https://idealroofingco.com/wp-content/uploads/flint-roofing-contractor-repair-and-replacement.webp') center bottom / cover no-repeat;
    box-shadow: inset 0 0 0 100vw rgba(0, 0, 0, 0.5);
}

.roofing-services.hp h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.3;
    color: var(--color-light) !important;
}

/* --- 3.2 Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

.service-card {
    background-color: var(--color-primary);
    color: var(--color-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.service-card__content {
    padding: var(--space-lg);
}

.service-card__heading {
    color: var(--color-light);
    text-align: center;
    font-size: 1.4rem;
    text-transform: uppercase;
    border-bottom: var(--border-thick) var(--color-accent);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-lg);
}

.service-card .service-list {
    padding-left: 0;
    list-style: none;
    color: var(--color-light);
}

/* --- 3.3 Tarping Section --- */
.tarping-card-container {
    margin: 0 auto;
}

.tarping-card {
    background-color: var(--color-primary);
    color: var(--color-light);
    border-radius: var(--border-radius);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
}

.tarping-card__heading {
    color: var(--color-light);
    margin-bottom: var(--space-lg);
}

.tarping-card .urgent-response-banner,
.tarping-card .stamp-of-approval {
    display: none;
}

.tarping-card .customer-review {
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid #FFCC00;
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    margin: var(--space-lg) auto var(--space-xl);
    text-align: left;
    color: var(--color-light);
}

.tarping-card .customer-review p,
.tarping-card .customer-review figcaption,
.tarping-card .customer-review blockquote {
    color: var(--color-light);
}

.tarping-card .customer-review blockquote {
    margin: 0 0 var(--space-md) 0;
    padding: 0;
}

.tarping-card .phone-highlight-centered {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin: var(--space-xl) auto;
}

.tarping-card .call-now {
    color: #d32f2f;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.tarping-card .phone-number {
    color: #000;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.tarping-card__footer-text {
    margin-top: var(--space-xl);
}

/* ===================================================================
   4. MOBILE-ONLY STRUCTURAL OVERRIDES (Max-width: 767px)
=================================================================== */
@media (max-width: 767px) {
    .roofing-services.hp {
        padding: 0;
    }
   
    .roofing-services.hp::before {
        width: 100%;
        left: 0;
        transform: none;
    }
   
    .hp-hero .hero-animated-content {
        padding: var(--space-xl) var(--space-lg);
    }
   
    .roofing-services.hp h1 {
        font-size: 1.3rem;
        margin-bottom: var(--space-lg);
    }
   
    .cities-section-hp {
        display: none;
    }
}

/* ===================================================================
   5. DESKTOP-ONLY STYLES (Min-width: 768px)
=================================================================== */
@media (min-width: 768px) {
   
    /* --- Global Desktop Rules --- */
    .mobile-layout-only,
    .mobile-only-p {
        display: none;
    }
   
    .desktop-layout-only,
    .desktop-only-p {
        display: block;
    }

    /* --- Hero Section --- */
    .roofing-services.hp .cities-section-hp h3 {
        color: var(--color-light) !important;
    }

    .hero-intro-container {
        max-width: 1100px;
        margin: 0 auto;
        margin-bottom: var(--space-3xl);
    }
   
    .cities-section-hp h3 {
        margin-bottom: var(--space-lg);
    }

    .cities-container-hp {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: var(--space-lg);
    }

    .city-item-hp h4 {
        color: var(--color-light);
        font-size: 1.1rem;
        font-weight: 400;
        transition: all 0.3s ease;
        padding: var(--space-xs) var(--space-sm);
        margin: 0;
        border-radius: var(--border-radius);
    }

    .city-item-hp h4:hover {
        color: #FFCC00 !important;
        background-color: rgba(0, 0, 0, 0.5);
        transform: scale(1.1);
    }

    /* --- Services Section --- */
    .services-grid {
        grid-template-columns: 1fr 1fr;
    }

    .service-card {
        background-color: transparent;
        background-size: cover;
        background-position: center;
        position: relative;
        padding: 0;
        display: flex;
        align-items: stretch;
        height: 100%;
    }

    .service-card__content {
       position: relative;
       z-index: 2;
       padding: var(--space-xl);
       display: flex;
       flex-direction: column;
       flex-grow: 1;
    }

    .service-card__content .wp-block-button {
        margin-top: auto;
    }

    .service-card--residential {
        background-image: url('https://idealroofingco.com/wp-content/uploads/flint-roofing-contractor-snow-storm.webp');
       
    }

    .service-card--commercial {
        background-image: url('https://idealroofingco.com/wp-content/uploads/flint-roofing-contractor-commercial_repairs.webp');
    }

    .service-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(26, 54, 93, 0.3);
        border-radius: var(--border-radius);
        z-index: 1;
    }

    /* --- Tarping Section --- */
    .tarping-card {
        position: relative;
        padding: var(--space-2xl) var(--space-xl);
        min-height: 500px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        background-image: url('https://idealroofingco.com/wp-content/uploads/roof-leak-tarping-repair-flint.webp');
        background-size: cover;
        background-position: center;
        box-shadow: 0.1875rem 0.5rem 0.75rem rgba(0, 0, 0, 0.44);
    }
   
    .tarping-card .customer-review {
        margin-left: -440px;
        margin-right: -440px;
    }

    .tarping-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(26, 54, 93, 0.75);
        border-radius: var(--border-radius);
    }

    .tarping-card__content {
        position: relative;
        z-index: 2;
        max-width: 650px;
        margin: 0 auto;
    }

    .tarping-card .urgent-response-banner {
        display: block;
        position: absolute;
        top: 0;
        right: 1.5rem;
        transform: translateY(-50%);
        z-index: 10;
        background-color: #FFCC00;
        color: var(--color-dark);
        padding: var(--space-sm) var(--space-lg);
        border-radius: var(--border-radius);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.9rem;
        letter-spacing: 0.5px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    }

    .tarping-card .stamp-of-approval {
        display: block;
        position: absolute;
        left: 1.5rem;
        bottom: 1.5rem;
        width: 150px;
        z-index: 5;
    }

    .tarping-card .stamp-of-approval img {
        width: 100%;
        height: auto;
        border-radius: 6px;
    }

    /* --- Legacy Sections (To be refactored) --- */
    .desktop-layout-only .roofing-content-wrapper,
    .desktop-layout-only .estimate-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
        align-items: center;
    }
}

/* ===================================================================
   6. LARGE DESKTOP ENHANCEMENTS (Min-width: 1200px)
=================================================================== */
@media (min-width: 75rem) {
    .service-card__content { 
        padding: 2.5rem; 
    }
}