@charset "utf-8";

html {
  scrollbar-gutter: stable;
}

body {
  width: 100%;
}

body.no-scroll {
  overflow-y: hidden;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background-color: rgba(0, 0, 0, .8);
  z-index: 1000;
  touch-action: none;
}

.modal.is-open {
  display: flex;
  justify-content: center;
  align-items: center;
}

.close-modal {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  font-size: 2.5rem;
  color: #999;
  background-color: transparent;
  width: 3rem;
  height: 3rem;
  border: none;
  cursor: pointer
}

.close-modal:hover {
  color: #555;
  transition: color .3s;
}

.modal-window {
  position: relative;
  color: #ccc;
  background-color: #eee;
  box-shadow: 1px 1px 10px rgba(255, 255, 255, .7);
  border-radius: 1rem;
  width: 85vw;
  max-width: 750px;
  height: auto;
  max-height: 80dvh;
  padding: 4rem 2rem;
}

.modal-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2rem;
  height: 100%;
  color: #444;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.modal-title {
  font-size: 1.8rem;
}

.text-block p {
  line-height: 2;
  text-align: justify;
}

/* header */

header {
  margin-top: 3rem;
  text-align: center;
}

.open-modal {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  background-color: transparent;
  margin-left: auto;
  border: none;
  cursor: pointer;
}

.open-modal:hover {
  text-decoration: underline;
  text-underline-offset: .2rem;
}

.main-title {
  font-size: 5rem;
}

.sub-title {
  font-size: 2rem;
  line-height: 1;
}

/* tabmenu */

.tab-menu {
  display: flex;
  width: fit-content;
  padding: .2rem;
  border: 1px solid #ccc;
  border-radius: 2rem;
  background-color: #eee;
}

.tab-item button {
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 600;
  display: block;
  padding: .7rem 1rem .4rem;
  border: none;
  border-radius: 2rem;
  background-color: transparent;
  cursor: pointer;
}

.sort-button button {
  padding: .4rem 1rem;
}

.tab-item.selected button {
  pointer-events: none;
  color: #fff;
  background-color: #666;
}

.tab-item:not(.selected) button:hover {
  background-color: #ccc;
  transition: background-color .3s, color .3s;
}

/* function-area */

.function-area {
  display: flex;
  justify-content: space-between;
  margin-top: 6rem;
}

/* category-selector */

.category-selector {
  justify-content: center;
  gap: 1rem;
}

/* sort button */

.sort-buttons {
  gap: .5rem;
}

/* contents */

#contents-list {
  width: 100%;
  margin: 2.5rem auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 1.8rem;
}

.content {
  border-radius: 1rem 1rem 0 0;
  transition: .2s;
}

.content.hidden {
  display: none;
}

.content:hover {
  transform: scale(1.05);
  transition: .3s;
}

.content-inner {
  position: relative;
  height: 100%;
  opacity: 0;
  transform: translateY(20px);
  border-bottom: 1px solid #ccc;
}

.content-inner.is-animated {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .8s ease-out, transform .8s ease-out;
}

.content img {
  object-fit: cover;
  transition: .3s;
}

.content:hover img {
  opacity: .7;
}

img {
  width: 100%;
  border: 1px solid #aaa;
  border-radius: 1rem;
  box-shadow: 1px 1px 10px rgba(0, 0, 0, .6);
}

.image-source {
  font-size: .6rem;
  text-align: right;
  margin-top: .2rem;
  padding-right: .6rem;
}

.source-link {
  color: #777;
  position: relative;
  z-index: 2;
}

.source-link:hover {
  color: #333;
  text-decoration: underline;
}

.main-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

h3 {
  font-size: 1.2rem;
  line-height: 1.4;
  margin-top: .3rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.date {
  font-size: 1rem;
  font-weight: 500;
  padding-bottom: 1rem;
}

.short {
  grid-row: span 3;
}

.tall {
  grid-row: span 4;
}

@media (max-width: 1024px) {

  .main-title {
    font-size: clamp(3rem, 8vw, 5rem);
    /* font-size: 3rem; */
  }

  .function-area {
    margin-top: 3rem;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .category-selector {
    gap: .6em;
  }

  .tab-item button {
    font-size: clamp(.7rem, 2vw, 1rem);
    padding: .7em .8em .4em;
  }

  #contents-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {

  .modal-content {
    gap: 1.4rem;
  }

  .modal-title {
    font-size: 1.5rem;
  }

  .text-block p {
    font-size: .9rem;
  }

  .main-title {
    font-size: 3rem;
  }

  .sub-title {
    font-size: 1rem;
  }

  #contents-list {
    margin-top: 2rem;
    gap: 1.4em 1.2rem;
  }

  h3 {
    font-size: 1rem;
    margin-top: .6rem;
  }
}

@media (max-width: 450px) {

  .modal-window {
    height: 80dvh;
    padding: 2.5rem 1.5rem;
  }

  .modal-title {
    font-size: 1.2rem;
  }

  .about {
    font-size: .6rem;
  }

  .open-modal {
    font-size: .8rem;
  }

  .main-title {
    font-size: 2.5rem;
  }

  .sub-title {
    font-size: .8rem;
  }

  .function-area {
    margin-top: 3rem;
  }

  .category-selector {
    gap: .3em;
  }

  .tab-item button {
    font-size: .6rem;
    padding: .6em .5em .4em;
  }

  #contents-list {
    margin-top: 1.6rem;
    grid-template-columns: 1fr;
  }

}