body{
    background-color: white;
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
}

section {
    margin-bottom: 50px;
}

/* Ylä banneri alkaa */
.navbar{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100px;
    background-color: white;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1); /* Add this line */
    position: relative; /* Add this */
    z-index: 10; /* Ensures it appears on top */ 


}
.logo{
    max-width: 300px;
    width: 40%;
    margin-left: 10px;
}

.navbar a img {
    max-width: 300px; /* Match your logo's intended size */
    width: 100%; /* Ensure responsive behavior */
    height: auto; /* Maintain aspect ratio */
    display: block; /* Prevent unwanted inline spacing issues */
}

.navbar ul{
    padding-right: 15px;
}
.navbar ul li{
    list-style: none;
    display: inline-block;
    position: relative;
    margin-left: 10px;
    margin-right: 10px;
}
.navbar ul li a{
    text-decoration: none;
    color: black;
    text-transform: uppercase;
}
.navbar ul li::after{
    content: '';
    height: 3px;
    width: 0%;
    background: rgb(13, 175, 74);
    position: absolute;
    left: 0px;
    bottom: -10px;
    transition: 0.5s;
}
.navbar ul li:hover::after{
    width: 100%;
}

/* off-screen-menu*/

.off-screen-menu{
    background-color: rgb(240, 240, 240);
    height: 100vh;
    width: 100%;
    max-width: 450px;
    position: fixed;
    top: 0;
    right: -450px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 3rem;
    transition: .3s ease;
}
.off-screen-menu.active{
    right: 0;
}
.ham-menu {
    height: 60px;
    width: 50px;
    position: fixed;
    background-color: rgb(240, 240, 240);
    border-radius: 5px;
    padding: 12px;
    right: 0;
    top: 15px;
    opacity: 90%;
}
.ham-menu span{
    height: 5px;
    width: 70%;
    background-color: rgb(13, 175, 74);
    border-radius: 25px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: .3s ease;
}
.ham-menu span:nth-child(1){
    top: 25%;
}
.ham-menu span:nth-child(3){
    top: 75%;
}
.ham-menu.active span:nth-child(1){
    top: 50%;
    transform: translate(-50%, 50%) rotate(45deg);
}
.ham-menu.active span:nth-child(2){
    opacity: 0;
}
.ham-menu.active span:nth-child(3){
    top: 50%;
    transform: translate(-50%, 50%) rotate(-45deg);
}

/* Yläbanneri loppuu*/

/* Etusivu alkaa */
.etusivu-banneri{
    display: grid;
    justify-content: center;
}
.banneri-kuva{
    width: 100%;
    padding-bottom: 20px;
    border-radius: 0px;
}
.main-content{
    display: grid;
    grid-template-columns: 350px 350px 350px;
    justify-content: center;
    column-gap: 40px; /* Adjust for even spacing */
    row-gap: 40px;
    padding: 20px; /* Add padding to create separation */
}
.etusivu-content1,
.etusivu-content2,
.etusivu-content3{
    text-align: center;
    color: black;
    display: inline-block;
    padding-top: 15px;
    padding-bottom: 15px;
    padding-left: 15px;
    padding-right: 15px;
    background-color: rgb(240, 240, 240);
    border-radius: 10px;
    line-height: 24px;
    padding: 20px;
}
.etusivu-content-1-teksti,
.etusivu-content-2-teksti,
.etusivu-content-3-teksti,
.etusivu-content-4-teksti,
.etusivu-content-5-teksti,
.etusivu-content-6-teksti{
    text-align: center;
    text-align: justify;
    font-size: 1.1rem; /* Increase font size, adjust as needed */
    line-height: 1.6;  /* Optional: Improve readability with more line spacing */

}

.etusivu-content1 h2,
.etusivu-content2 h2,
.etusivu-content3 h2 {
    margin-bottom: 25px; /* Adds space below the heading */
}

.etusivu-content-1-teksti p,
.etusivu-content-2-teksti p,
.etusivu-content-3-teksti p {
    margin: 20px 10px; /* Increase vertical spacing (top and bottom) */
}


.main-content-otsikko{
    text-align: center;
    color: rgb(13, 175, 74);
}

.main-content-otsikko h1 {
    margin-top: 30px; /* Add space above the "Lukemista" title */
    margin-bottom: 10px;
    color: white; /* Ensure the heading is white */

}

.main-content-2 {
    grid-template-columns: 300px; /* Matches other boxes */
    justify-content: center;
    text-align: justify; /* Align text for readability */
    padding: 20px;
    background: linear-gradient(135deg, #2CAA32, #075F1E); /* Stronger green tones */
    border-radius: 0px;
    margin: 30px auto; /* Center-align with space */

}
.etusivu-content-2{
    color: white; /* Ensure text contrast */
    padding: 0px;
    border-radius: 0px;
    font-size: 1.2rem; /* Adjust the size as needed */
    text-align: center;
    line-height: 1.8;
    margin: 40px auto;
    max-width: 900px; /* Limit the width of the content */

}
.main-content-3{
    display: grid;
    grid-template-columns: 300px 300px;
    justify-content: center;
    column-gap: 30px;
    margin-bottom: 30px;
}
.lehti-1,
.lehti-2{
    text-align: center;
}

.lehti-1, .lehti-2 {
    width: auto; /* Ensure they respect the grid */
    margin: 0; /* Remove any extra spacing */
}
.lehti-1-kuva,
.lehti-2-kuva{
    width: 300px;
    height: 400px;
    object-fit: cover;
}



.annosjakelu-kuva,
.lääkkeidentarkastus-kuva,
.lhka-kuva,
.eläinkuva{
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 100%;
    margin-top: 15px; /* Add top margin to balance */
    margin-bottom: 5px;

}
/* Etusivu loppuu*/

/* Footeri alkaa */
footer{
    background-image: url("Kuvat/footer-kuva1.png");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    margin-top: 15px;
}
.footer-content{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: end;
}
.footer-logo{
    max-width: 400px;
    width: 100%;
}
.footer-yhteystiedot{
    padding-top: 10px;
    padding-bottom: 20px;
    color: white;
    text-align: center;
    line-height: 20px;
}
.footer-some{
    display: grid;
    grid-template-columns: 30px 30px;
    justify-content: center;
    column-gap: 30px;
    font-size: 40px;
    align-items: end;
    padding-bottom: 20px;
}
.footer-linkki-1,
.footer-linkki-2,
.footer-linkki-1:visited,
.footer-linkki-2:visited,
.footer-some-1,
.footer-some-2,
.footer-some-1:visited,
.footer-some-2:visited{
    color: white;
}
/* Footeri loppuu */

.linkki-1,
.linkki-2,
.linkki-1:visited,
.linkki-2:visited{
    color:black
}
.yhteystieto-kartta{
    display: grid;
    grid-template-columns: 1fr 2fr;
    column-gap: 30px;
    justify-content: center;
    text-align: center;
    padding: 15px;
}
.palvelut_content{
    display: grid;
    grid-template-columns: 400px 400px 400px;
    justify-content: center;
    column-gap: 30px;
    row-gap: 30px;
    padding: 15px;
}

.palvelut_content_1,
.palvelut_content_2,
.palvelut_content_3,
.palvelut_content_4,
.palvelut_content_5,
.palvelut_content_6,
.palvelut_content_7{
    text-align: center;
    color: black;
    display: inline-block;
    padding-top: 15px;
    padding-bottom: 15px;
    padding-left: 15px;
    padding-right: 15px;
    background-color: rgb(240, 240, 240);
    border-radius: 10px;
    line-height: 24px;
    padding: 20px;
    text-align: center;
    color: black;
    display: inline-block;
    background-color: rgb(240, 240, 240);
    border-radius: 10px;
    line-height: 24px;
    font-size: 1.1rem; /* Increase font size, adjust as needed */
    line-height: 1.6;  /* Optional: Improve readability with more line spacing */

}
.palvelut_content_7{
    background-image: url(Kuvat/ipa-sisä.jpg);
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    font-size: 1.1rem; /* Increase font size, adjust as needed */
    line-height: 1.6;  /* Optional: Improve readability with more line spacing */
}

.palvelut_kuva{
    width: 75px;
    height: 75px;
    background-color: darkgray;
    border-radius: 20%;
    padding: 10px;
}
.palvelut_teksti{
    text-align: center;
    text-align: justify;
    font-size: 1.1rem; /* Increase font size, adjust as needed */
    line-height: 1.6;  /* Optional: Improve readability with more line spacing */
    margin-top: 10px; /* Add spacing around text */
    Padding: 0 10px;

}

.palvelut_teksti p {
    margin: 25px 0; /* Slightly increase vertical spacing */
}

.palvelut_content h2 {
    font-size: 1.5rem; /* Match heading size */
    margin-bottom: 20px; /* Add spacing below headings */
}

.yritys-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr; /* Layout with text in the center and images on the sides */
    column-gap: 30px; /* Space between columns */
    justify-content: center;
    align-items: center; /* Vertically align content */
    padding: 20px; /* Add padding around the entire section */
    background-color: rgb(240, 240, 240); /* Match the gray background */
    border-radius: 10px; /* Rounded corners for consistency */
}

.yritys-content-1 {
    padding: 20px; /* Inner padding for the text */
    background-color: rgb(240, 240, 240); /* Gray background color */
    text-align: justify; /* Justify the text for readability */
    font-size: 1.1rem; /* Match font size to other pages */
    line-height: 1.6; /* Improve line spacing */
    border-radius: 10px; /* Add rounded corners */
}

.yritys-content-1 h2 {
    font-size: 1.5rem; /* Match heading size */
    margin-bottom: 20px; /* Add space below the heading */
    text-align: center; /* Center the heading */
}

.yritys-content-1 p {
    margin: 25px 0; /* Add vertical space between paragraphs */
    padding: 0 10px; /* Optional: Add horizontal padding for better spacing */
}
.yritys_kuva{
    width: 100%;
    height: 700px;
    object-fit: cover;
    border-radius: 10px;
}
h2{
    text-align: center;
}



@media (max-width: 750px) {
    .main-content,
    .palvelut_content,
    .main-content-2,
    .main-content-3,
    .footer-content,
    .yhteystieto-kartta,
    .yritys-content {
        grid-template-columns: 1fr;
        padding-left: 50px;
        padding-right: 50px;
    }

    .navbar,
    .yhteystieto-kartta-2 {
        display: none;
    }
    .palvelut_content_7{
        min-height: 400px;
    }
    .logo{
        width: 70%;
    }
    .yritys-content-1{
        order: -1;
    }
}

@media (min-width: 751px) {
    .ham-menu,
    .off-screen-menu,
    .yhteystieto-kartta-3,
    nav {
        display: none;
    }
}

@media (min-width: 752px) and (max-width: 938px) {
    .main-content,
    .palvelut_content,
    .main-content-3{
        grid-template-columns: 1fr 1fr;
        padding: 15px;
    }
    .main-content-2,
    .footer-content{
    	margin-top: 50px; /* Space between footer and content above */
        grid-template-columns: 1fr;
        padding: 15px;
    }
    .palvelut_content_7{
        min-height: 400px;
    }
    .logo{
        width: 40%;
    }
}

@media (min-width: 752px) and (max-width: 1024px){
    .yhteystieto-kartta,
    .yritys-content{
        grid-template-columns: 1fr;
    }
    .palvelut_content{
        grid-template-columns: 1fr 1fr;
    }
    .yritys-content-1{
        order: -1;
    }
}