/* CSS styles for http://doodleduo.fi/ */


@font-face {
  font-family: 'Katibeh';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/katibeh/v22/ZGjXol5MQJog4bxDWCpbVQ.woff2) 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;
  ascent-override: 60%;
}
:root {
  --background-color: #fafefe;
  --heading-color: #344;
  --body-color: #222;
  --muted-color: #555;
  --contrast-color: #2f4f4f;
  --button-border-radius: 4px;
  --field-border-radius: 6px;

  font-family: 'Roboto Slab', Georgia, 'Times New Roman', Times, serif;
}

body {
  background-color: var(--background-color);
  color: var(--body-color);
  padding: 0;
  margin: 0;
}

a {
  display: inline-block;
  color: var(--body-color);
  font-weight: 500;
  transition: all 0.1s ease-in-out;
  &:hover {
    color: var(--contrast-color);
    text-decoration: none;
    transform: scale(1.05);
  }
}

/* Language select */
aside:has(.language-select) {
  position: absolute;
  right: 0;

  .language-select {
    display: flex;
    gap: 4px;
    padding: 4px;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    &:hover {
      opacity: 1;
    }

    button {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: none;
      border-radius: var(--button-border-radius);
      padding: 0.5rem;
      margin: 0;
      text-decoration: none;
      background: transparent;
      font-family: 'Roboto Slab';
      font-size: 1rem;
      cursor: pointer;
      text-align: center;
      transition: background-color 250ms ease-in-out, 
                  transform 150ms ease;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
    }

    button:hover,
    button:focus {
        background: var(--contrast-color);
        color: #fff;
    }

    button:focus-visible {
        outline: 1px solid #fff;
        outline-offset: -4px;
    }
  }
}
/* Hide active button */
html[lang="en"] #btn-en,
html[lang="fi"] #btn-fi {
  display: none;
}

/* Heading section */
header {
  container-type: inline-size;
  padding: 20px;
  padding-top: 40px;
}

h1 {
  font-family: 'Katibeh';
  font-weight: 400;
  text-align: center;
  line-height: 0.61;
  cursor: default;
  color: #344;

  .firstname {
    display: block;
    width: 100%;
    font-size: clamp(3.75rem, 9cqi, 6rem);
  }

  .lastname {
    display: block;
    width: 100%;
    font-size: clamp(5rem, 12cqi, 8rem);
    letter-spacing: -0.5px;
  }

}

/* Footer */
footer {
  .foot-nav {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    padding-top: 4rem;
    @media (min-width: 600px) {
      flex-direction: row;
      gap: 1.5rem;
    }
    li {
      text-align: center;
    }
  }
  .name-block {
    display: inline-block;
    font-family: 'Katibeh';
    font-weight: 400;
    text-align: center;
    line-height: 0.61;
    cursor: default;
    color: #344;
    .firstname {
      display: block;
      width: 100%;
      font-size: 2rem;
    }

    .lastname {
      display: block;
      width: 100%;
      font-size: 2.75rem;
      letter-spacing: -0.5px;
    }
  }
}

/* Navigation styling */
nav ul {
  /* Soft reset */
  list-style: none;
  padding: 0;
  margin: 0;
  /* Styles */
  display: flex;
  gap: 1em;
  justify-content: center;

  li {
    display: flex;
    position: relative;
    border-radius: var(--button-border-radius);
    box-shadow: 0 0 0 #0006;
    background-color: #fff0;
    transition: all 0.1s ease-in-out, background-color 0.15s ease-in-out;
    a {
      display: block;
      padding: 0.5em;
      width: 100%;
      color: inherit;
      &:hover {
        color: #fff;
      }
    }
    &:hover,
    &:has(a.active) {
      background-color:var(--contrast-color);
      color: #fff;
      font-weight: 500;
      text-shadow: 1px 1px #000;
      box-shadow: 0 6px 18px #0006;
      a {
        text-decoration: none;
      }
    }
    &:nth-child(odd):hover {
      transform: rotate(3deg) scale(1.1);
    }
    &:nth-child(even):hover {
      transform: rotate(-3deg) scale(1.1);
    }
  }
  @media (max-width: 400px) {
    flex-direction: column;
    gap: 0;
    align-items: center;
    li {
      width: fit-content;
    }
  }
}

/* Main content area */
main {
  --text-block-max-width: 400px;
  --text-block-padding-x: 2rem;

  display: grid;
  padding-top: 2em;

  /* Blockquote styling */
  blockquote {
    position: relative;
    margin: 1em;
    padding: 1em;
    background-color: #f3f4f4;
    border-radius: 8px;
    color: #344;
    font-style: italic;
    &::before,
    &::after {
      position: absolute;
      font-size: 60px;
      color: #3442;
      font-style: normal;
      display: block;
      content: '"';
    }
    &::before {
      left: -0.5rem;
      top: -0.25rem;
    }
    &::after {
      right: -0.5rem;
      bottom: -2rem;
    }
    p {
      margin-top: 0;
      margin-bottom: 0;
      &+p {
        margin-top: inherit;
      }
    }
    i {
      font-style: normal;
    }
  }

  /* Gallery-specific styles */
  .gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1em;
    align-items: center;
    padding-inline: 2em;
    margin-top: 2em;

    img {
      box-sizing: border-box;
      margin-top: -2em;
      display: block;
      width: 100%;
      height: auto;
      padding: 8px;
      background-color: #fff;
      border-radius: 4px;
      box-shadow: 0 4px 12px #0003;

      &:nth-child(5n + 1) { transform: rotate(-1.5deg); }
      &:nth-child(5n + 2) { transform: rotate(3.5deg); }
      &:nth-child(5n + 3) { transform: rotate(-3.5deg); }
      &:nth-child(5n + 4) { transform: rotate(2.25deg); }
      &:nth-child(5n)     { transform: rotate(1deg); }

      &.wide {
        grid-column: auto;
      }
    }
  }

  @media (min-width: 400px) {
    .gallery {
      grid-template-columns: repeat(2, minmax(0, 1fr));

      img.wide {
        grid-column: span 2;
      }
    }
  }
  @media (min-width: 480px) {
    .gallery {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (min-width: 760px) {
    .gallery {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  @media (min-width: 1200px) {
    .gallery {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }

  @media (min-width: 1920px) {
    .gallery {
      grid-template-columns: repeat(5, minmax(0, 1fr));
    }
  }
  @media (min-width: 2400px) {
    .gallery {
      grid-template-columns: repeat(6, minmax(0, 1fr));
    }
  }

  /* Books page specific styles */
  .books {

    ul.book-list {
      list-style: none;
      margin: 0;
      padding: 0;

      li.book {
        margin-top: 2rem;
        margin-bottom: 2rem;

        article {
          display: grid;
          grid-template-columns: 1fr;
          justify-items: center;
          justify-self: center;
          gap: 1em;
          max-width: var(--text-block-max-width);
          margin-left: auto;
          margin-right: auto;
          padding-left: 1em;
          padding-right: 1em;
          border-radius: 1em;

          .book-cover {
            position: relative;
            text-align: center;
            border-radius: 4px;
            height: fit-content;
            img {
              border-radius: 4px;
              position: relative;
              width: 75%;
              max-height: 100%;
              box-shadow: 0 0 0 #cccc;
              transform: perspective(1000px) rotateY(0) rotateX(0);
              transition-property: box-shadow, transform;
              transition-duration: 300ms;
              transition-timing-function: ease-in-out;
            }
            &::after {
              position: absolute;
              display: block;
              content: "";
              top:0;
              bottom: 0;
              width: 75px;
              left: 50%;
              background-color: #fff3;
              filter: blur(10px);
              opacity: 0;
              transform: perspective(1000px) rotateY(0) rotateX(0) translateX(-50%) skew(-5deg);
              transition-property: transform, opacity;
              transition-duration: 300ms;
              transition-timing-function: ease-in-out;
            }
          }

          .book-details {
            cursor: default;
            .book-name,
            .book-author {
              margin: 0;
            }
            .book-year {
              font-weight: 450;
            }
          }

          &:hover {
            .book-cover {
              &::after {
                opacity: 1;
                transform: perspective(1000px) rotateY(-10deg) rotateX(10deg) translateX(-50%) skew(-20deg);
              }
            }
            .book-cover img {
              box-shadow:
                .25em .25em 0 0 #ddd,
                .5em .5em .5em #cccc; 
              transform: perspective(1000px) rotateY(-10deg) rotateX(10deg);
            }
          }
        }

        @media (min-width: 480px) {
          article {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 2em;
            max-width: 640px;
            padding-top: 1rem;
            padding-bottom: 2rem;
          }
        }
      }
    }
  }

  .intro,
  .contact {
    padding-left: 1em;
    padding-right: 1em;
    margin-left: auto;
    margin-right: auto;
    max-width: 400px;
  }
  p {
    &.lead {
      font-size: larger;
    }
  }
  .profile-image {
    margin-left: auto;
    margin-right: auto;
    width: 10dvw;
    min-width: 200px;
    height: 10dvw;
    min-height: 200px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px #0003;
    &.jn {
      rotate: 3deg;
    }
    &.an {
      rotate: -3deg;
    }
    img {
      max-width: 100%;
    }
  }

}

/* Utilities */
.sr-only {
  position:absolute;
  left:-10000px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.g-center {
  place-self: center;
}
.g-left {
  place-self: start;
}
.g-right {
  place-self: end;
}
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}
.text-start {
  text-align: start;
}
.text-end {
  text-align: end;
}
.text-justify {
  text-align: justify;
}
.text-muted {
  color: var(--muted-color);
}
.text-accent {
  color: var(--heading-color);
}
.fw-normal {
  font-weight: 400 !important;
}