/* =========
   Perustyyli
   ========= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 20% 10%, rgba(255,255,255,0.9), rgba(230,233,240,0.6) 60%, rgba(210,213,220,0.5)),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.8), rgba(230,233,240,0.6) 70%, rgba(210,213,220,0.5));
    background-attachment: fixed;
    background-attachment: fixed; /* pitää gradientin paikoillaan */
    /*background-image:url("../tausta.png");*/
    background-size: 100% 100%;   /* VENYTTÄÄ kuvan */
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed; /* Valinnainen: tekee "parallax"-tuntuman */
    color: #656464;
    line-height: 1.5;
}

/* Linkit */

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

td {
    padding:10px;
}

tr {
    border: 1px solid lightgrey;
}

/* Layout-kontti */

.site-main {
    max-width: 1100px;
    margin: 1.5rem auto 2.5rem;
    padding: 0 1rem;
}

/* Kortti sivun sisällölle */

.page {
    background: #ffffff;
    border-radius: 18px;
    padding: 2rem 1.5rem 1.75rem;
    box-shadow:
        0 16px 40px rgba(15, 23, 42, 0.16),
        0 0 0 1px rgba(148, 163, 184, 0.16);
    opacity: 0;
    transform: translateY(28px);
    animation: pageFadeIn 440ms ease-out forwards;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pienemmille näytöille vähän tiiviimpi padding */

@media (max-width: 600px) {
    .page {
        padding: 0.6rem 0.6rem 0.7rem;
        border-radius: 14px;
    }
}

/* Otsikot ja tekstit */

.page h1 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: clamp(1.6rem, 2vw + 1rem, 2.1rem);
    letter-spacing: 0.01em;
    color: #e97001;
    text-align:center;
}

.section h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.section p {
    margin: 0.25rem 0 0.75rem;
    color: #444;
}

/* Yleinen korttimaisuus myös osioille */

.section {
    margin-bottom: 1.3rem;
    /*padding: 0.75rem 0.75rem 0.85rem;*/
	padding: 30px;
    border-radius: 12px;
    background: linear-gradient(to bottom right, #f9fafb, #f1f5f9);
    border: 1px solid rgb(232 111 2);
}

/* Viimeinen osio ilman ylimääräistä alareunamarginaalia */

.section:last-child {
    margin-bottom: 0;
}

.section-content p {
    margin: 0 0 0.75rem;
}

.section-content ul,
.section-content ol {
    margin: 0.4rem 0 0.9rem 1.25rem;
}

.section-content li {
    margin: 0.15rem 0;
}

.section-content a {
    color: #2563eb;
    text-decoration: underline;
}

.section-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    margin: 0.6rem auto;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}


/* =========
   Header & navigaatio
   ========= */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to right, #111827, #1f2937);
    color: #fff;
    padding: 0.5rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.45);
}

/* Sama max-width kuin mainilla, keskitetään sisältö */

.site-header > .inner {
    max-width: 1100px;
    margin: 0 auto;
}

/* Jos haluat joskus wräpätä header-sisällön .inneriin, tämä on valmiina
   – nyt mennään suoralla flexillä. */

.logo a {
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Navigaatio-listat */

.main-nav ul,
.mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Desktop-menu */

.main-nav ul {
    display: flex;
    gap: 0.35rem;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    color: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.95rem;
    white-space: nowrap;
    transition:
        background 0.16s ease,
        color 0.16s ease,
        transform 0.08s ease,
        box-shadow 0.16s ease;
}

.main-nav a:hover {
    background: rgba(249, 250, 251, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.55);
}

.main-nav li.active a {
    background: #f9fafb;
    color: #111827;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.75);
}

/* Hampurilainen (mobiili) */

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #e5e7eb;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    transition: background 0.16s ease, transform 0.08s ease;
}

.nav-toggle:hover {
    background: rgba(249, 250, 251, 0.12);
    transform: translateY(-1px);
}

/* Mobiilivalikko */

.mobile-nav {
    display: none;
    background: #818899;
    border-top: 1px solid #1f2937;
}

.mobile-nav.open {
    display: block;
}

.mobile-nav ul {
    display: flex;
    flex-direction: column;
}

.mobile-nav li a {
    color: #e5e7eb;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #1f2937;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.16s ease, padding-left 0.16s ease;
}

.mobile-nav li a::after {
    content: "›";
    font-size: 0.9rem;
    opacity: 0.7;
}

.mobile-nav li a:hover {
    background: #1f2937;
    padding-left: 1.2rem;
}

.mobile-nav li.active a {
    background: #f9fafb;
    color: #111827;
}

/* Desktop vs mobiili break-point */

@media (max-width: 768px) {
	.page {
		margin-top: 0;
	}
    .main-nav {
        display: none;
    }
    .nav-toggle {
        display: block;
    }
	
	.section {
		padding: 0.75rem 0.75rem 0.85rem;
	}
}

/* =========
   Lomake / yhteydenotto
   ========= */

.section-contact-form {
    background: #ffffff;
    border-radius: 14px;
    padding: 1rem 1rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    margin-top: 1.25rem;
}

.section-contact-form .form-row {
    margin-bottom: 0.9rem;
}

.section-contact-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.section-contact-form input,
.section-contact-form textarea {
    width: 100%;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
    background: #f9fafb;
}

.section-contact-form input:focus,
.section-contact-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
    background: #ffffff;
}

.section-contact-form textarea {
    min-height: 140px;
    resize: vertical;
}

/* Napit */

.section-contact-form button,
button,
input[type="submit"],
input[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.55);
    transition:
        background 0.16s ease,
        transform 0.08s ease,
        box-shadow 0.16s ease;
}

.section-contact-form button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.65);
}

.section-contact-form button:active,
button:active,
input[type="submit"]:active,
input[type="button"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.4);
}

/* Viesti-ilmoitukset */

.section-contact-form .success,
.section-contact-form .error {
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    margin-bottom: 0.85rem;
    font-size: 0.9rem;
}

.section-contact-form .success {
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #4ade80;
}

.section-contact-form .error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* =========
   Footer
   ========= */

.site-footer {
    text-align: center;
    padding: 1.1rem 1rem 1.6rem;
    font-size: 0.9rem;
    color: #374151;
    opacity: 0.9;
}

/* Pieni korttimainen tausta footerillekin */

.site-footer p {
    display: inline-block;
    background: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 2.9rem;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.lang-switcher {
    position: relative;
    margin-left: 1rem;
}

.lang-current {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font: inherit;
}

.lang-current .flag,
.lang-menu .flag {
    font-size: 0.7rem;   /* tai 1rem tms. */
    font-weight: 600;
    letter-spacing: 0.05em;
}

.lang-menu {
    position: absolute;
    right: 0;
    top: 120%;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    background: #222;          /* Tummempi tausta */
    border: 1px solid #444;
    border-radius: 4px;
    display: none;
    min-width: 140px;
    z-index: 1000;
}

.lang-menu.open {
    display: block;
}

.lang-menu li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    text-decoration: none;
    color: #fff;               /* Vaalea teksti */
    white-space: nowrap;
}

.lang-menu li a:hover {
    background: #444;          /* Hieman vaaleampi hover-tausta */
}

.thumb-row {
    display: flex;
    flex-wrap: wrap;        /* tärkeä mobiilissa */
    gap: 10px;              /* väli kuvien väliin */
    margin: 10px 0;
}

.thumb-row a {
    display: inline-flex;   /* estää ylimääräiset whitespace-ongelmat */
}

.thumb {
    width: 100px;           /* tai 10px jos se ei ollut kirjoitusvirhe */
    height: auto;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(0,0,0,0.35);
}

    /* Tummennettu tausta + popup-alue */
    #img-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.8);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        z-index: 9999;
    }

    #img-overlay.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

    #img-overlay .popup-inner {
        position: relative;
        max-width: 90vw;
        max-height: 90vh;
    }

    #img-overlay a {
        display: block;
        max-width: 100%;
        max-height: 100%;
        cursor: zoom-in; /* vihje että kuvaa voi klikata */
    }

    #img-overlay img {
        max-width: 100%;
        max-height: 100%;
        display: block;
        transform: scale(0.7);
        transition: transform 0.25s ease;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
        border-radius: 4px;
        cursor: pointer;
    }

    #img-overlay.is-visible img {
        transform: scale(1);
    }

    #img-overlay button#img-overlay-close {
        position: absolute;
        z-index: 10;
        top: -10px;
        right: -10px;
        border: none;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        font-size: 18px;
        line-height: 32px;
        cursor: pointer;
        background: #ffffff;
        color: black;
        box-shadow: 0 0 10px rgba(0,0,0,0.6);
    }

    body.no-scroll {
        overflow: hidden;
    }


/* =========
   Pieniä responsiivisia säätöjä
   ========= */

@media (max-width: 768px) {
    .site-main {
        margin-top: 1.1rem;
    }

    .page h1 {
        margin-bottom: 0.8rem;
    }
}
