/* /ohjeet — the Fleksi help centre (redesign 2026-08-12).
   One stable Fleksi reading surface: no gradient or colour change while
   scrolling. Scoped under .ohjeet-* so nothing leaks into other public pages.
   Record: docs/ohjeet-julkaisu-2026-08-12.md. */

/* Use the public site's theme tokens while keeping the help surface solid. */
body.ohjeet-body {
    background: var(--bg);
}
.ohjeet-main {
    background: var(--bg);
    color: var(--ink);
    padding: 28px 0 72px;
    min-height: 60vh;
}
.ohjeet-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}
.ohjeet-main a { color: var(--accent-strong); }
.ohjeet-main a:hover { text-decoration: underline; }

/* ── Landing ── */
.ohjeet-landing { max-width: 860px; }
.ohjeet-hero { margin: 20px 0 36px; }
.ohjeet-hero h1 { font-size: 2rem; margin: 0 0 18px; color: var(--ink); }
.ohjeet-search--hero input { font-size: 1.05rem; padding: 14px 16px; }

.ohjeet-tasks h2, .ohjeet-topics h2 {
    font-size: 1.15rem;
    margin: 30px 0 12px;
    color: var(--ink);
}
.ohjeet-tasks__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}
.ohjeet-tasks__list a {
    display: block;
    padding: 14px 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
}
.ohjeet-tasks__list a:hover { border-color: var(--accent); text-decoration: none; }

.ohjeet-topics__group { margin-bottom: 18px; }
.ohjeet-topics__group h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin: 18px 0 6px;
}
.ohjeet-topics__group ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}
.ohjeet-topics__group li a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}
.ohjeet-topics__group li a:hover { background: var(--accent-soft); text-decoration: none; }
.ohjeet-topics__group li a strong { color: var(--accent-strong); display: block; }
.ohjeet-topics__group li a span { font-size: 0.88rem; color: var(--muted); }

/* ── Article layout: topic nav left (desktop), article right, NO right rail ── */
.ohjeet-article-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    grid-template-areas:
        "bar bar"
        "nav article";
    gap: 8px 44px;
    align-items: start;
}
.ohjeet-articlebar {
    grid-area: bar;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.ohjeet-articlebar__home {
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.ohjeet-search--compact { max-width: 340px; flex: 1; }
.ohjeet-nav { grid-area: nav; font-size: 0.92rem; }
.ohjeet-article { grid-area: article; }

/* One simple topic list — intentionally NOT an independently scrolling pane. */
.ohjeet-nav h3 {
    margin: 16px 0 4px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}
.ohjeet-nav ul { list-style: none; margin: 0; padding: 0; }
.ohjeet-nav li a,
.ohjeet-nav__home {
    display: block;
    padding: 4px 8px;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
}
.ohjeet-nav__home { margin-top: 10px; font-weight: 600; }
.ohjeet-nav li a:hover, .ohjeet-nav__home:hover { background: var(--accent-soft); text-decoration: none; }
.ohjeet-nav li a.is-active, .ohjeet-nav__home.is-active {
    background: var(--signal-soft);
    color: var(--signal);
    font-weight: 600;
}

/* Mobile disclosure: summary visible only on narrow viewports (JS closes the
   details there; it ships open for the no-JS fallback). */
.ohjeet-nav__disclosure > summary { display: none; }
@media (max-width: 820px) {
    .ohjeet-nav__disclosure > summary {
        display: flex;
        align-items: baseline;
        gap: 8px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--paper);
        cursor: pointer;
        font-weight: 600;
        list-style: revert;
    }
    .ohjeet-nav__disclosure > summary:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }
    .ohjeet-nav__summary-current {
        font-weight: 400;
        color: var(--muted);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ── Search (shared) ── */
.ohjeet-search { position: relative; }
.ohjeet-search input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: var(--paper);
    color: var(--ink);
}
.ohjeet-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ohjeet-search__results {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-top: 4px;
}
.ohjeet-search__results a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--line);
}
.ohjeet-search__results a:hover,
.ohjeet-search__results a.is-selected { background: var(--accent-soft); }
.ohjeet-search__results .ohjeet-hit__page { font-weight: 600; font-size: 0.9rem; }
.ohjeet-search__results .ohjeet-hit__section { font-size: 0.84rem; color: var(--muted); }
.ohjeet-search__results .ohjeet-hit__none {
    display: block;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--muted);
}

/* ── Article typography: calm, ~70 characters per line ── */
.ohjeet-article {
    min-width: 0;
    max-width: 44rem;
    line-height: 1.65;
}
.ohjeet-article h1 { font-size: 1.7rem; margin: 4px 0 10px; color: var(--ink); }
.ohjeet-article h2 {
    font-size: 1.25rem;
    margin: 2.1em 0 0.5em;
    padding-top: 0.4em;
    border-top: 1px solid var(--line);
    color: var(--ink);
}
.ohjeet-article h2:first-of-type { border-top: 0; padding-top: 0; }
.ohjeet-article h3 { font-size: 1.05rem; margin: 1.5em 0 0.4em; color: var(--ink); }
.ohjeet-article hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.ohjeet-article blockquote {
    margin: 1.2em 0;
    padding: 10px 16px;
    border-left: 4px solid var(--accent);
    background: var(--paper);
    border-radius: 0 8px 8px 0;
}
.ohjeet-article blockquote p { margin: 0; }
.ohjeet-article code {
    background: var(--accent-soft);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Compact in-article "Tällä sivulla" under the title (long articles only). */
.ohjeet-onpage {
    margin: 0 0 18px;
    font-size: 0.92rem;
}
.ohjeet-onpage > summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--accent-strong);
}
.ohjeet-onpage ul { margin: 8px 0 0; padding-left: 20px; }
.ohjeet-onpage li { margin: 2px 0; }

/* Screenshots sit in the reading flow at a useful size, no decorative card. */
.ohjeet-article figure { margin: 1.6em 0; }
.ohjeet-image-link {
    position: relative;
    display: block;
    width: 100%;
    color: inherit;
    cursor: zoom-in;
}
.ohjeet-article figure img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
}
.ohjeet-image-link__icon {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    font-size: 22px;
    line-height: 1;
    overflow: hidden;
}
.ohjeet-image-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}
.ohjeet-article figcaption { font-size: 0.86rem; color: var(--muted); margin-top: 6px; }

@media (min-width: 821px) {
    .ohjeet-article figure {
        width: min(58rem, calc(100vw - 360px));
    }
}

/* Tables scroll inside their own container, never the page. */
.ohjeet-table { overflow-x: auto; margin: 1.2em 0; }
.ohjeet-table table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.ohjeet-table th, .ohjeet-table td {
    border: 1px solid var(--line);
    padding: 7px 10px;
    text-align: left;
    vertical-align: top;
    background: var(--paper);
}
.ohjeet-table th { background: var(--accent-soft); }

.ohjeet-pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.ohjeet-pager a { text-decoration: none; font-weight: 600; }
.ohjeet-pager__next { margin-left: auto; }

/* ── Responsive: phone reads title and content first ── */
@media (max-width: 820px) {
    /* The ARTICLE comes before the topic disclosure on a phone (redesign
       correction 1): title and purpose first, Aiheet after the article. */
    .ohjeet-article-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "bar"
            "article"
            "nav";
        gap: 10px;
    }
    .ohjeet-nav { margin-top: 18px; }
    .ohjeet-articlebar { flex-wrap: wrap; gap: 8px; }
    .ohjeet-search--compact { max-width: none; width: 100%; }
    .ohjeet-hero h1 { font-size: 1.6rem; }
}
