:root {
  --forest: #2f4a3e;
  --forest-dark: #1f332a;
  --moss: #6c8a5f;
  --tea: #c47f3a;
  --bark: #5a4632;
  --cream: #faf6ee;
  --card-bg: #ffffff;
  --ink: #29291f;
  --muted: #7a7a6d;
  --shadow: 0 8px 24px rgba(41, 41, 31, 0.1);
  --shadow-hover: 0 16px 36px rgba(41, 41, 31, 0.18);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

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

h1, h2 {
  font-family: 'Fraunces', Georgia, serif;
  margin: 0;
}

.site-header {
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-dark) 100%);
  color: #fff;
  padding: 28px 32px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  font-size: 2.4rem;
  line-height: 1;
}

.brand h1 {
  font-size: 1.6rem;
  font-weight: 600;
}

.tagline {
  margin: 4px 0 0;
  color: #cfe0d3;
  font-size: 0.9rem;
}

.filters {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #cfe0d3;
}

.field input,
.field select {
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  font-size: 0.95rem;
  font-family: inherit;
  min-width: 220px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--tea);
}

.clear-link {
  color: #f4e3c9;
  font-size: 0.85rem;
  text-decoration: underline;
  padding-bottom: 10px;
}

.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 32px 64px;
}

.hike-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.hike-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hike-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.thumb-button {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  cursor: pointer;
  position: relative;
  background: none;
}

.thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #d9e4d0, #c3d3b8);
}

.thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  color: rgba(47, 74, 62, 0.4);
}

.thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(31, 51, 42, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.thumb-button:hover .thumb-overlay,
.thumb-button:focus-visible .thumb-overlay {
  opacity: 1;
}

.hike-info {
  padding: 16px 18px 20px;
}

.trail-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--forest-dark);
  line-height: 1.3;
  margin-bottom: 10px;
}

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

.badge {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}

.date-badge {
  background: #e7efe2;
  color: var(--forest-dark);
}

.tea-badge {
  background: #f6e6d3;
  color: var(--bark);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.page-link {
  color: var(--forest);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--moss);
  transition: background 0.15s ease;
}

.page-link:hover {
  background: #e7efe2;
}

.page-status {
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.empty-state span {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 20, 0.9);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  width: min(92vw, 1000px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

#lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #111;
}

.lightbox-close {
  position: absolute;
  top: -46px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 2.2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev {
  left: -60px;
}

.lightbox-next {
  right: -60px;
}

.lightbox-caption {
  margin-top: 16px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: #f2ede0;
  gap: 12px;
}

.lightbox-caption strong {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.1rem;
  margin-right: 10px;
}

#lightbox-meta {
  color: #cbcabf;
  font-size: 0.9rem;
}

#lightbox-counter {
  color: #cbcabf;
  font-size: 0.85rem;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
  .lightbox-close { top: -40px; right: 4px; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .field input, .field select { min-width: 160px; }
}
