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

body {
    font-family: "Playfair Display", serif;
    background-color: #FFF7E1;
    color: #333;
    line-height: 1.6;
}

/* Pääsisältö */
main {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
}

.h1-sisältö {
    text-align: center;
    margin: 30px 0;
}

/* Otsikot */
h1, h2, h3 {
    font-family: "Great Vibes", cursive;
    color: #6A1C29;
    text-align: center;
}

h1 { font-size: 4rem; }
h2 { font-size: 3rem; }
h3 { font-size: 2.5rem; }

p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* Header ja navigaatio */
.headeri {
    position: relative;
    width: 100%;
    height: 400px;
}

.headeri img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Headerin muotoilu */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Navigointilista */
nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4); /* Läpinäkyvä tausta koko navigaatiolle */
    border-radius: 10px;
    width: fit-content;
    margin: 0 auto;
    flex-wrap: wrap; /* Sallii linkkien siirtymisen uudelle riville */
}

/* Navigointilinkkien tyyli */
nav ul li {
    margin: 5px;
    flex-shrink: 0;
}

/* Linkkien muotoilu */
nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    transition: 0.3s;
    padding: 10px 15px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease-in-out;
    text-align: center;
    display: inline-block;
    min-width: 90px;
    white-space: nowrap;
}

/* Hover-efekti (korostaa linkkejä kun hiiren vie päälle) */
nav ul li a:hover {
    background: rgba(255, 255, 255, 0.6);
    color: #6A1C29;
}

/* Aktiivinen navigointilinkki (korostaa sen sivun missä ollaan) */
nav ul li a.active {
    background-color: #D88C71;
    color: white;
    font-weight: bold;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2); 
}

/* Aktiivinen välilehti */
nav ul li a.active {
    background-color: #D88C71;
    border-radius: 5px;
}

/* Kuvan ja tekstin asettelu isolla näytöllä */
.sisältö {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 40px;
}

/* Otsikon tyyli */
.sisältö h3 {
    width: 100%;
    text-align: center;
    margin-bottom: 15px;
}

/* Kuvan ja tekstin sisältävä ryhmä */
.content-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

/* Kuvan tyyli */
.kuva {
    max-width: 300px;
    height: auto;
    flex-shrink: 0;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.4);
}

/* Joka toinen kuva vasemmalle, joka toinen oikealle (kaikilla sivuilla) */
@media (min-width: 1024px) {
    .sisältö:nth-child(odd) .content-wrapper {
        flex-direction: row; /* Kuva vasemmalle, teksti oikealle */
    }

    .sisältö:nth-child(even) .content-wrapper {
        flex-direction: row-reverse; /* Kuva oikealle, teksti vasemmalle */
    }
}

li {
    font-family: "Playfair Display";
    font-size: 1.2rem;
}

.lista ul {
    font-size: 1.2rem;
    line-height: 1.6;
    padding-left: 20px;
    text-align: left;
    margin: 10px 0;
}

.lista ul li {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

/* Footer */
footer {
    background-color: #6A1C29;
    color: white;
    padding: 10px;
    margin-top: 20px;
    text-align: center;
}

footer a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
}

/* Responsiivisuus (3 tasoa) */

/* 1. Kännykkä (alle 500px) */
@media (max-width: 500px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    p { font-size: 1rem; }

    .sisältö {
        display: flex;
        flex-direction: column !important;
        align-items: center;
        text-align: center;
    }

    .sisältö h3 {
        order: -1;
        margin-bottom: 10px;
    }

    .content-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .kuva {
        order: 2;
        max-width: 80%;
        height: auto;
        margin: 10px auto;
    }

    .teksti {
        order: 3;
        width: 100%;
        padding: 0 10px;
    }

    .lista ul {
       font-size: 1rem;
       padding-left: 15px;
    }

    .lista ul li {
        font-size: 1rem;
    }

    nav ul {
        flex-direction: column; /* Pakottaa linkit allekkain mobiilissa */
        align-items: center; /* Keskittää linkit */
        text-align: center;
        padding: 10px 0;
        width: 100%;
    }

    nav ul li {
        margin-bottom: 5px;
        width: 100%;
        text-align: center;
    }

    nav ul li a {
        width: 90%;
        padding: 12px;
        font-size: 1.2rem;
        min-width: auto;
        display: flex;
        justify-content: center;
    }

}

/* 2. Tabletti (500px - 1024px) */
@media (min-width: 500px) and (max-width: 1024px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }
    h3 { font-size: 2.25rem; }
    p { font-size: 1.1rem; }

    .sisältö {
        display: flex;
        flex-direction: column !important;
        align-items: center;
        text-align: center;
        margin-bottom: 25px;
    }

    .content-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .sisältö h3 {
        order: -1;
        margin-bottom: 10px;
    }

    .kuva {
        order: 2;
        display: block;
        margin: 0 auto 20px auto;
        max-width: 80%;
    }

    .teksti {
        order: 3;
        text-align: left;
        padding: 0 20px;
        display: block;
    }

    .lista ul {
        font-size: 1rem;
        padding-left: 15px;
     }
 
    .lista ul li {
         font-size: 1rem;
     }
    nav ul {
        flex-direction: row;
        justify-content: center;
    }

    nav ul li {
        margin: 0 10px;
    }
}

/* 3. Tietokone (yli 1024px) */
@media (min-width: 1024px) {
    h1 { font-size: 4rem; }
    h2 { font-size: 3rem; }
    h3 { font-size: 2.5rem; }
    p { font-size: 1.2rem; }

    .sisältö {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 40px;
    }

    .content-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;
        width: 100%;
    }

    .kuva {
        max-width: 400px;
        height: auto;
        flex-shrink: 0;
    }

    .teksti {
        flex: 1;
        text-align: left;
    }

    nav ul {
        flex-direction: row;
        justify-content: center;
    }
}
