* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #1f2a24;
  background: #f5f7f4;
}

.site-header {
  background: #2e5339;
  color: #fff;
  padding: 16px 20px;
  text-align: center;
}

.site-header h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.subtitle {
  margin: 0 0 10px;
  font-size: 0.95rem;
  opacity: 0.9;
}

.trail-select {
  padding: 6px 10px;
  border-radius: 4px;
  border: none;
  font-size: 0.95rem;
  min-width: 220px;
}

.layout {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

#map {
  flex: 1 1 60%;
  min-width: 300px;
  height: 70vh;
}

.places-list {
  flex: 1 1 300px;
  max-width: 380px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
  border-left: 1px solid #ddd;
}

.places-list h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.places-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.places-list li {
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  border-radius: 4px;
}

.places-list li:hover {
  background: #eef4ee;
}

.places-list li .place-km {
  color: #2e5339;
  font-weight: 600;
  margin-right: 6px;
}

/* Modal / gallery */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #555;
  line-height: 1;
}

#modal-title {
  margin: 0 30px 10px 0;
}

#modal-photo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}

#modal-photo {
  max-width: 100%;
  max-height: 60vh;
  display: block;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1rem;
}

.modal-prev {
  left: 8px;
}

.modal-next {
  right: 8px;
}

.photo-counter {
  text-align: center;
  color: #777;
  font-size: 0.85rem;
  margin: 8px 0 0;
}

.site-footer {
  text-align: center;
  padding: 14px;
  color: #777;
  font-size: 0.85rem;
}

@media (max-width: 700px) {
  .layout {
    flex-direction: column;
  }
  #map {
    flex: 0 0 auto;
    height: 55vh;
  }
  .places-list {
    max-width: none;
    max-height: none;
    border-left: none;
    border-top: 1px solid #ddd;
  }
}
