/* Glossary underline + mobile-friendly bottom sheet */

.hazu-hd-glossary-term {
  display: inline-block;
  padding: 0 2px;
  border-radius: 3px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-skip-ink: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0,0,0,0.12);
}


.hazu-hd-glossary-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.hazu-hd-glossary-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  background: #fff;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
  max-height: 75vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: translateY(18px);
  transition: transform 180ms ease, opacity 180ms ease;
}

.hazu-hd-glossary-sheet-inner {
  padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
}

.hazu-hd-glossary-sheet-handle {
  width: 52px;
  height: 5px;
  border-radius: 999px;
  background: #ddd;
  margin: 8px auto 12px;
}

.hazu-hd-glossary-sheet-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.3;
}

.hazu-hd-glossary-sheet-sub {
  font-size: 12px;
  color: #666;
  margin: 0 0 10px;
}

.hazu-hd-glossary-sheet-desc {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}

.hazu-hd-glossary-sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.hazu-hd-glossary-sheet-actions a,
.hazu-hd-glossary-sheet-actions button {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #f7f7f7;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
}

.hazu-hd-glossary-sheet-close {
  margin-left: auto;
}


.hazu-hd-glossary-sheet-actions a:focus-visible,
.hazu-hd-glossary-sheet-actions button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@media (min-width: 1024px) {
  /* On PC, make it feel like a small modal instead of full-width */
  .hazu-hd-glossary-sheet {
    left: 50%;
    transform: translateX(-50%);
    width: 520px;
    border-radius: 16px;
    bottom: 20px;
    max-height: 70vh;
  }
}


.hazu-hd-glossary-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.hazu-hd-glossary-overlay.is-closing {
  opacity: 0;
}

.hazu-hd-glossary-sheet.is-open {
  opacity: 1;
  transform: translateY(0);
}

.hazu-hd-glossary-sheet.is-closing {
  opacity: 0;
  transform: translateY(18px);
}

@media (prefers-reduced-motion: reduce) {
  .hazu-hd-glossary-overlay,
  .hazu-hd-glossary-sheet {
    transition: none;
  }
}
