/* ====== 額面ごとの折りたたみ ====== */
h2.denomination-toggle {
  margin-bottom: 0.4em;
}

h2.denomination-toggle button {
  all: unset;
  display: block;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  font: inherit;
  font-weight: bold;
  font-size: 1.05em;
  line-height: 1.4;
  padding: 10px 12px;
  border: 1px solid #999;
  background: #f5f5f5;
}

h2.denomination-toggle button:hover {
  background: #ececec;
}

h2.denomination-toggle button::before {
  content: "▶ ";
}

h2.denomination-toggle button[aria-expanded="true"]::before {
  content: "▼ ";
}

.denomination-panel {
  display: none;
  margin-bottom: 1.2em;
}

.denomination-panel.is-open {
  display: block;
}

.description-cell {
  width: 300px;
  min-width: 300px;
  box-sizing: border-box;
  vertical-align: top;
}

/* ====== ズームコンテンツ ====== */
.m-lens-container {
  display: inline-block;
  position: relative;
  vertical-align: bottom;
  cursor: crosshair;
}

.m-lens {
  position: absolute;
  z-index: 2;
  background: rgba(0, 0, 0, 0.3);
  height: 100px;
  width: 100px;
  display: none;
  pointer-events: none;
}

.m-lens-container:hover .m-lens {
  display: block;
}

.image-container.horizontal {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.image-container.vertical {
  flex-direction: column;
}

.zoom-area {
  display: none;
  position: fixed;
  width: 290px;
  height: 290px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.zoom-area.active {
  display: block;
}

/* ====== モーダル ====== */
#modal-container {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100dvh;
  box-sizing: border-box;
  pointer-events: none;
}

.modal-stage {
  display: flex;
  width: 100vw;
  flex: 1 1 auto;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  pointer-events: auto;
}

.modal-image-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
  max-width: 90vw;
  max-height: 72dvh;
}

.modal-image-wrap>img,
.modal-stage>img {
  width: auto;
  max-width: 90vw;
  height: auto;
  max-height: 72dvh;
  object-fit: contain;
  cursor: pointer;
  display: block;
  pointer-events: auto;
}

.modal-info {
  width: min(900px, 90vw);
  max-height: 20dvh;
  overflow: auto;
  background: #fff;
  color: #000;
  padding: 12px 16px;
  box-sizing: border-box;
  margin-bottom: 10px;
  border-radius: 2px;
  pointer-events: auto;
}

.modal-info .modal-country {
  font-weight: bold;
  margin-bottom: 8px;
}

.modal-nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  z-index: 10000;
  display: none;
  padding: 0;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

.modal-prev {
  left: 8px;
  transform: translateY(-50%);
}

.modal-next {
  right: 8px;
  transform: translateY(-50%);
}

.modal-nav:hover {
  background: rgba(0, 0, 0, 0.8);
}

img.popup {
  cursor: crosshair;
}

/* ====== ツールチップ ====== */
#custom-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 8px;
  border-radius: 5px;
  font-size: 10px;
  white-space: nowrap;
  display: none;
  pointer-events: none;
  z-index: 10001;
}

.cell {
  text-align: center;
}

.cell img {
  display: block;
  margin: auto;
}

.indent1 {
  text-indent: -1em;
  padding-left: 1em;
}

.indent2 {
  text-indent: -2em;
  padding-left: 2em;
}

.indent3 {
  text-indent: -3em;
  padding-left: 3em;
}

.indent4 {
  text-indent: -4em;
  padding-left: 4em;
}

/* ====== タッチ端末・スマホ調整 ====== */
@media (hover: none) and (pointer: coarse) {
  .m-lens-container:hover .m-lens {
    display: none !important;
  }

  .m-lens,
  .zoom-area,
  #custom-tooltip {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  .m-lens-container {
    cursor: default;
  }

  img.popup {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .modal-content {
    justify-content: flex-start;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .modal-stage {
    flex: 0 0 auto;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .modal-image-wrap {
    max-width: 94vw;
    max-height: 54dvh;
  }

  .modal-image-wrap>img,
  .modal-stage>img {
    max-width: 94vw;
    max-height: 54dvh;
  }

  .modal-nav {
    width: 88px;
    height: 88px;
    font-size: 40px;
    background: rgba(0, 0, 0, 0.72);
    touch-action: manipulation;
  }

  .modal-prev {
    left: 6px;
  }

  .modal-next {
    right: 6px;
  }

  .modal-info {
    width: 94vw;
    max-height: 28dvh;
    margin-bottom: 0;
    padding: 10px 12px;
    font-size: 14px;
  }
}