/* General Style */
body {
  background-color: #2a354c;
  color: #ffffff;

  margin: 0;
  display:flex;
  flex-direction: column;
  justify-content: space-evenly;
  overflow-x: hidden;
}
@media (max-width: 600px) {
  body {
    hyphens: auto;
  }
}

img {
  max-width: 100%;
  width: 100px;
  height:auto;
}

hr {
  margin: 2em 0;
  border: 1px #595e6f solid;
}

/* Fonts */
h1 { font-size: clamp(1rem, calc(2vh + 1rem), 5rem); }
h2 { font-size: clamp(1rem, calc(1.5vh + 1rem), 4.5rem); }
h3 { font-size: clamp(1rem, calc(1vh + 1rem), 4rem); }
textarea, input, ::placeholder, body, button { font-size: clamp(1rem, 2vh, 3rem); }

/* Navigation */
.navbar {
  background-color: white;
  overflow: hidden;

  & > ul {
    display: flex;
    justify-content: flex-end;
    list-style: none;
    align-items: center;
    padding: 0;
    margin: 0;

    & > li {
      height: 50px;

      &:first-child {
        margin-right: auto;
        justify-content: flex-start;
      }

      &:last-child > a > img {
          max-width: 50px;
          margin: auto;
      }
    }

    & a {
      display:flex;
      align-items: center;
      color:black;
      text-decoration: none;
      padding: 0 1em;
      height: 100%;

      &:hover {
        background-color: lightgrey;
      }
    }
  }
}

#burger-menu {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 250px;
  z-index: 999;
  box-shadow: rgba(0, 0, 0, 0.7) -3px -3px 0.4em;
  background-color: rgba(255, 255, 255, 0.98);

  & li {
    width: 100%;
  }

  & > li:first-child {
    display: none;
  }
}

.menu-button {
  display: none;
}
@media (max-width: 1000px) {
  .menu-link {
    display: none;
  }
  .menu-button {
    display: block;
  }
}

#navimg {
  max-width: 50px;
  padding: 0;
  display: block;
  line-height: 0;

  background-color: white;
  border: none;
  box-shadow: none;
  outline: none;
}


/* Header */
.header-container {
  display: flex;
  position:relative;
  justify-content: center;
  overflow:hidden;

  background: white;

  & .header-content {
    position:absolute;
    top: 50%;
    transform: translate(0%, -50%);

    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
}

#header-image {
  width: 100vw;
  height: 60vh;
  object-fit: cover;
  opacity: .3;
}

.header-content {
  color: black;
  text-align: center;

  & > * {
    margin: 10px 0;
    width: 100%;
  }
}

.header-buttons { 
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50%;
  margin-top: 20px;

  & > a {
    text-decoration: none;
    color: white;
    background: #1f2937;
    width: 30%;
    border-radius: 10px;
    padding: 1em 2em;
    margin: 0 5px;

    &:hover {
      background: #7a9ac0;
      font-weight: bold;
    }
  }
}
@media(max-width: 1000px) {
  .header-buttons {
    width: 100%;
  }
}

/* Section */
.section-header {
    text-align: center;
}


/* Containers */
.flex-container {
    display: flex;
    justify-content: center;

    margin: 0 auto;
    width: 50vw;
}
@media (max-width: 1000px) {
  .flex-container {
    margin: 0 15vw;
    width: 70vw;
  }
} 
@media (max-width: 600px) {
  .flex-container {
    margin: 0;
    width: auto;
  }
} 

.flex-container-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;

  &.form-container {
    margin-top: 1em;
    gap: 0em;
  }

  &.form-container > * {
  width: 30%;
  padding: 0.5em;
  }

  & .flex-container {
    border: 1px solid #595e6f;
    border-radius: 10px;
    margin: 1em;
    padding: 1em;
    justify-content: space-between;
    align-items: center;
  }

  & > * {
    min-width: min(500px, 90%);
  }

  & > input, textarea {
    padding: 1em;
    border-radius: 10px;
    border: none;
  }

  & > button {
    margin-top: 1em;
    border-radius: 10px;
    padding: 1em;
    /*  Input fields and buttons seem to behave differently,
        so I decided to fix size differences this way */
    width: calc(30% + 1em) !important;
  }
}

.flex-container .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid #595e6f;
  margin: 6px;
  background-color: #1f2937;
  border-radius: 10px;
  box-shadow: rgba(0, 0, 0, 0.3) 3px 3px 0.4em;

  & .list {
    margin: 1em 3em;
    padding: 0;
    text-align: left;
  }
}

.flex-container .card-alt {
  flex: 1;
  text-align: left;
  margin: 1em;
  max-width: 500px;
  
  & > * {
    margin: 1em;
  }

  & > p {
    color: #aab0bd;
  }
}

@media (max-width: 600px) {
  .flex-container:has(.card-alt) {
    display:flex !important;
    flex-direction: column !important;
  }
}

/* Buttons */
button {
  border: #595e6f solid 1px;
  background-color: #2a354c;
  color: white;

  &:hover {
    font-weight: bold;
    background-color: #7a9ac0;  
  }

  &:active {
    font-weight: bold;
    background-color: #7a9ac0;  
  }
}

.flex-container.selection-buttons > button {
  min-width: 200px;
}

.activeButton {
  font-weight: bold;
  background-color: #7a9ac0;
}

.flex-container > button {
  min-width: 100px;
  padding: 1em;

  &:nth-child(1) { border-radius: 10px 0 0 10px; }
  &:nth-child(2) { border-radius: 0 10px 10px 0; }
}

/* Hinnasto ja FAQ */
.card > button {
  border-radius: 10px;
  margin: 5px;
  padding: 5px 10px;
}

.qna {
  display:flex;
  flex-direction: column;
  align-items: center;
}

details {
  background: white;
  color: black;

  width: 70vw;
  padding: 1em;
  margin: 2px 0;
  border: black 1px solid;
  border-radius: 10px;
}
@media (max-width: 600px) {
  details {
    width: 80vw;
  }
}

summary {
  font-weight: bold;
  font-size: 1.1em;
}


/* Hinnat */
.flex-container.prices-container {
  width: 70vw;
}
@media (max-width: 1000px) {
    .flex-container.prices-container {
      flex-direction: column;
      align-items: center;
      width: 50vw;
      margin: auto;
  }
}
@media (max-width: 600px) {
    .flex-container.prices-container {
      width: 80vw;
  }
}

.prices-card {
  display:flex;
  flex-direction: column;
  justify-content: space-between;
  background: white;
  color: black;
  border-radius: 10px;
  width: 33%;
  margin: 1em;
  padding: 1em;

  & > ul {
    list-style: inside;
    padding: 0 0.5em;
    margin-top: 0;
    height:50%;

    & > li {
      margin: 0.2em;
    }
  }

  & > button {
    background: black;
    color: white;
    border-radius: 10px;
    margin: 5px;
    padding: 5px 10px;
  }
  
  &:nth-child(even) {
    background: black;
    color: white;

    & > button {
      background: white;
      color: black;
    }
  }
}
@media (max-width: 1000px) {
  .prices-card {
    width: 100%;
  }
}

/* Kirjasto */
.library-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));

  width: 67vw;
  margin: auto;
}
@media (max-width: 1000px) {
  .library-card-container {
    width: 90vw;
  }
}

.library-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: grey solid 1px;
  border-radius: 10px;
  overflow: hidden;
  justify-content: space-between;
  box-shadow: rgba(0, 0, 0, 0.3) 3px 3px 0.4em;
  margin: 1em;
  width: 200px;

  &:hover {
    background-color: #7a9ac0;
    box-shadow: rgba(0, 0, 0, 0.6) 3px 3px 0.8em;
  }

  & > img {
    width:fit-content;
    height: 150px;
  }

  & > h3 {
    margin: 0.5em;
  }
}

/* Varaus */
.flex-container.material-selection {
  background-color: #1f2937;
  margin: 0;
  padding: 15px;
  overflow: hidden;
  box-shadow: rgba(0, 0, 0, 0.7) 3px 3px 0.4em;
}

.flex-container.material-selection {
  & > div {
    padding: 0 1em;
    width:75%;
    & > a {
      line-height: 20px;
      padding-left: 0;
    }
  }
  & > img {
    height: 10vw;
    width: 25%;
  }
}
@media (min-width:2560px) {
  .flex-container.material-selection {
    padding: 15px;
    max-width: 30vw;

    & > img {
      height: 6vw;
    }
  }
}
@media (max-width:1000px) {
  .flex-container.material-selection > img {
    height: 15vw;
  }
}

.material-selection {
  & > div > a {
  color: white;
  font-weight: bold;
  padding:5px;

    &:hover {
      font-size: calc(1em + 0.1em);
    }
  }
}