/* --- Global Styles & Variables --- */
:root {
    --primary-blue: #2c476e;
    --secondary-blue: #3a6ba8;
    --light-gray-bg: #f8f9fa;
    --dark-text: #333;
    --light-text: #fff;
    --border-color: #e0e0e0;
    --font-main: 'Lato', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    color: var(--dark-text);
    line-height: 1.7;
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header & Navigation --- */
.top-bar {
    background-color: var(--primary-blue);
    color: var(--light-text);
    padding: 10px 0;
    font-size: 0.9rem;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.patient-portal-link {
    color: var(--light-text);
    text-decoration: none;
    font-weight: bold;
    border: 1px solid var(--light-text);
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
}

.patient-portal-link:hover {
    background-color: var(--light-text);
    color: var(--primary-blue);
}

.main-nav {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    padding-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img { max-height: 100px; }

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 700;
    padding: 10px 0;
    position: relative;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--secondary-blue); }

.dropdown { position: relative; }
.dropdown .arrow { font-size: 0.7em; }

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    list-style: none;
    padding: 10px 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 260px;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu li a {
    padding: 10px 20px;
    display: block;
    width: 100%;
}

/* --- Buttons --- */
.btn {
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    border: 1px solid transparent;
    display: inline-block;
}

.btn-primary {
    background-color: var(--secondary-blue);
    color: var(--light-text);
}
.btn-primary:hover { background-color: var(--primary-blue); }

.btn-secondary {
    background-color: transparent;
    color: var(--secondary-blue);
    border-color: var(--secondary-blue);
}
.btn-secondary:hover {
    background-color: var(--secondary-blue);
    color: var(--light-text);
}
.btn.inverted {
    background-color: var(--light-text);
    color: var(--secondary-blue);
}
.btn.inverted:hover {
    background-color: #f1f1f1;
}

.mobile-menu-toggle { display: none; }

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 70vh;
    display: flex;
    align-items: center;
    overflow: hidden; /* Hides anything that might stick out */
}

.hero-slides-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0; /* Make all slides invisible by default */
    transition: opacity 1.5s ease-in-out; /* This creates the smooth fade effect */
}

.hero-slide.active {
    opacity: 1; /* The active slide is visible */
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Dark overlay */
}

.hero-content {
    position: relative;
    z-index: 2; /* Ensures text is on top of the overlay and images */
    color: var(--light-text);
    padding-left: 5%;
    max-width: 600px;
}

.hero-content h1 {
    font-size: 3.2rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--light-text);
    padding-left: 5%; /* Aligns text to the left */
    max-width: 600px;
}

.hero-content h1 {
    font-size: 3.2rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1rem;
}
.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

/* --- Content Sections --- */
section { padding: 80px 0; }
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
}
.two-col-layout {
    display: flex;
    align-items: center;
    gap: 60px;
}
.two-col-layout.reverse { flex-direction: row-reverse; }
.two-col-layout > div { flex: 1; }

.intro-image img, .doctor-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.intro-text h2, .doctor-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}
.doctor-text h4 {
    font-size: 1.2rem;
    color: var(--secondary-blue);
    margin-bottom: 1.5rem;
}
.learn-more-link {
    color: var(--secondary-blue);
    text-decoration: none;
    font-weight: bold;
}



/* Services Section - Continuous Slider */
.services-section {
    background-color: var(--light-gray-bg);
}

.slider-container {
    position: relative; /* Needed for the fading edges */
}

.slider-viewport {
    width: 100%;
    position: relative;
    cursor: grab;
    /* --- The Fix --- */
    overflow-x: hidden; /* Hide horizontal overflow (keeps the slider working) */
    overflow-y: visible; /* Allow vertical overflow (lets the card pop up) */
    /* Add a little space at the top so the lifted card doesn't hit anything */
    padding-top: 15px; 
    margin-top: -15px; /* Pull the viewport back up to maintain original spacing */
}

/* Fading Edge Effect */
.slider-viewport::before,
.slider-viewport::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px; /* Width of the fade */
    z-index: 2;
    pointer-events: none; /* Allows clicking/dragging through the gradient */
}

.slider-viewport::before {
    left: 0;
    background: linear-gradient(to right, var(--light-gray-bg), transparent);
}

.slider-viewport::after {
    right: 0;
    background: linear-gradient(to left, var(--light-gray-bg), transparent);
}


.slider-track {
    display: flex;
    gap: 30px; /* Space between cards */
    /* The transform is now controlled entirely by JavaScript */
}

.slider-track.dragging {
    cursor: grabbing; /* Show a grabbing hand while dragging */
}

.service-card {
    flex: 0 0 350px; /* Give cards a fixed width */
    width: 350px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    /* Prevent text selection while dragging */
    user-select: none;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}
.service-card a {
    /* Prevent link dragging from interfering with slider drag */
    pointer-events: none;
}
.slider-track.dragging a {
    pointer-events: none; /* Disable links while dragging */
}
.slider-track:not(.dragging) a {
    pointer-events: auto; /* Re-enable links when not dragging */
}


.service-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none; /* Prevents image ghosting on drag */
}
.service-card h3 {
    margin: 20px 0 10px;
    color: var(--primary-blue);
}
.service-card p {
    padding: 0 20px;
    margin-bottom: 20px;
}
.service-card .learn-more-link {
    display: block;
    padding: 20px;
    background: var(--light-gray-bg);
    text-decoration: none;
    font-weight: bold;
    color: var(--secondary-blue);
    transition: background-color 0.3s;
}
.service-card .learn-more-link:hover {
    background-color: #e2e6ea;
}

/* Responsive adjustments for the fade effect */
@media (max-width: 768px) {
    .slider-viewport::before,
    .slider-viewport::after {
        width: 50px; /* Make the fade narrower on small screens */
    }
    .service-card {
        flex-basis: 300px; /* Make cards a bit smaller */
        width: 300px;
    }
}

/* --- Service Card Hover Effect --- */
.slider-track:not(.dragging) .service-card:hover {
    transform: translateY(-10px); /* Lifts the card up */
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15); /* Makes the shadow deeper */
}


/* Slider Buttons */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-blue);
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: background-color 0.3s, color 0.3s;
}

.slider-btn:hover {
    background-color: var(--primary-blue);
    color: #fff;
}

.slider-btn.prev { left: 0; }
.slider-btn.next { right: 0; }

.slider-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* Responsive adjustments for the slider */
@media (max-width: 992px) {
    .service-card {
        flex-basis: calc((100% / 2) - (30px / 2)); /* Show 2 cards */
    }
}

@media (max-width: 768px) {
    .service-card {
        flex-basis: 100%; /* Show 1 card */
    }
    .slider-container {
        padding: 0 40px; /* Reduce space for arrows on smaller screens */
    }
    .slider-btn {
        width: 40px;
        height: 40px;
    }
}



/* CTA Section */
.cta-section {
    background-color: var(--primary-blue);
    color: var(--light-text);
    text-align: center;
}
.cta-section h2 { font-size: 2.5rem; }

/* --- Footer --- */
footer {
    background-color: var(--primary-blue);
    color: #cdd6e0;
    padding-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    padding-bottom: 40px;
}
.footer-col h4 {
    color: var(--light-text);
    margin-bottom: 20px;
}
.footer-col ul { list-style: none; }
.footer-col a { color: #cdd6e0; text-decoration: none; }
.footer-col a:hover { color: #fff; }
.footer-col li { margin-bottom: 10px; }
.footer-logo { max-width: 200px; margin-bottom: 1rem; }
.footer-bottom {
    border-top: 1px solid #4a6a9b;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
}
.footer-bottom a { color: #fff; }

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .nav-links { gap: 20px; }
    .two-col-layout { flex-direction: column !important; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-links, .nav-btn { display: none; }
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.8rem;
        color: var(--primary-blue);
        cursor: pointer;
    }
    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 85px; left: 0;
        width: 100%;
        background-color: #fff;
        padding: 20px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        align-items: flex-start;
    }
    .dropdown:hover .dropdown-menu { display: none; } /* Disable hover on mobile */
    .dropdown.open .dropdown-menu { display: block; position: static; box-shadow: none; border: none; padding-left: 15px;}
    .hero-content h1 { font-size: 2.5rem; }
    .services-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* --- Location & Map Section (Compact Version) --- */
.location-section {
    padding: 30px 0; /* Reduced vertical padding from 80px */
}

.location-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px; /* Reduced gap from 50px */
    align-items: center; /* Vertically centers the text with the smaller map */
}

.location-details h3 {
    font-size: 1.6rem; /* Slightly smaller heading */
    color: var(--primary-blue);
    margin-bottom: 0.8rem;
}

.location-details p {
    font-size: 1rem; /* Slightly smaller text */
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.location-details h4 {
    font-size: 1.2rem;
    color: var(--primary-blue);
    margin-bottom: 0.8rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.office-hours {
    list-style: none;
    padding: 0;
    font-size: 0.95rem;
}

.office-hours li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0; /* Reduced padding */
    border-bottom: 1px solid #eee;
}

.office-hours li span {
    font-weight: bold;
    color: var(--dark-text);
}

.location-map iframe {
    border-radius: 8px;
    width: 100%;
}

/* --- Responsive Adjustments for Location Section --- */
@media (max-width: 992px) {
    .location-grid {
        grid-template-columns: 1fr; /* Stack the columns */
        gap: 30px;
    }
}

/* --- Responsive Adjustments for Location Section --- */
@media (max-width: 992px) {
    .location-grid {
        grid-template-columns: 1fr; /* Stack the columns */
    }
}


/* --- Subpage Template Styles --- */
.subpage-header {
    background-color: var(--primary-blue);
    color: var(--light-text);
    padding: 60px 0;
    text-align: center;
}

.subpage-header h1 {
    font-size: 2.8rem;
    font-weight: 900;
    margin: 0;
}

.subpage-header .subtitle {
    font-size: 1.2rem;
    margin-top: 10px;
    opacity: 0.9;
}

.main-content {
    padding: 80px 0;
}

/* Basic styles for content within the main area for good readability */
.main-content h2 {
    font-size: 2.2rem;
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
}

.main-content p,
.main-content ul {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    max-width: 800px; /* Constrains text width for easier reading */
}

.main-content ul {
    padding-left: 20px;
}