/*
   Tiedoston nimi: css.css
   Versio: 1.0.0 (Refaktoroitu)
   Muokkaaja: Henry/AI
   Kuvaus: Sivuston päätyylitiedosto.
*/

/* --- 1. Muuttujat ja Yleiset Asetukset --- */
:root {
    --text-primary: #595959;
    --text-heading: #737373;
    --accent-color: rgb(206, 15, 15);
    --bg-color: #ffffff;
    --bg-modal: rgba(255, 255, 255, 0.98);
    --font-serif: adobe-caslon-pro, serif;
    --font-serif-alt: karmina, serif;
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    min-width: 400px;
    font-family: var(--font-serif);
    color: var(--text-primary);
    background-color: var(--bg-color);
    text-align: center;
}

/* --- 2. Typografia --- */
h1 {
    color: var(--text-heading);
    font-size: 60px;
    line-height: 65px;
    text-transform: uppercase;
    margin: 0;
}

h2 {
    color: var(--text-heading);
    margin: 0;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.kontakti {
    margin-top: -50px;
    font-size: 25px;
    line-height: 1.4;
    color: var(--text-heading);
}

/* --- 3. Yleinen Asettelu --- */
.info {
    margin: 5vh 0 2vh 0;
    width: 90%;
    max-width: 800px;
}

nav {
    margin-bottom: 40px;
    font-size: 20px;
}

nav a {
    margin: 0 5px;
}

nav a.nyt {
    font-style: italic;
    text-decoration: underline;
}

footer {
    padding: 20px 0 40px 0;
    font-size: 12px;
    color: #c0c0c0;
}

footer a {
    color: inherit;
}

footer a:hover {
    color: #a0a0a0;
}

/* --- 4. Portfolio Galleria (Masonry Grid) --- */
.grid {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.image-container {
    width: 100%;
    margin-bottom: 20px;
}

.galleria-img {
    display: block;
    width: 100%;
    height: auto;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.galleria-img:hover {
    opacity: 0.8;
}

.lataus {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

/* --- 5. Komponentit: Modaali --- */
.modal {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-modal);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    overflow-y: auto;
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    padding: 10vh 5% 20vh 5%;
}

.pois {
    position: fixed;
    top: 30px;
    right: 40px;
    color: #333;
    font-size: 60px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
}

#modal-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
}

#modal-images img {
    cursor: pointer;
}

.modal-img {
    height: auto;
    object-fit: contain;
}

/* Orientaatioluokat modaalin kuville */
.potretti { width: 90%; max-width: 700px; }
.vaaka { width: 90%; max-width: 1200px; }

.modal-teksti-h2 {
    font-family: var(--font-serif-alt);
    font-size: 40px;
    font-weight: 300;
    font-style: italic;
    color: #333;
    margin: 20px 0 0 0;
}

.copyright {
    font-family: var(--font-serif-alt);
    font-size: 15px;
    color: #222;
    margin-top: 50px;
}

/* --- 6. Sivukohtaiset Tyylit: Contact-sivu --- */
.contact-page .jouni {
    width: 100%;
    max-width: 1000px;
    height: auto;
    display: block;
    margin: 0 auto 40px auto;
}

.contact-page .runko-kontti {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    font-size: 18px;
    text-align: left;
    line-height: 1.6;
}

.contact-page .studio-otsikko {
    font-family: var(--font-serif-alt);
    font-size: 50px;
    font-weight: 300;
    font-style: italic;
    margin: 60px 0 30px 0;
}

#studio-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

#studio-gallery .image-container {
    max-width: 600px;
}


/* --- 7. Mediakyselyt (Responsiivisuus) --- */

/* Tabletit ja pienet desktopit */
@media screen and (min-width: 768px) {
    h1 {
        font-size: 80px;
    }
    .kontakti {
        margin-top: 0;
    }
    .grid .image-container {
        /* Masonry hallitsee leveyden, mutta varmistetaan responsiivisuus */
        width: 48%;
    }
}

/* Isot desktopit */
@media screen and (min-width: 1200px) {
    .grid .image-container {
        width: 32%;
    }
}