:root {
  --bg: #f2f5ef;
  --surface: #ffffff;
  --ink: #11201b;
  --muted: #5a6c64;
  --accent: #1f7a4a;
  --line: #d6e0d9;
  --shadow: 0 14px 40px rgba(17, 32, 27, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 15% -10%, #dceadf 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 0%, #e9f2e5 0%, transparent 55%),
    var(--bg);
}

.hero {
  padding: 4rem 1.2rem 1.5rem;
}

.hero-content,
.layout {
  max-width: 1100px;
  margin: 0 auto;
}

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

h1 {
  margin: 0.5rem 0 0;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.05;
}

.subhead {
  max-width: 65ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.layout {
  padding: 0 1.2rem 2.2rem;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  margin-left: auto;
  padding: 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: fit-content;
}

.view-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #28493d;
  padding: 0 0.2rem;
}

.view-button {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #1d3b31;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.view-button[aria-pressed="true"] {
  background: #1f7a4a;
  color: #fff;
  border-color: #18663d;
}

.data-tools {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
}

.data-tools summary {
  cursor: pointer;
  font-weight: 700;
  color: #2f4f43;
}

.import-panel {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-top: 0.8rem;
}

.import-panel h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.upload-label {
  display: inline-block;
  margin-top: 0.6rem;
  margin-bottom: 0.4rem;
  font-weight: 700;
}

#csv-upload {
  display: block;
  font: inherit;
}

.export-button {
  display: block;
  margin-top: 0.8rem;
  border: 1px solid #276949;
  background: #2b7a50;
  color: #fff;
  font: inherit;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.import-status {
  min-height: 1.2rem;
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  color: #224b37;
}

.csv-format {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.trip-grid {
  display: grid;
  gap: 1.1rem;
  align-items: stretch;
}

.trip-grid.view-single {
  grid-template-columns: 1fr;
}

.trip-grid.view-double {
  grid-template-columns: 1fr;
}

.card {
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: translateY(10px);
  opacity: 0;
  animation: reveal 450ms ease forwards;
}

.card:nth-child(2) { animation-delay: 100ms; }
.card:nth-child(3) { animation-delay: 180ms; }
.card:nth-child(4) { animation-delay: 260ms; }

.card-content {
  padding: 1rem;
}

.trail-name {
  margin: 0;
  font-size: 1.3rem;
}

.stats {
  margin: 0.8rem 0 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 200px));
  gap: 0.6rem;
}

.stats div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem;
  background: #f8fbf8;
}

dt {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

dd {
  margin: 0.2rem 0 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.block {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.block h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #1e3a31;
}

.block h4 {
  margin: 0.75rem 0 0.4rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #2f4f43;
}

.block p {
  margin: 0;
  color: #263730;
  line-height: 1.45;
}

.text-content {
  margin: 0;
  color: #263730;
  line-height: 1.45;
}

.text-content ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.25rem;
}

.text-content > * + * {
  margin-top: 0.75rem;
}

.trip-links {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.3rem;
}

.trip-links a {
  color: #185e3a;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.map-image {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.gallery img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.zoomable {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(7, 12, 10, 0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 1000;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-image {
  max-width: min(1200px, 96vw);
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

@keyframes reveal {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 200px));
  }
}

@media (max-width: 680px) {
  .hero {
    padding-top: 2.5rem;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1050px) {
  .trip-grid.view-double {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
