/* Service Pages - Reusable Styles */

/* Performance Optimization */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

/* Service Hero Section */
.service-hero {
    height: 60vh;
    margin-top: 5vh;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    background: linear-gradient(135deg, rgba(39, 39, 94, 0.9), rgba(184, 156, 106, 0.3)),
                url('../img/services_pictures/criminal_law.webp');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    will-change: background-position;
}

/* Civil Litigation Hero Override */
.civil-hero {
    background: linear-gradient(135deg, rgba(39, 39, 94, 0.9), rgba(184, 156, 106, 0.3)),
                url('../img/services_pictures/civil_litigation/civil_hero.webp');
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* Family Law Hero Override */
.family-hero {
    background: linear-gradient(135deg, rgba(39, 39, 94, 0.9), rgba(184, 156, 106, 0.3)),
                url('../img/services_pictures/family_law/family_hero.webp');
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* Wills & Trusts Hero Override */
.wills-hero {
    background: linear-gradient(135deg, rgba(39, 39, 94, 0.9), rgba(184, 156, 106, 0.3)),
                url('../img/services_pictures/Trust_Will/will_hero.webp');
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* Labour Law Hero Override */
.labour-law-hero {
    background: linear-gradient(135deg, rgba(39, 39, 94, 0.85), rgba(184, 156, 106, 0.3)),
                url('../img/services_pictures/labour_law_hero.webp');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Commercial Law Hero Override */
.commercial-hero {
    background: linear-gradient(135deg, rgba(39, 39, 94, 0.9), rgba(184, 156, 106, 0.3)),
                url('../img/services_pictures/commercial_law/commercial_hero.webp');
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* Road Accident Fund Hero Override */
.raf-hero {
    background: linear-gradient(135deg, rgba(39, 39, 94, 0.9), rgba(184, 156, 106, 0.3)),
                url('../img/services_pictures/raf/raf_hero.webp');
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* Medical Negligence Hero Override */
.medical-hero {
    background: linear-gradient(135deg, rgba(39, 39, 94, 0.9), rgba(184, 156, 106, 0.3)),
                url('../img/services_pictures/medical_negligence/medical_hero.webp');
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* Deceased Estates Hero Override */
.deceased-hero {
    background: linear-gradient(135deg, rgba(39, 39, 94, 0.9), rgba(184, 156, 106, 0.3)),
                url('../img/services_pictures/deceased_estate/deceased_hero.webp');
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

.service-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--primary-color) 0%, transparent 50%, var(--accent-color) 100%);
    opacity: 0.1;
}

.service-hero .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    position: relative;
}

.service-hero h1 {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out;
}

.service-hero p {
    font-size: 1.4rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* Service Section */
.service-section {
    padding: 6rem 2rem;
    background-color: #f9f9f9;
}

.services-container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.8rem;
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 4rem;
    font-weight: bold;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2.2rem;
        margin-bottom: 3rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.service-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 4px solid var(--accent-color);
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    box-shadow: 0 20px 40px rgba(39,39,94,0.15);
    transform: translateY(-12px);
}

.service-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, rgba(39, 39, 94, 0.1) 0%, rgba(184, 156, 106, 0.1) 100%);
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.service-card:hover .service-image img {
    transform: scale(1.1);
}

.service-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.service-content h3 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: bold;
}

.service-content p {
    color: #666;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .service-hero {
        margin-top: 7.5vh;
        height: 40vh;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        background-attachment: scroll;
    }

    .service-hero h1 {
        font-size: 2.5rem;
    }

    .service-hero p {
        font-size: 1.1rem;
    }

    .service-section {
        padding: 4rem 1.5rem;
    }

    .services-grid {
        gap: 2rem;
    }

    .service-image {
        height: 200px;
    }

    .service-content {
        padding: 2rem;
    }

    .service-content h3 {
        font-size: 1.4rem;
    }

    .service-content p {
        font-size: 0.95rem;
    }
}

@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 701px) {
    .service-hero {
        margin-top: 6vh
    }
}

@media (max-width: 480px) {
    .service-hero {
        height: 45vh;
        margin-top: 5vh;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        background-attachment: scroll;
    }

    .service-hero h1 {
        font-size: 1.5rem;
    }

    .service-hero p {
        font-size: 0.85rem;
    }

    .service-section {
        padding: 3rem 1rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .service-image {
        height: 180px;
    }

    .service-content {
        padding: 1.5rem;
    }

    .service-content h3 {
        font-size: 1.2rem;
    }

    .service-content p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .service-link {
        font-size: 0.9rem;
    }
}

/* Hero Image Optimization - Tablet and Mobile */
@media (max-width: 1024px) {
    .service-hero {
        background-attachment: scroll !important;
    }
}
