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

html {
    font-size: 16px; /* Base reference for rem */
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f5f4ef;
    color: #222;
    line-height: 1.7;
}

/* Typography, fonts and stuff*/

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
p, a { font-size: 1rem; }

/* Links */
a {
    color: #222;
    text-decoration: none;
    transition: all 0.25s ease;
}

a:hover {
    color: #d4a017;
}

/***********************************************
************************************************

   POPUP SECTION

************************************************
************************************************/

/* Popup checkbox (hidden) */
#popup-toggle {
    display: none;
}

/* Popup overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Show popup when checkbox is checked */
#popup-toggle:checked ~ .popup-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Popup box */
.popup-box {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.popup-box h3 {
    color: #0a8f4d;
    margin-bottom: 1rem;
}

.popup-box p {
    margin-bottom: 1.5rem;
    color: #222;
}

/* Okay button */
.popup-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: #0a8f4d;
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.popup-btn:hover {
    background-color: #08743e;
}

/***********************************************
************************************************

   FLOATING CONTACT SECTION

************************************************
************************************************/

.floatcontact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background-color: #0a8f4d;
    color: #fff;
    font-family: monospace;
}

.fc_right,
.fc_left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.floatcontact img {
    height: 1.75rem;
    border-radius: 50%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.floatcontact img:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

/***********************************************
************************************************

   NAVBAR SECTION

************************************************
************************************************/

.navbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 2rem;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);

    /* to stick to the top */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar a {
    font-family: monospace;
    font-size: 1rem;
    position: relative;
}

.navbar a::after {
    /*this creates an animated line*/
    content: "";
    position: absolute;
    left: 0; /*Defines where it starts from */
    bottom: -4px;
    width: 0%;
    height: 2px;
    background-color: #d4a017;
    transition: width 0.3s ease;
}

.navbar a:hover::after {
    width: 100%;
}

/***********************************************
************************************************

   HOME SECTION

************************************************
************************************************/

.home {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    gap: 1.25rem;
    background-image: url(./images/whoe-we-are2.png);
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    margin: 0.5rem;
    border-radius: 12px;
}
.home h1{
    color: white;
}

.home_content,
.home_slogan {
    background: rgba(0, 60, 22, 0.65);
    color: #fff;
    padding: 1rem;
    border-radius: 12px;
    max-width: 700px;
}

/***********************************************
************************************************

   ABOUT SECTION

************************************************
************************************************/

.about {
    padding: 4rem 2rem;
}

.about-block {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 3rem;
}

.about-block.reverse {
    flex-direction: row-reverse;
}

.about-content {
    flex: 1;
    text-align: justify;
}

.image-swap {
    flex: 1;
    position: relative;
    height: 260px;
    overflow: hidden;
    border-radius: 16px;
}

.image-swap img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: fade 10s infinite;
}

.image-swap img:nth-child(1) {
    opacity: 1;
}

.image-swap img:nth-child(2) {
    animation-delay: 5s;
}

@keyframes fade {
    0% { opacity: 0; }
    20% { opacity: 1; }
    50% { opacity: 1; }
    70% { opacity: 0; }
    100% { opacity: 0; }
}
/***********************************************
************************************************

   PRODUCTS AND SERVICES SECTION

************************************************
************************************************/

.products-services {
    padding: 4rem 2rem;
}

.products-services h1 {
    margin-bottom: 2rem;
}

.products li {
    list-style: none;
    margin-bottom: 0.5rem;
}

.products li label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    background-color: #0a8f4d;
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.products li label:hover {
    background-color: #5c671c;
}

.products li label span {
    font-size: 1.2rem;
}

/* Accordion */
.products input[type="radio"] {
    display: none;
}

.products .content {
    max-height: 0;
    overflow: hidden;
    padding: 0 1rem;
    transition: max-height 0.3s ease;
}

.products input[type="radio"]:checked ~ .content {
    max-height: 1200px;
    padding: 1rem;
}

/* Image Grid for Products/Services */
.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.image-grid a {
    display: block;
    border-radius: 16px;
    overflow: hidden;
}

.image-grid img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.image-grid img:hover {
    transform: scale(1.05);
}

/***********************************************
************************************************

   IMPACT SECTION

************************************************
************************************************/

.impact {
    padding: 4rem 2rem;
    background-color: #fff;
    margin: 2rem 0;
}

/*.impact*/ h1 {
    color: #0a8f4d;
    margin-bottom: 1.5rem;
}

.impact p {
    margin-bottom: 1rem;
    text-align: justify;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Impact pictures */

.impact-gallery {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    margin-top: 2rem;
    scroll-behavior: smooth;
}

.impact-gallery::-webkit-scrollbar {
    height: 8px;
}

.impact-gallery::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.impact-gallery::-webkit-scrollbar-thumb {
    background: #0a8f4d;
    border-radius: 10px;
}

.impact-gallery::-webkit-scrollbar-thumb:hover {
    background: #08743e;
}

.impact-gallery a {
    flex-shrink: 0;
    width: 300px;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
}

.impact-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.impact-gallery img:hover {
    transform: scale(1.05);
}

/***********************************************
************************************************

   FOOTER SECTION

************************************************
************************************************/


.footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 3rem 2rem 1rem 2rem;
    background-color: #5f5a4a;
    color: #fff;
}

.footer img {
    height: 1.75rem;
    border-radius: 50%;
    transition: transform 0.25s ease;
}

.footer img:hover {
    transform: translateY(-3px);
}

.phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-links {
    display: flex;
    gap: 0.75rem;
}

.location-info {
    margin-top: 1rem;
}

.location-info p {
    margin: 0.25rem 0;
}

.email {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.email button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    background-color: #d4a017;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.email button:hover {
    background-color: #b8860b;
}

.email-text {
    font-size: 0.9rem;
    color: #ddd;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo img {
    width: 200px;
    height: auto;
    border-radius: 0;
}

/* Copyright Section */
.copyright {
    background-color: #5f5a4a;
    color: #fff;
    text-align: center;
    padding: 1rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.copyright p {
    margin: 0;
    font-size: 0.9rem;
}

/***********************************************
************************************************

   BACK TO TOP SECTION

************************************************
************************************************/


.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: #0a8f4d;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top:hover {
    background-color: #08743e;
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
/***********************************************
************************************************

    RESPONSIVE DESIGN

************************************************
************************************************/


@media screen and (max-width: 768px) {
    /* Popup sections*/
    .popup-overlay {
        align-items: flex-start; /* Start from top on mobile */
        padding: 1rem;
    }
    
    .popup-box {
        margin-top: 2rem; /* Space from top on mobile */
        padding: 1.5rem;
    }
    
    
    .home{
        background-position:80%;
    }

        

/* Floating contact section */
    .floatcontact {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
/* navbar section */

    .navbar {
        gap: 1rem;
    }

    /* Home section */
    .home {
        padding: 2rem;
        text-align: center;
    }

    /* About section */
    .about-block,
    .about-block.reverse {
        flex-direction: column;
        text-align: center;
    }


    /* fixing the disappering images in mobile */

    .image-swap {
        width: 100%;
        display: flex;
        gap: 0.7rem;
        scroll-snap-type: x mandatory;
        height: auto;
        padding-bottom: 0.5rem;
        
        overflow-x: auto;
        
    }
    .image-swap img{
        border: 5px solid khaki;
        position: static;          /* stop overlapping */
        flex: 0 0 100%;             /* image width */
        max-height: 500px;
        opacity: 1;
        animation: none;
        border-radius: 12px;
        scroll-snap-align: start;
    }

    /* Mobile: 1 column with vertical scroll for product images */
    .image-grid {
        grid-template-columns: 1fr;
        max-height: 450px;
        overflow-y: auto;
        padding-right: 0.5rem;
    }

    .image-grid::-webkit-scrollbar {
        width: 6px;
    }

    .image-grid::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .image-grid::-webkit-scrollbar-thumb {
        background: #0a8f4d;
        border-radius: 10px;
    }

    .image-grid::-webkit-scrollbar-thumb:hover {
        background: #08743e;
    }

    .image-grid img {
        height: 180px;
    }

    .impact-gallery a {
        width: 250px;
        height: 170px;
    }

    .footer {
        flex-direction: column;
        text-align: center;
    }

    .contact-links {
        justify-content: center;
    }

    .phone {
        justify-content: center;
    }

    .logo img {
        width: 200px;
    }

    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1.5rem;
        right: 1.5rem;
        font-size: 1.3rem;
    }

}
