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

body {
    font-family: Arial, sans-serif;
}

/* HEADER */
header {
    height: 5vh; /* 5 % sivun korkeudesta */
    background-color: grey;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* varmistaa päällimmäisyyden */
    position: relative;
}

header h1 a {
    text-decoration: none;
    color: black;
    font-size: 2rem;
}

/* TOPNAV */
.topnav {
    position: relative;
    height: 5vh;
    background-color: grey;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 10px;
    z-index: 1000;
}

.topnav a {
    float: left;
    display: block;
    color: black;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 17px;
}

.topnav a.active {
    font-weight: bold;
}

/* piilotettu oletuksena */
#myLinks {
    display: none;
}

/* Hamburger icon */
.topnav .icon {
    font-size: 24px;
    cursor: pointer;
    color: black;
    display: block;
}

/* MAIN */
main {
    height: 85vh;
    width: 100vw;
    position: relative;
    background-image: url("logistiikansankari_bg.jpg");
    background-size: cover;
    background-position: center;
}

/* overlay */
main .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.80) 0%,
        rgba(0, 0, 0, 0.875) 40%,
        rgba(0, 0, 0, 0.90) 100%
    );
    pointer-events: none;
}

/* center content */
.center-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #f0f0f0;
    max-width: 600px;
}

.center-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px black;
}

.center-content p {
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px black;
}

.cta-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #00a2ff;
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    border-radius: 5px;
    transition: 0.3s;
}

.cta-button:hover {
    background-color: #42c7ff;
}

/* FOOTER */
footer {
    height: 5vh;
    background-color: grey; /* Harmaa footer */
    display: flex;
    justify-content: center;
    align-items: center;
}


/* Dropdown menu, aluksi piilossa */
#dropdownMenu {
    display: none; /* piilotettu */
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid black;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    flex-direction: column;
    min-width: 180px;
    z-index: 9999;
}
#dropdownMenu a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: black;
}
#dropdownMenu a:hover {
    background-color: #f0f0f0;
}
#dropdownMenu.show {
    display: flex;
    flex-direction: column;
}

/* RESPONSIVE – mobiili */

@media screen and (max-width: 768px) {
    .topnav {
        flex-direction: row;       /* hamburger ja menu samalle riville */
        justify-content: flex-end; /* oikealle */
        align-items: center;
    }

    .topnav a {
        padding: 10px 12px;        /* pienempi padding mobiilissa */
        font-size: 16px;
    }

      #dropdownMenu {
        top: 5vh;       /* näkyy navin alapuolella */
        right: 0;
        width: 50%;
        background-color: white;
    }
}


.articles {
    display: flex;
    flex-direction: column; /* pystysuunta */
    gap: 30px; /* väli artikkeleiden välillä */
    padding: 40px 20px;
}

.articles article {
    max-width: 50%; /* vie neljäsosan leveydestä */
    background-color: white;
    border: 1px solid #ccc;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border-radius: 5px;
}

/* Vuorotellen vasen / oikea */
.articles article.left {
    align-self: flex-start;
}

.articles article.right {
    align-self: flex-end;
}

.articles img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 10px;
}

.articles h2 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.articles p {
    font-size: 0.9rem;
    line-height: 1.3;
    color: #333;
}

/* Mobiilissa kaikki keskelle ja leveys 90% */
@media screen and (max-width: 768px) {
    .articles article {
        max-width: 90%;     /* leveys 90% ruudusta */
        align-self: center; /* keskitetään */
        margin-bottom: 20px; /* väli artikkeleiden väliin */
    }
}
.short-text {
    max-height: 50px;  /* rajoitetaan näkyvä korkeus */
    overflow: hidden;
}

.read-more {
    margin-top: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
}

/* Modal */
.modal {
    display: none; /* aluksi piilossa */
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5); /* tausta himmennys */
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.modal-content p {
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
}

.close {
    float: right;
    font-size: 24px;
    cursor: pointer;
    margin-top: -10px;
}

.linkedin-btn {
    margin-top: 10px;
    background-color: #0077b5; /* LinkedIn sininen */
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;
    cursor: pointer;
}

.linkedin-btn:hover {
    background-color: #005582;
}
