:root {

  /* Colors */

  --bg-primary: #032c32;
  --bg-primary-light: #d3dedc;
  --bg-footer: var(--gray-1);
  --bg-button: var(--gray-2);
  --text-white: var(--gray-0);
  
  --gray-9: #212529;
  --gray-5: #adb5bd;
  --gray-4: #ced4da;
  --gray-2: #e9ecef;
  --gray-1: #f1f3f5;
  --gray-0: #f8f9fa;

  /* Font sizes */

  --fs--2: 0.8rem;
  --fs--1: 0.9rem;
  --fs-0: 1rem; /* P */
  --fs-1: 1.1rem;
  --fs-2: 1.2rem;
  --fs-3: 1.5rem; /* H3 */
  --fs-4: 2rem; /* H2 */
  --fs-5: 2.3rem; /* H1 */

  /* Spaces */

  --space-0: 1rem;
  --space-1: 1.5rem;
  --space-2: 2rem;
  --space-3: 2.5rem;
  --space-4: 3rem;
  --space-5: 3.5rem;
  --space-6: 4rem;
}

body {
  font-size: var(--fs-0);
  font-weight: 300;
}

h1,
h2,
h3 {
  font-weight: 600;
}

p {
  max-width: 70ch;
}

h1 {
  font-size: var(--fs-4);
}
    
h2 {
  font-size: var(--fs-3);
}
    
h3 {
  font-size: var(--fs-1);
}

time,
p {
  font-size: var(--fs--1);
}

  @media (min-width: 650px) {

    h1 {
      font-size: var(--fs-5);
    }
      
    h3 {
      font-size: var(--fs-2);
    }

    time,
    p {
      font-size: var(--fs-0);
    }

  }

  @media (min-width: 900px) {

    h1 {
      font-size: var(--fs-5);
    }
      
    h2 {
      font-size: var(--fs-4);
    } 

    h3 {
      font-size: var(--fs-3);
    } 

  }

/* Strong */

strong,
b {
  font-weight: 500;
}

/* ----------------------------------------- */

/* Address */

address {
  font-style: normal;
}

/* Horizontal rule */

hr {
  border: none;
  border-top: 1px solid var(--border-top-color, var(--gray-4));
  background-color: transparent;
}

/* ----------------------------------------- */

/* [Reusable components] */

/* [Link] */

a {
  color: var(--link-color, inherit);
  text-decoration: var(--link-decoration, underline);
  display: var(--link-display);
}

a:hover {
  opacity: var(--link-hover-opacity, 0.8);
  text-decoration: var(--link-hover-decoration);
}

a:focus-visible {
  outline: 1px solid var(--link-outline-color, currentColor);
  outline-offset: var(--link-outline-offset, 4px);
}

.link-bold {
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  font-weight: 600;
}

/* [List] */

ul,
ol {
  list-style-type: var(--list-style-type, disc);
}

/* [Img] */

img {
  border-radius: var(--border-radius);
}

/* [Flow] */

.flow > * + * {
  margin-top: 1rem;
  margin-top: var(--flow-space, 1rem);
}

/* [Splitter] */

.splitter {
  display: var(--splitter-display, flex);
  align-items: var(--splitter-align, center);
  justify-content: var(--splitter-justify, space-between);
  flex-direction: var(--splitter-direction, row);
  flex-wrap: var(--splitter-wrap, wrap);
  gap: var(--splitter-gap, 1rem);
}

/* [Auto-fit] */

.auto-fit {
  /* Flex backup */
  display: flex;
  flex-wrap: wrap;
  /* Grid layout */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--autofit-width, 350px)), 1fr));
  gap: var(--autofit-gap, 1rem);
}

/* [Auto-fill] */

.auto-fill {
  /* Flex backup */
  display: flex;
  flex-wrap: wrap;
  /* Grid layout */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--autofill-width, 260px)), 1fr));
  gap: var(--autofill-gap, 1rem);
}

/* [Nav] */

.nav {
  display: flex;
  flex-direction: var(--nav-direction);
  justify-content: var(--nav-justify);
  align-items: var(--nav-align);
  gap: var(--nav-gap, 1rem);
  flex-wrap: var(--nav-wrap, wrap);
}

/* [Button] */

.button {  
  /* [Link] */
  --link-decoration: none;
  --link-hover-decoration: none;

  display: inline-flex;
  background-color: var(--button-bg, var(--gray-2));
  border-radius: 32px;
  gap: 0.3rem;
  padding: var(--button-padding-y, 0.55em) var(--button-padding-x, 0.75em);
  text-align: center;
  align-items: center;
}

.button--cta {
  --button-padding-y: 0.75em;
  --button-padding-x: 0.85em;
  font-weight: 400;
}

.button-group {
  display: flex;
  gap: var(--button-gap, 1rem);
  flex-wrap: var(--button-wrap, wrap);
  align-content: start;
}

/* [Label] */

.label {
  display: flex;
  align-items: center;
  border-radius: var(--label-border-radius, 4px);
  padding: var(--label-padding-y, 0.1em) var(--label-padding-x, 0.5em);
  text-align: center;
  background-color: var(--label-bg-color, var(--gray-4));
}

/* ----------------------------------------- */

/* Composition and layout */

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.center {
  display: grid;
  justify-content: center;  
  max-width: 700px;
  margin-right: auto;
  margin-left: auto;
}

/* Header */

.header {
  /* [Splitter] */
  --splitter-align: center;
  --splitter-justify: space-between;
  --splitter-wrap: wrap;
  --splitter-gap: 1rem;
}

.header-title img {
  width: 130px;
  height: 17px;
}

@media (min-width: 650px) {
  .header-title img {
    width: 140px;
    height: 19px;
  }
}

/* Sub */

.sub .nav__list {
  display: flex;
  gap: 0.5rem;
  justify-content: start;
  flex-wrap: wrap;
}

/* Footer */

.footer .nav {
  flex-direction: column;
  gap: 2rem;
}

.footer .nav__link {
  --link-decoration: none;
  --link-hover-decoration: none;
}

@media (min-width: 550px) {
  .footer .nav {
    flex-direction: row;
    align-items: start;
    gap: 2rem;
    justify-content: space-evenly;
  }
}

 /* Calendar */

.calendar__item {
  display: flex;
  flex-direction: column-reverse;
  justify-content: stretch;
  gap: 1.1rem;
}

.calendar__info {
  display: flex;
  gap: 0.5rem;
}

/* Card */

.card__list {
  /* [Auto fit] */
  --autofit-width: 250px;
}

.card__item {
  display: grid;
}


.card__media img {
  /* [Img] */
  --border-radius: 16px 16px 0 0;
}



/* Pagination */

.pagination__list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  list-style: none;
}

.button--disabled {
  opacity: 0.5;
}


/* Content (Markdown) */

.content ul {
  font-size: var(--fs--1);
  padding-left: 1rem;
  list-style-type: disc;
}

@media (min-width: 650px) {
  .content ul  {
    font-size: var(--fs-0);
  }
}

.content ul li ul  {
  padding-left: 1rem;
  list-style-type: circle;
}

/* Not found */

/* .not-found {
  display: grid;
  place-items: center;
  background-color: var(--bg-button);
} */

/* ------------------ Utilities ------------------ */

/* Margin */

.my-lg {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.mb {
  margin-bottom: 1rem;  
}

/* List */

.list-none {
  list-style: none;
}

.list-space {
  margin-left: var(--list-space, 1rem);
}

.list-square {
  list-style: square;
}

.list-disc {
  list-style: disc;
}


/* Link */

.decoration-none {
  text-decoration: none;
}

/* Text */

.text-center {
  text-align: center;
}

.ch-max {
  max-width: 100ch;
}

/* Font size */

.fs--1 {
  font-size: var(--fs--1);
}

.fs--2 {
  font-size: var(--fs--2);
}

.fs-0 {
  font-size: var(--fs--1);
}

.fs-1 {
  font-size: var(--fs-0);
}

.fs-2 {
  font-size: var(--fs-1);
}

.fs-3 {
  font-size: var(--fs-1);
}

.fs-4 {
  font-size: var(--fs-3);
}
    
.fs-5 {
  font-size: var(--fs-4);
}

@media (min-width: 650px) {

  .fs-0 {
    font-size: var(--fs-0);
  }

  .fs-1 {
    font-size: var(--fs-1);
  }

  .fs-2 {
    font-size: var(--fs-2);
  }

  .fs-3 {
    font-size: var(--fs-2);
  } 

  .fs-4 {
    font-size: var(--fs-4);
  }

  .fs-5  {
    font-size: var(--fs-5);
  } 
  
}

@media (min-width: 900px) {

  .fs-3 {
    font-size: var(--fs-3);
  } 

}

/* Font weight */

.fw-300 {
  font-weight: 300;
}

.fw-400 {
  font-weight: 400;
}

.fw-500 {
  font-weight: 500;
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

/* Padding */

.p-sm {
  padding: var(--space-0);
}

.p-md {
  padding: var(--space-1);
}

.p-lg {
  padding: var(--space-1);
}

@media (min-width: 590px) {
  .p-md {
    padding: var(--space-1);
  }
  
  .p-lg {
    padding: var(--space-1);
  }
}

@media (min-width: 900px) {
  .p-lg {
    padding: var(--space-2);
  }
}

/* Padding Y */

.py-sm {
  padding: var(--space-0) 0;
}

.py-md {
  padding: var(--space-1) 0;
}

.py-lg {
  padding: var(--space-2) 0;
}

@media (min-width: 590px) {
  .py-md {
    padding: var(--space-2) 0;
  }

  .py-lg {
    padding: var(--space-3) 0;
  }
}

@media (min-width: 900px) {
  .py-lg {
    padding: var(--space-4) 0;
  }
}

/* Flow */

.flow--sm {
  --flow-space: 1rem;
}

.flow--md {
  --flow-space: 1rem;
}

.flow--lg {
  --flow-space: 2rem;
}

@media (min-width: 650px) { 
  .flow--md {
    --flow-space: 2rem;
  }
  
  .flow--lg {
    --flow-space: 3rem;
  }
}

@media (min-width: 900px) { 

  .flow--md {
    --flow-space: 2rem;
  }
  
  .flow--lg {
    --flow-space: 3.5rem;
  }
}

/* Radius */

.radius-md {
  border-radius: 8px;
}

.radius-lg {
  border-radius: 16px;
}

/* Gap */

.gap-md {
  gap: 2rem;
}

.gap-lg {
  gap: 3rem;
}

/* Color */

.text-white {
  color: var(--text-white);
}

.bg-gray-1 {
  background-color: var(--gray-1);
}

.bg-gray-2 {
  background-color: var(--gray-2);
}

.bg-gray-3 {
  background-color: var(--gray-3);
}

.bg-gray-4 {
  background-color: var(--gray-4);
}

.bg-gray-5 {
  background-color: var(--gray-5);
}


.bg-primary {
  background-color: var(--bg-primary);
  color: var(--text-white);
}

.bg-primary-light {
  background-color: var(--bg-primary-light);
}


/* Mobile nav */


/* Oletustila: näytetään valikko isolla näytöllä */

.header .nav__list {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;

}

.header .nav__link {
  display: block;
}


/* Mobile-button piiloon isolla näytöllä */

.mobile-menu {
  display: none;
}

/* Mobiilityylit */

@media (max-width: 890px) {

  .mobile-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    padding: 0.5em;
    color: var(--text-white);
    background-color: #ffffff16;
    border-radius: 4px;
  }

  .mobile-menu:hover {
    opacity: 0.9;
  }

  .mobile-menu:focus-visible {
    outline: 1px solid currentColor;
  }

  .mobile-menu .icon {
    display: block;
  }
  
  .mobile-menu .close {
    display: none; /* Piilotetaan sulkemiskuva oletuksena */
  }
  
  .hidden {
    display: none;
}
  
  .nav.active + .mobile-menu .icon {
    display: none; /* Piilotetaan valikkokuva, kun valikko on auki */
  }
  
  .nav.active + .mobile-menu .close {
    display: block; /* Näytetään sulkemiskuva, kun valikko on auki */
  }


  /* Piilotetaan nav oletuksena */

  .header .nav {
    display: none;
    position: absolute;
    top: 72px;  
    left: 0;
    right: 0;
    background-color: #d3dedc;
    color: var(--gray-9);
    padding: 1rem;
    /* box-shadow: 0 2px 5px rgba(0,0,0,0.2); */
    border-bottom: 3px solid var(--bg-primary);
    z-index: 10;
  }

  .header .nav__list {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  
  .header .nav__item {
    border-bottom: 1px solid rgba(83, 78, 78, 0.231);
    padding-bottom: 0.8rem;
  }

  .header .nav__item:last-of-type {
    border-bottom: none;
    padding-bottom: 0rem;
  }

  .header .nav__link {
    display: flex;
    line-height: 1.5;
    font-weight: 400;
    font-size: var(--fs-0);
  }

  /* Kun aktivoitu */
  .nav.active {
    display: flex;
  }

}