/* Snadittaren Kennel
   Musta & valkoinen kuin dalmatialainen. Korostus: Susannan logon periwinkle-sininen.
   Ainoa "rohkea" elementti: oikeat dalmatiantäplät etusivun yläosassa. */
:root {
    --valk: #ffffff;
    --musta: #000000;
    --teksti: #232323;
    --hiljainen: #5f5f66;
    --sini: #4a5bc4;
    --sini-tumma: #36449a;
    --sumu: #eef1fd;
    --maksa: #7a3e2b;
    --raja: #e4e4ea;
    --otsikko: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
    --leipa: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --leveys: 1120px;
    --palkki: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--palkki) + 12px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--leipa); font-size: 1.0625rem; line-height: 1.6; color: var(--teksti); background: var(--valk); }
img { max-width: 100%; display: block; }
/* Tekstilinkit: ei sinistä alleviivausta, vaan tumma lihava teksti ja hento täplämäinen korostus */
a { color: var(--musta); font-weight: 600; text-decoration: none; transition: color .15s ease, background-size .2s ease; }
a:hover { color: var(--sini); }
.teksti-linkki, .lomake .pieni a, .sijoitus a, .meista-teksti a, .teksti-sivu a {
    background-image: linear-gradient(var(--sumu), var(--sumu));
    background-repeat: no-repeat; background-position: 0 100%; background-size: 100% .45em;
    padding: 0 .1em;
}
.lomake .pieni a:hover, .sijoitus a:hover, .meista-teksti a:hover, .teksti-sivu a:hover { background-size: 100% 100%; color: var(--sini-tumma); }
:focus-visible { outline: 3px solid var(--sini); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--otsikko); color: var(--musta); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.005em; }
h2 { font-size: clamp(2rem, 5.5vw, 2.9rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1em; }
.piilotettu { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.keskelle { text-align: center; }

/* ---------- Yläpalkki ---------- */
.ylapalkki {
    position: sticky; top: 0; z-index: 50;
    height: var(--palkki);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0 clamp(1rem, 4vw, 2rem);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--raja);
}
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--musta); }
.logo img { height: 40px; width: 40px; border-radius: 50%; }
.logo span { font-family: var(--otsikko); font-size: 1.3rem; font-weight: 600; }
.valikko { display: flex; align-items: center; gap: 1.6rem; }
.valikko a { color: var(--teksti); text-decoration: none; font-size: .98rem; padding: .4rem 0; }
.valikko a:hover { color: var(--sini); }
.valikko .valikko-yhteys { background: var(--musta); color: var(--valk); padding: .55rem 1.1rem; border-radius: 999px; }
.valikko .valikko-yhteys:hover { background: var(--sini); color: var(--valk); }

.valikkonappi {
    display: none; width: 46px; height: 46px; margin-right: -8px;
    background: none; border: 0; cursor: pointer; border-radius: 10px;
    position: relative;
}
.valikkonappi span {
    position: absolute; left: 11px; right: 11px; height: 2.5px; background: var(--musta); border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}
.valikkonappi span:nth-child(1) { top: 15px; }
.valikkonappi span:nth-child(2) { top: 22px; }
.valikkonappi span:nth-child(3) { top: 29px; }
.valikko-auki .valikkonappi span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.valikko-auki .valikkonappi span:nth-child(2) { opacity: 0; }
.valikko-auki .valikkonappi span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
    .valikkonappi { display: block; }
    .valikko {
        position: fixed; top: var(--palkki); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--valk); border-bottom: 1px solid var(--raja);
        padding: .5rem 1.25rem 1.5rem;
        box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .25);
        transform: translateY(-120%); visibility: hidden;
        transition: transform .3s ease, visibility 0s linear .3s;
    }
    .valikko-auki .valikko { transform: none; visibility: visible; transition: transform .3s ease; }
    .valikko a { font-family: var(--otsikko); font-size: 1.5rem; padding: .85rem .25rem; border-bottom: 1px solid var(--raja); }
    .valikko .valikko-yhteys { margin-top: 1.2rem; text-align: center; font-family: var(--leipa); font-size: 1.05rem; font-weight: 600; padding: .95rem; border-bottom: 0; }
}

/* ---------- Napit ---------- */
.napit { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.nappi {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 50px; padding: .8rem 1.5rem;
    background: var(--musta); color: var(--valk);
    border: 2px solid var(--musta); border-radius: 999px;
    font: 600 1rem/1.2 var(--leipa); text-decoration: none; cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.nappi:hover { background: var(--sini); border-color: var(--sini); color: var(--valk); }
.nappi svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.nappi.toissijainen { background: var(--valk); color: var(--musta); }
.nappi.toissijainen:hover { border-color: var(--sini); color: var(--sini); background: var(--valk); }

/* ---------- Hero ja täplät ---------- */
.hero {
    position: relative; overflow: hidden;
    padding: clamp(2.5rem, 7vw, 5rem) 1.25rem clamp(3rem, 8vw, 5.5rem);
    text-align: center;
}
.hero-sisalto { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.hero-logo { width: min(100%, 380px); height: auto; margin: 0 auto 1.25rem; }
.hero-otsikko { font-family: var(--otsikko); font-size: clamp(1.35rem, 4vw, 1.7rem); color: var(--musta); margin-bottom: .4rem; }
.hero-teksti { color: var(--hiljainen); max-width: 32em; margin: 0 auto 1.75rem; }

.taplakentta { position: absolute; inset: 0; pointer-events: none; }
.tapla { position: absolute; fill: var(--musta); }
/* Täplät reunoille, kokonaisina, logon ympärille */
.t1  { width: 92px;  left: 5%;   top: 9%;   transform: rotate(18deg); }
.t2  { width: 38px;  left: 15%;  top: 31%;  transform: rotate(-30deg); }
.t3  { width: 64px;  left: 8%;   top: 55%;  transform: rotate(60deg); }
.t4  { width: 26px;  left: 19%;  top: 74%; }
.t5  { width: 120px; left: 3%;   top: 80%;  transform: rotate(-12deg); }
.t6  { width: 74px;  right: 7%;  top: 7%;   transform: rotate(-40deg); }
.t7  { width: 30px;  right: 18%; top: 22%;  transform: rotate(10deg); }
.t8  { width: 104px; right: 4%;  top: 41%;  transform: rotate(75deg); }
.t9  { width: 44px;  right: 16%; top: 66%;  transform: rotate(-65deg); }
.t10 { width: 22px;  right: 9%;  top: 82%; }
.t11 { width: 58px;  right: 23%; top: 88%;  transform: rotate(35deg); }

@media (max-width: 860px) {
    .hero { padding-bottom: 5.5rem; }
    .hero-logo { width: min(78%, 300px); }
    .t1  { width: 46px; left: 4%;  top: 2.5%; }
    .t2  { width: 18px; left: 16%; top: 10%; }
    .t6  { width: 38px; right: 5%; top: 3.5%; }
    .t7  { width: 15px; right: 16%; top: 11%; }
    .t5  { width: 52px; left: 7%;  top: auto; bottom: 1.4rem; }
    .t4  { width: 16px; left: 24%; top: auto; bottom: 1rem; }
    .t11 { width: 34px; right: 9%; top: auto; bottom: 2.4rem; }
    .t10 { width: 14px; right: 24%; top: auto; bottom: 1.2rem; }
    .t9  { width: 22px; left: 47%; right: auto; top: auto; bottom: .7rem; }
    .t3, .t8 { display: none; }
}

/* Sivun ainoa automaattinen animaatio: täplät ilmestyvät latautuessa */
@media (prefers-reduced-motion: no-preference) {
    .tapla { animation: tapla-esiin .5s cubic-bezier(.3, 1.6, .5, 1) both; }
    .t1 { animation-delay: .05s } .t6 { animation-delay: .12s } .t2 { animation-delay: .19s }
    .t7 { animation-delay: .26s } .t3 { animation-delay: .33s } .t8 { animation-delay: .4s }
    .t4 { animation-delay: .47s } .t9 { animation-delay: .54s } .t5 { animation-delay: .61s }
    .t10 { animation-delay: .68s } .t11 { animation-delay: .75s }
    @keyframes tapla-esiin { from { scale: 0; opacity: 0; } to { scale: 1; opacity: 1; } }
}

/* ---------- Osiot ---------- */
.osio { padding: clamp(3.5rem, 9vw, 6.5rem) clamp(1.25rem, 5vw, 2rem); max-width: var(--leveys); margin: 0 auto; }
.osio-otsikko { max-width: 38rem; margin-bottom: 2.2rem; }
.osio-otsikko p { color: var(--hiljainen); margin: 0; }

/* Meistä */
.meista { display: grid; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.meista-teksti { max-width: 36rem; }
.meista-teksti p { font-size: 1.08rem; }
.meista-teksti p:first-of-type { font-family: var(--otsikko); font-size: 1.35rem; line-height: 1.45; color: var(--musta); }
.meista-kuva { position: relative; max-width: min(300px, 80%); width: 100%; margin: 0 auto; }
.meista-kuva img {
    width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
    border-radius: 58% 42% 52% 48% / 46% 52% 48% 54%;
    background: var(--sumu);
}
.koriste { position: absolute; fill: var(--musta); }
.k1 { width: 70px; right: -6px; top: 6%; transform: rotate(25deg); }
.k2 { width: 34px; left: 2%; bottom: 8%; transform: rotate(-40deg); }
@media (min-width: 860px) { .meista { grid-template-columns: 5fr 6fr; } .meista-kuva { max-width: 380px; } }

/* Koirat */
.koirat { max-width: none; padding-left: 0; padding-right: 0; }
.koirat > .osio-otsikko, .ryhmaotsikko { max-width: var(--leveys); margin-left: auto; margin-right: auto; padding: 0 clamp(1.25rem, 5vw, 2rem); }
.ryhmaotsikko { font-size: 1.6rem; margin-top: 3.5rem; margin-bottom: 1.4rem; }
.koirarivi {
    display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 300px);
    gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 0 clamp(1.25rem, 5vw, 2rem) 1rem; scroll-padding: 0 clamp(1.25rem, 5vw, 2rem);
    scrollbar-width: thin;
}
@media (min-width: 1000px) {
    .koirarivi {
        grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        overflow: visible; max-width: var(--leveys); margin: 0 auto; padding-bottom: 0;
    }
}
.koira { scroll-snap-align: start; display: flex; flex-direction: column; }
.koira-kuva { position: relative; margin-bottom: 1rem; }
.koira-kuva img, .kuva-puuttuu { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 35%; border-radius: 22px; background: var(--sumu); }
.kuva-puuttuu { display: grid; place-items: end start; padding: 1rem; color: var(--hiljainen); font-size: .9rem;
    background:
        radial-gradient(ellipse 14% 11% at 30% 28%, #000 98%, transparent 100%),
        radial-gradient(ellipse 9% 12% at 68% 42%, #000 98%, transparent 100%),
        radial-gradient(ellipse 6% 5% at 52% 64%, #000 98%, transparent 100%),
        radial-gradient(ellipse 11% 8% at 78% 76%, #000 98%, transparent 100%),
        #f6f6f8;
}
.kuva-puuttuu span { background: #fff; padding: .2rem .6rem; border-radius: 999px; }
.nauha {
    position: absolute; left: 12px; top: 12px;
    background: var(--maksa); color: #fff; font-size: .82rem; font-weight: 600;
    padding: .35rem .75rem .35rem .65rem; border-radius: 6px 999px 999px 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.koira h3 { font-size: 1.65rem; margin: 0 0 .1rem; }
.virallinen { color: var(--hiljainen); font-size: .95rem; margin: 0 0 .6rem; }
.terveys { list-style: none; padding: 0; margin: 0 0 .8rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.terveys li { font-size: .8rem; font-weight: 600; border: 1.5px solid var(--musta); padding: .12rem .55rem; border-radius: 999px; }
.kuvaus p { font-size: .97rem; margin-bottom: .5rem; }
.koiranetti {
    margin-top: auto; align-self: flex-start;
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .45rem .85rem; border-radius: 999px;
    background: var(--sumu); color: var(--sini-tumma);
    font-size: .85rem; font-weight: 600; text-decoration: none; line-height: 1.2;
    transition: background .15s ease, color .15s ease;
}
.koiranetti::after {
    content: ""; width: .5rem; height: .5rem; flex: none;
    border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg);
}
.koiranetti:hover { background: var(--sini); color: var(--valk); }
/* Pienempi nappi (esim. kumppanin kauppaan) */
.nappi.pieni-nappi { min-height: 42px; padding: .5rem 1.1rem; font-size: .92rem; margin-top: .35rem; }

/* Pentulaatikko: koko leveyden sininen kaista */
.pennut { max-width: none; background: var(--sumu); display: grid; gap: 2.5rem; }
.pennut > * { width: 100%; max-width: var(--leveys); margin: 0 auto; }
@media (min-width: 900px) {
    .pennut { grid-template-columns: minmax(0, 560px) minmax(0, 520px); justify-content: center; gap: 5rem; }
    .pennut > * { margin: 0; }
}
.pentutila-otsikko { font-family: var(--otsikko); font-size: clamp(1.45rem, 4vw, 1.9rem); line-height: 1.3; color: var(--musta); }
.pentutila.aktiivinen .pentutila-otsikko { color: var(--sini-tumma); }
.pentutila .nappi { margin-top: .5rem; }
.mukaan h3 { font-size: 1.5rem; }
.mukaan ul { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.mukaan li { position: relative; padding: .6rem 0 .6rem 2.1rem; border-bottom: 1px solid #d5dbf6; }
.mukaan li::before {
    content: ""; position: absolute; left: .2rem; top: 1rem;
    width: 14px; height: 12px; background: var(--musta);
    border-radius: 58% 42% 55% 45% / 50% 60% 40% 50%; transform: rotate(-15deg);
}
.mukaan li:nth-child(even)::before { width: 11px; height: 13px; transform: rotate(30deg); }
.sijoitus p { color: var(--hiljainen); font-size: .97rem; }

/* Instagram */
.ig-kuvat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border-radius: 18px; overflow: hidden; margin-bottom: 2rem; }
.ig-kuvat img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--sumu); }
@media (min-width: 860px) { .ig-kuvat { grid-template-columns: repeat(6, 1fr); } }
.ig-ruudukko { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); justify-items: center; margin-bottom: 2rem; }
.ig-ruudukko .instagram-media { margin: 0 !important; min-width: 0 !important; width: 100% !important; max-width: 420px !important; }

/* Kumppanit: kuponki */
.kumppanit { padding-top: 0; }
.kumppanit h2 { font-size: clamp(1.7rem, 4.5vw, 2.2rem); }
.kuponki {
    display: grid; gap: 1.25rem; align-items: center;
    border: 2px dashed var(--sini); border-radius: 18px;
    padding: clamp(1.25rem, 4vw, 1.75rem); margin-bottom: 1rem;
}
.kuponki h3 { margin-bottom: .3rem; }
.kuponki p { margin-bottom: .5rem; }
.kuponki a { font-weight: 600; }
@media (min-width: 700px) { .kuponki { grid-template-columns: 1fr auto; } }
.koodi {
    display: flex; flex-direction: column; align-items: center; gap: .15rem;
    background: var(--sumu); border: 0; border-radius: 12px; padding: .9rem 1.4rem;
    cursor: pointer; font-family: var(--leipa); color: var(--musta);
}
.koodi-teksti { font-size: 1.25rem; font-weight: 800; letter-spacing: .06em; }
.koodi-ohje { font-size: .85rem; color: var(--sini-tumma); font-weight: 600; }
.koodi:hover { background: #e2e7fb; }
.koodi.kopioitu .koodi-ohje { color: #1d7a3a; }

/* Yhteys */
.yhteys { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 900px) { .yhteys { grid-template-columns: 1fr minmax(0, 500px); gap: 5rem; } }
.yhteys-nimi { font-family: var(--otsikko); font-size: 1.3rem; color: var(--musta); }
.yhteys-ohje p { color: var(--hiljainen); }
.yhteyslista { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .6rem; }
.yhteyslista a {
    display: flex; align-items: center; gap: .85rem; min-height: 48px;
    color: var(--teksti); text-decoration: none; font-weight: 500; word-break: break-word;
}
.yhteyslista a:hover { color: var(--sini); }
.yhteyslista svg {
    width: 44px; height: 44px; flex: none; padding: 11px; border-radius: 50%;
    background: var(--musta); fill: var(--valk); transition: background .15s;
}
.yhteyslista a:hover svg { background: var(--sini); }

.lomake { background: var(--valk); border: 1px solid var(--raja); border-radius: 22px; padding: clamp(1.25rem, 4vw, 2rem); box-shadow: 0 24px 50px -30px rgba(40, 50, 120, .35); }
.lomake h3 { margin-bottom: 1rem; }
.lomake label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 1rem; color: var(--musta); }
.lomake label small { font-weight: 400; color: var(--hiljainen); }
.lomake input, .lomake textarea {
    display: block; width: 100%; margin-top: .35rem; padding: .8rem .9rem;
    font: 400 1rem/1.4 var(--leipa); color: var(--teksti);
    background: #fafafc; border: 1.5px solid var(--raja); border-radius: 12px;
}
.lomake input:focus, .lomake textarea:focus { outline: none; border-color: var(--sini); background: var(--valk); box-shadow: 0 0 0 4px var(--sumu); }
.lomake textarea { resize: vertical; }
.lomake .nappi { width: 100%; margin-top: .75rem; }
.lomake .pieni { font-size: .85rem; color: var(--hiljainen); margin: .9rem 0 0; text-align: center; }
.cf-turnstile { min-height: 65px; }
.piilokentta { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lomakeviesti { padding: .85rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-weight: 600; }
.lomakeviesti.ok { background: #e3f6e8; color: #17602d; }
.lomakeviesti.virhe { background: #fde8e8; color: #8f1d1d; }

/* Some-ikonit valikossa ja alapalkissa */
.valikko-some { display: flex; gap: .4rem; }
.valikko-some a, .alapalkki-some a {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    border: 1.5px solid var(--raja); padding: 0;
}
.valikko-some svg, .alapalkki-some svg { width: 20px; height: 20px; fill: var(--musta); }
.valikko-some a:hover { border-color: var(--musta); }
@media (max-width: 860px) {
    .valikko-some { justify-content: center; gap: .8rem; margin-top: 1rem; }
    .valikko .valikko-some a { width: 48px; height: 48px; border-bottom: 1.5px solid var(--raja); padding: 0; }
}
.alapalkki-some { display: flex; justify-content: center; gap: .6rem; margin-bottom: 1rem !important; }
.alapalkki-some a { border-color: #444; }
.alapalkki-some svg { fill: #fff; }

/* Toast: läpikuultava ilmoitus alhaalla keskellä */
.toast {
    position: fixed; z-index: 100; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: max-content; max-width: calc(100% - 2rem);
    padding: .9rem 1.3rem; border-radius: 16px;
    background: rgba(20, 20, 24, .78); color: #fff;
    backdrop-filter: blur(12px) saturate(1.4); -webkit-backdrop-filter: blur(12px) saturate(1.4);
    box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .45);
    font-weight: 600; text-align: center; cursor: pointer;
    animation: toast-sisaan .3s ease both;
}
.toast::before { content: ""; display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .6rem; background: #7ee2a0; vertical-align: .05em; }
.toast.virhe::before { background: #ff8a8a; }
.toast.pois { opacity: 0; transform: translate(-50%, 12px); transition: opacity .35s ease, transform .35s ease; }
@keyframes toast-sisaan { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Alapalkki */
.alapalkki { background: var(--musta); color: #c9c9cf; text-align: center; padding: 2.5rem 1rem; font-size: .92rem; }
.alapalkki p { margin: .2rem 0; }
.alapalkki a { color: var(--valk); font-weight: 500; }
.alapalkki a:hover { color: #c9cff5; }

/* Tietosuojasivu */
.teksti-sivu { max-width: 44rem; }
.teksti-sivu h3 { margin-top: 2rem; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Kenttävirheet (omat, ei selaimen kuplia) */
.kenttavirhe { display: block; margin-top: .35rem; color: #a32020; font-size: .85rem; font-weight: 600; }
.lomake [aria-invalid="true"] { border-color: #d64545; background: #fff6f6; }

/* Koiran kuvan suurennus */
.koira-kuva img { cursor: zoom-in; transition: transform .25s ease; }
.koira-kuva img:hover { transform: scale(1.02); }
.koira-kuva { overflow: hidden; border-radius: 22px; }
.kuvaikkuna {
    border: 0; padding: 0; margin: auto; background: transparent;
    max-width: 100vw; max-height: 100vh; width: 100vw; height: 100dvh;
    display: none; place-items: center; cursor: zoom-out;
}
.kuvaikkuna[open] { display: grid; }
.kuvaikkuna::backdrop { background: rgba(10, 10, 14, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.kuvaikkuna figure { margin: 0; padding: 1rem; display: flex; flex-direction: column; align-items: center; gap: .8rem; max-height: 100%; }
.kuvaikkuna img {
    max-width: min(92vw, 1100px); max-height: calc(100dvh - 7rem); width: auto; height: auto;
    object-fit: contain; border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
}
.kuvaikkuna figcaption { color: #fff; font-family: var(--otsikko); font-size: 1.25rem; text-align: center; }
.kuvaikkuna-sulje {
    position: fixed; top: calc(.75rem + env(safe-area-inset-top)); right: .75rem; z-index: 2;
    width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255, 255, 255, .15); color: #fff; font-size: 2rem; line-height: 1;
}
.kuvaikkuna-sulje:hover { background: rgba(255, 255, 255, .3); }
@media (prefers-reduced-motion: no-preference) {
    .kuvaikkuna[open] img { animation: kuva-auki .28s cubic-bezier(.2, .9, .3, 1.1) both; }
    .kuvaikkuna[open]::backdrop { animation: tausta-auki .25s ease both; }
    @keyframes kuva-auki { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
    @keyframes tausta-auki { from { opacity: 0; } to { opacity: 1; } }
}
