@charset "utf-8";

:root {
  --bg-base: #f7fafb;
  --text-main: #56616b;
  --text-light: #8a949d;
  --heading: #6e7983;
  --accent: #d8e6eb;
  --line: rgba(221, 230, 234, 0.8);
  --font-gothic: "Zen Kaku Gothic New", sans-serif;
  --font-serif: "Noto Serif JP", serif;
  --transition: 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-gothic);
  line-height: 1.8;
  letter-spacing: 0.05em;
}

main {
  width: min(92%, 1100px);
  margin: 0 auto;
  padding-bottom: 100px;
}

h2 {
  font-family: var(--font-serif);
  margin: 120px 0 50px;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  color: var(--heading);
  letter-spacing: 0.4em;
  text-transform: lowercase;
}

h2::before,
h2::after {
  content: "";
  display: inline-block;
  width: 30px;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin: 0 15px;
}

#contents ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 30px 24px;
  justify-content: center;
}

.template-link {
  position: relative;
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
  transition: var(--transition);
}

.template-link:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 15px 30px -10px rgba(160, 178, 186, 0.2);
}

.thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f3f5f7;
  display: grid;
  place-items: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.template-link:hover .thumb iframe {
  transform: scale(0.26);
}

.template-title {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 30px 15px 12px;
  margin: 0;
  font-family: var(--font-gothic);
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.1em;
  z-index: 10;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
  transition: var(--transition);
}

.template-link:hover .template-title {
  padding-bottom: 16px;
}

.check {
  margin-top: 100px;
  text-align: left;
  font-size: 0.82rem;
  color: var(--text-light);
  border-top: 1px solid #eee;
  padding-top: 40px;
}

.js .fade-up,
.js .fade-left,
.js .fade-item,
.js .stagger-item {
  opacity: 0;
}

.fade-up {
  transform: translateY(40px);
  transition: var(--transition);
}

.fade-left {
  transform: translateX(-30px);
  transition: var(--transition);
}

.fade-item {
  transform: translateY(20px);
  transition: var(--transition);
}

.stagger-item {
  transform: translateY(20px);
  transition: var(--transition);
}

.show {
  opacity: 1 !important;
  transform: translate(0, 0) !important;
}

.delay-1 {
  transition-delay: 0.2s;
}

.delay-2 {
  transition-delay: 0.4s;
}

.delay-3 {
  transition-delay: 0.6s;
}

@media (max-width: 600px) {
  #contents ul {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }

  .template-title {
    font-size: 0.75rem;
    padding: 20px 10px 8px;
  }
  
  .thumb {
    aspect-ratio: 4 / 3;
  }

  .thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }

  .template-title {
    font-size: 0.75rem;
    padding: 20px 10px 8px;
  }
}