/* Theme — change these to recolor the map */
:root {
  --county-fill:          #2c5f4f;  /* 已有景點縣市的填色 */
  --county-fill-empty:    #9bb3a6;  /* 已建頁面但尚無景點 (淡綠) */
  --county-fill-hover:    #d9534f;  /* 滑鼠移上時的顏色 */
  --county-fill-active:   #d9534f;  /* 目前所在縣市的顏色 */
  --county-fill-disabled: #cdd5db;  /* 完全未開啟頁面 (灰色) */
  --county-stroke:        #ffffff;  /* 縣市邊界線 */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Microsoft JhengHei", sans-serif;
  line-height: 1.7;
  color: #222;
  background: #fafafa;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: #2c5f4f;
  padding: 16px 0;
  margin-bottom: 32px;
}
.site-title {
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  text-decoration: none;
}

/* Hero */
.hero {
  text-align: center;
  padding: 40px 20px 32px;
}
.hero h1 {
  font-size: 36px;
  margin: 0 0 12px;
}
.hero p {
  font-size: 18px;
  color: #666;
  margin: 0;
}

/* Map */
.map-container {
  max-width: 540px;
  margin: 0 auto 24px;
  padding: 16px;
  border-radius: 10px;
  background: #e6eef3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.map-hint {
  text-align: center;
  font-size: 13px;
  color: #557;
  margin: 0 0 12px;
}

/* SVG clickable maps — Taiwan counties / Japan regions / Malaysia states */
.taiwan-svg-map,
.japan-svg-map,
.malaysia-svg-map {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
}
.taiwan-svg-map path,
.japan-svg-map path,
.malaysia-svg-map path {
  stroke: var(--county-stroke);
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 0.15s;
  fill: var(--county-fill-disabled);
}
.taiwan-svg-map .county-disabled,
.japan-svg-map .region-disabled,
.malaysia-svg-map .region-disabled {
  fill: var(--county-fill-disabled);
  cursor: default;
}
.taiwan-svg-map .county-link,
.japan-svg-map .region-link,
.malaysia-svg-map .region-link {
  cursor: pointer;
}
.taiwan-svg-map .county-link path,
.japan-svg-map .region-link path,
.malaysia-svg-map .region-link path {
  fill: var(--county-fill);
}
.taiwan-svg-map .county-link.is-empty path,
.japan-svg-map .region-link.is-empty path,
.malaysia-svg-map .region-link.is-empty path {
  fill: var(--county-fill-empty);
}
.taiwan-svg-map .county-link:hover path,
.taiwan-svg-map .county-link:focus path,
.japan-svg-map .region-link:hover path,
.japan-svg-map .region-link:focus path,
.malaysia-svg-map .region-link:hover path,
.malaysia-svg-map .region-link:focus path {
  fill: var(--county-fill-hover);
}
.taiwan-svg-map .county-link.is-active path,
.taiwan-svg-map .county-disabled.is-active,
.japan-svg-map .region-link.is-active path,
.japan-svg-map .region-disabled.is-active,
.malaysia-svg-map .region-link.is-active path,
.malaysia-svg-map .region-disabled.is-active {
  fill: var(--county-fill-active);
}
.malaysia-svg-map .region-label {
  font-size: 18px;
  font-weight: 600;
  fill: #557;
  text-anchor: middle;
}
.malaysia-svg-map .region-label--group {
  font-size: 22px;
  fill: #345;
}

/* County page */
.county-hero {
  text-align: center;
  padding: 24px 20px 8px;
}
.county-hero h1 {
  margin: 0 0 8px;
  font-size: 32px;
}
.county-hero .lead {
  margin: 0;
  color: #666;
  font-size: 16px;
}
.breadcrumb {
  margin: 0 0 12px;
  font-size: 14px;
}
.breadcrumb a {
  color: #2c5f4f;
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}

.county-map-wrap {
  display: flex;
  justify-content: center;
  margin: 0 auto 32px;
  max-width: 900px;
}
.county-map-wrap .county-map {
  width: 100%;
  max-width: 600px;
}
.county-map {
  background: #e6eef3;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.county-map h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #557;
  text-align: center;
}
.county-map--overview .taiwan-svg-map,
.county-map--overview .japan-svg-map,
.county-map--overview .malaysia-svg-map {
  max-height: 320px;
}
.county-map .japan-svg-map,
.county-map .malaysia-svg-map {
  max-height: 420px;
}
.county-content {
  max-width: 700px;
  margin: 0 auto 24px;
  padding: 0 20px;
}
.empty-msg {
  text-align: center;
  color: #888;
  font-style: italic;
  grid-column: 1 / -1;
  padding: 24px;
}

@media (max-width: 720px) {
  .county-map-wrap .county-map {
    max-width: 100%;
  }
}

.section-title {
  text-align: center;
  margin: 40px 0 0;
  font-size: 22px;
  color: #555;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 20px 0 60px;
}

.card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.card img {
  width: 100%;
  height: 240px;
  object-fit: contain;
  background: #f4f4f4;
}
.card-body {
  padding: 16px 20px 20px;
}
.card h2 {
  font-size: 20px;
  margin: 0 0 8px;
}

.meta {
  color: #888;
  font-size: 14px;
  margin: 4px 0 8px;
}

/* Attraction page */
.attraction {
  background: #fff;
  padding: 32px 40px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  margin-bottom: 40px;
}
.attraction h1 {
  margin-top: 0;
  font-size: 32px;
}
.attraction .cover {
  display: block;
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  margin: 16px auto 24px;
  border-radius: 8px;
}
.attraction .content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 12px 0;
}
.attraction .content h2 {
  margin-top: 28px;
}

/* Footer */
.site-footer {
  text-align: center;
  color: #888;
  padding: 24px 0;
  border-top: 1px solid #e5e5e5;
  margin-top: 40px;
}
.site-footer .attribution {
  font-size: 12px;
  color: #aaa;
  margin: 4px 0 0;
}
.site-footer .attribution a {
  color: #888;
}

/* Login */
.login {
  max-width: 360px;
  margin: 60px auto;
  padding: 32px 28px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  text-align: center;
}
.login h1 {
  font-size: 24px;
  margin: 0 0 8px;
  color: #2c5f4f;
}
.login-hint {
  margin: 0 0 24px;
  color: #777;
  font-size: 14px;
}
#login-form input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 12px;
}
#login-form input[type="password"]:focus {
  outline: none;
  border-color: #2c5f4f;
}
#login-form button {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  background: #2c5f4f;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
#login-form button:hover {
  background: #234a3e;
}
.login-error {
  color: #d9534f;
  font-size: 14px;
  margin: 12px 0 0;
}

/* Country selector grid (/HomePage/) */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 16px auto 60px;
  padding: 0 20px;
}
.country-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 20px;
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: #222;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  border-top: 6px solid #2c5f4f;
}
.country-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.country-card h2 {
  margin: 0;
  font-size: 24px;
}
.country-card p {
  margin: 0;
  color: #888;
  font-size: 14px;
}
.country-card__flag {
  font-size: 56px;
  line-height: 1;
}
.country-card--tw { border-top-color: #2c5f4f; }
.country-card--jp { border-top-color: #bc002d; }
.country-card--my { border-top-color: #cc0001; }

/* Region / state grid (Malaysia) */
.region-grid-section {
  margin-bottom: 20px;
}
.region-grid-section__title {
  margin: 0 0 10px;
  font-size: 14px;
  color: #557;
  text-align: center;
}
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}
.region-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 12px 10px;
  border-radius: 8px;
  background: var(--county-fill);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.15s, transform 0.15s;
}
.region-tile:hover,
.region-tile:focus {
  background: var(--county-fill-hover);
  transform: translateY(-1px);
}
.region-tile.is-empty {
  background: var(--county-fill-empty);
}
.region-tile.is-active {
  background: var(--county-fill-active);
}
.region-tile--disabled {
  background: var(--county-fill-disabled);
  color: #555;
  cursor: default;
}
.region-tile--disabled:hover {
  background: var(--county-fill-disabled);
  transform: none;
}
.region-tile__count {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
}

/* Tablet/mobile */
@media (max-width: 600px) {
  .hero h1 { font-size: 28px; }
  .attraction { padding: 24px 20px; }
  .country-card { padding: 24px 16px; }
  .country-card__flag { font-size: 44px; }
}
