@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;500;700&family=Noto+Sans+JP:wght@400;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #c0b566;
  --brand-dark: #a69e52;
  --green-1: #008803;
  --green-2: #d5edbb;
  --green-3: #e9f7d9;
  --green-4: #eff9e3;
  --bg: #f4f5f9;
  --link: #0585e2;
  --text: #333;
  --text-sub: #666;
  --border: #dadada;
  --white: #fff;
  --font-heading: "Zen Maru Gothic", sans-serif;
  --font-body: "Noto Sans JP", sans-serif;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
}

/* ── topbar ── */
.topbar {
  background: var(--brand);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
  position: relative;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  flex-shrink: 0;
}

.brand-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: var(--font-body);
}

.brand-main {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  font-family: var(--font-heading);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  flex: 1;
  max-width: 380px;
}

.search-bar svg {
  color: #999;
  flex-shrink: 0;
}

.search-bar input {
  border: none;
  background: none;
  outline: none;
  font: inherit;
  font-size: 14px;
  width: 100%;
  color: var(--text);
}

.search-bar input::placeholder {
  color: #aaa;
}

/* ── layout ── */
.layout {
  display: flex;
  height: calc(100vh - 60px);
}

/* ── sidebar ── */
.sidebar {
  width: 400px;
  min-width: 400px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--white);
}

.filter-section {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  background: var(--green-4);
}

.filter-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--green-1);
  margin-bottom: 8px;
  font-family: var(--font-heading);
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-buttons button {
  font-family: var(--font-body);
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid #c5c5c5;
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
}

.filter-buttons button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #fdfcf3;
}

.filter-buttons button.active {
  background: var(--brand);
  color: var(--white);
  border-color: var(--brand);
}

.list-header {
  padding: 8px 16px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  color: var(--text-sub);
  background: var(--bg);
}

/* ── card list ── */
.card-list {
  flex: 1;
  overflow-y: auto;
}

.card {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #ececec;
  cursor: pointer;
  transition: background 0.12s;
}

.card:hover {
  background: var(--green-4);
}

.card.active {
  background: var(--green-3);
  border-left: 3px solid var(--green-1);
}

/* ── card thumbnail with hover overlay ── */
.card-thumb-link {
  position: relative;
  display: block;
  width: 130px;
  min-width: 130px;
  height: 110px;
  overflow: hidden;
  flex-shrink: 0;
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #e8e8e8;
  display: block;
}

.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: var(--green-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8cb878;
  font-size: 11px;
  font-family: var(--font-heading);
}

.card-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.card-thumb-link:hover .card-thumb-overlay {
  opacity: 1;
}

.card-thumb-overlay-text {
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-heading);
  padding: 6px 14px;
  border: 1.5px solid rgba(255,255,255,0.8);
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.card-body {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

.card-category {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 2px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-heading);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--white);
  background: var(--green-1);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.empty-msg {
  padding: 40px 16px;
  text-align: center;
  color: #aaa;
  font-size: 14px;
  font-family: var(--font-heading);
}

/* ── map ── */
.map-pane {
  flex: 1;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

/* markers */
.map-marker div {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: transform 0.15s, opacity 0.15s;
}

.has-label .map-marker div,
.has-label > div {
  opacity: 0;
  pointer-events: none;
}

.popup-open .map-marker div,
.popup-open > div {
  opacity: 1;
  pointer-events: auto;
}

/* auto-labels on map (tooltip-based) */
.map-label-tip {
  background: var(--white);
  border: none;
  border-radius: 5px;
  padding: 3px 8px;
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-heading);
  color: var(--text);
  white-space: nowrap;
  box-shadow: 0 1px 5px rgba(0,0,0,0.15);
  pointer-events: auto;
  cursor: pointer;
}

.leaflet-tooltip-right.map-label-tip::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  margin-left: -5px;
  margin-top: -5px;
  border: 5px solid transparent;
  border-right-color: var(--white);
  border-left: 0;
  background: transparent;
}

.leaflet-tooltip-right.map-label-tip {
  margin-left: 0;
  transform: translateY(-50%);
}

/* popup */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
  margin: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  font-family: var(--font-body);
}

.leaflet-popup-content strong {
  font-size: 15px;
  color: var(--text);
  font-family: var(--font-heading);
}

.leaflet-popup-content .popup-cat {
  font-size: 11px;
  font-weight: 600;
}

.leaflet-popup-content a {
  color: var(--link);
  font-weight: 600;
}

/* popup image with hover overlay */
.popup-img-link {
  display: block;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.popup-img-link .popup-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  margin-bottom: 0;
}

.popup-img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.3px;
}

.popup-img-link:hover .popup-img-overlay {
  opacity: 1;
}

/* ── mobile ── */
@media (max-width: 768px) {
  .topbar { height: 52px; }
  .layout {
    flex-direction: column-reverse;
    height: calc(100vh - 52px);
  }
  .sidebar {
    width: 100%;
    min-width: 0;
    height: 45vh;
    border-right: none;
    border-top: 1px solid var(--border);
  }
  .map-pane {
    height: 55vh;
  }
  .search-bar { max-width: none; }
}
