/* Typo */
.crimson-text-regular {
  font-family: "Crimson Text", serif;
  font-weight: 400;
  font-style: normal;
}

.crimson-text-semibold {
  font-family: "Crimson Text", serif;
  font-weight: 600;
  font-style: normal;
}

.crimson-text-bold {
  font-family: "Crimson Text", serif;
  font-weight: 700;
  font-style: normal;
}

.crimson-text-regular-italic {
  font-family: "Crimson Text", serif;
  font-weight: 400;
  font-style: italic;
}

.crimson-text-semibold-italic {
  font-family: "Crimson Text", serif;
  font-weight: 600;
  font-style: italic;
}

.crimson-text-bold-italic {
  font-family: "Crimson Text", serif;
  font-weight: 700;
  font-style: italic;
}

.courier-prime-regular {
  font-family: "Courier Prime", monospace;
  font-weight: 400;
  font-style: normal;
}

.courier-prime-bold {
  font-family: "Courier Prime", monospace;
  font-weight: 700;
  font-style: normal;
}

.courier-prime-regular-italic {
  font-family: "Courier Prime", monospace;
  font-weight: 400;
  font-style: italic;
}

.courier-prime-bold-italic {
  font-family: "Courier Prime", monospace;
  font-weight: 700;
  font-style: italic;
}

.unifrakturmaguntia-regular {
  font-family: "UnifrakturMaguntia", cursive;
  font-weight: 400;
  font-style: normal;
}

/* ascii */
#ascii-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* scll */
html {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

body {
  font-family: "Crimson Text", serif;
  background-image: url("img/darkbrown.webp");
  background-size: contain;
  background-position: center;
  background-repeat: repeat;
  margin: 0;
  overflow-x: hidden;
}

/* title */
.hero-section,
.narrative-section {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  scroll-snap-align: start;
  position: relative;
  z-index: 1;
}

.title {
  font-family: "UnifrakturMaguntia", cursive;
  color: rgb(205, 239, 239);
  font-size: 9vw;
  text-align: center;
  margin: 0;
}

.scroll-hint {
  position: absolute;
  bottom: 50px;
  color: rgb(205, 239, 239);
  font-family: "Crimson Text", serif;
  font-size: 1rem;
  animation: bounce 2s infinite;
  font-weight: lighter;
}

.narrative-card {
  color: #221201;
  background-image: url(img/chocomin.webp);
  background-size: contain;
  background-position: center;
  background-repeat: repeat;
  max-width: 85vw;
  padding: 40px 35px;
  border-radius: 1px;
  position: relative;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.narrative-title {
  font-family: "Crimson Text", serif;
  text-align: left;
  font-weight: lighter;
  margin-top: 0;
  margin-bottom: 20px;
}

.narrative-content {
  font-family: "Crimson Text", serif;
  font-weight: lighter;
  line-height: 1.5;
  text-align: justify;
}

.narrative-content p {
  margin-bottom: 15px;
}

.narrative-author {
  font-family: "Crimson Text", serif;
  text-align: right;
  font-weight: lighter;
  margin-top: 25px;
}

.narrative-card:hover {
  position: relative;
  z-index: 10;
  cursor: pointer;
  transform: scale(1.1);
  filter: drop-shadow(0 0px 5px rgba(0, 0, 0, .35));
}

@keyframes bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-8px);
  }

  60% {
    transform: translateY(-4px);
  }
}

.notes-section {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 60px 0;
  scroll-snap-align: start;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

.container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Đồng bộ với JS: JS append trực tiếp vào #notes-container, nên ta gộp chung style cho class .notes hoặc ID #notes-container */
.notes,
#notes-container {
  width: 1000px;
  max-width: 90vw;
  column-count: 3;
  column-gap: 8px;
}

.note {
  border-radius: 1px;
  color: #221201;
  break-inside: avoid;
  margin-bottom: 8px;
  padding: 30px 20px;
  position: relative;
  background-size: contain;
  background-position: center;
  background-repeat: repeat;
  white-space: pre-wrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.note:hover {
  position: relative;
  z-index: 10;
  cursor: pointer;
  transform: scale(1.1);
  filter: drop-shadow(0 0px 5px rgba(0, 0, 0, .35));
}

.note-author {
  text-align: right;
  font-weight: bold;
  margin-top: 10px;
}

.note.real-time-note {
  background-image: none !important;
  background-color: transparent;
  color: rgba(205, 239, 239);
  box-shadow: none !important;
}

.note.real-time-note:hover {
  filter: none !important;
  box-shadow: none !important;
}

.imgs {
  margin-bottom: 8px;
  break-inside: avoid;
  position: relative;
  width: 100%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
  overflow: hidden;
  border-radius: 1px;
  padding: 15px 15px 5px 15px;
  box-sizing: border-box;
}

.imgs img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: transparent;
}

.imgs:hover {
  position: relative;
  z-index: 10;
  cursor: pointer;
  transform: scale(1.1);
  filter: drop-shadow(0 0px 5px rgba(0, 0, 0, .35));
}

/* responsive */
@media (max-width: 768px) {
  html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
  }

  body {
    display: block;
    width: 100vw;
    overflow-x: hidden;
  }

  .hero-section,
  .narrative-section {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 40px 20px;
  }

  .narrative-card {
    max-width: 85vw;
    height: auto;
    max-height: none;
  }

  .notes-section {
    width: 100vw;
    min-height: 100vh;
    height: auto;
    display: flex;
    justify-content: center;
    padding: 60px 0;
    box-sizing: border-box;
  }

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

  .notes,
  #notes-container {
    width: 80vw;
    max-width: 90%;
    column-count: 1;
    column-gap: 0;
  }

  .note,
  .imgs {
    width: 100%;
    max-width: none;
    break-inside: avoid;
    margin-bottom: 24px;
    margin-top: 24px;
    box-sizing: border-box;
    overflow: visible;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    transform-origin: center center;
  }

  .imgs img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  .note.active-zoom,
  .imgs.active-zoom {
    transform: scale(1.08);
    z-index: 10;
  }

  .note.real-time-note.active-zoom {
    transform: none !important;
  }
}