/**
 * Tsubottan Japan Map Styles - 8地域タイル形式
 * 地域別工務店数を表示するインタラクティブな日本地図
 */

.ts-japan-map-container {
  max-width: 750px;
  aspect-ratio: 4 / 4.5;
  margin: 0 auto;
}

.ts-map-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  padding: 2rem;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .ts-map-wrapper {
    padding: 1rem;
  }
}

.ts-japan-map-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.ts-region-tile {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.ts-region-rect {
  transition: all 0.2s ease;
}

.ts-region-tile:hover .ts-region-rect {
  filter: brightness(0.9);
}

.ts-region-name-label,
.ts-region-count-label {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',
    'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  fill: #ffffff;
  text-anchor: middle;
  pointer-events: none;
  user-select: none;
  text-shadow:
    0 1px 4px rgba(0, 0, 0, 0.9),
    0 0 2px rgba(0, 0, 0, 0.8),
    1px 1px 0 rgba(0, 0, 0, 0.5),
    -1px -1px 0 rgba(0, 0, 0, 0.5);
}

.ts-region-name-label {
  font-size: 20px;
  font-weight: 700;
}

.ts-region-count-label {
  font-size: 28px;
  font-weight: 800;
}

.ts-japan-map__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.ts-japan-map__title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 1.5rem;
  margin-top: 0;
}

.ts-japan-map__legend {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.ts-japan-map__legend-text {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',
    'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

@media (max-width: 768px) {
  .ts-japan-map-container {
    aspect-ratio: 1 / 1.3;
  }

  .ts-japan-map__title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .ts-region-name-label {
    font-size: 16px;
  }

  .ts-region-count-label {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .ts-japan-map-container {
    aspect-ratio: 1 / 1.5;
  }

  .ts-japan-map__title {
    font-size: 1.125rem;
  }

  .ts-region-name-label {
    font-size: 14px;
  }

  .ts-region-count-label {
    font-size: 18px;
  }

  .ts-map-wrapper {
    padding: 0.75rem;
  }

  .ts-japan-map__legend-text {
    font-size: 0.75rem;
  }
}

@media (prefers-contrast: high) {
  .ts-region-rect {
    stroke-width: 4;
  }
}

@media print {
  .ts-japan-map-container {
    break-inside: avoid;
  }
}
