:root {
  color-scheme: light;
  --ink: #24302c;
  --muted: #66736d;
  --green: #2f6f4e;
  --green-dark: #1f5138;
  --line: #d9ded2;
  --paper: #fffdf7;
  --cream: #f6f0e4;
  --sky: #dcebf0;
  --water: #7eb0bd;
  --accent: #b84f36;
  --shadow: 0 14px 36px #2a33260f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hero,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 24px;
  align-items: stretch;
  min-height: 360px;
  padding: 32px 0 18px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0;
}

.hero h1,
.section-heading h2,
.map-header h2,
.filters h2 {
  margin: 0;
  letter-spacing: 0;
}

.hero h1 {
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  line-height: 1.03;
}

.hero p {
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-photo {
  min-height: 320px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff00 45%, #21352d55),
    url("https://kmc2400.github.io/kamiyama-pages/images/018_2025061900340_enjoy_map_image_22nenshinrinkouen_zentaifukan_.jpg") center / cover;
  box-shadow: var(--shadow);
}

main {
  padding-bottom: 40px;
}

.purpose-section {
  padding: 16px 0 24px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2,
.map-header h2 {
  font-size: 1.35rem;
}

.purpose-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.purpose-card {
  display: grid;
  min-height: 150px;
  padding: 18px;
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px #2a33260a;
}

.purpose-card span {
  font-size: 1.35rem;
  font-weight: 800;
}

.purpose-card small {
  color: var(--muted);
  line-height: 1.6;
}

.purpose-card strong {
  align-self: end;
  color: var(--green);
}

.purpose-card.active {
  color: white;
  background: var(--green);
  border-color: var(--green-dark);
}

.purpose-card.active small,
.purpose-card.active strong {
  color: #ecfff4;
}

.explorer {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.filters,
.map-panel,
.card,
.empty {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filters {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 20px;
  padding: 18px;
}

.filters h2 {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.search-box {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
  border: 1px solid #bfc8be;
  border-radius: 8px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.links a,
.detail-button,
.close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 800;
  background: #eef6ef;
  border: 1px solid #cddfce;
  border-radius: 999px;
}

.chip.active {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.results-panel {
  min-width: 0;
}

.map-panel {
  margin-bottom: 18px;
  overflow: hidden;
}

.map-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

#count {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.map-canvas {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  background:
    linear-gradient(32deg, transparent 0 44%, #ffffff80 44% 47%, transparent 47%),
    linear-gradient(128deg, transparent 0 54%, #ffffff90 54% 57%, transparent 57%),
    radial-gradient(circle at 16% 22%, #f7fbf3 0 10%, transparent 11%),
    radial-gradient(circle at 82% 72%, #e3efe4 0 12%, transparent 13%),
    linear-gradient(110deg, transparent 0 60%, var(--water) 60% 66%, transparent 66%),
    var(--sky);
}

.map-marker {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 190px;
  padding: 7px 9px;
  color: var(--ink);
  background: #fffdf7f2;
  border: 1px solid #c9d4ca;
  border-radius: 999px;
  box-shadow: 0 8px 20px #23362a24;
}

.map-marker span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: white;
  font-weight: 900;
  background: var(--accent);
  border-radius: 50%;
}

.map-marker small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.marker-0 { left: 8%; top: 16%; }
.marker-1 { left: 38%; top: 12%; }
.marker-2 { right: 10%; top: 22%; }
.marker-3 { left: 19%; top: 44%; }
.marker-4 { right: 28%; top: 42%; }
.marker-5 { right: 8%; top: 56%; }
.marker-6 { left: 10%; bottom: 16%; }
.marker-7 { left: 42%; bottom: 20%; }
.marker-8 { right: 14%; bottom: 12%; }
.marker-9 { left: 28%; top: 28%; }
.marker-10 { left: 58%; top: 28%; }
.marker-11 { left: 30%; bottom: 36%; }

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  overflow: hidden;
}

.card img {
  width: 100%;
  height: 190px;
  display: block;
  object-fit: cover;
  background: #d8ded5;
}

.card-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.category {
  margin: 0;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
}

.card h2 {
  margin: 0;
  font-size: 1.16rem;
  line-height: 1.35;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.quick-info {
  display: grid;
  gap: 8px;
  margin: 0;
}

.quick-info div {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #edf0e8;
}

.quick-info dt {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.quick-info dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.detail-button {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.empty {
  padding: 24px;
  color: var(--muted);
  font-weight: 800;
}

.detail-dialog {
  width: min(880px, calc(100% - 24px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 28px 80px #0006;
}

.detail-dialog::backdrop {
  background: #0f191699;
}

.detail-cover {
  position: relative;
}

.detail-cover img {
  display: block;
  width: 100%;
  height: min(360px, 46vh);
  object-fit: cover;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--ink);
  background: #fffdf7e8;
}

.detail-body {
  display: grid;
  gap: 16px;
  padding: 22px;
  background: var(--paper);
}

.detail-body h2 {
  margin: 0;
  font-size: 1.7rem;
}

.lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid section {
  padding: 12px;
  background: #f7f9f3;
  border: 1px solid #e5eadf;
  border-radius: 8px;
}

.detail-grid h3 {
  margin: 0 0 6px;
  font-size: 0.86rem;
}

.detail-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 880px) {
  .hero,
  .explorer {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .hero-photo {
    min-height: 220px;
  }

  .purpose-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    position: static;
  }
}

@media (max-width: 560px) {
  .hero,
  main {
    width: min(100% - 20px, 1180px);
  }

  .purpose-grid,
  .cards,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .map-header {
    display: grid;
  }

  #count {
    white-space: normal;
  }

  .map-canvas {
    min-height: 420px;
  }

  .map-marker {
    max-width: 160px;
  }

  .quick-info div {
    grid-template-columns: 1fr;
  }
}
