@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@200..900&family=Noto+Serif+KR:wght@200..900&family=Noto+Serif+SC:wght@200..900&family=Noto+Serif+TC:wght@200..900&display=swap');

@media (max-width: 600px) {
  .titles {
    top: 0;
    padding-bottom: 4px;
    position: static;
    width: 100vw;
    max-width: 100vw;
    background: #fff;
    z-index: 11;
  }
  .main-title {
    font-size: 1.2rem !important;
  }
  .subtitle {
    font-size: 1rem !important;
  }
  /* Do not override .overlap, .overlap-en for mobile to preserve overlap effect */
  .indent {
    margin-left: 0.15em;
  }
  .main-img {
    height: 65vh;
    max-height: 75vh;
    width: 98vw;
    max-width: 90vw;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
  }
  .main-img img {
    max-width: 96vw;
    max-height: 80vh;
    width: 96vw;
    height: 80vh;
    margin: 0 auto;
    display: block;
    object-fit: contain;
  }
  .viewer {
    justify-content: flex-start;
  }
}
.subtitle {
  font-size: 1.2rem;
  font-weight: 300;
  margin: 0;
  padding: 0;
  letter-spacing: 0.05em;
  color: #111;
}
.overlap-en {
  position: absolute;
  left: 0.9em;
  top: 0;
  pointer-events: none;
  color: #555;
  font-size: 1.4rem;
  font-weight: 300;
  line-height: 1;
}
.indent {
  margin-left: 0.3em;
  display: inline-block;
}
.main-title {
  font-size: 2rem;
  font-weight: 300;
  margin: 0;
  padding: 0;
  letter-spacing: 0.2em;
  position: relative;
  display: inline-block;
}
.overlap-wrap {
  position: relative;
  display: inline-block;
}
.overlap {
  position: absolute;
  left: 0.4em;
  top: 0.4em;
  pointer-events: none;
  color: #444;
  opacity: 60%;
  font-size: 0.98em;
  line-height: 1;
}
/* Thumbnail bar styled like Mac OS dock */
.thumbs {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 2px;
  overflow-x: auto;
  width: 100vw;
  max-width: 100vw;
  height: 54px;
  background: rgba(240,240,240,0.95);
  border-top: 1px solid #eee;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
  padding: 4px 0 0 0;
  position: relative;
  justify-content: center;
}
.thumb {
  width: 40px;
  height: 50px;
  object-fit: cover;
  opacity: 0.6;
  cursor: pointer;
  border: none;
  background: none;
  transition: opacity 0.2s, transform 0.2s;
  margin: 0 1px;
}
.thumb.active {
  opacity: 1;
  transform: scale(1.1);
  z-index: 1;
}
.thumb:hover {
  opacity: 0.9;
  transform: scale(1.15);
  z-index: 2;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Noto Serif JP", "Noto Serif KR", "Noto Serif SC", "Noto Serif TC", Arial, serif;
  min-height: 100vh;
  /* height: 100vh; */
  /* overflow: hidden; */
}
#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  height: 100vh;
  box-sizing: border-box;
}
/* Viewer fills viewport, main image flexes to fit above dock */
.viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
}
.titles {
  flex: 0 0 auto;
  width: 100vw;
  max-width: 100vw;
  text-align: center;
  padding: 8px 0 4px 0;
  background: #fff;
  z-index: 11;
}
.h1{
    font-size: 1.5rem;
    margin: 0;
    padding: 0;
}

.main-img {
  font-family: "Noto Serif JP", "Noto Serif KR", "Noto Serif SC", "Noto Serif TC", Arial, serif;
  font-size: 2.2rem;
  font-weight: 400;
  margin: 0;
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
  height: 60vh;
  max-height: 60vh;
}
.main-img img {
  max-height: 100%;
  max-width: 60vw;
  width: auto;
  height: auto;
  object-fit: contain;
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
  display: block;
}
.thumbs {
  flex: 0 0 54px;
  width: 100vw;
  max-width: 100vw;
  height: 54px;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 2px;
  overflow-x: auto;
  background: rgba(240,240,240,0.95);
  border-top: 1px solid #eee;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
  padding: 4px 0 0 0;
  position: relative;
  justify-content: center;
  z-index: 10;
}
.main-img img {
  max-width: 60vw;
  max-height: calc(100vh - 54px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
  display: block;
}
.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

/* mobile styles */

@media (max-width: 600px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 601px) and (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
@media (min-width: 1025px) {
  .grid {
    grid-template-columns: repeat(8, minmax(180px, 1fr));
  }
}
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: #fff;
  align-items: center;
  justify-content: center;
}
.modal-content {
  margin: auto;
  display: block;
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 0;
  box-shadow: none;
}
.close {
  position: absolute;
  top: 16px;
  right: 24px;
  color: #000;
  font-size: 2rem;
  font-weight: normal;
  cursor: pointer;
  background: none;
  border: none;
}
.modal-controls {
  text-align: center;
  margin-top: 8px;
}
.modal-controls button {
  background: none;
  border: none;
  padding: 8px 16px;
  margin: 0 8px;
  font-size: 1rem;
  cursor: pointer;
  color: #000;
}
