/* ==========================================================================
   臺南市民日本友誼市景點優惠互動指南 - 主樣式表 (WCAG 2.1 AA 合規)
   ========================================================================== */

/* 1. 防快閃機制 (Anti-FOUC) */
[v-cloak] {
  display: none !important;
}

/* 2. 基礎全域樣式 */
body {
  background-color: #f8fafc;
  color: #1e293b;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 3. 無障礙螢幕閱讀器與跳過導航 (WCAG 2.4.1 Bypass Blocks) */
.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;
}

.focus\:not-sr-only:focus,
.sr-only:focus {
  position: fixed !important;
  top: 12px !important;
  left: 12px !important;
  z-index: 9999 !important;
  width: auto !important;
  height: auto !important;
  padding: 10px 18px !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
  background-color: #0f172a !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.3) !important;
  border: 2px solid #fb7185 !important;
  outline: 3px solid #be123c !important;
  text-decoration: none !important;
}

/* 4. 鍵盤聚焦高對比外框 (WCAG 2.4.7 Focus Visible & 1.4.11 Non-text Contrast) */
:focus-visible {
  outline: 2px solid #be123c !important;
  outline-offset: 2px !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #be123c !important;
  outline-offset: 2px !important;
}

/* 5. 減少動態效果適配 (WCAG 2.2.2 Pause, Stop, Hide & 2.3.3 Animation from Interactions) */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .animate-pulse-subtle,
  .animate-ping,
  .animate-bounce-short {
    animation: none !important;
  }
}

/* 6. 背景與視覺質感 */
.hero-pattern {
  background-color: #ffffff;
  background-image: radial-gradient(#e2e8f0 0.75px, transparent 0.75px), radial-gradient(#e2e8f0 0.75px, #ffffff 0.75px);
  background-size: 30px 30px;
  background-position: 0 0, 15px 15px;
}

.glass-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.gradient-text {
  background: linear-gradient(135deg, #9f1239 0%, #c2410c 50%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 7. 隱藏捲軸輔助類別 (保持觸控滑動能力) */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 8. 微動畫定義 */
@keyframes pulse-subtle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.animate-pulse-subtle {
  animation: pulse-subtle 2s infinite ease-in-out;
}

/* 9. Leaflet 自訂城市地標標記 (City Pin Markers) */
.city-pin-marker {
  background: none;
  border: none;
}
.city-pin-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 0 0 2px #be123c;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.city-pin-card:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 24px rgba(190, 18, 60, 0.35), 0 0 0 3px #9f1239;
  z-index: 1000 !important;
}
.city-pin-badge {
  background: #be123c;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 9999px;
}

/* 10. Leaflet 自訂景點地標標記 (Spot Pin Markers) */
.spot-pin-wrapper {
  background: none;
  border: none;
}
.spot-map-pin {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.18));
}
.spot-map-pin:hover {
  transform: scale(1.15) translateY(-3px);
  z-index: 1000 !important;
}
.spot-pin-bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #ffffff;
  font-weight: 700;
  font-size: 11px;
  color: #0f172a;
  white-space: nowrap;
  border: 2px solid #0369a1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.spot-map-pin.is-free .spot-pin-bubble {
  border-color: #047857;
  background: #f0fdf4;
  color: #064e3b;
}
.spot-map-pin.is-discount .spot-pin-bubble {
  border-color: #be123c;
  background: #ffffff;
  color: #881337;
}
.spot-pin-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #0369a1;
  margin-top: -1px;
}
.spot-map-pin.is-free .spot-pin-arrow {
  border-top-color: #047857;
}
.spot-map-pin.is-discount .spot-pin-arrow {
  border-top-color: #be123c;
}

/* 11. Leaflet 氣泡彈窗樣式 (Popup Styling) */
.leaflet-popup-content-wrapper {
  background: #ffffff !important;
  color: #1e293b !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}
.leaflet-popup-content {
  margin: 0 !important;
  line-height: 1.5 !important;
}
.leaflet-popup-tip {
  background: #ffffff !important;
}
.leaflet-container {
  font-family: inherit !important;
  background: #f1f5f9 !important;
}

/* 12. 列印模式最佳化 (Print Styles) */
@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
}
