/* DEH Law Mobile Card Fix v3.1 - External CSS File */

/* ===== 1. HERO: Lighten the gradient so the background image is visible ===== */
.dehlaw-location-page .page-hero {
    background-image: linear-gradient(rgba(10,25,41,0.40), rgba(26,41,66,0.45)),
                      url('https://www.dehlaw.com/wp-content/uploads/2026/02/texas-hero-areas-we-serve.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}
.dehlaw-location-page .page-hero h1 {
    text-shadow: 0 2px 12px rgba(0,0,0,0.6), 0 1px 3px rgba(0,0,0,0.4) !important;
}
.dehlaw-location-page .page-hero .hero-subtitle {
    text-shadow: 0 1px 8px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.3) !important;
}

/* ===== 2. SECTION HEADERS: White bg, high-contrast text ===== */
.dehlaw-location-page .section,
.dehlaw-location-page .dehlaw-locations-index {
    background: #ffffff !important;
    position: relative;
    z-index: 1;
}
.dehlaw-location-page h2 {
    color: #0a1929 !important;
    background: #ffffff !important;
    display: inline-block !important;
    padding: 0.25rem 0 0.75rem !important;
    position: relative !important;
    z-index: 5 !important;
}

/* ===== 3. GRID: Force proper grid on containers ===== */
.dehlaw-location-page .areas-grid-premium,
.dehlaw-location-page .areas-grid-premium.is-layout-grid,
.dehlaw-location-page .areas-grid-premium.is-layout-flex {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 1.5rem !important;
}

/* ===== 4. CARDS: Override Gutenberg/Elementor layout classes ===== */
.dehlaw-location-page .area-card.is-layout-flex,
.dehlaw-location-page .area-card-image.is-layout-flex,
.dehlaw-location-page .area-card-image {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0 !important;
    justify-content: flex-end !important;
    min-height: 250px !important;
    position: relative !important;
    overflow: hidden !important;
    background-size: cover !important;
    background-position: center !important;
}

/* ===== 5. Remove the CSS ::after gradient overlay ===== */
.dehlaw-location-page .area-card-image::after {
    display: none !important;
    content: none !important;
}

/* ===== 6. Fix Gradient Overlay ===== */
.dehlaw-location-page .area-card-image > div,
.dehlaw-location-page .area-card-image > div[style*="linear-gradient"] {
    background: linear-gradient(to top,
      rgba(0,8,20,0.85) 0%,
      rgba(0,8,20,0.40) 45%,
      rgba(0,8,20,0.05) 100%) !important;
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 1 !important;
}

/* ===== 7. Card text: force visible, full-width, properly stacked ===== */
.dehlaw-location-page .area-card-image h3,
.dehlaw-location-page .area-card-image p,
.dehlaw-location-page .area-card-image span.area-link,
.dehlaw-location-page .area-card-image > h3,
.dehlaw-location-page .area-card-image > p,
.dehlaw-location-page .area-card-image > p > span {
    position: relative !important;
    z-index: 2 !important;
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}
.dehlaw-location-page .area-card-image h3,
.dehlaw-location-page .area-card-image > h3,
.dehlaw-location-page .area-card-image h3 a {
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5) !important;
    font-size: 1.5rem !important;
    margin: 0 0 0.5rem 0 !important;
    text-decoration: none !important;
}
.dehlaw-location-page .area-card-image p,
.dehlaw-location-page .area-card-image > p {
    color: rgba(255,255,255,0.92) !important;
    font-size: 0.9375rem !important;
    line-height: 1.6 !important;
    margin-bottom: 0.75rem !important;
}
.dehlaw-location-page .area-card-image .area-link {
    color: #c9a961 !important;
    font-weight: 600 !important;
    font-size: 0.9375rem !important;
}

/* ===== 8. Hide stray empty paragraph tags WP inserts ===== */
.dehlaw-location-page .areas-grid-premium > p:empty,
.dehlaw-location-page .area-card-image > p:empty {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ===== 9. MOBILE SPECIFIC ===== */
@media (max-width: 768px) {
    .dehlaw-location-page .areas-grid-premium {
        grid-template-columns: 1fr !important;
    }
    .dehlaw-location-page .area-card-image.is-layout-flex,
    .dehlaw-location-page .area-card-image {
        min-height: 220px !important;
        margin-bottom: 1rem !important;
    }
    .dehlaw-location-page .page-hero {
        padding: 4rem 0 3rem !important;
    }
    .dehlaw-location-page .page-hero h1 {
        font-size: clamp(2rem, 5vw, 3rem) !important;
    }
}
