/* OPS-arkisto – Laurean brändiohjeistus 2026. Mobile first, ei kirjastoja. */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('fonts/inter-latin.woff2?v=260c81a4') format('woff2-variations'), url('fonts/inter-latin.woff2?v=260c81a4') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('fonts/inter-latin-ext.woff2?v=1ad231aa') format('woff2-variations'), url('fonts/inter-latin-ext.woff2?v=1ad231aa') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Brändivärit */
    --vihrea-tummin: #0F331F;
    --vihrea: #1A5336;
    --vihrea-vaalea: #9DEA9F;
    --keltavihrea: #DEEB9C;
    /* Tehostevärit */
    --sininen-vaalea: #B6E3F5;
    --oranssi: #F8A523;
    --roosa: #F8C5D2;
    --sininen: #009FE3;

    /* Käyttövärit (kontrastit valkoista/taustaa vasten ≥ 4.5:1) */
    --teksti: #0F331F;
    --teksti-heikko: #4A5550;
    --linkki: #1A5336;
    --tausta: #F6F3EC;
    --kortti: #FFFFFF;
    --laatikko: #EFEFEC;
    --rivi: #F4F4F1;
    --raja: #D9D6CE;
    --fokus: #1A5336;

    --fontti: 'Inter', system-ui, sans-serif;
    --pyoristys: 12px;
    --leveys: 1400px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    background: var(--tausta);
    color: var(--teksti);
    font-family: var(--fontti);
    font-size: 1rem;
    line-height: 1.5;
}

h1,
h2,
h3 {
    line-height: 1.25;
    margin: 0 0 .75rem;
}

h1 {
    font-size: 1.625rem;
    font-weight: 700;
}

h2 {
    font-size: 1.25rem;
    font-weight: 650;
}

h3 {
    font-size: 1.0625rem;
    font-weight: 600;
}

a {
    color: var(--linkki);
    text-underline-offset: .15em;
}

a:hover {
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 3px solid var(--fokus);
    outline-offset: 2px;
    border-radius: 2px;
}

img,
svg {
    flex-shrink: 0;
}

.leveys {
    width: 100%;
    max-width: var(--leveys);
    margin-inline: auto;
    padding-inline: 1rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip-link */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 100;
    padding: .75rem 1rem;
    background: var(--vihrea);
    color: #fff;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
}

.skip-link:focus {
    top: 0;
    outline-color: var(--vihrea-tummin);
}

/* Yläpalkki */
.ylapalkki {
    background: #fff;
    border-bottom: 1px solid var(--raja);
}

.ylapalkki__sisus {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    min-height: 72px;
}

.hakukentta {
    order: 3;
    display: flex;
    flex: 1 1 100%;
    padding-bottom: .75rem;
}

.hakukentta input {
    flex: 1 1 auto;
    min-width: 0;
    padding: .5rem .75rem;
    border: 2px solid var(--teksti-heikko);
    border-right: 0;
    border-radius: 8px 0 0 8px;
    background: #fff;
    color: var(--teksti);
    font: inherit;
}

.hakukentta input::placeholder {
    color: var(--teksti-heikko);
}

.hakukentta button {
    display: grid;
    place-items: center;
    padding: 0 .875rem;
    border: 2px solid var(--vihrea);
    border-radius: 0 8px 8px 0;
    background: var(--vihrea);
    color: #fff;
    cursor: pointer;
}

.hakukentta button:hover {
    background: var(--vihrea-tummin);
    border-color: var(--vihrea-tummin);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--teksti);
    text-decoration: none;
}

.logo img {
    display: block;
    height: 40px;
    width: auto;
}

.logo__sivusto {
    display: none;
    padding-left: 1rem;
    border-left: 1px solid var(--raja);
    font-weight: 600;
    font-size: 1.0625rem;
}

.kielet ul {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kielet a {
    display: block;
    min-width: 2.75rem;
    padding: .5rem .75rem;
    border: 2px solid var(--vihrea);
    color: var(--vihrea);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    line-height: 1.2;
}

.kielet li:first-child a {
    border-radius: 8px 0 0 8px;
}

.kielet li:last-child a {
    border-radius: 0 8px 8px 0;
    margin-left: -2px;
}

.kielet a:hover {
    background: var(--keltavihrea);
}

.kielet a[aria-current] {
    background: var(--vihrea);
    color: #fff;
}

/* Murupolku ja valikkopainike */
.mururivi {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    padding-block: 1rem;
}

.murupolku {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .9375rem;
}

.murupolku li {
    flex-shrink: 0;
}

.murupolku li:not(:last-child)::after {
    content: '/';
    margin-inline: .5rem;
    color: var(--teksti-heikko);
}

.murupolku [aria-current] {
    font-weight: 600;
}

.valikko-nappi {
    display: none;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border: 2px solid var(--vihrea);
    border-radius: 8px;
    background: var(--vihrea);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.valikko-nappi:hover {
    background: var(--vihrea-tummin);
    border-color: var(--vihrea-tummin);
}

.js .valikko-nappi {
    display: inline-flex;
}

/* Mobiilissa "Valikko", työpöydällä tilan mukaan "Piilota valikko" / "Näytä valikko". */
.valikko-nappi__piilota,
.valikko-nappi__nayta {
    display: none;
}

/* Murupolku mobiilissa yhdellä vaakasuunnassa vieritettävällä rivillä */
@media (max-width: 767.98px) {
    .mururivi > nav {
        flex: 1 1 100%;
        min-width: 0;
    }

    .murupolku {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: .25rem;
    }
}

/* Pääalue */
.runko {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding-bottom: 3rem;
}

.kortti {
    min-width: 0;
    padding: 1.25rem;
    background: var(--kortti);
    border-radius: var(--pyoristys);
    box-shadow: 0 1px 3px rgb(15 51 31 / 8%);
}

.kortti:focus {
    outline: none;
}

.kortti > :last-child {
    margin-bottom: 0;
}

.ingressi {
    font-size: 1.125rem;
}

/* Sivupalkki: puunavigaatio */
.sivupalkki {
    min-width: 0;
}

@media (max-width: 991.98px) {
    .js:not(.valikko-auki) .sivupalkki {
        display: none;
    }

    .sivupalkki {
        padding: .75rem;
        background: #fff;
        border-radius: var(--pyoristys);
    }
}

.puu,
.puu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.puu ul {
    padding-left: 1rem;
}

.puu summary,
.puu a.puu__haara {
    display: flex;
    align-items: flex-start;
    gap: .375rem;
    padding: .375rem .25rem;
    border-radius: 6px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}

.puu ul summary,
.puu ul a.puu__haara {
    font-weight: 500;
}

.puu a.puu__haara {
    color: var(--teksti);
    font-size: 1rem;
}

.puu summary:hover {
    background: rgb(26 83 54 / 8%);
}

.puu a {
    display: block;
    padding: .3125rem .25rem .3125rem 1.375rem;
    border-radius: 6px;
    color: var(--teksti);
    text-decoration: none;
    font-size: .9375rem;
}

.puu a:hover {
    background: rgb(26 83 54 / 8%);
    text-decoration: underline;
}

.puu a[aria-current] {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    color: var(--vihrea);
}

summary::-webkit-details-marker {
    display: none;
}

.chevron {
    margin-top: .25em;
    transition: transform .15s ease;
}

details[open] > summary > .chevron {
    transform: rotate(90deg);
}

@media (prefers-reduced-motion: reduce) {
    .chevron {
        transition: none;
    }
}

/* Tietolaatikko */
.tietolaatikko {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--laatikko);
    border-radius: var(--pyoristys);
}

.tietolaatikko__sarakkeet {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem 1.5rem;
    margin: 0;
}

.tietolaatikko dt {
    font-size: .875rem;
    font-weight: 600;
    color: var(--teksti-heikko);
}

.tietolaatikko dd {
    margin: 0;
    font-weight: 500;
}

.tietolaatikko__maara {
    margin: .75rem 0 0;
    padding-top: .75rem;
    border-top: 1px solid var(--raja);
}

/* Haitarit */
.haitari {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--raja);
}

.haitari > summary {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .75rem .25rem;
    cursor: pointer;
    list-style: none;
}

.haitari > summary > h2,
.haitari > summary > h3 {
    margin: 0;
}

.haitari > summary .chevron {
    width: 20px;
    height: 20px;
    margin-top: .125rem;
}

.haitari > summary:hover {
    background: rgb(26 83 54 / 6%);
    border-radius: 6px;
}

.haitari__sisus {
    padding: 0 0 1rem .5rem;
}

.haitari--vuosi {
    margin-bottom: .25rem;
}

.haitari--vuosi:last-child {
    border-bottom: 0;
}

/* Ryhmärivit */
.ryhmat {
    display: grid;
    gap: .5rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.ryhma {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem 1rem;
    padding: .75rem 1rem;
    background: var(--rivi);
    border-radius: 8px;
}

.ryhma__tunnus {
    font-weight: 700;
    min-width: 7rem;
}

.ryhma__nimi {
    flex: 1 1 14rem;
}

.ryhma__toiminnot {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.ryhma__tots {
    color: var(--teksti-heikko);
    font-size: .875rem;
}

a.ryhma__tots {
    color: var(--linkki);
    font-weight: 500;
}

.nappi {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .75rem;
    border-radius: 6px;
    background: var(--vihrea);
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.nappi:hover {
    background: var(--vihrea-tummin);
    text-decoration: underline;
}

.nappi--aariviiva {
    padding: calc(.375rem - 2px) calc(.75rem - 2px);
    border: 2px solid var(--vihrea);
    background: #fff;
    color: var(--vihrea);
}

.nappi--aariviiva:hover {
    background: var(--keltavihrea);
    color: var(--vihrea-tummin);
}

.nappi--iso {
    gap: .5rem;
    padding: .625rem 1.125rem;
    font-size: 1rem;
}

/* Ryhmäsivu: toteutukset lukukausittain. Mobiilissa rivit kortteina. */
.lukukausi {
    margin-top: 1.5rem;
}

.toteutukset {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 .5rem;
    font-size: .9375rem;
}

.toteutukset thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.toteutukset,
.toteutukset tbody,
.toteutukset tr,
.toteutukset td {
    display: block;
}

.toteutukset tr {
    margin-bottom: .5rem;
    padding: .75rem 1rem;
    background: var(--rivi);
    border-radius: 8px;
}

.toteutukset td {
    padding: .125rem 0;
}

.toteutukset colgroup {
    display: none;
}

.toteutukset td[data-otsikko]::before {
    content: attr(data-otsikko) ': ';
    color: var(--teksti-heikko);
    font-weight: 600;
}

.toteutukset__nimi {
    font-weight: 600;
}

.toteutukset__pdf {
    margin-top: .375rem;
}

.tila {
    display: inline-block;
    margin-left: .375rem;
    padding: .0625rem .5rem;
    border-radius: 999px;
    color: var(--vihrea-tummin);
    font-size: .75rem;
    font-weight: 600;
    vertical-align: .1em;
}

.tila--muokattavana {
    background: var(--oranssi);
}

.tila--puuttuu {
    background: var(--roosa);
}

.tila--ei_tilaa {
    background: var(--sininen-vaalea);
}

/* Toteutussivu */
.paluu {
    margin: 0 0 1rem;
}

.tekstiversio {
    margin-top: 1.5rem;
}

.tekstiversio summary {
    display: inline-block;
    padding: .5rem 1rem;
    border: 2px solid var(--vihrea);
    border-radius: 8px;
    color: var(--vihrea);
    font-weight: 600;
    cursor: pointer;
}

.tekstiversio summary:hover {
    background: var(--keltavihrea);
}

.tekstiversio pre {
    max-height: 80vh;
    margin: 1rem 0 0;
    padding: 1rem;
    overflow: auto;
    background: var(--rivi);
    border: 1px solid var(--raja);
    border-radius: 8px;
    font-size: .8125rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Ops-rivin tekstiversiolinkki */
.tekstilinkki {
    font-size: .875rem;
    font-weight: 500;
}

/* Hakusivu (Pagefind UI) */
.haku {
    --pagefind-ui-scale: .9;
    --pagefind-ui-primary: var(--vihrea);
    --pagefind-ui-text: var(--teksti);
    --pagefind-ui-background: #fff;
    --pagefind-ui-border: var(--teksti-heikko);
    --pagefind-ui-tag: var(--laatikko);
    --pagefind-ui-border-width: 2px;
    --pagefind-ui-border-radius: 8px;
    --pagefind-ui-font: var(--fontti);
}

.haku mark {
    background: var(--keltavihrea);
    color: var(--vihrea-tummin);
}

.haku .pagefind-ui__result-link {
    color: var(--linkki);
}

.haku-tiedot {
    display: block;
    margin-bottom: .25rem;
    color: var(--teksti-heikko);
    font-size: .875rem;
    font-weight: 600;
}

.haku-nojs {
    padding: 1rem;
    background: var(--laatikko);
    border-radius: 8px;
}

/* Opinto-oppaat 2000–2005 */
.puu__otsikko {
    margin: 0 0 .5rem;
    font-weight: 700;
}

.puu__otsikko a {
    color: var(--teksti);
    text-decoration: none;
}

.puu__otsikko a:hover,
.puu__otsikko a[aria-current] {
    text-decoration: underline;
}

.opas-sisallys {
    margin: 0 0 1.5rem;
    padding-left: 1.25rem;
}

.opas-sisallys li {
    margin: .25rem 0;
}

.opas-sisallys ul {
    margin: .25rem 0 .75rem;
    padding-left: 1.25rem;
}

.opas-sisalto {
    max-width: 75ch;
    overflow-wrap: break-word;
}

.opas-sisalto h2,
.opas-sisalto h3,
.opas-sisalto h4,
.opas-sisalto h5,
.opas-sisalto h6 {
    margin: 1.5rem 0 .5rem;
}

.opas-sisalto h4,
.opas-sisalto h5,
.opas-sisalto h6 {
    font-size: 1rem;
    font-weight: 600;
}

.opas-sisalto p {
    margin: 0 0 .875rem;
}

.opas-sisalto ul,
.opas-sisalto ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.opas-sisalto li {
    margin: .25rem 0;
}

.opas-sisalto img {
    max-width: 100%;
    height: auto;
}

/* Vanhojen oppaiden taulukot: reunat ja vaakavieritys omassa laatikossaan */
.opas-taulukko {
    max-width: 100%;
    margin: 0 0 1.25rem;
    overflow-x: auto;
}

.opas-taulukko table {
    min-width: 100%;
    border-collapse: collapse;
    font-size: .9375rem;
}

.opas-taulukko th,
.opas-taulukko td {
    padding: .375rem .625rem;
    border: 1px solid var(--raja);
    text-align: left;
    vertical-align: top;
}

.opas-taulukko th,
.opas-taulukko tr:first-child td {
    background: var(--laatikko);
}

.opas-taulukko p:last-child {
    margin-bottom: 0;
}

.opas-selaus {
    display: grid;
    gap: .75rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--raja);
}

.opas-selaus a {
    display: block;
    padding: .75rem 1rem;
    border-radius: 8px;
    background: var(--rivi);
    color: var(--teksti);
    text-decoration: none;
}

.opas-selaus a:hover {
    background: var(--laatikko);
    text-decoration: underline;
}

.opas-selaus__suunta {
    display: block;
    color: var(--linkki);
    font-size: .875rem;
    font-weight: 600;
}

@media (min-width: 768px) {
    .opas-selaus {
        grid-template-columns: 1fr 1fr;
    }

    .opas-selaus__seuraava {
        grid-column: 2;
        text-align: right;
    }
}

/* Footer */
.alapalkki {
    background: var(--vihrea-tummin);
    color: #fff;
}

.alapalkki__sisus {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 2rem;
    padding-block: 2rem;
}

.alapalkki a {
    color: #fff;
    font-weight: 500;
}

.alapalkki a:focus-visible {
    outline-color: var(--vihrea-vaalea);
}

/* Siirry alkuun */
.alkuun {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 50;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--vihrea);
    color: #fff;
    box-shadow: 0 2px 8px rgb(15 51 31 / 25%);
    transition: opacity .2s ease, visibility .2s;
}

.alkuun:hover {
    background: var(--vihrea-tummin);
}

.alkuun:focus-visible {
    outline-color: var(--vihrea-tummin);
    outline-offset: 3px;
}

.js .alkuun:not(.nakyy) {
    opacity: 0;
    visibility: hidden;
}

/* Juurisivun kielivalinta */
.juuri {
    padding-block: 3rem;
}

/* Tabletti */
@media (min-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .leveys {
        padding-inline: 1.5rem;
    }

    .logo img {
        height: 48px;
    }

    .logo__sivusto {
        display: block;
    }

    .hakukentta {
        order: 0;
        flex: 0 1 20rem;
        margin-left: auto;
        padding-bottom: 0;
    }

    .kortti {
        padding: 2rem;
    }

    .tietolaatikko__sarakkeet {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Leveä näyttö: toteutukset taulukkona, kaikissa sivun taulukoissa samat sarakeleveydet */
@media (min-width: 1200px) {
    .toteutukset {
        display: table;
        table-layout: fixed;
        border-spacing: 0 .375rem;
    }

    .toteutukset colgroup {
        display: table-column-group;
    }

    .toteutukset col {
        display: table-column;
    }

    .toteutukset__c-koodi {
        width: 6.5rem;
    }

    .toteutukset__c-op {
        width: 4rem;
    }

    .toteutukset__c-toteutus {
        width: 7.5rem;
    }

    .toteutukset__c-ajankohta {
        width: 12rem;
    }

    .toteutukset__c-pdf {
        width: 7rem;
    }

    .toteutukset thead {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        display: table-header-group;
    }

    .toteutukset tbody {
        display: table-row-group;
    }

    .toteutukset tr {
        display: table-row;
    }

    .toteutukset th {
        padding: 0 .75rem;
        color: var(--teksti-heikko);
        font-size: .8125rem;
        font-weight: 600;
        text-align: left;
    }

    .toteutukset td {
        display: table-cell;
        padding: .625rem .75rem;
        overflow-wrap: anywhere;
        background: var(--rivi);
        vertical-align: middle;
    }

    .toteutukset td:first-child {
        border-radius: 8px 0 0 8px;
    }

    .toteutukset td:last-child {
        border-radius: 0 8px 8px 0;
        text-align: right;
    }

    .toteutukset td[data-otsikko]::before {
        content: none;
    }

    .toteutukset__pdf {
        margin-top: 0;
    }
}

/* Työpöytä: kaksipalstainen */
@media (min-width: 992px) {
    .ylapalkki__sisus {
        min-height: 88px;
    }

    .logo img {
        height: 56px;
    }

    .valikko-nappi__mobiili {
        display: none;
    }

    html:not(.valikko-piilossa) .valikko-nappi__piilota,
    .valikko-piilossa .valikko-nappi__nayta {
        display: inline;
    }

    .runko {
        grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
        align-items: start;
    }

    .js.valikko-piilossa .runko,
    .runko--yksi {
        grid-template-columns: minmax(0, 1fr);
    }

    .js.valikko-piilossa .sivupalkki {
        display: none;
    }

    .sivupalkki {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    .kortti {
        padding: 2.5rem;
    }
}
