/* === Base Styles === */
/* --- Improved Box Sizing Inheritance --- */
html {
    box-sizing: border-box; /* Set base */
    scroll-behavior: smooth;
    font-size: 16px;
}
*, *:before, *:after {
    box-sizing: inherit; /* Make all elements inherit */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    line-height: 1.7;
    color: #495057;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* --- Add overflow prevention --- */
    overflow-x: hidden; /* Prevent horizontal scrollbars */
    position: relative; /* Often helps with positioning contexts */
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 25px;
}

a, button {
    transition: all 0.3s ease;
}

/* === Navigation === */
.top-menu {
    background-color: #ffffff;
    padding: 10px 0;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.top-menu .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: block;
    line-height: 0;
}

.nav-logo img {
    max-height: 45px;
    width: auto;
    vertical-align: middle;
    transition: max-height 0.3s ease; /* Add transition for size change */
}

.top-menu ul {
    list-style: none;
    display: flex;
}

.top-menu ul li {
    margin-left: 30px;
}

.top-menu ul li a {
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    font-size: 0.95em;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.top-menu ul li a:hover,
.top-menu ul li a:focus {
    color: #0056b3;
    border-bottom-color: #0056b3;
}


/* === Header Enhancements === */
.main-header {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('img/gpa_header.jpg');
    background-color: #343a40;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    padding: 120px 0;
    text-align: center;
    position: relative;
    z-index: 1;
    color: #ffffff;
}

.main-header .header-content {
    position: relative;
    z-index: 2;
}

.main-header h2 {
    font-size: 2.8em;
    font-weight: 700;
    margin-bottom: 15px;
    color: #ffffff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.main-header .header-subtitle {
    font-size: 1.2em;
    font-weight: 300;
    color: #e9ecef;
    max-width: 600px;
    margin: 0 auto 25px auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}


/* === Main Content & Section Styling === */
#main-content {
    padding: 60px 0;
    background-image: linear-gradient(to bottom, #eef2f7, #ffffff);
    background-color: #f8f9fa;
}

#main-content section {
    margin-bottom: 60px;
    padding: 50px 40px;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.section-accented-bg {
    /* background-color: #f1f3f5; */ /* Commented out as main gradient is used */
}

#main-content h3 {
    font-size: 2.1em;
    font-weight: 700;
    margin-bottom: 30px;
    color: #212529;
    text-align: center;
    padding-bottom: 15px;
    position: relative;
}
#main-content h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #0056b3;
}
#main-content h4 {
    font-size: 1.25em;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #343a40;
}
.section-intro, .section-outro {
    text-align: center;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 35px;
    font-size: 1.05em;
    color: #6c757d;
}
.section-outro { margin-top: 35px; margin-bottom: 0; }

/* === Image Placeholders / Content Images === */
.content-image-placeholder {
    background-color: #e9ecef; border: 2px dashed #ced4da; border-radius: 4px; padding: 20px; min-height: 220px; display: flex; align-items: center; justify-content: center; text-align: center; color: #6c757d; font-size: 0.9em; font-style: italic; box-sizing: border-box; margin: 25px auto 30px auto; width: 90%; max-width: 450px;
}
.content-image {
    display: block; max-width: 100%; height: auto; margin: 25px auto 30px auto; border-radius: 4px; box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}
/* Clearfix for Sections Containing Floats */
#about::after, #approach::after { content: ""; display: table; clear: both; }

/* === Approach Section Icons === */
.approach-items-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px 50px; margin-top: 40px; text-align: left; }
.approach-item { display: flex; align-items: center; gap: 15px; }
.approach-icon i { font-size: 1.6em; color: #0056b3; width: 35px; flex-shrink: 0; text-align: center; }
.approach-text { flex-grow: 1; }
.approach-item h4 { font-size: 1.15em; font-weight: 600; margin-top: 0; margin-bottom: 8px; color: #343a40; }
.approach-item p { font-size: 0.95em; margin-bottom: 0; color: #6c757d; line-height: 1.6; }

/* === Services Section Cards === */
.service-cards-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; margin-top: 40px; }
.service-card { background-color: #ffffff; padding: 35px 30px; border-radius: 6px; border: 1px solid #e0e0e0; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04); text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.service-card:hover { transform: translateY(-5px); box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08); }
.service-icon i { font-size: 2.5em; color: #0056b3; margin-bottom: 20px; }
.service-card h4 { font-size: 1.2em; font-weight: 600; margin-top: 0; margin-bottom: 15px; color: #343a40; }
.service-card p { font-size: 0.95em; line-height: 1.6; color: #6c757d; margin-bottom: 0; }

/* === Contact Section === */
#contact { text-align: center; }
.contact-details { margin-top: 30px; }
.contact-details p { margin-bottom: 10px; }
.appointment-note { margin-top: 25px; font-size: 0.9em; color: #6c757d; }

/* === Footer === */
.main-footer { background-color: #343a40; color: #adb5bd; text-align: center; padding: 40px 0; margin-top: 50px; font-size: 0.9em; }
.main-footer p { margin: 0 0 10px 0; }
.footer-nav a { color: #ced4da; text-decoration: none; margin: 0 10px; }
.footer-nav a:hover { color: #ffffff; text-decoration: underline; }

/* === Button Styles (Optional) === */
/* (Keep previous button styles) */
.btn { display: inline-block; padding: 12px 25px; border-radius: 5px; text-decoration: none; font-weight: 500; cursor: pointer; text-align: center; border: none; transition: background-color 0.3s ease, border-color 0.3s ease; }
.btn-primary { background-color: #0056b3; color: #ffffff; border: 1px solid #0056b3; }
.btn-primary:hover { background-color: #004494; border-color: #004494; }
.btn-secondary { background-color: #6c757d; color: #ffffff; border: 1px solid #6c757d; }
.btn-secondary:hover { background-color: #5a6268; border-color: #5a6268; }
.btn-header { margin-top: 15px; font-size: 1.05em; }


/* ========================== */
/* === Responsive Adjustments === */
/* ========================== */

/* Apply floats only on larger screens (Desktop First approach for floats) */
@media (min-width: 769px) {
    /* Floated images and placeholders */
    .content-image.image-float-right,
    .placeholder-float-right {
        float: right;
        width: 35%; /* Adjust width as needed */
        max-width: 320px; /* Max width when floated */
        margin-top: 5px;
        margin-bottom: 20px;
        margin-left: 30px; /* Space from text on the left */
        margin-right: 0; /* Override default auto margin */
    }

    .content-image.image-float-left,
    .placeholder-float-left {
        float: left;
        width: 35%;
        max-width: 320px;
        margin-top: 5px;
        margin-bottom: 20px;
        margin-right: 30px; /* Space from text on the right */
        margin-left: 0; /* Override default auto margin */
    }
}

/* Larger adjustments for typical laptop/desktop */
@media (max-width: 992px) {
    .main-header h2 { font-size: 2.4em; }
    .main-header .header-subtitle { font-size: 1.1em; }
    #main-content h3 { font-size: 1.9em; }
}

/* Tablet View - Where stacking begins */
@media (max-width: 768px) {
    html { font-size: 15px; }
    .container { padding: 0 20px; }
    .top-menu ul li { margin-left: 20px; }
    .nav-logo img { max-height: 40px; }

    /* --- MODIFIED AGAIN: Using display:table and explicit resets --- */
    .placeholder-float-right, .placeholder-float-left,
    .content-image.image-float-right, .content-image.image-float-left {
        /* --- Display & Sizing --- */
        display: table !important;         /* Use table display */
        table-layout: fixed !important;    /* Force stricter layout */
        width: 100% !important;            /* Occupy container width */
        max-width: 100% !important;      /* Don't exceed container */
        height: auto !important;           /* Maintain aspect ratio */
        /* --- Reset potentially interfering properties --- */
        float: none !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        position: static !important;       /* Reset positioning if any applied */
        transform: none !important;        /* Reset transforms if any applied */
        /* --- Margins --- */
        margin: 20px auto 25px auto !important; /* Center block margins */
    }
    /* --- End Modification --- */

    /* Ensure base image respects container */
    .content-image {
        max-width: 100%;
        height: auto;
        display: block; /* Default display when not floated */
    }
    /* Keep placeholder height consistent */
    .content-image-placeholder {
        min-height: 180px;
         /* Apply similar fixes if needed */
        /* display: table !important; table-layout: fixed !important; ... etc */
    }
    /* Hide potential overflow on sections */
     #main-content section {
        overflow: hidden;
     }


    /* Stack approach items */
    .approach-items-container { grid-template-columns: 1fr; gap: 35px; }
    /* ... (rest of approach item styles) ... */

    /* Stack service cards */
    .service-cards-container { grid-template-columns: 1fr; }
    #main-content section { padding: 40px 30px; }
}

/* Mobile View */
@media (max-width: 480px) {
    html { font-size: 14px; }
    .container { padding: 0 15px; }

    /* Stack nav menu */
    .top-menu .container {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    .nav-logo {
        margin-bottom: 10px;
    }
    .nav-logo img {
        max-height: 55px; /* Increased logo size */
    }
    .top-menu ul {
        flex-direction: column;
        align-items: center;
        margin-top: 0;
        width: 100%;
        padding-top: 10px;
        border-top: 1px solid #eee; /* Optional separator */
    }
    .top-menu ul li {
        margin: 8px 0; /* Vertical spacing */
    }

    .main-header { padding: 80px 0; }
    .main-header h2 { font-size: 2em; }
    .main-header .header-subtitle { font-size: 1em; }

    #main-content { padding: 40px 0; }
    #main-content section { padding: 30px 20px; margin-bottom: 40px; }
    #main-content h3 { font-size: 1.6em; margin-bottom: 25px; }
    #main-content h3::after { width: 50px; height: 2px; } /* Smaller underline */

    /* Image stacking styles from 768px cascade down correctly */
    /* Placeholder adjustments for smaller screens */
    .content-image-placeholder {
       min-height: 150px;
       padding: 15px;
       font-size: 0.85em;
       margin: 15px auto 20px auto; /* Keep using centered margins */
    }
}