@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap');

* {
    font-family: 'Inter', sans-serif !important;
    -webkit-tap-highlight-color: transparent;
}

/* style1.css HARMAA */

/* ============================= */
/* RESET & BASE */
/* ============================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

img {
    display: block;
}

:focus:not(:focus-visible) {
    outline: none;
}

html, body {
    height: 100%;
    background: #1e1e1e;  /* tumma tausta PALAUTETTU */
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    user-select: none;
}

/* ============================= */
/* KESKITETYT FONTTIASETUKSET    */
/* ============================= */

/* Niputettu vain fontit ja koot, pidetään väri alkuperäisenä #888 */
#about-content p, 
#comment-box p, 
.close-btn,
.footer-link,
.categories button {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1.5;
    color: #888; 
}

/* ============================= */
/* HEADER / TOP */
/* ============================= */

.top-container {
    padding: 20px 20px 10px;
    text-align: center;
}

h1, h2, h3, p, span, a, button {
    color: #888;
}

h1 {
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-size: 24px;
}

h1 span {
    font-size: 20px;
    letter-spacing: 2px;
}

h2.subtitle {
    font-size: 12px;
    font-weight: 600;          /* Ohut ja hienostunut */
    letter-spacing: 4px;       /* Paljon ilmaa, jotta se tuntuu "siistiltä" */
    text-transform: uppercase;
    line-height: 1.8;
    margin-bottom: 10px;       /* Jättää tilaa ennen galleriaa/nappeja */
    text-align: center;        /* Oletan, että haluat sen keskelle kuten muutkin */
}

/* ============================= */
/* CATEGORY BUTTONS */
/* ============================= */

.categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.categories button {
    background: none;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.categories button:hover,
.categories button.active {
    color: #fff; /* valkoinen hover PALAUTETTU */
}

/* ============================= */
/* CONTENT & GALLERY - CENTERED  */
/* ============================= */

.content-wrapper {
    overflow-y: auto;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, 100px); 
    gap: 10px;
    width: 100%;
    max-width: 1200px;
    justify-content: center;
    margin: 0 auto;
}

.gallery-img {
    width: 100px !important;
    height: 100px !important;
    object-fit: cover !important;
    background-color: #f5f5f5;
    transition: transform 0.2s ease-in-out;
cursor: pointer; /* Pakottaa mobiiliselaimen tunnistamaan klikkaukset */
    touch-action: manipulation; /* Estää viiveet ja parantaa kosketusvastetta */
}

.gallery-img:hover {
    transform: scale(1.04);
}

/* ============================= */
/* ABOUT SECTION */
/* ============================= */

#about-content {
    display: none;
    text-align: center;
    max-width: 600px;
    padding: 10px;
}

#about-content.active {
    display: block;
}

#about-content .gallery-img {
    margin: 0 auto 15px auto !important;
}

#about-content p {
    line-height: 1.8 !important; /* Nostaa rivivälin todella väljäksi ja tyylikkääksi */
    margin-bottom: 20px;         /* Lisää tilaa myös kappaleiden väliin */
}

/* ============================= */
/* FOOTER */
/* ============================= */

.site-footer {
    padding: 15px 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 8px;
}

.footer-link {
    text-decoration: none;
    background: none;
    border: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #fff;
}

/* ============================= */
/* POPUP / LIGHTBOX */
/* ============================= */

#popup {
    display: none; /* JS muuttaa tämän flexiksi */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #1e1e1e;
    z-index: 2000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#popup-img {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#popup-img.loaded {
    opacity: 1;
}

.close-btn {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 2100;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #fff;
}

.nav-btn {
display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2100;
    font-size: 30px;
    background: none;
    border: none;
    color: #444;
    cursor: pointer;
}

.nav-btn:hover {
    color: #fff;
}

#prev-btn { left: 20px; }
#next-btn { right: 20px; }

#comment-box {
    margin-top: 15px;
    text-align: center;
}

/* Mobiili-näkymä: Piilotetaan nuolet */
@media (max-width: 768px) {
    .nav-btn {
        display: none !important;
    }
}