@charset "utf-8";

body {
  display: flex;
  background: #fafafa;
  color: #333;
  flex-direction: column;
  font-family: "Poppins", "Noto Sans JP", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;

  img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
  }

  pre {
    white-space: inherit;
  }

  .footer {
    padding:  2rem;

    a {
      color: inherit;
      text-decoration: none;
    }
  }
}

/* ==================================================
  home
================================================== */

body {
  /* background: #eee; */
}

section {
  padding: 100px 2rem;

  h1 {
    margin-bottom: 4rem;
    font-size: 2rem;
    font-weight: 600;
  }

  .section_footer {
    margin-top: 2rem;
  }
}

.home_fv {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  width: 100%;
  height: 90svh;
  background: #fff;
  border-bottom: 1px solid #ddd;

  h1 {
    margin-bottom: 0;
    font-size: 4rem;
    font-weight: 600;
    transition: .4s;

    @media screen and (max-width: 800px) {
      font-size: 2rem;
    }
  }
}

.archive-gallery {
  .posts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 1rem;

    @media screen and (max-width: 1200px) {
      grid-template-columns: repeat(2, 1fr);
    }

    @media screen and (max-width: 800px) {
      grid-template-columns: repeat(1, 1fr);
    }

    .post {
      width: 100%;
      color: inherit;
      text-decoration: none;
      overflow: auto;

      [class^="post_thumbnail"] {
        aspect-ratio: 2.6;
        width: 100%;
        overflow: hidden;

        &.post_thumbnail_title,
        &.post_thumbnail_content {
          position: relative;
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-content: center;
          height: 100%;
          padding: 10%;
          border: 1px solid #ddd;

          &::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            display: block;
            width: 100%;
            aspect-ratio: 5;
            background: linear-gradient(transparent 0%, #fff 60%);
          }
        }

        .post-title {
          margin-bottom: .5rem;
          font-weight: 600;
        }

        .post_content {
          overflow: hidden;
        }
        

        &.is-overflow {
          display: block;

          &::before {
            display: none;
          }
        }
      }
    }
  }
}

.home_projects {
  .projects {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 2rem;
    margin: auto;
    width: 100%;
    max-width: 800px;

    .project {
      aspect-ratio: 1/1.4;
      padding: 40px 2rem;
      width: 100%;
      background: #eee;

      .project_title {
        font-size: 1.4rem;
      }

      .project_links {
        margin: 2rem 0;
        .project_link {
          a {
            text-decoration: none;
          }
        }
      }
    }
  }
}

.home_works {
  background: #eee;

  .works {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 2rem;

    @media screen and (max-width: 800px) {
      grid-template-columns: 1fr;
    }

    .work {
      .work_image {
        img {
          aspect-ratio: 1;
          width: 100%;
          border: 1px solid #ddd;
        }
      }
      .work_title {
        margin-top: .5rem;
        font-weight: 500;
      }
    }
  }

  .section_footer {
    a {
      display: flex;
      gap: 1rem;
      margin-left: auto;
      padding: .5rem 1rem;
      width: fit-content;
      border: 1px solid #ddd;
      border-radius: 3em;
      background: #000;
      color: #fff;
      text-decoration: none;

      &::after {
        content: "→";
      }
    }
  }
}

.home_profile {
    .profile {
      display: grid;
      grid-template-columns: 100px 1fr;
      grid-gap: 1rem;

      .profile_image {
        aspect-ratio: 1;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          border-radius: 50%;
        }
      }
      .profile_text {
        .profile_name {
          font-size: 1.2rem;
          font-weight: 500;
        }
        .profile_name_yomi {

        }
        .profile_links_list {
          margin-top: 2rem;
          display: grid;
          grid-gap: 8px;
        }
        .profile_links_list_item {
        }
        .profile_link {
          display: grid;
          grid-template-columns: 2rem 1fr;
          grid-gap: 4px;
          align-items: center;
          color: inherit;
          text-decoration: none;

          .profile_link_icon {
            aspect-ratio: 1;
            width: 100%;
            background: #eee;
            border-radius: 50%;

            img {
              padding: 30%;
              width: 100%;
              height: 100%;
              object-fit: contain;
            }
          }
          .profile_link_title {

          }
        }
      }
    }
}

.archive {
  margin: 0 auto;
  width: 1000px;
  max-width: calc(100% - 4rem);

  .archive-header {
    margin: 10rem 0 6rem;

    .archive-title {
      font-size: 4rem;
      font-weight: 600;
      transition: .4s;

      @media screen and (max-width: 800px) {
        font-size: 1.4rem;
      }
    }
  }

  .archive-body {

  }

  .archive-footer {

  }

  .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 2rem 0;

    select {
      padding: .5rem 1rem;
      width: 3rem;
      background: transparent;
      text-align: center;
      border: 0;
      font-size: .8rem;
      font-weight: 600;
      cursor: pointer;
      outline: unset;
      appearance: unset;
    }

    .arrow {
      aspect-ratio: 1;
      display: inline-flex;
      justify-content: center;
      align-items: center;
      width: 3rem;
      background: #eee;
      color: inherit;
      /* border: 1px solid #ddd; */
      border-radius: 50%;
      text-decoration: none;
      font-size: .8rem;
      font-weight: 600;

      a& {
        transition: .2s;

        &:hover {
          background: #ddd;
        }
      }

      span& {
        background: transparent;
        color: #ddd;
        pointer-events: none;
      }
    }
  }
}

.page {
  margin: 6rem auto;
  width: 1000px;
  max-width: calc(100% - 4rem);

  .post-content {
    line-height: 1.6;

    & > * + * {
      margin-top: 1rem;
    }

    h2 {
      margin: 2rem 0 1rem;
      font-size: 1.2rem;
      font-weight: 500;

      &:first-child {
        margin-top: 0;
      }
    }

    img {
      border: 1px solid #ddd;
    }

    figcaption {
      margin-top: .5rem;
      color: #888;
      font-size: .9rem;
      font-style: italic;
      text-align: right;
    }

    blockquote {
      padding: 1rem;
      background: #fafafa;
      border: 1px solid #ddd;
    }
  }

  .post-notes {
    padding-top: 2rem;
    border-top: 2px solid #eee;
    font-size: .8rem;
    font-weight: 600;

    ul {
      padding-left: 1rem;

      li {
        list-style-type: disc;
        list-style-position: outside;
      }
    }
  }
}


.page-header {
  margin: calc(2rem + 3rem + 4rem) 0 4rem;
  text-align: center;

  a {
    color: inherit;
    text-decoration: none;
  }

  .post-title {
    margin-top: .5rem;
    font-size: 2rem;
    font-weight: 500;
  }
}

.page-body {
  margin: 4rem 0;
}


/*

  header

*/

.header-site-title {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;

  .header-site-title-image {
    display: flex;
    width: 1.2rem;
    height: auto;

    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      vertical-align: baseline;
    }
  }
}

.header-nav {
  position: fixed;
  z-index: 150;
  top: 0;
  left: 100vw;
  right: -80vw;
  bottom: 0;
  padding:  calc(2rem + 3rem + 4rem) 2rem 4rem;
  background: #fafafafa;
  transition: .4s;

  ul {
    display: grid;
    grid-gap: .5rem;

    li {
      a {
        display: grid;
        grid-template-columns: 200px 1fr;
        grid-gap: 1rem;
        align-items: center;
        color: inherit;
        text-decoration: none;
        transition: .2s;

        &:hover {
          color: #888;

          &:after {
            width: 100%;
          }
        }

        &:after {
          content: "";
          display: block;
          margin-left: auto;
          width: 0px;
          height: 4px;
          background: #ddd;
          transition: .2s;
        }
      }
    }
  }

  &.active {
    left: 20vw;
    right: 0;
  }

  & > * + * {
    margin-top: 4rem;
  }

  nav {
    ul {
      flex-direction: column;
      align-items: flex-start;

      &:not(:first-child) {
        margin-top: 2rem;
      }

      li {
        font-size: 1.6rem;
        font-weight: 600;

        a {
          img {
            width: 3rem;
          }
        }
      }
    }
  }

  .list-icon {
    display: flex;
    gap: 1rem;

    a {
      display: flex;
      align-items: center;
      justify-content: center;
      aspect-ratio: 1;
      padding: 30%;
      width: 3rem;
      background: #eee;
      border-radius: 50%;
      
      img {
        width: 100%;
        height: 100%;
        object-fit: contain;
      }
    }
  }
}

/*

  footer

*/

.footer-nav {
  position: fixed;
  z-index: 100;
  left: 1rem;
  bottom: 2rem;
}


/*
  PWA
*/

.pwa {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  &.active {
    @media (max-width: 600px) {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }
  }
}

.pwa-version-area {
  .pwa-version {
    margin-top: .5rem;
    font-size: .8rem;
    font-weight: 500;
    text-align: center;
  }
}

.update-btn {
  display: block;
  padding: 1rem;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 3rem;
}


.btn-nav {
  position: fixed;
  z-index: 1000;
  top: 2rem;
  right: 2rem;
  aspect-ratio: 1;
  width: 3rem;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  transition: .2s;
  user-select: none;

  &:hover {
    transform: scale(1.1);
  }

  &.active {
    &:before {
      top: calc(50% - .5px);
      transform: rotate(225deg) scale(1.2);
    }
    &:after {
      bottom: calc(50% - .5px);
      transform: rotate(-225deg) scale(1.2);
    }
  }

  &:before,
  &:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
    width: 1rem;
    height: 1px;
    background: #000;
    transition: .2s;
  }

  &:before {
    top: 40%;
  }

  &:after {
    bottom: 40%;
  }
}


/* page */

.page-nav {
  margin: 4rem 0;

  a {
    color: inherit;
    text-decoration: none;
  }

  .page-nav-gallery {
    display: flex;
    
    li {

      &:not(:last-child) {
        &::after {
          content: "|";
          display: inline-block;
          margin: 0 .5rem;
        }
        &:first-child {
          &::after {
            content: "→";
            display: inline-block;
            margin: 0 1rem;
          }
        }
      }
    }
  }

  .btn {
    position: fixed;
    z-index: 1000;
    top: 2rem;
    left: 2rem;
    aspect-ratio: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 3rem;
    background: #fafafa;
    color: inherit;
    border: 1px solid #ddd;
    border-radius: 50%;
    text-decoration: none;
    transition: .2s;

    &:hover {
      background: #eee;
    }
  }
  .btn-back {
    position: fixed;
    z-index: 1000;
    top: 2rem;
    left: 2rem;
    aspect-ratio: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 3rem;
    background: #fafafa;
    color: inherit;
    border: 1px solid #ddd;
    border-radius: 50%;
    text-decoration: none;
    transition: .2s;
    user-select: none;

    &:hover {
      background: #eee;
    }
  }
}

/* author */
.author {
  .author-card {
    display: grid;
    grid-template-rows: 120px 1fr;
    grid-gap: 1rem;
    align-items: center;
    margin: auto;
    width: fit-content;

    @media (max-width: 600px) {

    }

    .author-image {
      aspect-ratio: 1;
      width: 100%;
      height: 100%;
      border-radius: 50%;

      img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
      }
    }

    .author-name {
      font-weight: 500;
    }
  }

  .author-message {
    position: relative;
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #eee;
    border-radius: 8px;

    &:before {
      content: "";
      position: absolute;
      top: -.5rem;
      left: calc(40px - .5rem);
      width: 0;
      height: 0;
      border: .5rem solid #eee;
      transform: rotate(45deg);
    }
  }
}
