/* Kythnos Island Map — styles */
:root {
  --bg: #f7f5f0;
  --ink: #1f2933;
  --ink-soft: #52606d;
  --sea: #2e86ab;
  --sea-deep: #1b4965;
  --sand: #e9dfc9;
  --card: #ffffff;
  --line: #e2ddd2;
  --shadow: 0 6px 24px rgba(27, 73, 101, 0.12);
  --radius: 14px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

body { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ---------- Top bar ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: linear-gradient(100deg, var(--sea-deep), var(--sea));
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 20;
  flex: 0 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand__mark { font-size: 26px; }
.brand__title { font-size: 1.35rem; margin: 0; line-height: 1.1; font-weight: 700; }
.brand__tagline { margin: 0; font-size: 0.8rem; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar__actions { display: flex; align-items: center; gap: 12px; min-width: 0; }

.filters { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; max-width: 60vw; padding: 4px 0; }
.filters::-webkit-scrollbar { height: 0; }
.chip {
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { background: rgba(255, 255, 255, 0.25); }
.chip[aria-pressed="true"] { background: #fff; color: var(--sea-deep); border-color: #fff; font-weight: 600; }
.chip__dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.lang-toggle {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 46px; height: 36px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}
.lang-toggle:hover { background: rgba(255, 255, 255, 0.3); }

/* ---------- Layout ---------- */
.layout { position: relative; flex: 1 1 auto; display: flex; min-height: 0; }
.map { flex: 1 1 auto; min-height: 0; background: #dbe7ee; }

.panel {
  width: 380px;
  max-width: 42vw;
  flex: 0 0 auto;
  background: var(--card);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel__header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel__heading { margin: 0; font-size: 1.05rem; }
.panel__toggle { display: none; border: none; background: none; font-size: 1.1rem; cursor: pointer; color: var(--ink-soft); }

.list { overflow-y: auto; padding: 8px 8px 24px; }

.area-group { margin: 8px 0 4px; }
.area-group__title {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-soft); margin: 14px 8px 6px; font-weight: 700;
}

.place {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; text-align: left;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; padding: 10px 12px; margin: 6px 4px;
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.place:hover { border-color: var(--sea); box-shadow: 0 2px 10px rgba(46,134,171,0.12); }
.place:active { transform: scale(0.997); }
.place.is-active { border-color: var(--sea); box-shadow: 0 2px 12px rgba(46,134,171,0.22); }
.place__dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex: 0 0 auto; }
.place__body { min-width: 0; }
.place__name { font-weight: 600; font-size: 0.98rem; }
.place__meta { font-size: 0.78rem; color: var(--ink-soft); margin-top: 2px; }
.place__nocoord { font-size: 0.72rem; color: #9aa5b1; }

/* ---------- Detail panel ---------- */
.detail {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 380px; max-width: 90vw;
  background: var(--card); border-left: 1px solid var(--line);
  box-shadow: var(--shadow); z-index: 30;
  padding: 18px 18px 28px; overflow-y: auto;
  animation: slidein 0.18s ease;
}
@keyframes slidein { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail__close { position: absolute; top: 10px; right: 12px; border: none; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--ink-soft); }
.detail__cat { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }
.detail__cat .place__dot { width: 10px; height: 10px; }
.detail__name { font-size: 1.4rem; margin: 8px 0 2px; }
.detail__area { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 12px; }
.detail__comment { line-height: 1.55; font-size: 0.96rem; }
.detail__access { margin-top: 14px; background: var(--sand); border-radius: 10px; padding: 10px 12px; font-size: 0.88rem; }
.detail__access strong { display: block; margin-bottom: 2px; }
.detail__links { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.detail__links a { color: var(--sea); font-weight: 600; text-decoration: none; }
.detail__links a:hover { text-decoration: underline; }
.detail__map-btn {
  margin-top: 16px; width: 100%; padding: 10px; border-radius: 10px;
  border: 1px solid var(--sea); background: var(--sea); color: #fff;
  font-weight: 600; cursor: pointer;
}
.detail__map-btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- Status / error overlay ---------- */
.status[hidden],
.detail[hidden] { display: none !important; }
.status {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(247,245,240,0.92); z-index: 40; padding: 24px; text-align: center;
}
.status__box { max-width: 420px; }
.status__box h2 { margin: 0 0 8px; }
.status__box p { color: var(--ink-soft); }
.status__box button { margin-top: 12px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--sea); background: var(--sea); color: #fff; font-weight: 600; cursor: pointer; }

/* Map popup tweaks */
.maplibregl-popup-content { border-radius: 10px; padding: 10px 12px; font-family: inherit; }
.popup__name { font-weight: 700; }
.popup__cat { font-size: 0.78rem; color: var(--ink-soft); }

/* Custom markers */
.marker {
  width: 22px; height: 22px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
}
.marker.is-active { width: 28px; height: 28px; z-index: 5; }

/* ---------- Mobile: bottom sheet ---------- */
@media (max-width: 760px) {
  .brand__tagline { display: none; }
  .filters { max-width: 48vw; }
  .layout { flex-direction: column; }
  .map { flex: 1 1 auto; }
  .panel {
    width: 100%; max-width: 100%;
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 46%; border-left: none; border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(27,73,101,0.16);
    transition: height 0.2s ease;
  }
  .panel.is-collapsed { height: 52px; }
  .panel__toggle { display: block; }
  .detail { width: 100%; max-width: 100%; }
}

.map-degraded .panel { position: static; width: 100%; max-width: 100%; height: auto; flex: 1 1 auto; border-radius: 0; }
.map-degraded .map { display: none; }
