/* ==========================================
   HOME SERVICES SECTION
   Legacy Protection Services
   Scale matched to intro section
========================================== */

.services-section {
    padding: clamp(48px, 6vw, 80px) 0;
    background: #F0F2F5;
    position: relative;
    overflow: hidden;
}

.services-shell {
    position: relative;
    z-index: 1;
}

/* SECTION INTRO - MATCHING INTRO BADGE + TEXT SIZES */
.section-intro {
    max-width: 800px;
    margin: 0 auto 3rem auto;
}

.section-label {
    display: inline-block;
    background: rgba(214, 154, 59, 0.12);
    color: var(--color-primary-dark);
    font-size: 0.7rem;  /* Matches intro-badge */
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.25rem 0.9rem;
    border-radius: 40px;
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);  /* Matches intro h2 */
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.section-text {
    font-size: 0.9rem;  /* Matches intro-text */
    line-height: 1.65;
    color: var(--color-text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* SERVICES GRID - ENHANCED RESPONSIVENESS */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 3rem 0;
}

.service-card {
    background: var(--color-white);
    border-radius: 1rem;  /* Matches intro-image-card */
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-4px);  /* Reduced from -6px for subtlety */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: rgba(214, 154, 59, 0.2);
}

.service-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f5f5f5;  /* Fallback while images load */
}

.service-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.service-card:hover .service-card-image {
    transform: scale(1.02);  /* Matches intro-image scale */
}

.service-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover .service-overlay {
    opacity: 1;
}

.service-overlay i {
    font-size: 2rem;
    color: var(--color-white);
}

.service-card-body {
    padding: 1.25rem;  /* Reduced from 1.5rem */
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.service-icon {
    position: absolute;
    top: -20px;
    right: 1.25rem;
    width: 40px;  /* Reduced from 48px */
    height: 40px;  /* Reduced from 48px */
    background: var(--color-primary);
    border-radius: 10px;  /* Reduced from 12px */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(214, 154, 59, 0.3);
}

.service-icon i {
    font-size: 1.1rem;  /* Reduced from 1.3rem */
    color: var(--color-black);
}

.service-card-body h3 {
    font-size: 1rem;  /* Reduced from 1.1rem - matches compact style */
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-right: 2.5rem;
    line-height: 1.4;
}

.service-card-body p {
    font-size: 0.8rem;  /* Reduced from 0.85rem - matches intro scale */
    line-height: 1.6;
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.service-tags span {
    background: rgba(214, 154, 59, 0.08);
    padding: 0.2rem 0.65rem;  /* Reduced padding */
    border-radius: 30px;
    font-size: 0.65rem;  /* Reduced from 0.68rem */
    font-weight: 500;
    color: var(--color-primary-dark);
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;  /* Reduced from 0.8rem */
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: auto;
}

.service-link:hover {
    gap: 0.75rem;
    color: var(--color-primary-dark);
}

.service-link i {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
}

.service-link:hover i {
    transform: translateX(3px);
}

.services-bottom {
    text-align: center;
    margin-top: 2rem;
}

/* ========== ENHANCED RESPONSIVENESS ========== */

/* Tablet landscape & smaller desktops */
@media (max-width: 1100px) {
    .services-grid {
        gap: 1.5rem;
    }
    
    .service-card-body {
        padding: 1rem;
    }
    
    .service-card-body h3 {
        font-size: 0.95rem;
        padding-right: 2rem;
    }
    
    .service-icon {
        width: 36px;
        height: 36px;
        top: -18px;
        right: 1rem;
    }
    
    .service-icon i {
        font-size: 1rem;
    }
}

/* Tablet portrait */
@media (max-width: 991px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .section-intro {
        margin-bottom: 2rem;
    }
}

/* Mobile landscape */
@media (max-width: 640px) {
    .services-grid {
        gap: 1.25rem;
    }
    
    .service-card-body {
        padding: 0.875rem;
    }
    
    .service-card-body h3 {
        font-size: 0.9rem;
        padding-right: 1.75rem;
    }
    
    .service-card-body p {
        font-size: 0.75rem;
    }
    
    .service-tags span {
        font-size: 0.6rem;
        padding: 0.15rem 0.55rem;
    }
    
    .service-icon {
        width: 32px;
        height: 32px;
        top: -16px;
    }
    
    .service-icon i {
        font-size: 0.9rem;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .services-bottom .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .section-label {
        font-size: 0.65rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .section-text {
        font-size: 0.85rem;
    }
}

/* Large screens - prevent cards from becoming too wide */
@media (min-width: 1400px) {
    .services-grid {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Touch device optimization */
@media (hover: none) {
    .service-card:hover {
        transform: none;
    }
    
    .service-card:hover .service-card-image {
        transform: none;
    }
    
    .service-overlay {
        opacity: 0;
    }
}