/* General Body Styling */

html,body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Header and Navigation */
header {
    background-color: #333;
    color: white;
    padding: 1em 0;
    position: relative;
}

header, nav {
    position: relative;
    z-index: 999; /* bring to front */
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

nav li {
    position: relative;
    margin-right: 40px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 10px;
    display: block;
}

nav ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #444;
    padding: 0;
    z-index: 1000;
}

nav li:hover > ul {
    display: block;
}

nav ul ul li {
    width: 250px;
    margin-right: 0;
}

nav img {
    height: auto;
    vertical-align: middle;
    margin-right: 10px;
}

/* Main Content */
main {
    padding: 2em;
    margin-left: 5em;
    margin-right: 10em;
}

main h1 {
    font-size: 1.5em;
    margin-top: 1em;
}

main p {
    line-height: 1.6;
}

/* Footer Styling */
footer {
     width: 100%;
    min-width: 100%; 
    background-color: #333;
    color: white;
    padding: 1em;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

footer div {
    /* min-width: 200px; */
    margin: 10px;
}

footer a {
    color: white;
    text-decoration: none;
}

/* Media Queries for responsive design */
@media (min-width: 768px) {
    main {
        padding: 2rem 4%;
    }
    
    .content-block {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        align-items: start;
        margin: 2.5rem 0;
    }
    
    .content-block img {
        width: 100%;
        height: auto;
        max-height: 400px;
        object-fit: contain;
        border-radius: 4px;
    }
    
    .content-text {
        padding: 0 1rem;
    }
    
    .image-right {
        direction: rtl;
    }
    
    .image-right > * {
        direction: ltr;
    }
}

/* ======================
   MOBILE STYLES (max-width: 767px)
   ====================== */
@media only screen and (max-width: 767px) {

    /* Ensure nav stays on top */
    header, nav {
        position: relative;
        z-index: 9999;
    }

    nav ul {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 10px;
    }

    nav li {
        width: 100%;
        position: relative;
    }

    nav a {
        display: block;
        width: 100%;
        padding: 12px;
    }

    nav ul ul {
        display: none;
        position: relative;
        background: #444;
        width: 100%;
        z-index: 999;
        margin-left: 10px;
    }


    /* Enable dropdown on focus or active */
    nav li:focus-within > ul,
    nav li:hover > ul {
        display: block;
    }

    nav ul ul li a {
        padding-left: 20px;
    }

    /* Ensure no element overlaps header */
    main, section {
        position: relative;
        z-index: 1;
    }

    /* Prevent paragraphs from becoming too narrow */
    body, main, section {
        width: 100% !important;
        max-width: 100% !important;
        padding: 1em !important;
        margin: 0 auto !important;
        box-sizing: border-box;
    }

    p {
        font-size: 1em;
        line-height: 1.6;
        margin-bottom: 1em;
        text-align: left;
        word-break: normal;
    }

    h1, h2 {
        font-size: 1.3em;
        margin-top: 1.5em;
    }

    /* Stack content blocks vertically */
    div[style*="display: flex"] {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1.2em;
    }

    div[style*="display: flex"] img {
        width: 100% !important;
        height: auto !important;
    }

    /* Hero image full width */
    img[style*="width:100%"] {
        width: 100% !important;
        height: auto;
    }

    /* Footer layout */

    footer {
        display: flex !important;          /* make footer a flex container */
        flex-direction: row !important;    /* arrange children in a row */
        justify-content: center !important;/* center horizontally */
        align-items: center !important;    /* center vertically */
        flex-wrap: nowrap !important;      /* no wrapping, force one row */
        text-align: center !important;
        padding: 1em !important;
        /* width: 100% !important; */
        box-sizing: border-box !important;

    }

    footer div {
        margin: 0 15px !important;          /* horizontal spacing */
        min-width: auto !important;         /* override any min-width */
        text-align: center !important;
    }

 
}
