/* Universal Styles */
:root {
    /* Define color variables for easy changes and consistency */
    --primary-color: #5d4037; /* Darker brown */
    --secondary-color: #2e7d32; /* Darker green */
    --text-color-dark: #333;
    --text-color-light: #fff;
    --accent-grey: grey;
    --background-light: rgb(255, 255, 243); /* Your existing off-white/cream */
    --footer-bg-color: #2c3e50; /* Deep charcoal for footer */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Using system fonts for performance and native feel */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

html {
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
}

body {
    line-height: 1.6;
    color: var(--text-color-dark);
    overflow-x: hidden; /* Prevent horizontal scroll due to potential overflows */
    -webkit-font-smoothing: antialiased; /* Better font rendering for macOS/iOS */
    -moz-osx-font-smoothing: grayscale; /* Better font rendering for macOS/iOS */
}

a {
    text-decoration: none;
    color: var(--accent-grey);
    transition: color 0.3s ease; /* Smooth hover effect */
}

a:hover,
a:focus {
    color: var(--primary-color); /* Change link color on hover/focus */
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* Removes extra space below images */
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2; /* Better line height for headings */
    margin-bottom: 0.5em; /* Add some space below headings */
}

/* Reusable Utility Classes */
.container {
    max-width: 1200px; /* Max width for central content */
    margin: 0 auto;
    padding: 0 20px; /* Add some padding on the sides */
}

/* Screen Reader Only Class for Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #fff; /* Assuming a white background for the header */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow for depth */
    position: sticky; /* Makes header stick to top */
    top: 0;
    z-index: 1000; /* Ensures header is above other content */
}

.logo-link {
    display: flex; /* Align logo image better if it has space around it */
    align-items: center;
}

.logo {
    width: 120px; /* Adjust as needed for your logo size */
    height: auto;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 25px; /* Space between navigation items */
    transition: transform 0.3s ease-in-out;
}

.main-nav a {
    font-size: 1.1em;
    font-weight: 500;
    padding: 8px 0; /* Add more vertical padding for clickable area */
    position: relative; /* For underline effect */
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -3px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

.main-nav a:hover::after,
.main-nav a:focus::after {
    width: 100%;
}

/* Mobile Navigation Toggle (Hidden by default on desktop) */
.menu-toggle {
    display: none; /* Hide on larger screens */
    background: none;
    border: none;
    font-size: 1.8em;
    color: var(--primary-color);
    cursor: pointer;
    padding: 10px;
    z-index: 1001; /* Ensure toggle is above the menu */
}

/* Hero Banner Section */
.hero-banner {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    align-items: center;
    justify-content: center; /* Center content when wrapped */
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    padding: 60px 20px; /* Increased padding for more space */
    color: var(--text-color-light);
    gap: 40px; /* Space between text and image */
    text-align: center; /* Center text by default */
}

.banner-content {
    flex: 1; /* Allows content to grow */
    min-width: 280px; /* Minimum width before wrapping */
    max-width: 600px; /* Limit content width on very large screens */
    text-align: left; /* Align text to left within its container */
}

.hero-banner h1 {
    font-size: clamp(2em, 5vw, 3.5em); /* Responsive font size */
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-banner .tagline {
    font-size: clamp(1.2em, 3vw, 1.8em); /* Responsive font size */
    opacity: 0.9; /* Slightly less prominent than heading */
}

.banner-image {
    flex: 1;
    min-width: 250px; /* Minimum width before wrapping */
    max-width: 500px; /* Limit image width */
    background: linear-gradient(to left, rgba(255,255,255,0), rgba(255,255,255,0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 8px; /* Slightly rounded corners for the image background */
    overflow: hidden; /* Ensure image doesn't overflow rounded corners */
}

.banner-image img {
    border-radius: 4px; /* Slightly rounded corners for the image itself */
    object-fit: cover; /* Ensure image covers the area nicely */
    width: 100%;
    height: 100%; /* Fill the container */
    max-height: 350px; /* Limit max height for large screens */
}

/* Services Overview Section */
.services-overview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Changed from space-around to center for better alignment */
    padding: 60px 20px;
    background-color: var(--background-light);
    gap: 30px; /* Space between service items */
    text-align: center;
}

.services-overview h2 {
    color: var(--primary-color);
    font-size: clamp(2em, 4vw, 2.8em);
    margin-bottom: 40px;
    width: 100%;
}

.service-item {
    flex: 1;
    min-width: 280px; /* Minimum width before stacking */
    max-width: 350px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
}

.service-item .icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
}

.service-item h3 {
    color: var(--primary-color);
    font-size: 1.5em;
    margin-bottom: 10px;
}

/* About Us Section */
.about-us-section {
    padding: 60px 20px;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.about-us-section h2 {
    color: var(--primary-color);
    font-size: clamp(2em, 4vw, 2.8em);
    margin-bottom: 30px;
}

.about-us-section p {
    font-size: 1.15em;
    line-height: 1.8;
    color: var(--text-color-dark);
}

/* Gallery Section */
.gallery-section {
    display: flex;
    flex-direction: column;
    padding: 40px 20px;
    background-color: var(--background-light);
}

.image-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.image-row {
    display: flex;
    flex-direction: row;
    height: 270px;
    gap: 50px;
    align-items: center;
    justify-content: center;
}

.image-row img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.image-row img:hover {
    transform: scale(1.02);
}

/* Health Resources Section (Books) */
.health-resources-section {
    padding: 60px 20px;
    text-align: center;
}

.health-resources-section h2 {
    color: var(--primary-color);
    font-size: clamp(1.8em, 4vw, 2.5em);
    margin-bottom: 40px;
}

.books-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.book-item {
    flex: 0 0 auto;
    width: 220px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
/* Ensure the link container acts as a flexbox to stack the image and button */
.book-item a {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.book-item:hover {
    transform: translateY(-8px);
}
.book-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    flex-grow: 1; /* Allow the image to take up available space */
}

/* New rule for the Diabetes Management book to set a specific height */
.dm-book img {
    height: 343.75px;
}
/* The a tag will have the border radius and overflow hidden now */
.book-item a {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
}

/* New style for the "Buy Now" button */
.buy-now-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--secondary-color);
    color: var(--text-color-light);
    border: none;
    border-radius: 0; /* No longer needed as the parent a tag handles it */
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: auto; /* Push the button to the bottom */
}

.buy-now-btn:hover {
    background-color: var(--primary-color);
}
.clients {
    padding: 60px 20px;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    color: var(--primary-color);
    font-size: clamp(2em, 4vw, 2.8em);
    margin-bottom: 30px;
}
.teledig {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-top: 60px;
    
}
.telemed {
    color: var(--primary-color);
    font-size: clamp(2em, 4vw, 2.8em);
}
.digital {
    background-color: rgb(201, 49, 49);
    color: var(--text-color-light);
     width: clamp(16em, 30vw, 20em);
    text-align: center;
    font-size: clamp(1.5em, 1.2vw, 2em);
    padding: 5px 8px;
    margin-left: 5px;
    border-radius: 20px;
}
.consult {
    margin: 10px auto;
}
.telemed-reg {
    font-size: 1.15em;
    line-height: 1.8;
    color: var(--text-color-dark);
    margin: 0 auto;
    text-align: center;
    padding: 20px 20px;
}
.learn {
    text-align: center;
    font-size: 1em;
    border: transparent;
    width: 7em;
    border-radius: 10px;
    padding: 3px 0;
    background-color: rgb(201, 49, 49);
    color: var(--text-color-light);
}
.learn:hover {
    background-color: var(--primary-color);
}
#slider {
    overflow: hidden;
}
#slider figure {
    position: relative;
    width: 500%;
    margin: 0;
    left: 0;
    animation: 20s slider infinite;
}
#slider figure img {
    float: left;
    width: 20%;
}
@keyframes slider {
    0% {
        left: 0;
    }
    20% {
        left: 0;
    }
    25% {
        left: -100%;
    }
    45% {
        left: -100%;
    }
    50% {
        left: -200%;
    }
    70% {
        left: -200%;
    }
    75% {
        left: -300%;
    }
    95% {
        left: -300%;
    }
    100% {
        left: -400%;
    }
}
 
/* Footer */
.site-footer {
    background-color: #5d4037;
    color: var(--text-color-light);
    padding: 40px 20px 20px;
    text-align: center;
}

.footer-contact-info {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-contact-info address {
    font-style: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

.footer-contact-info .icon {
    width: 25px;
    height: 25px;
    filter: invert(100%);
    display: inline-block;
    vertical-align: middle;
}

.footer-contact-info p,
.footer-contact-info a {
    color: var(--text-color-light);
    font-size: 1em;
    margin: 0;
}

.footer-contact-info a:hover {
    text-decoration: underline;
}

/* New styling for the contact icons in the footer */
.contact-icon {
    width: 20px;
    height: 20px;
    filter: invert(100%);
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

.footer-copyright p {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 20px;
}


/* ========================================= */
/* MEDIA QUERIES FOR RESPONSIVENESS          */
/* ========================================= */

/* For screens up to 1024px wide (desktops, large tablets) */
@media (max-width: 1024px) {
    .site-header {
        padding: 10px;
    }
    .logo {
        width: 100px;
    }
    .main-nav ul {
        gap: 20px;
    }
}

/* For screens up to 768px wide (tablets and smaller) */
@media (max-width: 768px) {
    /* Mobile navigation */
    .menu-toggle {
        display: block;
    }
    .main-nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        right: 0;
        width: 250px;
        background-color: #fff;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        border-radius: 8px;
        padding: 20px;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }
    .main-nav ul[data-visible="true"] {
        display: flex;
        transform: translateX(0);
    }
    .main-nav li {
        margin: 10px 0;
        text-align: center;
    }
    .main-nav a {
        padding: 10px;
        display: block;
        font-size: 1.2em;
    }
    .main-nav a::after {
        display: none;
    }

    /* Hero Banner */
    .hero-banner {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
    }
    .banner-content {
        order: 2;
        text-align: center;
    }
    .banner-image {
        order: 1;
        margin-bottom: 30px;
    }
    .hero-banner h1, .hero-banner .tagline {
        text-align: center;
    }

    /* Gallery */
    .image-grid {
        gap: 15px;
    }
    .image-row {
        flex-direction: column;
        height: auto;
        gap: 15px;
    }
    .image-row img {
        width: 100%;
        height: 200px;
    }

    /* Sections */
    .about-us-section,
    .services-overview,
    .health-resources-section {
        padding: 40px 20px;
    }

    .digital {
     width: clamp(12em, 30vw, 16em);
     font-size: clamp(1.2em, 0.8vw, 1.5em);
}
    .books-container {
        flex-direction: column;
        align-items: center;
    }

    .book-item {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .footer-contact-info address,
    .footer-contact-info a {
        font-size: 0.9em;
    }
}

/* For screens up to 480px wide (small mobile phones) */
@media (max-width: 480px) {
    .site-header {
        padding: 10px;
    }
    .logo {
        width: 80px;
    }
    .main-nav ul {
        width: 100%;
        border-radius: 0;
        right: 0;
    }

    .hero-banner h1 {
        font-size: clamp(1.8em, 8vw, 2.5em);
    }
    .hero-banner .tagline {
        font-size: clamp(1em, 5vw, 1.4em);
    }

    .books-container {
        gap: 20px;
    }
    .book-item {
        width: 100%;
    }
    .buy-now-btn {
        font-size: 0.9em;
        padding: 8px;
    }

    .footer-contact-info address,
    .footer-contact-info a {
        font-size: 0.9em;
    }
}
