/* Gallery 2 — Echoes from the Soil. All rules are isolated to this page. */
body.gallery2-body {
  --g2-font-en: Georgia, "Times New Roman", serif;
  --g2-font-ja: Georgia, "Times New Roman", serif;
  --g2-bg: #ffffff;
  --g2-fg: #1a1a1a;
  --g2-muted: rgba(0, 0, 0, 0.4);
  --g2-line: rgba(0, 0, 0, 0.13);
  margin: 0;
  color: var(--g2-fg);
  background: var(--g2-bg);
  font-family: var(--g2-font-en);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

html.dark body.gallery2-body {
  color-scheme: dark;
  --g2-bg: #000000;
  --g2-fg: #ffffff;
  --g2-muted: rgba(255, 255, 255, 0.44);
  --g2-line: rgba(255, 255, 255, 0.16);
}

html:not(.dark) body.gallery2-body {
  color-scheme: light;
}

body.gallery2-body #scroller-wrapper {
  position: fixed !important;
  inset: 0 !important;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-x: none;
  background: var(--g2-bg);
  color: var(--g2-fg);
  -webkit-overflow-scrolling: touch;
}

body.gallery2-body #scroller-content,
body.gallery2-body .gallery2-page {
  width: 100%;
  min-height: 100%;
  background: var(--g2-bg);
  color: var(--g2-fg);
}

body.gallery2-body .gallery2-page,
body.gallery2-body .gallery2-page *,
body.gallery2-body .gallery2-page *::before,
body.gallery2-body .gallery2-page *::after {
  box-sizing: border-box;
}

body.gallery2-body .gallery2-page img {
  max-width: 100%;
  display: block;
}

body.gallery2-body .gallery2-page a {
  color: inherit;
}

body.gallery2-body .gallery2-page button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
}

body.gallery2-body .page-chrome {
  position: fixed;
  top: max(1.2rem, env(safe-area-inset-top));
  left: max(1.5rem, env(safe-area-inset-left));
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.55em;
}

body.gallery2-body .back-home {
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: opacity 0.2s;
}

body.gallery2-body .back-home:hover {
  opacity: 0.4;
}

body.gallery2-body #theme-toggle {
  cursor: pointer;
  font-size: 0.95em;
  line-height: 1;
  opacity: 0.75;
  transition: opacity 0.2s;
}

body.gallery2-body #theme-toggle:hover {
  opacity: 0.4;
}

/* Image-first carousel. */
body.gallery2-body .image-carousel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100svh;
  height: 100dvh;
  min-height: 440px;
  padding: max(2.2vh, env(safe-area-inset-top)) 0 max(1.6vh, env(safe-area-inset-bottom));
  overflow: hidden;
}

body.gallery2-body .main-area {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y pinch-zoom;
}

body.gallery2-body .main-image-wrapper {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 1.8vh 2.4vw;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

body.gallery2-body .main-image,
body.gallery2-body .main-image.fade {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 1 !important;
  animation: none !important;
  transition: none !important;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Quiet desktop edge controls. They are always removed on mobile/tablet. */
body.gallery2-body .g2-nav-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 18%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

body.gallery2-body .g2-nav-zone:hover,
body.gallery2-body .g2-nav-zone:focus-visible {
  opacity: 1;
}

body.gallery2-body .g2-nav-zone.prev {
  left: 0;
  justify-content: flex-start;
  padding-left: 1.1vw;
}

body.gallery2-body .g2-nav-zone.next {
  right: 0;
  justify-content: flex-end;
  padding-right: 1.1vw;
}

body.gallery2-body .g2-nav-zone svg {
  display: block;
  width: 0.8rem !important;
  height: 1rem !important;
  max-width: 0.8rem !important;
  max-height: 1rem !important;
}

body.gallery2-body .g2-nav-zone[data-disabled="true"] {
  opacity: 0 !important;
  cursor: default;
  pointer-events: none;
}

body.gallery2-body .thumbnail-container {
  display: flex;
  flex: 0 0 auto;
  gap: 3px;
  width: 100%;
  height: 8vw;
  max-height: 2.6rem;
  min-height: 28px;
  padding: 0 2.4vw;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

body.gallery2-body .thumbnail-container::-webkit-scrollbar {
  display: none;
}

body.gallery2-body .thumbnail {
  flex: 0 0 auto;
  width: auto;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s;
}

body.gallery2-body .thumbnail:hover,
body.gallery2-body .thumbnail:focus-visible,
body.gallery2-body .thumbnail.current {
  opacity: 1;
}

body.gallery2-body .thumbnail:focus-visible {
  outline: 1px solid var(--g2-fg);
  outline-offset: -1px;
}

body.gallery2-body .thumbnail img {
  width: auto;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

body.gallery2-body .pager {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 12px;
  margin-top: 1.1vh;
  padding: 0 2.4vw;
}

body.gallery2-body .pager > span {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1;
  color: var(--g2-muted);
}

body.gallery2-body .pager-spacer {
  width: 1px;
  height: 0.55rem;
  margin: 1px 0.6rem 0;
  background: var(--g2-muted);
}

body.gallery2-body .index-button {
  position: absolute;
  right: max(2.4vw, env(safe-area-inset-right));
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1;
  color: var(--g2-muted);
  transition: color 0.2s;
}

body.gallery2-body .index-button:hover,
body.gallery2-body .index-button:focus-visible {
  color: var(--g2-fg);
}

/* Index modal. */
body.gallery2-body .index-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--g2-bg);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

body.gallery2-body .index-modal.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
}

body.gallery2-body .index-inner {
  display: flex;
  flex-direction: row;
  padding: 0 6.4vw;
  height: 100%;
}

body.gallery2-body .index-grid {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 12.8vw 4.8vw;
  height: 100dvh;
  padding: 31.4667vw 0 max(15.4667vw, env(safe-area-inset-bottom));
  margin: 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body.gallery2-body .index-grid::-webkit-scrollbar {
  display: none;
}

body.gallery2-body .index-grid li {
  flex: 0 0 25.8667vw;
  display: flex;
  align-items: flex-start;
}

body.gallery2-body .index-grid button {
  cursor: pointer;
  width: 100%;
  padding: 0;
}

body.gallery2-body .index-grid img {
  width: 100%;
  height: auto;
}

body.gallery2-body .index-close {
  position: absolute;
  top: max(6.4vw, env(safe-area-inset-top));
  right: max(6.4vw, env(safe-area-inset-right));
  z-index: 2;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

body.gallery2-body .index-close:hover,
body.gallery2-body .index-close:focus-visible {
  color: var(--g2-muted);
}

body.gallery2-body.modal-lock #scroller-wrapper {
  overflow: hidden !important;
}

/* Project details beneath the first viewport. */
body.gallery2-body .works-details {
  width: 100%;
}

body.gallery2-body .work-title {
  width: 87.2vw;
  margin: 13.0667vw auto 0;
  font-family: var(--g2-font-ja);
  font-feature-settings: "palt" 1;
  font-size: 5.86667vw;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.45;
}

body.gallery2-body .work-title .lat {
  font-family: var(--g2-font-en);
  font-weight: 500;
}

body.gallery2-body .detail-container {
  width: 87.2vw;
  margin: 12.8vw auto 0;
  padding-bottom: max(26.6667vw, env(safe-area-inset-bottom));
}

body.gallery2-body .detail-table {
  display: flex;
  flex-direction: column;
  gap: 3.73333vw;
  width: 100%;
  margin: 0;
}

body.gallery2-body .table-row {
  display: flex;
  align-items: center;
}

body.gallery2-body .table-row dt {
  flex: 0 0 30.9333vw;
  padding-right: 6.4vw;
  color: var(--g2-muted);
  font-size: 4vw;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
}

body.gallery2-body .table-row dd {
  flex: 1 1 auto;
  margin: 0;
  font-size: 4vw;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

body.gallery2-body .rich-editor {
  display: flex;
  flex-direction: column;
  gap: 7.46667vw;
  margin-top: 15.2vw;
  overflow-wrap: anywhere;
  font-family: var(--g2-font-ja);
  font-feature-settings: "palt" 1;
  font-size: 3.73333vw;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.91;
}

body.gallery2-body .rich-editor p {
  margin: 0;
}

body.gallery2-body .rich-editor p:first-child {
  margin-top: -0.45em;
}

body.gallery2-body .rich-editor a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

body.gallery2-body .rich-editor a:hover {
  color: var(--g2-muted);
}

/* Never show side arrows on phones, tablets, coarse pointers, or no-hover UIs. */
@media (max-width: 1024px), (hover: none), (pointer: coarse) {
  body.gallery2-body .g2-nav-zone {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
  }
}

@media (max-width: 767px) {
  body.gallery2-body .page-chrome {
    top: max(1.15rem, env(safe-area-inset-top));
    left: max(1.5rem, env(safe-area-inset-left));
  }

  body.gallery2-body .image-carousel {
    min-height: 400px;
    padding-top: max(2.2vh, env(safe-area-inset-top));
  }

  body.gallery2-body .main-image-wrapper {
    padding-left: max(2.4vw, env(safe-area-inset-left));
    padding-right: max(2.4vw, env(safe-area-inset-right));
  }

  body.gallery2-body .thumbnail-container {
    min-height: 30px;
    padding-left: max(2.4vw, env(safe-area-inset-left));
    padding-right: max(2.4vw, env(safe-area-inset-right));
  }
}

@media (min-width: 768px) {
  body.gallery2-body .index-inner {
    padding: 0 3.88889vw;
  }

  body.gallery2-body .index-grid {
    gap: 5vw 1.66667vw;
    padding: 7.22222vw 0 4.23611vw;
  }

  body.gallery2-body .index-grid li {
    flex: 0 0 13.9583vw;
  }

  body.gallery2-body .index-close {
    top: 2vw;
    right: 3.88889vw;
    font-size: max(1.11111vw, 0.75rem);
  }

  body.gallery2-body .work-title {
    display: flex;
    width: 84.3056vw;
    margin: 5.69444vw auto 0 3.95833vw;
    font-size: 2.5vw;
  }

  body.gallery2-body .detail-container {
    display: flex;
    width: 84.3056vw;
    margin: 6.66667vw auto 0 3.95833vw;
    padding-bottom: 12.5vw;
  }

  body.gallery2-body .detail-table {
    flex: 0 0 46.9444vw;
    gap: 0.833333vw;
    padding-right: 8.33333vw;
  }

  body.gallery2-body .table-row dt {
    flex-basis: 12.7083vw;
    padding-right: 3.33333vw;
    font-size: max(1.11111vw, 0.75rem);
  }

  body.gallery2-body .table-row dd {
    font-size: max(1.11111vw, 0.75rem);
  }

  body.gallery2-body .rich-editor {
    width: 37.4306vw;
    margin-top: 0.277778vw;
    gap: 2.22222vw;
    font-size: max(1.04167vw, 0.6875rem);
  }
}

@media (max-width: 767px) and (orientation: landscape) and (max-height: 520px) {
  body.gallery2-body .image-carousel {
    min-height: 100dvh;
    padding-top: max(1vh, env(safe-area-inset-top));
    padding-bottom: max(1vh, env(safe-area-inset-bottom));
  }

  body.gallery2-body .page-chrome {
    top: max(0.65rem, env(safe-area-inset-top));
    left: max(1rem, env(safe-area-inset-left));
  }

  body.gallery2-body .thumbnail-container {
    min-height: 25px;
    max-height: 30px;
  }

  body.gallery2-body .pager {
    margin-top: 0.5vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.gallery2-body .back-home,
  body.gallery2-body #theme-toggle,
  body.gallery2-body .thumbnail,
  body.gallery2-body .index-modal {
    transition: none;
  }
}
