/* Yleinen tyyli */
body {
    font-family: 'Inter', sans-serif;
    font-size: 16px; /* Default size, adjusts with screen */
    margin: 0;
    padding: 0;
    background-color: white;
    color: black;
}

html {
    scroll-behavior: smooth;
}

.sticky {
    position: sticky;
    top: 0;
    justify-content: space-between;
    z-index: 100;  /* Varmistetaan, että sticky header on muiden päälle */
}

/* Yläpalkki, jossa puhelinnumero, sähköposti ja slogan */
.top-bar {
    background-color: #00719c;
    color: white;
    padding: 10px;
    font-size: 1rem;
    display: flex;
    justify-content: center;  /* Keskittää kaikki sisältö vaakasuunnassa */
    align-items: center;
}

.top-bar span {
    padding: 25px;
}

.no-style {
    text-decoration: none;  /* Poistaa alleviivauksen */
    color: inherit;         /* Käyttää tekstin väriä, ei linkin oletusväriä */
}

.no-style:hover {
    color: #00415a;              /* Vaihtaa värin tummemmaksi, kun linkkiä viedään hiirellä */
    text-decoration: underline;  /* Säilyttää alleviivauksen hover-tilassa */
}

.styled-link {
    text-decoration: none;  /* Poistaa alleviivauksen */
    color: inherit;             /* Muuttaa linkin väriksi sinisen */
  }
  
  .styled-link:hover {
    color: #00719c; /* Vaihtaa värin tummemmaksi, kun linkkiä viedään hiirellä */
    text-decoration: underline;   /* Säilyttää alleviivauksen hover-tilassa */
  }

/* Pääpalkki (logo, nimi ja valikko) */
.sticky-header {
    position: sticky;
    top: 0; /* Lisää tämä */
    background-color: #00415a;
    padding-top: 5px;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding-left: 150px;
    padding-right: 50px;
    display: flex; /* Use flexbox */
    justify-content: space-between; /* Space out the elements */
    align-items: center; /* Vertically align the elements */
}

.sticky-header .container {
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.sticky-header .logo img {
    max-height: 75px;
}

.sticky-header ul {
    list-style-type: none;
    padding: 0px;
    margin: 0px;
}

.sticky-header nav ul li {
    display: inline;
    margin: 0px 5px;
}

.sticky-header nav ul li a {
    color: #009bd6;
    text-decoration: none;
    font-size: 1.5rem;
}

.sticky-header nav ul li a:hover {
    text-decoration: underline;
}

.menu-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hamburger {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hamburger .bar {
    width: 30px;
    height: 4px;
    background-color: white;
}

/* Piilotetaan nav-menu mobiilissa */
.nav-menu {
    display: none;
    background-color: #009bd6;
    position: absolute;
    top: 84px;
    width: 100%;
    left: 0;
    border-radius: 5px;
    text-align: center;
    margin: 0px;
    padding: 0px;
}

.nav-menu ul li a {
    display: block;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-menu ul li a:hover {
    background-color: #00719c;
}

/* General layout adjustments */
.news-section {
    display: flex;
    flex-wrap: wrap;
    gap: 60px; /* Increased gap between sections for more space */
    justify-content: center; /* Centering all sections */
    padding: 60px; /* Increased padding for more space around */
    background-color: #e6f7ff; /* Light blueish background */
}

.latest-post {
    flex: 2; /* Keeps the latest post prominent */
    max-width: 750px;
    background-color: #f4f7fa;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    padding: 30px;
    position: relative; /* Make the parent position relative */
}

.latest-image {
    position: relative; /* This is important for positioning the overlay on top of the image */
    width: 100%; /* Ensure the image takes up 100% of the container's width */
    max-width: 800px; /* Set the max-width of the image */
    max-height: 500px; /* Set the max-height of the image */
    border-radius: 12px 12px 0 0;
    overflow: hidden; /* Ensure the image is contained inside the box */
    transition: transform 0.3s ease; /* Smooth transition for scaling */
}

.latest-image:hover {
    transform: scale(1.1); /* Scale the image slightly on hover */
}

.latest-image img {
    width: 100%; /* Ensure the image fills the container width */
    height: 100%; /* Ensure the image fills the container height */
    object-fit: cover; /* This ensures the image covers the container without stretching */
    object-position: center; /* Ensure the image is centered within the container */
}

.latest-date-overlay {
    position: absolute;
    top: 10px; /* Position it towards the top */
    left: 15px; /* Position it towards the left */
    background-color: rgba(0, 0, 0, 0.6); /* Dark semi-transparent background */
    color: #fff; /* White text */
    padding: 5px 15px; /* Space around the text */
    border-radius: 8px; /* Rounded corners for the date box */
    font-size: 14px; /* Smaller font for the date */
    font-weight: bold;
    z-index: 2; /* Ensure the overlay appears above the image */
}

.latest-info {
    padding: 20px;
}

.latest-title {
    font-size: 26px;
    color: #00415a;
    margin-bottom: 15px;
}

.latest-link {
    text-decoration: none;
    color: #009bd6;
    font-weight: bold;
}

.recent-posts {
    flex: 1; /* Reduced flex value to make the recent posts smaller */
    display: flex;
    flex-direction: column;
    gap: 20px; /* Reduced gap between posts */
    padding-left: 20px; /* More padding for better alignment */
    font-size: 20px;
}

.post-item {
    display: flex;
    gap: 20px; /* Reduced gap between image and text */
    align-items: center;
    padding: 15px 0; /* Slightly less padding inside each post item */
    border-bottom: 2px solid #ddd;
}

.post-image {
    width: 80px; /* Reduced image size */
    height: 80px;
    object-fit: cover;
    border-radius: 12px; /* Larger border radius for image */
    transition: transform 0.3s ease; /* Smooth transition for scaling */
}

.post-image:hover {
    transform: scale(1.1); /* Scale the image slightly on hover */
}

.post-text h4 {
    margin: 0;
    color: #00719c;
    font-size: 20px; /* Smaller font for titles */
}

.post-text a {
    text-decoration: none; /* Remove the underline from the anchor tag */
    color: inherit; /* Inherit the color from the parent (the h4 element) */
}

.post-text a:hover {
    color: #00415a; /* Change color on hover */
}

.post-link {
    text-decoration: none;
    color: #009bd6;
    font-weight: bold;
}

.all-news {
    text-align: center;
    margin-top: 50px; /* More space above */
}

.all-news-link {
    font-size: 20px; /* Slightly larger font size */
    text-decoration: none;
    color: #00415a;
}

.all-news-section {
    margin-top: 50px; /* Increased top margin for more space */
    padding-top: 40px; /* More padding for better content spacing */
    padding-left: 20px;
    background-color: #f4f7fa;
    border-radius: 12px; /* Larger border radius for smoother corners */
    display: flex; /* Enable flexbox */
    flex-direction: column; /* Ensure items stack vertically */
    align-items: center; /* Center items horizontally */
    justify-content: center; /* Center items vertically (if needed) */
}

.all-news-section h2 {
    text-align: center;
    font-size: 30px;
    margin-bottom: 25px; /* More space between title and content */
    color: #00415a;
}

.all-news-list {
    display: flex;
    flex-direction: column;
    gap: 30px; /* Increased gap between news items */
    padding-bottom: 30px;
}

.news-item {
    display: flex;
    gap: 30px; /* Larger gap between image and text */
    align-items: center;
    border-bottom: 2px solid #ddd;
    padding: 20px 0; /* More space inside each news item */
}

.news-image {
    width: 160px; /* Reduced image size */
    height: 160px;
    object-fit: cover;
    border-radius: 12px; /* Larger border radius for image */
    transition: transform 0.3s ease; /* Smooth transition for scaling */
}

.news-image:hover {
    transform: scale(1.1); /* Scale the image slightly on hover */
}

.news-info h4 {
    margin: 0;
    color: #00719c;
    font-size: 20px; /* Larger font for titles */
}

.news-link {
    text-decoration: none;
    color: #009bd6;
    font-weight: bold;
}

@media (max-width: 1000px) {
    .recent-posts {
        display: none;
    }
}

@media (max-width: 750px) {
    .nav-menu {
        background-color: #009bd6;
        position: absolute;
        left: 0;
        border-radius: 5px;
    }

    .news-section {
        flex-direction: column;
        gap: 30px; /* Adds space between items in column layout */
    }

    .latest-post {
        max-width: 100%; /* Ensure it takes up the full width */
        margin-bottom: 30px; /* Add some space below the latest post */
    }

    .post-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px; /* Add space between image and text */
        padding: 15px 0;
    }

    .post-image {
        width: 100%; /* Image takes up full width */
        height: auto;
        margin-bottom: 15px; /* Space between image and text */
        border-radius: 8px; /* Optional, to keep the image corners rounded */
    }

    .post-text h4 {
        font-size: 18px; /* Slightly larger text for easier reading */
        color: #00719c;
    }
}

@media (max-width: 600px) {
    .news-section {
        padding: 10px; /* Increased padding for more space around */
    }

    .latest-post {
        background-color: #f4f7fa;
        padding: 10px; /* More padding for better content spacing */
    }

    
    .all-news-section {
        padding: 20px;
        background-color: #f4f7fa; /* Ensure the background is consistent */
        border-radius: 12px; /* Smooth corners */
    }

    .all-news-section h2 {
        font-size: 25px; /* Make the heading slightly larger */
        margin-bottom: 20px;
    }


    .news-item {
        display: flex;
        flex-direction: column;
        gap: 15px; /* Add space between image and text */
        align-items: flex-start;
        border-bottom: 2px solid #ddd;
        padding: 5px;
        padding-bottom: 50px;
    }

    .news-image {
        width: 100%; /* Image takes up full width */
        height: auto;
        border-radius: 8px;
    }

    .news-info h4 {
        font-size: 18px; /* Slightly larger font for better readability */
        color: #00719c;
    }

    .news-link {
        text-decoration: none;
        color: #009bd6;
        font-weight: bold;
    }
}

@media (max-width: 400px) {
    .top-bar span {
        padding: 5px;
    }

    .sticky-header {
        padding-left: 10px;
        padding-right: 20px;
    }

    .sticky-header .logo img {
        max-height: 50px;
    }

    .footlogo {
        max-height: 40px;
    }
}