/* editorial-shared.css
   Koodinorppa-sivuston jaettu tyylipohja. Käytetään etusivulla (index.html)
   ja kaikilla alasivuilla (privacy / terms / help / support, fi + en).
   Sisältää: variables, fontit, body, nav.top + hamburger drawer, footer,
   article-grundille riittävät tyylit alasivuille.
*/

:root {
    /* Saimaa Dark — syvempi paletti */
    --ink: #0A1623;
    --ink-deep: #050D17;
    --ink-elev: #122638;
    --ink-elev-2: #1A3349;

    /* Brand-keltainen — yksi väri, ei gradienteja */
    --brand: #E7B040;
    --brand-glow: #F4C76A;
    --brand-deep: #B07F1E;

    /* Paperisävyt — lämmin kontrasti tummalle */
    --paper: #F4EFE5;
    --paper-dim: #C9BDA7;

    /* Tekstit */
    --text: #F4EFE5;
    --text-dim: #9BAFC4;
    --text-faint: #7A8FA4;

    /* Viivat ja erottimet */
    --rule: rgba(244, 239, 229, 0.10);
    --rule-strong: rgba(244, 239, 229, 0.20);

    /* Typografia */
    --display: 'DM Serif Display', 'Times New Roman', Georgia, serif;
    --body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
    background: var(--ink);
}

body {
    font-family: var(--body);
    background: var(--ink);
    color: var(--text);
    line-height: 1.7;
    font-weight: 400;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "onum" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

::selection {
    background: var(--brand);
    color: var(--ink-deep);
}

a {
    color: var(--brand-glow);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--brand);
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ─────────────────────────────────────────────
   NAV — pieni, vaiti, sticky. Hamburger mobiilissa.
   ───────────────────────────────────────────── */
nav.top {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 22, 35, 0.78);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-bottom: 1px solid var(--rule);
}
nav.top .inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.15rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}
nav.top .brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text);
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.18rem;
    letter-spacing: -0.015em;
}
nav.top .brand img {
    width: 30px;
    height: 30px;
    display: block;
}
nav.top .links {
    display: flex;
    align-items: center;
    gap: 2.1rem;
    font-family: var(--body);
    font-size: 0.95rem;
    font-style: italic;
    font-weight: 400;
}
nav.top .links a {
    color: var(--text-dim);
}
nav.top .links a:hover {
    color: var(--brand-glow);
}
nav.top .lang {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.18em;
}
nav.top .lang:hover {
    color: var(--brand-glow);
}

/* Hamburger — vain mobiilissa näkyvä, piilotettu desktop-leveyksillä */
nav.top .hamburger {
    display: none;
    background: transparent;
    border: 0;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text);
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}
nav.top .hamburger svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* ─────────────────────────────────────────────
   MOBILE DRAWER — slide-in oikealta
   ───────────────────────────────────────────── */
.mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 13, 23, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 90;
}
.mobile-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(85vw, 320px);
    background: var(--ink-deep);
    border-left: 1px solid var(--rule-strong);
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow-y: auto;
}
.mobile-drawer.open {
    transform: translateX(0);
}
.mobile-drawer .close {
    align-self: flex-end;
    background: transparent;
    border: 0;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-dim);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}
.mobile-drawer .close svg {
    width: 24px;
    height: 24px;
}
.mobile-drawer a {
    display: block;
    padding: 0.85rem 0;
    color: var(--text);
    font-family: var(--body);
    font-size: 1.05rem;
    font-weight: 500;
    border-bottom: 1px solid var(--rule);
    transition: color 0.15s ease;
}
.mobile-drawer a:hover {
    color: var(--brand-glow);
}
.mobile-drawer .lang {
    margin-top: auto;
    padding-top: 1.5rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    border: 0;
    align-self: flex-start;
}

/* Estä body-skrollaus kun drawer auki */
body.drawer-open {
    overflow: hidden;
}

/* ─────────────────────────────────────────────
   FOOTER — sama kaikilla sivuilla
   ───────────────────────────────────────────── */
footer.site {
    border-top: 1px solid var(--rule);
    padding: 3rem 0 2.5rem;
    margin-top: 4rem;
    color: var(--text-faint);
    font-size: 0.85rem;
}
footer.site .grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2.5rem;
}
footer.site h4 {
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--text-dim);
    margin-bottom: 1rem;
    font-weight: 500;
}
footer.site ul {
    list-style: none;
}
footer.site ul li {
    margin-bottom: 0.55rem;
}
footer.site ul a {
    color: var(--text-faint);
    font-size: 0.92rem;
}
footer.site ul a:hover {
    color: var(--brand-glow);
}
footer.site .about {
    font-family: var(--body);
    color: var(--text-dim);
    font-size: 0.92rem;
    line-height: 1.65;
}
footer.site .about strong {
    font-family: var(--display);
    font-weight: 400;
    color: var(--text);
    font-size: 1.15rem;
    display: block;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}
footer.site .copyright {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
}

/* ─────────────────────────────────────────────
   ARTICLE — alasivujen content-pohja
   ───────────────────────────────────────────── */
article.subpage {
    max-width: 760px;
    margin: 0 auto;
    padding: 5rem 2rem 6rem;
}
article.subpage .eyebrow {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 1.5rem;
}
article.subpage h1 {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: var(--text);
    margin-bottom: 0.75rem;
}
article.subpage .updated {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 3rem;
}
article.subpage h2 {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 3rem 0 1rem;
}
article.subpage h3 {
    font-family: var(--body);
    font-weight: 600;
    font-size: 1.08rem;
    color: var(--text);
    margin: 2rem 0 0.6rem;
    letter-spacing: -0.005em;
}
article.subpage p,
article.subpage li {
    color: var(--paper-dim);
    font-size: 1rem;
    margin-bottom: 0.9rem;
    line-height: 1.75;
}
article.subpage ul,
article.subpage ol {
    padding-left: 1.5rem;
    margin-bottom: 1.2rem;
}
article.subpage li {
    margin-bottom: 0.45rem;
}
article.subpage strong {
    color: var(--text);
    font-weight: 600;
}
article.subpage code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--ink-elev);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: var(--brand-glow);
}
article.subpage table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}
article.subpage th,
article.subpage td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--rule);
    font-size: 0.95rem;
}
article.subpage th {
    font-family: var(--mono);
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}
article.subpage a {
    border-bottom: 1px solid var(--rule);
    transition: border-color 0.15s ease, color 0.15s ease;
}
article.subpage a:hover {
    border-bottom-color: var(--brand);
}
article.subpage hr {
    border: 0;
    border-top: 1px solid var(--rule);
    margin: 3rem 0;
}

/* details/summary — FAQ-tyyppisille listoille help-sivulla */
article.subpage details {
    border-top: 1px solid var(--rule);
    padding: 1.15rem 0;
}
article.subpage details:last-of-type {
    border-bottom: 1px solid var(--rule);
}
article.subpage details summary {
    cursor: pointer;
    list-style: none;
    font-family: var(--body);
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--text);
    padding-right: 2rem;
    position: relative;
    transition: color 0.15s ease;
}
article.subpage details summary::-webkit-details-marker {
    display: none;
}
article.subpage details summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: -2px;
    font-family: var(--mono);
    font-weight: 400;
    font-size: 1.4rem;
    color: var(--brand);
    transition: transform 0.2s ease;
    line-height: 1;
}
article.subpage details[open] summary::after {
    transform: rotate(45deg);
}
article.subpage details summary:hover {
    color: var(--brand-glow);
}
article.subpage details > p,
article.subpage details > ul,
article.subpage details > ol {
    margin-top: 0.85rem;
}
article.subpage details p:last-child,
article.subpage details ul:last-child,
article.subpage details ol:last-child {
    margin-bottom: 0;
}

/* ─────────────────────────────────────────────
   RESPONSIVE — mobiili-breakpoint
   ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .container { padding: 0 1.5rem; }
    nav.top .inner { padding: 1rem 1.5rem; }
    nav.top .links { display: none; }
    nav.top .hamburger { display: inline-flex; }

    article.subpage { padding: 3rem 1.5rem 4rem; }

    footer.site .grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 480px) {
    footer.site .grid {
        grid-template-columns: 1fr;
    }
    .copyright { font-size: 0.65rem; }
}

/* ─────────────────────────────────────────────
   STICKY CTA — mobiili-pohjapalkki, vain pienillä näytöillä.
   Näyttää "Lataa App Storesta" -napin koko ajan saatavilla niin että
   käyttäjän ei tarvitse scrollata Osio VIII:aan asti.
   ───────────────────────────────────────────── */
.sticky-cta {
    display: none;
}
@media (max-width: 900px) {
    .sticky-cta {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
        z-index: 60;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.8rem 1.45rem;
        /* Tumma frosted-lasi: kulta jää aksentiksi (reunus + logo), ei pinnaksi */
        background: rgba(18, 38, 56, 0.72);              /* --ink-elev läpikuultavana */
        -webkit-backdrop-filter: blur(16px) saturate(140%);
        backdrop-filter: blur(16px) saturate(140%);
        border: 1px solid rgba(231, 176, 64, 0.45);      /* --brand, ohut hiusviiva */
        border-radius: 999px;
        color: var(--paper);
        font-family: var(--body);
        font-weight: 600;
        font-size: 0.95rem;
        letter-spacing: 0.01em;
        white-space: nowrap;
        text-decoration: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
        transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
    }
    .sticky-cta:hover,
    .sticky-cta:focus {
        border-color: var(--brand);
        background: rgba(18, 38, 56, 0.86);
        transform: translateX(-50%) translateY(-1px);
    }
    .sticky-cta svg {
        width: 17px;
        height: 17px;
        color: var(--brand);                              /* Apple-logo kullalla */
        flex-shrink: 0;
    }
    /* Body-padding ettei sticky peitä sisältöä lopussa */
    body { padding-bottom: 5rem; }
}

/* ─────────────────────────────────────────────
   EYEBROW — pidä fraasit kokonaisina, katkaise vain segmenttien
   (pisteiden) välistä, ei sanan keskeltä.
   ───────────────────────────────────────────── */
.hero-eyebrow .nw {
    white-space: nowrap;
}

/* ─────────────────────────────────────────────
   TOUCH-TARGET — 44px+ Applen Human Interface Guidelines mukaan
   ───────────────────────────────────────────── */
nav.top .lang {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 0.55rem;
}

/* ─────────────────────────────────────────────
   ACCESSIBILITY — kunnioita prefers-reduced-motion
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
