/* ==========================================================================
   teksti.css – fontit, tekstikoot ja tekstin värit
   Tekijä: Aapo Katajala
   Päivitetty: 3.11.2026

   Ulkoiset fontit ladataan Google Fontsista jokaisen sivun <head>-osassa:
     - Bricolage Grotesque: otsikot (persoonallinen, hieman pyöreä)
     - Atkinson Hyperlegible: leipäteksti (suunniteltu hyvin luettavaksi)
   Molemmilla on varafontit, jos ulkoinen fontti ei lataudu.

   Kaikki koot ovat suhteellisia (rem/em), jolloin teksti skaalautuu
   käyttäjän selainasetusten mukaan. 1rem = selaimen oletuskoko (yl. 16 px).

   Sisällys:
     1. Perusteksti
     2. Otsikot
     3. Linkit
     4. Tekstielementit sivun osissa
     5. Responsiiviset tekstikoot
   ========================================================================== */


/*
   1. PERUSTEKSTI
*/
html {
  font-size: 100%;   /* käyttäjän oma oletuskoko säilyy */
}

body {
  font-family: "Atkinson Hyperlegible", Verdana, Arial, sans-serif;
  font-size: 1.0625rem;   /* n. 17 px */
  line-height: 1.6;
  color: var(--forest);
}

p {
  margin-top: 0;
  margin-bottom: 1em;
  max-width: 42rem;   /* rivin pituus pysyy luettavana */
}

/* Lomake-elementit eivät peri fonttia automaattisesti */
input,
textarea,
button {
  font-family: inherit;
  font-size: 1rem;
  color: var(--forest);
}

strong {
  font-weight: 700;
}


/*
   2. OTSIKOT
   Tyyppiasteikko: 1.25-kertainen suhde otsikkotasojen välillä.
*/
h1,
h2,
h3 {
  font-family: "Bricolage Grotesque", "Trebuchet MS", Arial, sans-serif;
  color: var(--basalt);
  line-height: 1.15;
  margin-top: 0;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5em;
}

h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.6em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4em;
}


/*
  3. LINKIT
 */
a {
  color: var(--moss);
}

a:hover {
  color: var(--basalt);
  text-decoration-color: var(--coffee);
}

/* Näkyvä kohdistus näppäimistöllä liikkuvalle */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 0.2rem solid var(--coffee);
  outline-offset: 0.15rem;
}

/* Valikon ja painikkeiden linkeistä alleviivaus pois */
.paavalikko a,
.logo,
.painike {
  text-decoration: none;
}

.paavalikko a {
  color: var(--forest);
}

.paavalikko a.aktiivinen {
  color: var(--basalt);
  font-weight: 700;
}

.painike {
  font-weight: 700;
  color: var(--forest);
}

.painike-toissijainen {
  color: var(--moss);
}

/* Pääpainikkeessa valkoinen teksti tummaa taustaa vasten */
.painike-paa,
.painike-paa:hover {
  color: var(--valko);
}


/*
  4. TEKSTIELEMENTIT SIVUN OSISSA
  Logo: nimi otsikkofontilla 
*/
.logo {
  font-family: "Bricolage Grotesque", "Trebuchet MS", Arial, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--basalt);
}

/* Etusivun pääotsikko: nimi isolla ja tiiviisti */
.hero h1 {
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.035em;
  margin-bottom: 0.35em;
}

/* Johdantoteksti: hieman leipätekstiä isompi */
.johdanto {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--forest);
}

/* Pieni lisätieto, esim. sijainti tai päivämäärä */
.pieni {
  font-size: 0.9375rem;
  color: var(--ochre);
}

/* Aikajanan vuosiluvut */
.aikajana time {
  display: block;
  font-family: "Bricolage Grotesque", "Trebuchet MS", Arial, sans-serif;
  font-weight: 700;
  color: var(--moss);
  font-variant-numeric: tabular-nums;
}

/* Projektin tietolista */
.projekti-tiedot dt {
  font-weight: 700;
  color: var(--ochre);
}

.tila {
  font-size: 0.875rem;
  font-weight: 700;
}

/* Galleria- ja kuvatekstit */
.galleria span,
.kaavio figcaption {
  display: block;
  font-size: 0.9375rem;
  color: var(--ochre);
  padding-top: 0.5rem;
}

.lightbox figcaption {
  font-size: 1rem;
}

/* Lomakkeen otsikot */
.lomake label {
  font-weight: 700;
}

/* Koodilohkot */
pre,
code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9375rem;
}

pre {
  color: var(--valko);
  line-height: 1.5;
}

/* Taulukon otsikkosolut */
th {
  text-align: left;
  font-weight: 700;
  color: var(--basalt);
}

/* Alatunnisteen teksti vaalealla tummaa taustaa vasten */
.sivun-alaosa,
.sivun-alaosa p {
  color: var(--sand);
  font-size: 0.9375rem;
}

.sivun-alaosa a {
  color: var(--valko);
}

.sivun-alaosa a:hover {
  color: var(--stone);
}

.sivun-alaosa h2 {
  color: var(--valko);
  font-size: 1.125rem;
}


/*
   5. RESPONSIIVISET TEKSTIKOOT
   Isommilla näytöillä otsikot kasvavat.
*/
@media screen and (min-width: 48em) {
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.1rem;
  }

  .hero h1 {
    font-size: 4.25rem;
  }
}

@media screen and (min-width: 64em) {
  .hero h1 {
    font-size: 5.25rem;
  }

  .johdanto {
    font-size: 1.375rem;
  }
}
