/* General Styles */
body::before {
    content: "";
    display: block;
    height: 60px; /* Same as header height */
    width: 100%;
}

body {
    margin: 0;
    font-family: 'Arial', serif;
    color: #ffffff;
    background-color: #121212;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

html {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

a {
    color: #fff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #000;
    position: fixed !important; /* Keep as fixed */
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    height: 85px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem; /* Slightly less padding on mobile */
        height: 85px; /* Consistent height */
    }

    body {
        padding-top: 0 !important; /* Remove any top padding that might be affecting the header */
    }
}

/* Contact Links in Header */
.contact-links {
    display: flex;
    flex-direction: column; /* Stack email and phone vertically */
    align-items: center; /* Center-align the links */
    justify-content: center; /* Center the links vertically */
    position: absolute;
    color: rgb(143, 143, 143);
    top: 50%; /* Center vertically in the header */
    left: 50%; /* Center horizontally in the header */
    transform: translate(-50%, -50%); /* Adjust for perfect centering */
    text-align: center;
    z-index: 50; /* Ensure it stays above other elements */
    transition: opacity 0.3s ease; /* Smooth fade-in effect */
}

.header.scrolled .contact-links {
    opacity: 1; /* Show contact links after the logo shrinks */
}

.contact-links a {
    font-size: 0.9rem;
    color: #8f8f8f;
    text-decoration: none;
    margin: 0.2rem 0; /* Add spacing between the links */
    transition: color 0.3s ease;
}

.contact-links a:hover {
    color: #ccc; /* Change color on hover */
}

/* Hamburger Button */
.hamburger {
    display: none; /* Hidden by default, shown only on mobile */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1002; /* Ensure it stays above other elements */
    position: absolute; /* Keep it in the same position */
    top: 2.5rem; /* Adjust to match the header padding */
    right: 2rem; /* Align to the right inside the header */
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger Button Open State (Transforms into "X") */
.hamburger.open span:nth-child(1) {
    transform: rotate(45deg);
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
}

.hamburger.open span:nth-child(2) {
    opacity: 0; /* Hide the middle line */
}

.hamburger.open span:nth-child(3) {
    transform: rotate(-45deg);
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
}

/* Mobile Menu */
.mobile-menu {
    display: none; /* Hidden by default */
    position: fixed;
    top: 90px; /* Below the header */
    left: 0;
    width: 100%;
    height: calc(100vh - 60px); /* Full screen minus the header height */
    background-color: #121212;
    z-index: 1001;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.mobile-menu a {
    font-size: 1.5rem;
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mobile-menu a:hover {
    color: #ccc;
}

/* Show the mobile menu when active */
.mobile-menu.active {
    display: flex;
}


/* Logo Styling */
.logo {
    position: relative;
    z-index: 1001; /* Ensure the logo is above other elements */
}

.logo-image {
    position: absolute;
    top: -40px; /* Overflow the logo above the header */
    left: 20px; /* Adjust the position as needed */
    width: 300px; /* Initial size of the logo */
    height: auto;
    transition: all 0.3s ease; /* Smooth transition for shrinking */
}

.header.scrolled .logo-image {
    top: -35px; /* Shrink into the header */
    width: 120px; /* Smaller size when scrolling */
}

.nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav ul li a {
    font-size: 1rem;
    font-weight: bold;
    position: relative; /* Required for positioning the pseudo-element */
    transition: color 0.3s ease; /* Smooth color transition */
    padding: 3px 0; /* Add padding to create space for underline */
}

.nav ul li a::after {
    content: '';
    position: absolute;
    width: 0; /* Start with zero width */
    height: 1px; /* Line thickness */
    bottom: 0;
    left: 0;
    background-color: #fff; /* Line color */
    transition: width 0.3s; /* Smooth width transition */
}

.nav ul li a:hover {
    color: #fff;
    text-decoration: none; /* Remove default underline */
}

.nav ul li a:hover::after {
    width: 100%; /* Expand to full width on hover */
}

.hero {
    position: relative;
    width: 100%;
    height: calc(100vh - 80px); /* Subtract the header height from the viewport height */
    margin-top: 0px;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    background: url('images/KTP-4.jpg') no-repeat center center/cover;
    background-position: center top; /* Makes the image static */ /* Keeps the background image fixed during scroll */
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, var(--dimming-opacity, 0)); /* Use CSS variable for opacity */
    transition: background-color 0.3s ease; /* Smooth transition for dimming */
    z-index: 2;
}

/* About Section */
.about {
    padding: 2rem;
    text-align: center;
}

.about-container {
    display: flex;
    flex-wrap: wrap; /* Ensure responsiveness */
    gap: 2rem;
    align-items: center;
    justify-content: center;
}

.about-image {
    flex: 1;
    min-width: auto; /* Remove the fixed minimum width */
    max-width: 100%;/* Ensure the image doesn't shrink too much */
}

.about-image img {
    width: 100%;
    height: 500px;
    border-radius: 10px; /* Optional: Add rounded corners */
}

.about-text {
    flex: 2;
    text-align: left; /* Align the paragraph to the left */
}

.about-text h2 {
    font-family: 'Georgia', serif;
    text-align: center; /* Center-align the title */
    margin-bottom: 1rem;
    font-size: 2rem;
    position: relative; /* Allows positioning of the underline */
}

.about-text h2::after {
    content: '';
    display: block;
    width: 50%; /* Adjust the width of the underline */
    height: 2px; /* Thin underline */
    background-color: #ccc; /* Modern light gray color */
    margin: 0.5rem auto 0; /* Add spacing below the heading */
    border-radius: 5px; /* Optional: Rounded edges for a modern look */
}

.about-text p {
    font-size: 1rem;
    color: #ccc;
    line-height: 1.8;
}



/* Services Section */
/* Improved Services Heading with Background Box */
.home-page .services h2 {
    font-family: 'Georgia', serif;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    position: relative; /* Keep for underline positioning */
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
    display: inline-block; /* Make the background fit the content */
    padding: 0.5rem 2rem; /* Add padding inside the box */
    border-radius: 8px; /* Rounded corners */
    color: #ffffff; /* Ensure text is white for contrast */
    max-width: 80%; /* Prevent from being too wide */
    margin-left: auto; /* Center the box */
    margin-right: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); /* Subtle shadow for depth */
}

/* Container for the heading to center it */
.home-page .services .heading-container {
    justify-content: center;
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
}


.home-page .services {
    background: url('images/contact.jpg') no-repeat center center; 
    background-size: cover; /* Changed from default to "cover" */
    background-position: center center; /* Center both horizontally and vertically */
    padding: 2rem 1rem;
    border-radius: 10px;
    margin: 2rem 0;
    position: relative; /* Added for positioning the overlay */
}

.home-page .services ul {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* Six columns for more precise control */
    grid-template-rows: auto auto auto; /* Three rows */
    gap: 3rem;
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 1200px;
    grid-template-areas:
        "service1 service1 service2 service2 service3 service3" /* Top row: 3 services */
        "service4 service4 service4 service5 service5 service5" /* Middle row: exact 50/50 split */
        "service6 service6 service7 service7 service8 service8"; /* Bottom row: 3 services */
}

/* Services Section */
.home-page .services ul li {
    background-color: rgba(50, 50, 50, 0.838);
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #dedcdc;
    text-align: left; /* Align text to the left */
    color: #fff;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    font-weight: bold;
    height: 180px; /* Adjust height to fit content */
    display: flex;
    flex-direction: column; /* Stack content vertically */
    justify-content: space-between; /* Space out content */
}

.home-page.services ul li .icon-title {
    display: flex;
    align-items: center; /* Align icon and title vertically */
    gap: 1.5rem; /* Space between icon and title */
}

.home-page.services ul li i {
    font-size: 2rem;
    color: #fff;
}

.home-page .services ul li h3 {
    font-size: 1.2rem;
    margin: 0;
    color: #fff;
}

.home-page .services ul li p {
    font-size: 0.9rem;
    color: #dedcdc;
    margin: 0.5rem 0;
    flex-grow: 1; /* Push the button to the bottom */
}

.home-page .services ul li .read-more {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #444;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    text-align: center;
    transition: background-color 0.3s ease;
    align-self: flex-start; /* Align button to the left */
}

.home-page .services ul li .read-more:hover {
    background-color: #666;
}

/* Updated Service Grid Item Assignments */
.home-page .services ul li:nth-child(1) { grid-area: service1; }
.home-page .services ul li:nth-child(2) { grid-area: service2; }
.home-page .services ul li:nth-child(3) { grid-area: service3; }
.home-page .services ul li:nth-child(4) { grid-area: service4; }
.home-page .services ul li:nth-child(5) { grid-area: service5; }
.home-page .services ul li:nth-child(6) { grid-area: service6; }
.home-page .services ul li:nth-child(7) { grid-area: service7; }
.home-page .services ul li:nth-child(8) { grid-area: service8; }

/* Contact Section */
.contact h2{
    font-family: 'Georgia', serif;
    text-align: center; /* Center-align the title */
    margin-bottom: 1rem;
    font-size: 2rem;
    position: relative; /* Allows positioning of the underline */
}

.contact h2::after {
    content: '';
    display: block;
    width: 50%; /* Adjust the width of the underline */
    height: 2px; /* Thin underline */
    background-color: #ccc; /* Modern light gray color */
    margin: 0.5rem auto 0; /* Add spacing below the heading */
    border-radius: 5px; /* Optional: Rounded edges for a modern look */
}

.contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

/* Contact Form Improvements */
.contact-form {
    flex: 1;
    min-width: 300px;
    padding: 0 2rem; /* Add horizontal padding */
    max-width: 600px; /* Prevent form from stretching too wide */
    margin: 0 auto; /* Center the form in its container */
}

/* Underlined input styling */
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.8rem 0.5rem;
    margin-bottom: 1.5rem;
    border: none;
    border-bottom: 1px solid #555;
    border-radius: 0;
    background-color: transparent !important; /* Force transparency */
    color: #fff !important; /* Force white text */
    transition: border-color 0.3s ease;
    -webkit-appearance: none; /* Remove iOS default styling */
    -moz-appearance: none; /* Remove Firefox default styling */
    appearance: none; /* Standard property */
}

.contact-form textarea {
    border: 1px solid #555; /* Keep borders on all sides for textarea */
    border-radius: 4px; /* Small border radius for textarea */
    background-color: rgba(30, 30, 30, 0.3); /* Slightly visible background */
    resize: vertical; /* Allow vertical resizing only */
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Override browser autofill styles */
.contact-form input:-webkit-autofill,
.contact-form input:-webkit-autofill:hover, 
.contact-form input:-webkit-autofill:focus,
.contact-form textarea:-webkit-autofill,
.contact-form textarea:-webkit-autofill:hover,
.contact-form textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff !important;
    -webkit-box-shadow: 0 0 0px 1000px transparent inset;
    transition: background-color 5000s ease-in-out 0s;
    background-clip: content-box !important;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #888;
    box-shadow: none;
    background-color: transparent !important;
}

/* Submit button styling */
.contact-form button {
    background-color: #909090;
    color: #fff;
    cursor: pointer;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem; /* Add bottom margin for spacing */
}

.contact-form button:hover {
    background-color: #666;
    transform: translateY(-2px);
}

.contact-form button:active {
    transform: translateY(0);
}

/* Form label styling */
.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #ccc;
    font-size: 0.9rem;
}

/* Side by side name fields */
.name-fields {
    display: flex;
    gap: 1rem;
    width: 100%;
    margin-bottom: 0; /* Remove bottom margin as individual fields have it */
}

.form-group.half {
    flex: 1; /* Each takes up equal space */
    position: relative;
    width: calc(50% - 0.5rem); /* Explicit width calculation with gap consideration */
    margin: 0; /* Remove any default margins */
}

/* Ensure consistent bottom margin with other inputs */
.form-group.half input {
    width: 100%;
    display: block; /* Ensure block-level for proper width */
    box-sizing: border-box; /* Include padding and border in width calculation */
    margin-bottom: 1.5rem;
}

/* Responsive layout for very narrow screens */
@media (max-width: 480px) {
    .name-fields {
        flex-direction: column;
        gap: 0;
    }
}

/* Ensure responsiveness */
@media (max-width: 768px) {
    .contact-form {
        padding: 0 1.5rem; /* Slightly less padding on mobile */
    }
}

/* Contact Details Styling */
.contact-details {
    flex: 1;
    min-width: 300px;
    text-align: center; /* Center all text */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center the content horizontally */
    justify-content: flex-start;
}

.contact-details p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.contact-details i {
    margin-right: 10px;
    width: 16px;
    color: #7e7e7e;
}

.contact-details a {
    color: #e7e7e7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-details a:hover {
    color: #8c8c8c;
    text-decoration: none;
}

/* Special styling for map link */
.contact-details a[href^="https://maps.google.com"] {
    display: inline-block;
    margin-top: 3px;
}

.contact-details a[href^="https://maps.google.com"]:hover {
    color: #ffffff;
}

/* Office Hours Side-by-Side Layout */
.office-hours-container {
    width: 100%;
    text-align: center;
}

.office-hours-row {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.day-hours {
    flex: 1;
    text-align: center;
}

.hours-heading {
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #e7e7e7;
}

.hours-detail {
    line-height: 1.5;
    color: #ccc;
}

/* Responsive adjustments for office hours */
@media (max-width: 600px) {
    .office-hours-row {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    .contact {
        flex-direction: column;
    }

     .hamburger {
        display: flex; /* Show the hamburger button on mobile */
    }

    .nav {
        display: none; /* Hide the desktop navigation on mobile */
    }

    .home-page .services ul {
        display: flex; /* Change grid to flex for carousel */
        flex-wrap: nowrap; /* Prevent wrapping */
        overflow-x: auto; /* Enable horizontal scrolling */
        scroll-snap-type: x mandatory; /* Snap to items while scrolling */
        gap: 1rem; /* Space between items */
        padding: 1rem;
    }

    .home-page .services ul li {
        flex: 0 0 80%; /* Each item takes 80% of the viewport width */
        scroll-snap-align: center; /* Center the item in the viewport */
        height: auto; /* Allow height to adjust for content */
    }

    .home-page .services ul::-webkit-scrollbar {
        display: none; /* Hide the scrollbar for a cleaner look */
    }

    .contact-links {
        font-size: 0.8rem;
        color: #9a9a9a; /* Slightly smaller font size for mobile */
    }

    .logo-image {
        position: absolute;
        top: -30px; /* Keep position static and consistent */
        left: -20px; /* Adjusted left position for mobile */
        width: 100px; /* Fixed size for mobile */
        transition: none !important; /* Disable transition with !important */
    }
    
    /* Override any scrolled styles for mobile */
    .header.scrolled .logo-image {
        top: -30px; /* Keep position static and consistent */
        left: -20px; /* Adjusted left position for mobile */
        width: 100px; /* Keep size static and consistent */
        transition: none !important; /* Explicitly disable transition */
    }

    .team-cards {
        flex-direction: column; /* Stack main attorney cards vertically */
        gap: 1.5rem; /* Add spacing between cards */
        align-items: center; /* Center-align the cards */
    }

    .team-card {
        flex: 0 0 100%; /* Each card takes the full width */
        max-width: 100%; /* Ensure the maximum width is 100% */
        margin: 0; /* Remove extra margins */
    }

    /* Support Groups Section */
    .support-groups {
        flex-direction: column; /* Stack blocks vertically */
        gap: 1.5rem; /* Add spacing between blocks */
        align-items: stretch; /* Ensure blocks stretch to full width */
    }

    .staff-block {
        flex: 0 0 100%; /* Each block takes the full width */
        min-width: 100%; /* Ensure the maximum width is 100% */
        margin: 0; /* Remove extra margins */
        padding: 1rem; /* Add padding for better spacing inside the block */
        box-sizing: border-box; /* Include padding in the width calculation */
    }

    /* General Adjustments */
    body {
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }

}

/* Team Page Styles */
.team-main, .team-support {
    padding: 2rem 1rem;
    text-align: center;
    color: #fff;
    margin: 2rem 0;
    border-radius: 10px;
}

.team-main h2, .team-support h2 {
    font-family: 'Georgia', serif;
    font-weight: 300;
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-decoration: none;
    margin-top: 1rem;
    position: relative;
    color: #000000;
}

.team-main h2::after, .team-support h2::after {
    content: '';
    display: block;
    width: 50%; /* Adjust the width of the underline */
    height: 1px; /* Very thin underline */
    background-color: #000000; /* Light gray color for the underline */
    margin: 0.5rem auto 0; /* Center the underline and add spacing */
    border-radius: 5px; /* Optional: Rounded edges for a modern look */
}

.team-cards {
    display: flex;
    justify-content: space-around; /* Distribute cards evenly with less space between them */
    gap: 0.2rem; /* Reduce the gap between cards */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.team-card {
    background-color: #333333a2;
    padding: 0.5rem;
    border-radius: 10px;
    text-align: center;
    flex: 1 1 30%; /* Make each card take up approximately 30% of the row */
    max-width: 350px; /* Increase the maximum width of each card */
    margin: 0.2rem; /* Add a small margin around each card */
    position: relative; /* Add this to set the context for absolute positioning */
    z-index: 5; /* Normal z-index */
    transition: z-index 0.01s linear, transform 0.3s ease, box-shadow 0.3s ease;
}


.team-card h3 {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: 1.2rem;
    font-weight: 300;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: #dfdfdf;
    letter-spacing: 2px;
}

.team-card p {
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    color: #ccc;
}

/* Attorney Card Expansion */
.attorney-expanded-content {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background-color: #333333e8;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    height: 0;
    opacity: 0;
    transition: height 0.4s ease-out, opacity 0.3s ease-out;
    padding: 0 1rem;
    z-index: 10;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible; /* Allow content to be fully visible */
}

.team-card.expanded {
    position: relative;
    z-index: 20;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 400px; /* Add space below the expanded card */
}


.team-card.expanded .attorney-expanded-content {
    height: auto;
    opacity: 1;
    padding: 1rem;
    overflow: visible; /* Remove scrolling */
    max-height: none; /* Remove height restriction */
}
/* Style the expanded content */
.attorney-expanded-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    text-align: left;
}

.team-read-less-btn {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background-color 0.3s;
}

.team-read-less-btn:hover {
    background-color: #555;
}

.team-read-more-btn {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background-color 0.3s;
    display: block;
    margin: 0 auto; /* This centers the button */
    text-align: center;
    width: fit-content;
}

.team-read-more-btn:hover {
    background-color: #555;
}

.team-card .team-read-more-btn {
    position: relative; /* Ensure it's in the document flow */
    left: 0; /* Reset any left positioning */
    transform: none; /* Remove any transforms */
    margin-left: auto;
    margin-right: auto;
}

/* Mobile responsiveness for expanded cards */
@media (max-width: 768px) {
    .team-card.expanded {
        max-width: 100%;
    }
    
    .attorney-expanded-content {
        padding: 0 0.5rem;
    }
    
    .team-card.expanded .attorney-expanded-content {
        padding: 0.5rem;
    }
}


/* Staff Block */
.support-groups {
    display: flex; /* Use Flexbox to align blocks horizontally */
    justify-content: space-between; /* Add space between the blocks */
    gap: 1rem; /* Add spacing between the blocks */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.staff-block {
    flex: 0 0 27%; /* Each block takes 27% of the container width */
    max-width: 27%; /* Ensure the maximum width is 27% */
    background-color: #333333a2; /* Optional: Add a background color */
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Optional: Add a subtle shadow */
    text-align: center; /* Center-align the content */
    height: fit-content;
    min-height: auto;
}
.staff-block p {
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    color: #ffffff;
    margin: 0.5rem 0; /* Add some spacing between paragraphs */
}

/* Staff List */
.staff-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.staff-list li {
    margin-bottom: 1.5rem; /* Add space between rows */
}

/* Staff Member Layout */
.staff-member {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Space between photo and info */
}

/* Circular Staff Photo */
.staff-photo {
    width: 100px; /* Larger size for better visibility */
    height: 100px;
    border-radius: 50%; /* Make the photo circular */
    object-fit: cover;
    object-position: center top;
    /* Add shadow to hide pixelation at edges */
}

/* Staff Info */
.staff-info {
    flex: 1;
}

.staff-name {
    font-size: 1.2rem; /* Larger font for name */
    font-weight: bold;
    color: #fff;
    margin: 0;
    font-family: 'Georgia', serif;
}

.staff-contact {
    font-size: 1rem; /* Adjust font size for contact details */
    color: #ccc;
    margin: 0.5rem 0 0;
}

.staff-contact a {
    color: #ccc;
    text-decoration: none;
}

.staff-contact a:hover {
    color: #fff;
}

/* Divider Between Staff Members */
.staff-list li:not(:last-child) {
    border-bottom: 1px solid #444; /* Add a divider between staff members */
    padding-bottom: 1.5rem;
}

/* Main Attorney Card Photos */
.team-photo {
    width: 100%; /* Keep full width */
    height: 450px; /* Keep your current height */
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    
    /* Add these properties to improve rendering quality */
    image-rendering: auto; /* Let the browser decide best rendering method */
    transform: translateZ(0); /* Force GPU rendering */
    backface-visibility: hidden;
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
    .team-photo {
        filter: brightness(0.98) contrast(1.02); /* Subtle adjustment for Retina displays */
    }
}

/* Services Page - Static Background Section */
#services-hero {
    position: fixed; /* Fixed position to remain stationary while scrolling */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Full viewport height */
    background: url('images/KTP-60-min.jpg') no-repeat center center/cover;
    background-attachment: fixed; /* Ensures the background stays fixed while scrolling */
    z-index: 1; /* Lower z-index to appear behind content */
    display: flex;
    align-items: center;
    justify-content: center;
}

.services-hero-content {
    text-align: center;
    color: #fff;
    padding: 2rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5); /* Semi-transparent background */
    transition: opacity 0.3s ease, transform 0.3s ease; /* Add smooth transitions */
}

.services-hero-content h1 {
    font-family: 'Georgia', serif;
    font-size: 3rem;
    margin: 0;
    color: #000000;
    text-decoration: none; /* Remove default text decoration */
    position: relative; /* For positioning the pseudo-element */
    padding-bottom: 10px; /* Add space for the underline */
}

/* Services Page - Sliding Content Section */
#services-content {
    position: relative;
    z-index: 2; /* Higher z-index to appear above the fixed background */
    margin-top: 100vh; /* Start content after the hero section */
    background: rgba(217, 217, 217, 0.546); /* Semi-transparent background */
    color: #000000;
    min-height: auto; /* Ensure it's at least a full viewport height */
    padding: 2rem 0 0 0;
}

#services-content .service-card:nth-child(n) {
    padding: 2rem;
    width: calc(100% - 4rem);
    margin-left: auto;
    margin-right: auto;
}

.services-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.services-title {
    text-align: center;
    margin-bottom: 3rem;
}

.services-title h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-family: 'Georgia', serif;
    text-decoration: none; /* Remove default text decoration */
    position: relative; /* For positioning the pseudo-element */
    padding-bottom: 10px; /* Add space for the underline */
}

.services-hero-content h1::after,
.services-title h2::after {
    content: ""; /* Required for pseudo-elements */
    position: absolute;
    bottom: 0;
    left: 50%; /* Center the line */
    transform: translateX(-50%); /* Ensure perfect centering */
    width: 60px; /* Width of the underline - adjust as needed */
    height: 2px; /* Height/thickness of the underline */
    background-color: #000000; /* Color of the underline */
}

.services-title p {
    font-size: 1.2rem;
    opacity: 0.8;
}

.services-items {
    display: flex;
    flex-direction: column;
    gap: rem; /* Spacing between service cards */
}

/* Service Card Styling */
.service-card {
    background: rgba(255, 255, 255, 0.781);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 800px;
    margin: 0 auto 3rem;
    width: calc(100% - 4rem); /* Consistent width calculation */
    color: black;
    box-sizing: border-box; /* Include padding in width calculation */
}

.service-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-family: 'Georgia', serif;
    color: #000000;
}

.service-card p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: #2e2e2e;
}

/* Two-Column Layout for Service Columns */
.service-columns {
    display: grid;
    grid-template-columns: 70% 30%; /* Left column 70%, right column 30% */
    gap: 1.5rem;
    margin: 1.5rem 0;
}

/* Left Column - Service List */
.service-list-column {
    color: #000000;
}

.service-list-column h4 {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #000000;
}

.service-list-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-list-column li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
    color: #000000;
}

.service-list-column li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #000000;
}

/* Right Column - Icon */
.service-icon-column {
    display: flex;
    justify-content: flex-start; /* Align icon to the right instead of center */
    align-items: center;
    padding-right: 15px; /* Add some padding from the right edge */
}

.service-icon-column i {
    font-size: 8rem; /* Large icon */
    color: #000000;
    opacity: 0.8;
    margin-right: 10px; /* Add some margin from the right edge */
}

/* Contact Info and CTA Button */
.contact-info {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.1rem;
    color: #fff;
}

.service-cta {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: #4f4f4f;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.service-cta:hover {
    background-color: #000000;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.service-cta:active {
    transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .services-hero-content h1 {
        font-size: 2.5rem;
    }
    
    .services-title h2 {
        font-size: 2rem;
    }
    
    .services-content-wrapper {
        padding: 2rem 1rem; /* Reduce side padding on mobile */
    }
    
    .service-card {
        padding: 1.5rem;
        width: 100%; /* Ensure full width within container */
        max-width: 100%; /* Override any max-width that might be causing overflow */
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box; /* Include padding in width calculation */
    }
    
    .service-columns {
        grid-template-columns: 1fr; /* Single column on mobile */
    }
    
    .service-icon-column {
        order: -1; /* Move icon above the list on mobile */
        margin-bottom: 1rem;
    }
    
    .service-icon-column i {
        font-size: 4rem; /* Smaller icon on mobile */
    }
}

@media (max-width: 480px) {
    .services-hero-content h1 {
        font-size: 2rem;
    }
    
    .services-title h2 {
        font-size: 1.8rem;
    }
    
    .service-card {
        padding: 1rem;
    }
    
    .service-card h3 {
        font-size: 1.5rem;
    }
}

/* JavaScript integration for scroll effects */
.services-hero-content.hidden {
    opacity: 0;
    transform: translateY(-20px);
}

/* Service Navigation Buttons */
.service-nav-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.service-nav-btn {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid #fff;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.service-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.service-nav-btn:active {
    transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .service-nav-buttons {
        gap: 0.4rem;
    }
    
    .service-nav-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .service-nav-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .service-nav-btn {
        width: 80%;
        margin-bottom: 0.3rem;
    }
}

/* Footer Styles */
.main-footer {
    background-color: #0d0d0d;
    color: #ccc;
    padding: 3rem 0 2rem;
    margin-top: 0;
    border-top: 2px solid #5f5f5f;
    z-index: 2;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0 2rem;
}

/* Column Styling */
.footer-column {
    flex: 1;
    min-width: 250px;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

/* Logo Column */
.footer-logo-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
}

.footer-tagline {
    font-style: italic;
    margin-bottom: 1rem;
}

.footer-copyright {
    font-size: 0.8rem;
    color: #777;
    margin-top: auto;
}

/* Contact Column */
.footer-contact-column h3,
.footer-nav-column h3 {
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-contact-column h3::after,
.footer-nav-column h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 50px;
    background-color: #555;
}

.footer-contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact-list li {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: flex-start;
}

.footer-contact-list i {
    margin-right: 10px;
    color: #777;
    width: 16px;
    text-align: center;
}

.footer-contact-list a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-contact-list a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Navigation Column */
.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav li {
    margin-bottom: 0.8rem;
}

.footer-nav a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
    display: inline-block;
    position: relative;
}

.footer-nav a:hover {
    color: #fff;
}

.footer-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: #fff;
    transition: width 0.3s;
}

.footer-nav a:hover::after {
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .footer-container {
        flex-direction: column;
    }
    
    .footer-column {
        flex: 0 0 100%;
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .footer-logo-column {
        align-items: center;
    }
    
    .footer-contact-column h3::after,
    .footer-nav-column h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-contact-list li {
        justify-content: center;
    }
    
    .footer-nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem 2rem;
    }
    
    .footer-nav li {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .footer-nav ul {
        flex-direction: column;
        gap: 0.8rem;
    }
}
@media (max-width: 768px) {
    .hero {
        margin-top: 30px;
        height: 0vh; /* Shorter height on mobile */
        background-position: top center; /* Focus on top portion of image */
        min-height: 250px; /* Ensure minimum height */
        background-image: url('images/KTP-4.jpg');
        background-size: contain; /* This contains the image within its width */
        background-repeat: no-repeat; /* Your new mobile-specific image */
    }

    .about {
        margin-top: -50px; /* Pull up the about section */
        position: relative;
        z-index: 10; /* Ensure it appears above the hero section */
        padding-top: 20px; /* Reduced top padding */
    }
    
    .about-container {
        flex-direction: column; /* Stack image and text vertically */
    }
    
    .about-image {
        width: 100%; /* Take full width on mobile */
        margin: 0 auto; /* Center the image */
    }
    
    .about-image img {
        width: 100%; /* Full width */
        height: auto; /* Maintain aspect ratio */
        max-height: 400px; /* Limit maximum height */
        object-fit: contain; /* Ensure entire image is visible */
    }
}

.captcha-note {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}

/* hCaptcha container styles */
.h-captcha {
    margin: 10px 0;
}

@media (max-width: 768px) {
    .h-captcha {
        transform-origin: left top;
        transform: scale(0.9);
    }
}


/* Contact Section Background Image with Overlay */
#contact {
    position: relative;
    padding: 3rem 2rem;
    z-index: 1; /* Ensure content appears above background */
}

/* Background image container */
#contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #5f5f5f; /* Put your image path here */
    background-size: contain;
    background-position: center;
    z-index: -2; /* Behind the overlay */
}

/* Dark overlay for readability */
#contact::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Black overlay at 70% opacity */
    z-index: -1; /* Above image but below content */
}

/* Enhance form and details containers for better visibility */
.contact-form, .contact-details {
    background-color: rgba(18, 18, 18, 0.7); /* Semi-transparent background */
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    #contact::before, #contact::after {
        display: none; /* Hide background image on mobile if desired */
    }
}

@media (max-width: 768px) {
  #conveyancing, 
  #property-law, 
  #litigation, 
  #mediation, 
  #family-law, 
  #estates, 
  #collection,
  #notarial,
  .service-card h3[id] {
    scroll-padding-top: 160px; /* Adjust for mobile header height */
    scroll-margin-top: 160px;
     /* Adjust for mobile header height */
  }
}

/* About Image - Desktop specific width */
@media (min-width: 769px) {
    .about-image {
        width: 700px; /* Fixed width on desktop */
        min-width: 700px; /* Prevent shrinking below this width */
        max-width: 700px; /* Ensure it doesn't grow larger */
        flex: 0 0 auto; /* Don't allow flexbox to resize */
    }
}

/* Add this to your styles.css file */

/* Remove tap highlight on mobile devices */
* {
    -webkit-tap-highlight-color: transparent; /* For iOS Safari */
    -webkit-touch-callout: none; /* Disable callout/copy menu on iOS */
    -webkit-user-select: none; /* Disable text selection on iOS */
    user-select: none; /* Disable text selection on standard browsers */
}

/* Re-enable text selection for specific elements */
p, h1, h2, h3, h4, h5, h6, li, span, input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* Remove outline on buttons and links when focused/clicked */
button, a, [role="button"], .service-nav-btn, .hamburger {
    outline: none !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Optional: Add a custom focus indicator that doesn't use the blue highlight */
button:focus, a:focus, .service-nav-btn:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}


/* Mobile Contact Section Alignment */
@media (max-width: 768px) {
    /* Center the entire contact section */
    .contact {
        padding: 1.5rem;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Contact form centering */
    .contact-form {
        width: 100%;
        max-width: 100%;
        padding: 1.5rem;
        box-sizing: border-box;
        margin: 0 auto;
    }
    
    /* Form elements centering */
    .contact-form input,
    .contact-form textarea,
    .contact-form button {
        display: block;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Center the name fields */
    .name-fields {
        display: flex;
        justify-content: space-between;
        width: 100%;
        margin: 0 auto;
    }
    
    /* Captcha centering */
    .h-captcha {
        display: flex;
        justify-content: center;
        width: 100% !important;
        margin: 1rem auto;
        transform-origin: center top;
    }
    
    /* Contact details centering */
    .contact-details {
        width: 100%;
        padding: 1.5rem;
        box-sizing: border-box;
        margin: 1rem auto 0;
        text-align: center;
    }
    
    .contact-details p,
    .office-hours-container {
        text-align: center;
        width: 100%;
    }
    
    /* Center contact list items */
    .footer-contact-list li {
        justify-content: center;
        text-align: center;
        display: flex;
    }
}

/* Fix for extremely narrow screens */
@media (max-width: 400px) {
    .form-group.half {
        width: 100%;
    }
    
    .name-fields {
        flex-direction: column;
    }
}


.general-staff-block {
    background-color: #333333a2;
    flex: 0 0 25%;
    max-width: 25%;
    display: flex;
    justify-content: center;
}

.general-staff-photo-container {
    width: 150px;
    height: 150px;
    margin-bottom: 1rem;
    border-radius: 8px; /* Add rounded corners to the container */
    overflow: hidden; /* Ensure image respects the container's border radius */
}

.general-staff-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.general-staff-name {
    color: #f6f6f6;
    font-family: 'Georgia', serif;
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.general-staff-contact {
    font-size: 0.9rem;
    color: #ccc;
}

/* Messengers Group - Updated for direct cards */
.messengers-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    margin-top: 1rem;
}

/* Messenger Card - Direct styling without blocks */
.messenger-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 160px; /* Fixed width for consistency */
    background-color: #333333a2;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    height: 220px;
}

/* General Staff Group - Updated for direct cards */
.general-staff-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 2rem;
    margin-top: 1rem;
}

/* General Staff Card - Direct styling without blocks */
.general-staff-card {
    height:fit-content;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 250px; /* Fixed width for consistency */
    background-color: #333333a2;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.messenger-photo-container {
    width: 140px;
    height: 140px;
    margin: 5px; /* Add margin around the photo */
    position: relative; /* For proper positioning of the image */
    overflow: hidden; /* Keep the image within the container */
    border-radius: 8px; /* Rounded corners for the image container */
}

.messenger-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px; /* Rounded corners for the image */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15); /* Subtle shadow for the image */
}

.messenger-name {
    color: #cecece;
    font-family: 'Georgia', serif;
    font-size: 1rem; /* Reduced from 1.5rem */
    font-weight: bold;
    margin-top: 0.3rem; /* Reduced from 0.5rem */
    margin-bottom: 0.2rem; /* Add small bottom margin */
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .messenger-card,
    .general-staff-card {
        width: 85%;
        max-width: 250px;
        margin: 0 auto 1.5rem auto;
    }
}

/* Alternative approach - use fixed height on mobile */
@media (max-width: 768px) {
    .home-page .services {
        min-height: auto;
        padding: 3rem 1rem;
    }
    
    /* Force image quality */
    .home-page .services::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: inherit;
        background-size: cover;
        background-position: center;
        filter: brightness(0.8); /* Slightly dim for better text visibility */
        z-index: -1;
    }
}
/* iPhone-specific background image fix - with improved compatibility */
@supports (-webkit-touch-callout: none) {
    /* iOS-only styles */
    .home-page .services {
        background-size: 100% auto !important;
        background-position: center center !important;
        -webkit-background-size: cover !important;
        -webkit-transform: translateZ(0); /* Safari-specific */
        transform: translateZ(0); /* Standard property for other browsers */
    }
    
    /* Additional layers of override for iOS Safari */
    @media screen and (max-width: 812px) {
        .home-page .services {
            background-attachment: scroll !important;
            background-size: cover !important;
            -webkit-transform: none !important; /* Safari-specific */
            transform: none !important; /* Standard property */
        }
    }
}


/* Updated Full-page background for team.html with parallax effect */
body.team-page {
    margin-top: 85px;
    position: relative;
    background: none; /* Remove the background from body */
    min-height: 100vh; /* Ensure body covers at least full viewport */
}

/* Backgroundontainer that will move with scroll */
body.team-page::before {
    content: '';
    position: absolute; /* Fixed position for parallax effect */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('images/team2.png') no-repeat center center;
    background-size: cover;
    z-index: -2; /* Behind the overlay */
    transform: translateZ(0); /* Force hardware acceleration */
    will-change: transform; /* Optimize for animations */
}

/* Overlay to ensure text readability - fixed position */
body.team-page::after {
    content: '';
    position: absolute; /* Fixed position to match background */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
 /* Dark overlay with 70% opacity */
    z-index: -1; /* Above background but below content */
}

/* Ensure content has proper z-index and reaches footer */
.team-page .main-footer {
    position: relative;
    z-index: 1; /* Match content z-index */
}

/* Make content stretch to push footer down */
.team-page main {
    min-height: calc(100vh - 85px - 200px); /* Viewport height minus header height minus approx footer height */
    position: relative;
    z-index: 1;
}

.team-main h2, 
.team-support h2,
.team-card,
.staff-block,
.general-staff-card,
.messenger-card {
    position: relative;
    z-index: 2; /* Ensure these specific elements appear above overlay */
}

/* Keep containers transparent */
.team-main, 
.team-support {
    background-color: transparent; /* Remove background color */
    position: relative;
    z-index: 1;
}

/* Mobile-specific heading sizes for home page */
@media (max-width: 768px) {
  /* General h2 size reduction */
  .home-page h2 {
    font-size: 1.5rem !important; /* Smaller default size for all h2 on home page */
    margin-bottom: 0.8rem;
  }
  
  /* Specific h2 size adjustments */
  .home-page .about h2 {
    font-size: 1.4rem !important; /* Slightly smaller for about section */
  }
  
  .home-page .services h2 {
    font-size: 1.5rem !important; /* Adjust services heading */
    padding: 0.4rem 1.5rem; /* Smaller padding for the background box */
  }
  
  .home-page .contact h2 {
    font-size: 1.4rem !important; /* Smaller size for contact section */
  }
  
  /* Additional adjustments for heading containers */
  .home-page .heading-container {
    margin-bottom: 1.2rem; /* Less margin below heading containers */
  }
}

/* Extra small screens (phones under 480px) */
@media (max-width: 480px) {
  .home-page h2 {
    font-size: 1.3rem !important; /* Even smaller for very small screens */
  }
  
  .home-page .services h2 {
    padding: 0.3rem 1rem; /* Tighter padding on small screens */
    max-width: 95%; /* Allow more width on tiny screens */
  }
}

@media (max-width: 1024px) {
    .header .logo img {
        width: 120px !important;
        height: 60px !important; /* Force the smaller size with !important */
        transition: none; /* Disable transitions on mobile/tablet */
    }
}

/* Tablet-specific hero adjustments */
@media (min-width: 481px) and (max-width: 1024px) {
    .hero {
        margin-top: 20px;
        height: 0vh; /* Shorter height on tablets */
        background-size: contain; /* Show full image without cropping */
        background-position: center top; /* Position from the top */
        min-height: 450px; /* Ensure minimum height */
        background-repeat: no-repeat;
        margin-bottom: -50px;
    }

    .about {
        position: relative;
        z-index: 2; /* Ensure it appears above the hero */
        margin-top: -40px; /* Negative margin to reduce the gap */
        padding-top: 30px; /* Add some padding to the top */
    }
}

/* Enhance existing mobile styles for hero */
@media (max-width: 480px) {
    .hero {
        height: 40vh; /* Even shorter on mobile */
        min-height: 250px;
        background-size: contain;
        background-position: center top;
        background-repeat: no-repeat;
    }
    
    /* Adjust the about section margin to compensate */
    .about {
        margin-top: -30px;
    }
}

/* iPad Pro specific adjustments */
@media only screen and (min-width: 1024px) and (max-width: 1366px) and (-webkit-min-device-pixel-ratio: 2) {
    /* iPad Pro portrait and landscape */
    .about-container {
        flex-direction: column; /* Stack image and text vertically */
    }

    .about-image {
        width: 100%; /* Full width */
        min-width: auto; /* Remove fixed width constraints */
        max-width: 700px; /* Match desktop max-width */
        margin: 0 auto 2rem; /* Center the image and add margin below */
    }

    .about-text {
        width: 100%; /* Full width */
        text-align: center; /* Center the text for better appearance */
    }
    
    .about-text p {
        max-width: 700px; /* Constrain paragraph width */
        margin-left: auto;
        margin-right: auto;
    }

    /* Adjust vertical spacing */
    .about {
        margin-top: -40px; /* Match the tablet adjustment */
        padding-top: 30px;
    }
}

/* Additional fix for iPad Air and other mid-sized iPads */
@media only screen and (min-width: 820px) and (max-width: 1023px) {
    /* Ensure consistent behavior on all iPad models */
    .about-container {
        flex-direction: column;
    }

    .about-image {
        width: 100%;
        max-width: 600px;
        margin: 0 auto 1.5rem;
    }
}

/* Fix for iPad Air and similar mid-sized tablets service card overflow */
@media only screen and (min-width: 740px) and (max-width: 1024px) {
    /* Target iPad Air specifically */
    .home-page .services ul {
        gap: 1.5rem; /* Reduce gap to allow more space for content */
    }
    
    .home-page .services ul li {
        height: auto; /* Let height be determined by content */
        min-height: 180px; /* Minimum height to maintain design */
        padding: 1rem; /* Consistent padding */
        display: flex;
        flex-direction: column;
        font-size: 0.9rem; /* Slightly reduce font size */
        overflow: hidden; /* Prevent overflow */
    }
    
    .home-page .services ul li h3 {
        font-size: 1.1rem; /* Reduce heading size */
        margin-bottom: 0.5rem;
    }
    
    .home-page .services ul li p {
        font-size: 0.85rem; /* Smaller text */
        margin: 0.3rem 0;
        line-height: 1.4; /* Tighter line height */
    }
    
    .home-page .services ul li .read-more {
        padding: 0.4rem 0.8rem; /* Smaller button */
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }
}

/* Additional adjustments for scrolling services on tablets */
@media (min-width: 481px) and (max-width: 1024px) {
    .home-page .services ul {
        display: flex; /* Use flex instead of grid on tablets */
        flex-wrap: nowrap; /* Allow horizontal scrolling */
        overflow-x: auto; /* Enable horizontal scroll */
        padding: 1rem;
        scroll-snap-type: x mandatory; /* Snap to items */
        scroll-behavior: smooth; /* Smooth scrolling */
        -webkit-overflow-scrolling: touch; /* Better iOS scrolling */
        gap: 1rem;
    }
    
    .home-page .services ul li {
        flex: 0 0 80%; /* Each item takes up 80% of container width */
        scroll-snap-align: center; /* Center snap point */
        margin-right: 5px; /* Space between items */
    }
    
    /* Hide scrollbar but maintain functionality */
    .home-page .services ul::-webkit-scrollbar {
        height: 0; /* Hide scrollbar */
        width: 0;
    }
    
    /* Visual indicator for scrolling */
    .home-page .services::after {
        content: '';
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 4px;
        background-color: rgba(255, 255, 255, 0.5);
        border-radius: 2px;
        opacity: 0.7;
    }
}

/* Responsive adjustments for tablet devices */
@media (min-width: 481px) and (max-width: 1024px) {
    .service-card {
        padding: 1.5rem;
        width: calc(100% - 3rem); /* Account for smaller padding */
    }
    
    #services-content .service-card:nth-child(n) {
        padding: 1.5rem;
        width: calc(100% - 3rem);
    }
}

/* Responsive adjustments for mobile devices */
@media (max-width: 480px) {
    .service-card {
        padding: 1.25rem;
        width: calc(100% - 2.5rem); /* Account for smaller padding */
        margin-bottom: 2rem; /* Smaller spacing between cards on mobile */
    }
    
    #services-content .service-card:nth-child(n) {
        padding: 1.25rem;
        width: calc(100% - 2.5rem);
    }
    
    /* Ensure service columns are consistent */
    .service-columns {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
}

/* Fix for support staff overflow on iPad Air and iPad Mini */
@media only screen and (min-width: 768px) and (max-width: 1024px) {
    /* Target staff blocks */
    .staff-block {
        margin-bottom: 2rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Modify staff list layout */
    .staff-list {
        display: grid;
        grid-template-columns: 1fr !important; /* Force single column */
        gap: 0.3rem;
        padding: 0;
    }
    
    /* Adjust individual staff members */
    .staff-member {
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    .support-groups {
        gap: 0.5rem; /* Reduced from 1rem */
    }
    /* Rearrange order: Name first, then photo, then contact info */
    .staff-info {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        order: 0; /* Put info container first */
    }
    
    .staff-name {
        font-size: 1rem;
        font-weight: bold;
        margin: 0 0 0.3rem 0; /* Add margin below name */
        text-align: center;
        order: 1; /* Name appears first */
    }
    
    .staff-photo {
        width: 100px;
        height: 100px;
        max-width: 100%;
        object-fit: cover;
        margin: 0 auto 0.5rem;
        order: 2; /* Photo in the middle */
    }
    
    /* Contact info below photo */
    .staff-contact {
        font-size: 0.8rem;
        margin-top: 0.4rem;
        word-break: break-word;
        order: 3; /* Contact info at the bottom */
        width: 100%;
    }
    
    /* Fix the HTML structure using CSS */
    .staff-member {
        display: flex;
        flex-wrap: wrap;
    }
    
    .staff-info {
        display: contents; /* Allow direct children to be positioned in the flex container */
    }
    
    /* Ensure proper order of elements */
    .staff-member > .staff-info > .staff-name {
        width: 100%;
        order: 1;
    }
    
    .staff-member > .staff-photo {
        order: 2;
    }
    
    .staff-member > .staff-info > .staff-contact {
        width: 100%;
        order: 3;
    }
    
    /* General staff and messengers sections */
    .general-staff-card,
    .messenger-card {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        width: 100%;
        box-sizing: border-box;
        height: auto;
    }
    
    .general-staff-group {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 3 cards per row */
        gap: 1rem;
        justify-content: center;
    }
    /* General staff card: Name first, then photo, then contact */
    .general-staff-name {
        order: 1;
        margin-bottom: 0.8rem;
        width: 100%;
        text-align: center;
        font-size: 1rem;
    }
    
    .general-staff-photo-container,
    .messenger-photo-container {
        order: 2;
        width: 100px;
        height: 100px;
        margin: 0 auto 0.8rem;
    }
    
    .general-staff-contact {
        order: 3;
        margin-top: 0.8rem;
        font-size: 0.8rem;
        width: 100%;
        text-align: center;
    }
    
    .messenger-name {
        order: 1;
        margin-bottom: 0.8rem;
        width: 100%;
        text-align: center;
        font-size: 1rem;
    }

    .messengers-group {
        display: grid;
        grid-template-columns: repeat(8, 1fr); /* 3 cards per row */
        gap: 1rem;
        justify-content: center;
    }
    
    /* Fix email overflow */
    .staff-contact a.email-link,
    .general-staff-contact a.email-link {
        word-break: break-all;
        display: inline-block;
        max-width: 100%;
    }
}

/* Ensure proper grid layout on different iPad models */
@media only screen and (min-width: 768px) and (max-width: 834px) {
    .staff-list {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .general-staff-group,
    .messengers-group {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media only screen and (min-width: 835px) and (max-width: 1024px) {
    .general-staff-group {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .messengers-group {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}



/* iOS-specific fix without using pseudo-elements */
@supports (-webkit-touch-callout: none) {
    #services-hero {
        background-attachment: scroll; /* Use scroll instead of fixed on iOS */
        background-size: cover; /* Maintain cover sizing */
        position: absolute; /* Use absolute instead of fixed on iOS */
        transform: translateZ(0); /* Force hardware acceleration */
        -webkit-transform: translateZ(0); /* Safari-specific hardware acceleration */
    }
    
    /* Ensure content still starts after the hero section */
    #services-content {
        position: relative;
        margin-top: 100vh; /* Start after hero section */
    }
}

@media only screen and (min-width: 1024px) and (max-width: 1366px) {
    .general-staff-group {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .messengers-group {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
    
    /* Adjust individual card sizes */
    .general-staff-card {
        padding: 1rem;
    }
    
    .messenger-card {
        padding: 0.75rem;
    }
}

/* Form Messages Styling - Positioned below submit button */
#form-messages {
    padding: 12px;
    margin: 15px 0 0 0; /* Top margin to create space below the button */
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    width: 100%;
    display: none; /* Initially hidden */
}

/* Show the messages when they have content */
#form-messages:not(:empty) {
    display: block;
}

/* Success message style */
.success-message {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid #4CAF50;
    font-size: 16px;
}

/* Error message style */
.error-message {
    background-color: rgba(244, 67, 54, 0.2);
    color: #F44336;
    border: 1px solid #F44336;
}