/* ── 暮らしの中の阪和 — Interactive Map ── */

/* ── Map container ── */
.hanwa-map-outer {
  position: relative;
  background: #fff;
}

/* Desktop: full SVG visible */
.hanwa-map-scroll {
  width: 100%;
  overflow: visible;
}

.hanwa-map-inner {
  width: 100%;
  overflow: hidden;
}

.hanwa-map-inner svg {
  width: 100%;
  height: auto;
  display: block;
  transform: scale(1.006);
}

/* Mobile: SVG is 3× viewport width, centre third visible by default.
   JS scrolls to centre on load. User scrolls left/right to see other thirds. */
@media (max-width: 640px) {
  .hanwa-map-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Snap to thirds for clean UX */
    scroll-snap-type: x mandatory;
  }
  .hanwa-map-scroll::-webkit-scrollbar { display: none; }

  .hanwa-map-inner {
    /* SVG total width = 3× the viewport = shows exactly 1/3 at a time */
    width: calc(300vw);
    min-width: 900px; /* floor for very small devices */
    flex-shrink: 0;
  }

  .hanwa-map-inner svg {
    width: 100%;
    height: auto;
    display: block;
  }
}

/* Scroll hint — mobile only */
.hanwa-scroll-hint {
  display: none;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  padding: 8px 0;
  margin: 0;
  background-color: #252f3f;
}

@media (max-width: 640px) {
  .hanwa-scroll-hint { display: flex; }
}

/* ── Interactive layers ── */
.interactive-layer {
  cursor: pointer;
  outline: none;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.interactive-layer:hover,
.interactive-layer:focus-visible {
  opacity: 0.92;
  filter: drop-shadow(0 0 6px #009e42);
}

.interactive-layer.is-active {
  filter: drop-shadow(0 0 10px #009e42) drop-shadow(0 0 4px #009e42);
}

/* ── Scrollbar-gutter mask (fills the gap left by the hidden scrollbar) ── */
.hanwa-scrollbar-gutter {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 0;
  background: #2c2c2c;
  z-index: 1002;
  pointer-events: none;
}

/* ── Modal backdrop ── */
.hanwa-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.hanwa-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Modal ── */
.hanwa-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  z-index: 1001;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 16px 24px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  scrollbar-width: thin;
}

.hanwa-modal.is-open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%);
}

/* Mobile: slide up from bottom */
@media (max-width: 640px) {
  .hanwa-modal {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 80vh;
    border-radius: 16px 16px 0 0;
    padding: 16px 16px 24px;
    transform: translateY(20px);
  }

  .hanwa-modal.is-open {
    transform: translateY(0);
  }
}

/* Close button */
.hanwa-modal-close {
  position: absolute;
  top: 17px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #009e42;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.hanwa-modal-close:hover {
  background: #82c997;
}

@media (max-width: 640px) {
  .hanwa-modal-close {
    top: 15px;
  }
}

/* Title */
.hanwa-modal-title {
  font-size: 24px;
  font-weight: 500;
  color: #252f3f;
  margin: 0 0 16px;
  line-height: 1.4;
  padding-right: 24px;
}

@media (max-width: 640px) {
  .hanwa-modal-title {
    font-size: 20px;
    padding-right: 32px;
  }
}

/* Image */
.hanwa-modal-image-wrap {
  overflow: hidden;
  margin: 0 0 8px;
  aspect-ratio: 16/9;
  background: #fff;
}

.hanwa-modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Top-level description — hidden (description is now per-item) */
.hanwa-modal-desc { display: none; }

/* Items container */
.hanwa-modal-links {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Each item: description + link */
.hanwa-modal-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d2d6dc;
}

.hanwa-modal-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Per-item description */
.hanwa-modal-item-desc {
  font-size: 16px;
  line-height: 1.8;
  color: #252f3f;
  margin: 0;
}

@media (max-width: 640px) {
  .hanwa-modal-item-desc {
    font-size: 14px;
  }
}

/* Each link */
.hanwa-modal-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #009e42;
  background: transparent;
  border: 2px solid #009e42;
  border-radius: 8px;
  padding: 6px 16px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .hanwa-modal-link {
    font-size: 15px;
  }
}

.hanwa-modal-link:hover,
.hanwa-modal-link:focus-visible {
  background: #009e42;
  color: #fff;
}

.hanwa-modal-link:focus-visible {
  outline: 2px solid #009e42;
  outline-offset: 2px;
}

.hanwa-modal-link svg {
  flex-shrink: 0;
  margin-left: auto;
}
