/* Yleinen tyyli */
body {
    font-family: 'Inter', sans-serif;
    font-size: 16px; /* Default size, adjusts with screen */
    margin: 0;
    padding: 0;
    background-color: #e6f7ff;
    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;
}

.mainPhoto {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.mainPhoto img {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 50px;
    margin-bottom: 50px;
}

.floating-button {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    padding: 10px 20px;
    background-color: #00719c;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.floating-button:hover {
    background-color: #00415a;
}

.uutinenKontti {
    display: flex;
    justify-content: center; /* Keskittää sisältö vaakasuunnassa */
    align-items: flex-start; /* Kohdistaa elementit ylös */
    gap: 10px;
    max-width: 1200px; /* Määritetään yhteinen maksimileveys */
    margin: 0 auto; /* Keskittää kontti */
    padding-bottom: 50px;
}

.theUutinen {
    flex: 2 1 45%; /* Tehty responsiiviseksi, pitää leveyden 45%:ssa */
    background: #fefefe;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding-left: 30px;
    padding-right: 10px;
}

.theUutinen h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.uutinen-sisalto p {
    line-height: 1.7;
    margin-bottom: 1rem;
}

.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;
    padding-right: 20px;
    font-size: 20px;
    background-color: #fefefe;
    border-radius: 12px;
}

.post-item {
    display: flex;
    gap: 50px; /* Reduced gap between image and text */
    align-items: center;
    padding: 15px 0;
    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 */
}

.post-text h4 {
    margin: 0;
    color: #00719c;
    font-size: 20px; /* Smaller font for titles */
}

.post-text p {
    font-size: 0.875rem;
    color: #666;
}

.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;
}

@media (max-width: 1300px) {
    .mainPhoto {
        width: 90%;
        margin: auto;
    }
    
    /* Responsiivinen uutinenkontti */
    .uutinenKontti {
        max-width: 90%;
    }
}

@media (max-width: 950px) {
    .nav-menu {
        background-color: #009bd6;
        position: absolute;
        left: 0;
        border-radius: 5px;
    }

    .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;
    }

    .floating-button {
        padding: 10px 10px;
        font-size: 10px;
    }
}

@media (max-width: 750px) {
    .uutinenKontti {
        max-width: 90%; /* Määritetään maksimileveys (voit säätää tätä arvoa) */
        flex-direction: column; /* Muuttaa flex-suunta pystysuuntaiseksi */
    }
    
    .theUutinen {
        order: 1; /* Varmistaa, että uutinen on ylhäällä */
        width: 90%; /* Tekee uutisesta täysleveyden */
        margin-bottom: 30px;
    }
    .recent-posts {
        padding-bottom: 10px;
        order: 2; /* Asettaa kaikki uutiset alapuolelle */
        width: 90%; /* Tekee tämän täysleveäksi */
    }

    .floating-button {
        padding: 5px 5px;
        font-size: 10px;
    }
}

@media (max-width: 450px) {
    .mainPhoto {        
        width: 100%;
    }
    .mainPhoto img {
        width: 100%;
    }
    .uutinenKontti {
        flex-direction: column; /* Muuttaa flex-suunta pystysuuntaiseksi */
        max-width: 80%;
        margin: 0;
        padding-left: 20px;
    }
    
    .theUutinen {
        order: 1; /* Varmistaa, että uutinen on ylhäällä */
        width: 95%; /* Tekee uutisesta täysleveyden */
        margin: 0px;
        margin-bottom: 30px;
    }
    
    .recent-posts {
        padding-bottom: 10px;
        order: 2; /* Asettaa kaikki uutiset alapuolelle */
        width: 95%; /* Tekee tämän täysleveäksi */
        gap: 5px;
    }

    .recent-posts h3 {
        margin-top: 20px;
    }

    .theUutinen h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .uutinen-sisalto p {
        line-height: 1.7;
        margin-bottom: 1rem;
    }

    .post-text h4 {
        margin: 0;
        color: #00719c;
        font-size: 17px; /* Smaller font for titles */
    }

    .post-text p {
        font-size: 0.75rem;
    }

}