/* 1. Määritellään fontti */
@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 100 900; /* Variable font tukee kaikkia painoja */
  font-display: swap;
  src: url('lexend-v26-latin-variable.woff2') format('woff2');
}

/* 2. Otetaan fontti käyttöön koko wikissä */
body, h1, h2, h3, h4, h5, h6, #bodyContent {
    font-family: 'Lexend', sans-serif !important;
}

/* 3. Säädetään vielä luettavuutta (Lexend on usein hieman ilmava) */
#bodyContent {
    letter-spacing: -0.01em;
    line-height: 1.6;
}

/* 1. Määritellään juurikoko koko sisällölle */
#mw-content-text {
    font-size: inherit;
    line-height: 1.6;
}

/* Vanhojen ohjeiden kiinteäleveät kuvat mahtuvat myös puhelimen ruutuun. */
#mw-content-text img {
    max-width: 100%;
    height: auto;
}

/* 2. Säädetään otsikot suhteessa peruskokoon */
h1 { font-size: 2.2em; font-weight: 700; }
h2 { font-size: 1.8em; font-weight: 600; border-bottom: 1px solid #eeeeee; }
h3 { font-size: 1.4em; font-weight: 600; }

.mw-body #bodyContent {
	max-width: none;
	width: 100%;
}

/* Leveys on aina leveä, myös aiemmin tallennetulla kapealla asetuksella. */
.mw-page-container,
.mw-header,
.vector-sticky-header {
    max-width: none !important;
}

@media screen and (min-width: 1000px) {
    .mw-body {
        grid-template-columns: minmax(0, 1fr) min-content !important;
    }
}

#skin-client-prefs-vector-feature-limited-width {
    display: none;
}

/* Lukijalla ei ole työkaluja: myös tyhjät otsikot ja valikkopainike pois. */
.ajas-reader-view .vector-page-tools-landmark,
.ajas-reader-view .vector-page-toolbar,
.ajas-reader-view #vector-page-tools-dropdown,
.ajas-reader-view #vector-page-tools-pinned-container,
.ajas-reader-view #vector-page-tools-unpinned-container {
    display: none !important;
}

/* Haku kuuluu Touch-asiakkaille ja MediaWiki-kirjautuneille lukijoille.
   Pelkkä sallittu ylläpito-IP ei tuo hakua julkiseen näkymään. */
.ajas-public-view #p-search,
.ajas-public-view .vector-search-box,
.ajas-public-view .search-toggle,
.ajas-public-view #vector-sticky-search-form {
    display: none !important;
}

.ajas-public-banner {
    margin: 0 0 1.25rem;
    text-align: left;
}

.ajas-public-banner a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: 14px;
    background: #3026ed;
    color: #fff;
    text-decoration: none;
    line-height: 1.5;
}

.ajas-public-banner strong {
    font-size: 1.2rem;
}

.ajas-public-banner a:hover {
    background: #2118c7;
    color: #fff;
    text-decoration: underline;
}

.ajas-public-banner a:focus-visible {
    outline: 3px solid #111;
    outline-offset: 3px;
}

@media print {
    .ajas-public-banner { display: none; }
}

/* Logo ja Ajas Ohjekeskus -sanamerkki ovat erillisiä linkkejä. */
.mw-header .mw-logo[data-ajas-logo-ready] {
    min-width: 0;
    flex: 0 0 auto;
}

.mw-header .mw-logo[data-ajas-logo-ready] .mw-logo-icon {
    margin-right: 0;
}

.ajas-logo-wordmark-link {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    margin-left: 14px;
}

.ajas-logo-wordmark-link .mw-logo-container {
    max-width: none;
}

@media screen and (max-width: 999px) {
    .mw-header:not(.vector-header-search-toggled) {
        flex-flow: row nowrap;
        gap: 8px;
    }

    .vector-header-start {
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
    }

    .vector-header-end {
        width: auto;
        flex: 0 0 auto;
        margin-left: auto;
    }

    .ajas-logo-wordmark-link {
        min-width: 0;
        white-space: normal;
        margin-left: 8px;
    }
}

/* Työpöydällä haku pysyy oikeassa reunassa eikä peitä sanamerkkiä. */
@media screen and (min-width: 1000px) {
    .vector-header-start {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .vector-header-end {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-end;
    }

    .vector-search-box {
        flex: 1 1 auto;
        min-width: 320px;
        max-width: 760px;
        margin-left: auto;
    }

    .vector-search-box .vector-typeahead-search-container,
    .vector-search-box .cdx-typeahead-search,
    .vector-search-box form {
        width: 100%;
    }
}

/* Footer lisätään koko Vector-sivun jälkeen, myös sivupalkin alapuolelle. */
.ajas-site-footer {
    clear: both;
    width: 100%;
    position: relative;
    z-index: 1;
}
