:root {
  --color-navy: #1a2332;
  --color-tan: #c9a96e;
  --color-olive: #4a5c3a;
  --color-cream: #f5f0e8;
  --color-amber: #d4922a;
  --text-on-dark: #f5f0e8;
  --text-on-light: #1a1a1a;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'DM Sans', var(--font-sans);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
}

/* Map page app shell */
body.map-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* GoodWater wordmark lockup - name + rule + tagline.
   Rule width matches the tagline via flex column + stretch on
   .wordmark-underline (the tagline's nowrap width sets the column's
   intrinsic width, the rule then stretches to fill it). */
.wordmark {
  display: inline-flex;
  flex-direction: column;
  font-family: var(--font-display);
  max-width: 100%;
}

.wordmark-name {
  font-weight: 700;
  color: var(--color-amber);
  line-height: 1;
  white-space: nowrap;
}

.wordmark-underline {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 6px;
  overflow: hidden;
}

.wordmark-rule {
  height: 1.5px;
  background: var(--color-cream);
  margin-bottom: 6px;
  flex-shrink: 0;
}

.wordmark-tagline {
  font-weight: 400;
  font-size: 11px;
  color: var(--color-cream);
  letter-spacing: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Top navbar - mobile only; the sidebar replaces it on wider screens */
#navbar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  background: var(--color-navy);
  color: var(--color-cream);
  padding: 12px 14px;
  z-index: 6;
}

.navbar-wordmark {
  grid-column: 2;
  justify-self: center;
}

.navbar-wordmark .wordmark-name {
  font-size: 17px;
}

.navbar-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: 13px;
}

.navbar-actions .username-display {
  white-space: nowrap;
}

.navbar-actions a,
.navbar-actions button {
  border: 1px solid rgba(201, 169, 110, 0.5);
  background: transparent;
  color: var(--color-cream);
  border-radius: 14px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.navbar-actions .nav-help-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  color: var(--color-tan);
  font-weight: 700;
}

/* Bottom tab bar - mobile only */
.bottom-tabs {
  display: none;
}

@media (max-width: 768px) {
  .bottom-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--color-navy);
    border-top: 1px solid var(--color-tan);
    z-index: 6;
  }

  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }
}

.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: rgba(245, 240, 232, 0.55);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}

.bottom-tab svg {
  width: 22px;
  height: 22px;
}

.bottom-tab.active {
  color: var(--color-amber);
}

/* Left sidebar - sits below the hero, beside the page content, on wider screens */
.sidebar {
  display: none;
}

/* The hero is always full-width at the top; the sidebar and page content
   form a row below it (a column on narrow screens, where the sidebar
   is replaced by the top navbar / bottom tab bar). */
.page-body {
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

@media (min-width: 769px) {
  #navbar {
    display: none;
  }

  .page-body {
    flex-direction: row;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    width: 200px;
    flex-shrink: 0;
    background: var(--color-navy);
    color: var(--color-cream);
  }
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  color: var(--color-cream);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-left: 3px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-nav-item:hover {
  background: rgba(245, 240, 232, 0.08);
}

.sidebar-nav-item.active {
  color: var(--color-amber);
  border-left-color: var(--color-tan);
  background: rgba(245, 240, 232, 0.05);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px 24px;
  border-top: 1px solid rgba(201, 169, 110, 0.3);
}

.sidebar-footer .username-display {
  display: block;
  font-size: 12px;
  color: var(--color-cream);
  margin-bottom: 8px;
  word-break: break-word;
}

.sidebar-footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-footer-links a,
.sidebar-footer-links .logout-btn {
  font-size: 12px;
  color: var(--color-tan);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.sidebar-footer-links a:hover,
.sidebar-footer-links .logout-btn:hover {
  color: var(--color-amber);
}

/* On the map page, .page-body fills all remaining space below the hero,
   and .page-content (right of the sidebar) becomes a column flex
   container so #map-container can fill the remaining height. */
body.map-body .page-body {
  flex: 1;
  min-height: 0;
}

body.map-body .page-content {
  display: flex;
  flex-direction: column;
}

/* Map fills all remaining space below the filter bar */
#map-container {
  position: relative;
  flex: 1;
  min-height: 0;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

#controls {
  position: absolute;
  bottom: 24px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 5;
}

#controls button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--color-tan);
  background: var(--color-navy);
  font-size: 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#controls button:active {
  transform: scale(0.95);
}

/* Place search - top-right of the map, below the filter bar */
.search-bar {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  max-width: calc(100% - 32px);
}

.search-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--color-tan);
  background: var(--color-navy);
  color: var(--text-on-dark);
  font-size: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-toggle:active {
  transform: scale(0.95);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-navy);
  border: 2px solid var(--color-tan);
  border-radius: 22px;
  padding: 0 12px;
  height: 44px;
  width: 260px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.search-box-icon {
  font-size: 14px;
  color: var(--color-tan);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  color: var(--text-on-dark);
  font-family: var(--font-sans);
  font-size: 14px;
}

.search-input::placeholder {
  color: rgba(245, 240, 232, 0.5);
}

.search-input:focus {
  outline: none;
}

.search-clear {
  border: none;
  background: none;
  color: rgba(245, 240, 232, 0.6);
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px;
  line-height: 1;
}

.search-clear:hover {
  color: var(--color-cream);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--color-cream);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(201, 169, 110, 0.4);
}

.search-result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid rgba(26, 35, 50, 0.08);
  background: none;
  cursor: pointer;
  font-family: var(--font-sans);
}

.search-result:last-child {
  border-bottom: none;
}

.search-result:hover,
.search-result.active {
  background: rgba(201, 169, 110, 0.2);
}

.search-result-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-navy);
}

.search-result-context {
  display: block;
  font-size: 12px;
  color: rgba(26, 35, 50, 0.6);
  margin-top: 2px;
}

.search-empty {
  padding: 10px 14px;
  font-size: 13px;
  color: rgba(26, 35, 50, 0.6);
}

/* Map style / 3D terrain / public land toggle panel - top-right, below place search */
.map-tools {
  position: absolute;
  top: 64px;
  right: 16px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.map-tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-navy);
  border: 2px solid var(--color-tan);
  border-radius: 20px;
  color: var(--color-cream);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 8px 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  white-space: nowrap;
}

.map-tool-btn:active {
  transform: scale(0.96);
}

.map-tool-btn.active {
  background: var(--color-tan);
  color: var(--color-navy);
}

/* Mobile: collapse to a single icon button that expands into the input */
@media (max-width: 640px) {
  .map-tools {
    top: 60px;
  }

  .map-tool-btn {
    font-size: 12px;
    padding: 7px 10px;
  }

  .search-toggle {
    display: flex;
  }

  .search-box {
    display: none;
  }

  .search-bar.expanded .search-toggle {
    display: none;
  }

  .search-bar.expanded .search-box {
    display: flex;
    width: min(70vw, 280px);
  }

  .search-results,
  .search-bar.expanded .search-results {
    width: min(70vw, 280px);
  }
}

/* Pin markers on the map
   NOTE: do not set `position`, `top`, `left`, or `transform` on .pin-marker -
   Mapbox's `.mapboxgl-marker` class sets `position: absolute` on this exact
   element and drives it with an inline `transform: translate()` that tracks
   the map on every pan/zoom. Overriding `position` here wins the cascade
   (loaded after mapbox-gl.css) and breaks that tracking. All visual styling
   lives on the inner .pin-marker-icon instead. */
.pin-marker {
  width: 34px;
  height: 34px;
  cursor: pointer;
}

/* Pins the current user (or admin) can drag to reposition */
.pin-marker-movable {
  cursor: grab;
}

.pin-marker-movable:active {
  cursor: grabbing;
}

.pin-marker-icon {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.pin-shared-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-tan);
  border: 1px solid white;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
}

.pin-marker-temp {
  /* NOTE: do not set `position` here - Mapbox's own `.mapboxgl-marker`
     class sets `position: absolute` on this same element and uses it as
     the containing block for drag/positioning transforms. Our stylesheet
     loads after mapbox-gl.css, so overriding `position` here would win
     the cascade and break Mapbox's positioning. */
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(201, 169, 110, 0.4);
  border: 3px solid var(--color-tan);
  cursor: grab;
  pointer-events: auto;
  /* Keep the marker above #pin-form-overlay (z-index: 10) so the form
     sheet can never sit on top of it and intercept drag events. */
  z-index: 20;
}

/* Pulse lives on a pseudo-element so its `transform: scale()` animation
   doesn't fight the `transform: translate()` Mapbox sets directly on this
   element to position/drag the marker. */
.pin-marker-temp::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 3px solid var(--color-tan);
  animation: pulse 1.2s infinite;
  pointer-events: none;
}

.pin-marker-temp:active {
  cursor: grabbing;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 1; }
  70% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(0.8); opacity: 0; }
}

/* Pin creation form + Log a Visit form (same bottom-sheet treatment) */
#pin-form-overlay,
#visit-form-overlay {
  position: fixed;
  /* No `top`, so this box is only as tall as the sheet itself - it does
     NOT span the full viewport/map. The map stays fully visible and
     interactive everywhere else (for dragging the placement marker). */
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

#pin-form-overlay.hidden,
#visit-form-overlay.hidden {
  display: none;
}

@media (min-width: 769px) {
  #pin-form-overlay,
  #visit-form-overlay {
    left: 200px;
  }
}

#pin-form,
#visit-form {
  background: var(--color-navy);
  color: var(--color-cream);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  border-top: 2px solid var(--color-tan);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
  padding: 20px;
  pointer-events: auto;
}

#pin-form h2,
#visit-form h2 {
  margin: 0 0 12px 0;
  font-family: var(--font-serif);
  font-weight: normal;
  color: var(--color-cream);
}

.pin-coords {
  font-family: monospace;
  font-size: 12px;
  color: var(--color-tan);
  margin: -6px 0 14px 0;
}

#pin-form label,
#visit-form label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-cream);
}

#pin-form input,
#pin-form textarea,
#visit-form input,
#visit-form textarea,
#visit-form select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid rgba(201, 169, 110, 0.4);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  background: rgba(245, 240, 232, 0.06);
  color: var(--color-cream);
}

#pin-form input::placeholder,
#pin-form textarea::placeholder,
#visit-form input::placeholder,
#visit-form textarea::placeholder {
  color: rgba(245, 240, 232, 0.4);
}

#visit-form select option {
  color: var(--text-on-light);
}

#type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: rgba(245, 240, 232, 0.06);
  cursor: pointer;
  font-size: 12px;
  color: var(--color-cream);
}

.type-btn .type-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
}

.type-btn.selected {
  border-color: var(--color-tan);
  background: rgba(201, 169, 110, 0.15);
}

#fishing-fields.hidden {
  display: none;
}

#photos-field.hidden,
#notes-field.hidden,
#rating-field.hidden,
#visit-new-trip-field.hidden {
  display: none;
}

#star-rating,
#visit-star-rating {
  font-size: 28px;
  cursor: pointer;
  margin-top: 4px;
}

#star-rating .star,
#visit-star-rating .star {
  color: rgba(245, 240, 232, 0.25);
}

#star-rating .star.filled,
#visit-star-rating .star.filled {
  color: var(--color-tan);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.form-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--color-tan);
  color: var(--color-navy);
}

.btn-secondary {
  background: #eee;
  color: #333;
}

/* Cancel button on the dark pin-creation / visit forms needs a lighter treatment */
#pin-form .btn-secondary,
#visit-form .btn-secondary {
  background: rgba(245, 240, 232, 0.1);
  color: var(--color-cream);
  border: 1px solid rgba(201, 169, 110, 0.4);
}

/* Pin detail popups */
.mapboxgl-popup-content {
  font-family: inherit;
  max-width: 320px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--color-navy);
  color: var(--color-cream);
  border-radius: 10px;
  border: 1px solid rgba(201, 169, 110, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.mapboxgl-popup-close-button {
  color: var(--color-cream);
  font-size: 16px;
}

/* Match the popup's little pointer to the navy background for every anchor side */
.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip {
  border-top-color: var(--color-navy);
}

.mapboxgl-popup-anchor-top .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip,
.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip {
  border-bottom-color: var(--color-navy);
}

.mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
  border-right-color: var(--color-navy);
}

.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
  border-left-color: var(--color-navy);
}

.pin-popup h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  color: var(--color-cream);
}

.pin-popup .pin-meta {
  font-size: 12px;
  color: rgba(245, 240, 232, 0.6);
  margin-bottom: 6px;
}

.pin-share-toggle {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid rgba(201, 169, 110, 0.4);
  border-radius: 8px;
  background: rgba(201, 169, 110, 0.12);
  color: var(--color-tan);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pin-popup .pin-extra {
  font-size: 13px;
  margin-top: 6px;
  color: rgba(245, 240, 232, 0.85);
}

.pin-popup .pin-description {
  font-size: 13px;
  margin-top: 6px;
  color: rgba(245, 240, 232, 0.85);
  white-space: pre-wrap;
}

.pin-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pin-photo-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(201, 169, 110, 0.4);
}

.pin-navigate {
  display: block;
  text-align: center;
  margin-top: 10px;
  padding: 8px;
  border-radius: 8px;
  background: var(--color-tan);
  color: var(--color-navy);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.pin-popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.pin-edit-btn,
.pin-delete-btn {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pin-edit-btn {
  border: 1px solid rgba(201, 169, 110, 0.4);
  background: rgba(201, 169, 110, 0.12);
  color: var(--color-tan);
}

.pin-delete-btn {
  border: 1px solid rgba(198, 40, 40, 0.4);
  background: rgba(198, 40, 40, 0.12);
  color: #e57373;
}

/* "Log a Visit" call-to-action in the pin popup */
.log-visit-btn {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--color-tan);
  color: var(--color-navy);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

/* Visit history list */
.visit-history-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.55);
  margin: 12px 0 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(201, 169, 110, 0.25);
}

.visit-empty {
  font-size: 13px;
  color: rgba(245, 240, 232, 0.55);
  font-style: italic;
}

/* Empty-state shown in the pin popup when a place has no logged visits yet */
.visit-empty-state {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(201, 169, 110, 0.25);
  text-align: center;
}

.visit-empty-state p {
  font-size: 13px;
  font-style: italic;
  color: rgba(245, 240, 232, 0.75);
  margin: 0 0 8px;
}

.visit-empty-state .log-visit-btn {
  margin: 0;
}

.visit-card {
  border: 1px solid rgba(201, 169, 110, 0.25);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  background: rgba(245, 240, 232, 0.04);
}

.visit-card:last-child {
  margin-bottom: 0;
}

.visit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: rgba(245, 240, 232, 0.6);
  margin-bottom: 4px;
}

.visit-card-date {
  font-weight: 700;
  color: var(--color-cream);
}

.visit-card-trip {
  font-size: 12px;
  color: var(--color-tan);
  margin-bottom: 4px;
}

.visit-card-rating {
  color: var(--color-tan);
  font-size: 14px;
  margin-bottom: 4px;
}

.visit-card-note {
  font-size: 14px;
  white-space: pre-wrap;
  color: var(--color-cream);
  margin-bottom: 4px;
}

.visit-card-conditions {
  font-size: 13px;
  color: rgba(245, 240, 232, 0.8);
  margin-bottom: 4px;
}

.visit-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.visit-card-actions button {
  flex: 1;
  padding: 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.visit-edit-btn {
  border: 1px solid rgba(201, 169, 110, 0.4);
  background: rgba(201, 169, 110, 0.12);
  color: var(--color-tan);
}

.visit-delete-btn {
  border: 1px solid rgba(198, 40, 40, 0.4);
  background: rgba(198, 40, 40, 0.12);
  color: #e57373;
}

#pin-form input[type="file"] {
  border: none;
  padding: 8px 0;
}

.hidden {
  display: none;
}

/* Login page */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--color-navy);
}

.login-box {
  background: rgba(245, 240, 232, 0.04);
  border: 1px solid rgba(201, 169, 110, 0.3);
  width: 90%;
  max-width: 360px;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.login-box h1 {
  text-align: center;
  margin: 0 0 20px 0;
  font-family: var(--font-serif);
  font-weight: normal;
  color: var(--color-cream);
}

.login-box label {
  display: block;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-cream);
}

.login-box input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid rgba(201, 169, 110, 0.4);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  background: rgba(245, 240, 232, 0.06);
  color: var(--color-cream);
}

.login-box input::placeholder {
  color: rgba(245, 240, 232, 0.4);
}

.login-error {
  color: #ff8a80;
  font-size: 14px;
  margin-bottom: 12px;
}

/* Filter bar - integrated below the navbar, toggles pin types on/off */
#filter-bar {
  flex-shrink: 0;
  display: flex;
  gap: 16px;
  background: var(--color-navy);
  border-top: 1px solid rgba(201, 169, 110, 0.2);
  padding: 8px 14px 10px;
  overflow-x: auto;
  z-index: 6;
}

.filter-btn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.15s;
}

.filter-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid rgba(245, 240, 232, 0.25);
}

.filter-label {
  font-size: 10px;
  color: rgba(245, 240, 232, 0.75);
  white-space: nowrap;
}

.filter-btn:not(.active) {
  opacity: 0.3;
}

/* Admin page */
.admin-body {
  background: #f2f2f2;
  min-height: 100%;
}

.admin-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

.admin-section {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.admin-section h2 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.new-invite {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.new-invite.hidden {
  display: none;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-row {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px;
}

.admin-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-row-meta {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.admin-badge {
  background: #007aff;
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.admin-empty {
  color: #888;
  font-size: 14px;
  margin: 0;
}

.maintenance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.maintenance-status {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.maintenance-status.off {
  background: rgba(74, 92, 58, 0.15);
  color: var(--color-olive);
}

.maintenance-status.on {
  background: rgba(212, 146, 42, 0.18);
  color: var(--color-amber);
}

.invite-link-input,
#new-invite-link {
  flex: 1;
  min-width: 0;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

/* Signup page */
.login-box p {
  font-size: 14px;
  color: rgba(245, 240, 232, 0.75);
}

/* Landing page (logged-out splash) */
.landing-body {
  margin: 0;
}

.landing-hero {
  position: relative;
  min-height: 100vh;
  width: 100%;
  background-color: var(--color-navy);
  background-image: url('/images/zack-smith-kSxzRXZJrag-unsplash.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26, 35, 50, 0.15) 0%, rgba(26, 35, 50, 0.45) 100%);
}

.landing-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
  max-width: 90%;
}

.landing-content .wordmark {
  align-items: center;
  margin-bottom: 40px;
}

.landing-content .wordmark-name {
  font-size: clamp(3rem, 13vw, 5.5rem);
}

.landing-content .wordmark-underline {
  margin-top: 10px;
}

.landing-content .wordmark-rule {
  margin-bottom: 10px;
}

.landing-content .wordmark-tagline {
  font-size: clamp(0.85rem, 2.6vw, 1.15rem);
  letter-spacing: 5px;
}

.landing-login-btn {
  display: inline-block;
  background: var(--color-tan);
  color: var(--color-navy);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  padding: 14px 44px;
  border-radius: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.15s;
}

.maintenance-message {
  margin: 0;
  color: var(--text-on-dark);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 3vw, 1.25rem);
  letter-spacing: 0.02em;
  max-width: 32ch;
}

.maintenance-submessage {
  margin: 12px 0 0;
  color: rgba(245, 240, 232, 0.65);
  font-family: var(--font-sans);
  font-size: clamp(0.8rem, 2.2vw, 0.95rem);
  letter-spacing: 0.02em;
  max-width: 32ch;
}

.landing-login-btn:active {
  opacity: 0.85;
}

/* Home page (logged-in landing) */
.home-body {
  background: var(--color-cream);
  color: var(--text-on-light);
  min-height: 100%;
}

/* Page hero - full-width image strip below the navbar on every page,
   with a dark overlay and centered title (or the wordmark on Home) */
.page-hero {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  height: 120px;
  background-color: var(--color-navy);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .page-hero {
    height: 220px;
  }
}

/* The hero spans the full viewport width, but the page content beside it
   is offset by the 200px sidebar. Pad the hero's content area to match so
   its centered title/wordmark lines up with the content below. */
@media (min-width: 769px) {
  .page-hero {
    padding-left: 200px;
  }
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26, 35, 50, 0.35) 0%, rgba(26, 35, 50, 0.75) 100%);
}

.page-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 16px 24px;
  max-width: 90%;
}

.page-hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 4vw, 2rem);
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--color-cream);
  margin: 18px 0 0;
}

.page-hero-content .wordmark {
  align-items: center;
  margin: 0 auto;
}

.page-hero-content .wordmark-name {
  font-size: clamp(1.6rem, 6vw, 2.6rem);
}

/* Home page hero wordmark is the page's centerpiece - shown 50% larger
   than the default, with the rule/tagline scaled to match. */
.page-hero--home .wordmark-name {
  font-size: clamp(2.4rem, 9vw, 3.9rem);
}

.page-hero--home .wordmark-underline {
  margin-top: 9px;
}

.page-hero--home .wordmark-rule {
  height: 2.25px;
  margin-bottom: 9px;
}

.page-hero--home .wordmark-tagline {
  font-size: 16.5px;
  letter-spacing: 6px;
}

/* Sub-pages show a smaller wordmark with the page title below it */
.page-hero-content--with-title .wordmark-name {
  font-size: clamp(1.3rem, 5vw, 2.2rem);
}

/* Each page uses its own hero image to give the section its own feel */
.page-hero--home {
  background-image: url('/images/anton-volnuhin-DmfCQJAkbZU-unsplash.jpg');
  height: 250px;
}

@media (min-width: 768px) {
  .page-hero--home {
    height: 440px;
  }
}

.page-hero--map {
  background-image: url('/images/steve-adams-xSunG7wLrDU-unsplash.jpg');
}

.page-hero--trips {
  background-image: url('/images/manuel-meurisse-RlXU6DiifBg-unsplash.jpg');
  background-position: center 70%;
}

.page-hero--conditions {
  background-image: url('/images/zack-smith-kSxzRXZJrag-unsplash.jpg');
}

.page-hero--admin {
  background-image: url('/images/anton-volnuhin-DmfCQJAkbZU-unsplash.jpg');
}

.page-hero--how-it-works {
  background-image: url('/images/steve-adams-xSunG7wLrDU-unsplash.jpg');
}

.page-hero--visit {
  background-image: url('/images/zack-smith-kSxzRXZJrag-unsplash.jpg');
}

.page-hero--guides {
  background-image: url('/images/manuel-meurisse-RlXU6DiifBg-unsplash.jpg');
}

/* First-login welcome banner */
.welcome-banner {
  background: var(--color-navy);
  color: var(--text-on-dark);
  border-bottom: 2px solid var(--color-tan);
  padding: 18px 20px;
}

.welcome-banner-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.welcome-banner-text {
  flex: 1;
  min-width: 240px;
}

.welcome-banner-text p {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.6;
}

.welcome-banner-link {
  color: var(--color-tan);
  font-weight: 600;
  font-size: 13px;
  text-decoration: underline;
}

.welcome-banner .btn-primary {
  flex-shrink: 0;
}

/* Home page content sections */
.home-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}

/* Home dashboard fills the full width available next to the sidebar */
.home-content.home-dashboard {
  max-width: none;
  margin: 0;
  padding: 36px 16px 64px 24px;
}

.home-section {
  margin-bottom: 48px;
}

.home-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 5px;
  color: var(--color-navy);
  text-align: center;
  margin: 0 0 28px 0;
}

.home-section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: var(--color-tan);
  margin: 12px auto 0;
}

.home-empty {
  font-size: 14px;
  color: rgba(26, 35, 50, 0.6);
  text-align: center;
}

/* How it Works page */
.how-it-works-section {
  text-align: center;
}

.how-it-works-icon {
  display: block;
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.how-it-works-text {
  max-width: 540px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-on-light);
}

/* Home page - two column layout (Recent Visits + Recent Trips, Map) */
.home-columns {
  display: block;
}

.home-col-left,
.home-col-right {
  width: 100%;
}

@media (min-width: 769px) {
  .home-columns {
    display: grid;
    grid-template-columns: 62% 38%;
    gap: 16px;
  }

  .home-col-left,
  .home-col-right {
    width: 100%;
    min-width: 0;
  }

  .home-map-section {
    position: sticky;
    top: 24px;
  }
}

.home-view-all {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-olive);
  text-decoration: none;
}

.home-view-all:hover {
  color: var(--color-amber);
}

/* Recent visits feed - compact cards, distinct from the large immersive
   trip cards: text on the left, a small photo crop on the right. */
.visit-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.visit-feed-card {
  display: flex;
  align-items: stretch;
  min-height: 128px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(26, 35, 50, 0.12);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

@media (hover: hover) {
  .visit-feed-card:hover {
    box-shadow: 0 4px 14px rgba(26, 35, 50, 0.2);
    transform: translateY(-1px);
  }
}

@media (min-width: 769px) {
  .visit-feed {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

.visit-feed-text {
  flex: 1 1 60%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 14px 16px;
}

.visit-feed-photo {
  flex: 0 0 40%;
  align-self: stretch;
}

.visit-feed-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visit-feed-pin {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-navy);
}

.visit-feed-pin-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 13px;
}

.visit-feed-water {
  color: var(--color-tan);
}

.visit-feed-rating {
  font-size: 14px;
  color: var(--color-tan);
  white-space: nowrap;
}

.visit-feed-trip {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-tan);
}

.visit-feed-meta {
  font-size: 12px;
  color: rgba(26, 35, 50, 0.55);
}

.visit-feed-note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-on-light);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Recent trips - smaller magazine cards for the home page */
.home-trip-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.trip-card--home {
  height: 220px;
}

@media (min-width: 769px) {
  .home-trip-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Mobile shows fewer items than the backend returns */
  .visit-feed-card:nth-child(n+6) {
    display: none;
  }

  .home-trip-grid > a:nth-child(n+4) {
    display: none;
  }
}

/* The Map */
.home-map-label {
  font-size: 13px;
  color: rgba(26, 35, 50, 0.6);
  text-align: center;
  margin: -8px 0 12px;
}

.home-map-label a {
  color: var(--color-olive);
  font-weight: 600;
  text-decoration: none;
}

.home-map-label a:hover {
  color: var(--color-amber);
}

.home-map {
  width: 100%;
  height: 300px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-navy);
}

@media (min-width: 769px) {
  .home-map {
    height: calc(100vh - 48px);
    min-height: 600px;
  }
}

/* Stats strip */
.stats-strip {
  width: 100%;
  background: var(--color-cream);
  border-top: 2px solid var(--color-tan);
}

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

.stats-strip-numbers {
  flex: 1;
  min-width: 280px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  text-align: center;
  padding: 0 12px;
}

@media (min-width: 769px) {
  .stat {
    border-right: 1px solid rgba(201, 169, 110, 0.4);
  }

  .stat:last-child {
    border-right: none;
  }
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--color-amber);
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-navy);
  margin-top: 6px;
}

.stats-strip-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stats-strip-links a,
.stats-strip-links button {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-olive);
  text-decoration: none;
  cursor: pointer;
}

.stats-strip-links a:hover,
.stats-strip-links button:hover {
  color: var(--color-amber);
}

@media (max-width: 768px) {
  .stats-strip-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-strip-numbers {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 12px;
  }

  .stat:nth-child(-n+2) {
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(201, 169, 110, 0.4);
  }

  .stat:nth-child(odd) {
    border-right: 1px solid rgba(201, 169, 110, 0.4);
  }

  .stats-strip-links {
    justify-content: center;
  }
}

/* Suggest a Feature modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 35, 50, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--color-cream);
  color: var(--text-on-light);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(26, 35, 50, 0.35);
}

.modal-title {
  font-family: var(--font-serif);
  font-weight: normal;
  font-size: 1.3rem;
  color: var(--color-navy);
  margin: 0 0 14px;
}

.modal textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid rgba(201, 169, 110, 0.5);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

/* Placeholder pages (Trips, Conditions) */
.placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  gap: 10px;
}

.placeholder-icon {
  font-size: 48px;
}

.placeholder-title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: normal;
  color: var(--color-navy);
  margin: 0;
}

.placeholder-text {
  font-size: 14px;
  color: rgba(26, 35, 50, 0.6);
  margin: 0;
}

/* Conditions page */
.conditions-intro-text {
  max-width: 560px;
  margin: 0 auto 32px;
  text-align: center;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(26, 35, 50, 0.65);
}

.conditions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.conditions-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-navy);
  color: var(--text-on-dark);
  border-radius: 12px;
  border: 1px solid rgba(201, 169, 110, 0.3);
  box-shadow: 0 2px 10px rgba(26, 35, 50, 0.15);
  padding: 28px 24px;
}

.conditions-card-icon {
  font-size: 2.4rem;
  margin-bottom: 10px;
}

.conditions-card-title {
  font-family: var(--font-serif);
  font-weight: normal;
  font-size: 1.2rem;
  margin: 0 0 10px;
  color: var(--color-cream);
}

.conditions-card-text {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(245, 240, 232, 0.75);
  margin: 0 0 20px;
}

.conditions-card-select {
  width: 100%;
  margin-top: auto;
  text-align: left;
}

.conditions-card-select label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-tan);
  margin-bottom: 6px;
}

.conditions-card-select select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(201, 169, 110, 0.4);
  border-radius: 8px;
  background: rgba(245, 240, 232, 0.06);
  color: rgba(245, 240, 232, 0.6);
  font-size: 14px;
  font-family: inherit;
  cursor: not-allowed;
}

/* Guides page */
.guides-subheader {
  max-width: 560px;
  margin: 0 auto 32px;
  text-align: center;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(26, 35, 50, 0.65);
}

.guides-placeholder-card {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  background: var(--color-navy);
  color: var(--text-on-dark);
  border-radius: 12px;
  border: 1px solid rgba(201, 169, 110, 0.3);
  box-shadow: 0 2px 10px rgba(26, 35, 50, 0.15);
  padding: 40px 28px;
}

.guides-placeholder-icon {
  display: block;
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.guides-placeholder-card p {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(245, 240, 232, 0.8);
  margin: 0 0 20px;
}

.guides-suggest-link {
  display: inline-block;
  padding: 0;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-tan);
  text-decoration: underline;
  cursor: pointer;
}

.guides-suggest-link:hover {
  color: var(--color-cream);
}

/* Trips page - magazine grid */
.trip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.trip-card {
  position: relative;
  display: block;
  height: 400px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(26, 35, 50, 0.18);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease;
}

.trip-card-bg {
  position: absolute;
  inset: 0;
  background-color: var(--color-navy);
  background-size: cover;
  background-position: center;
  transition: filter 0.25s ease;
}

.trip-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(26, 35, 50, 0) 35%, rgba(26, 35, 50, 0.92) 100%);
}

.trip-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(26, 35, 50, 0.55);
  color: var(--color-cream);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
}

.trip-card-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px;
}

.trip-card-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  color: var(--color-cream);
  margin: 0;
}

.trip-card-dates {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-tan);
  margin-top: 4px;
}

.trip-card-stats {
  font-size: 13px;
  color: rgba(245, 240, 232, 0.85);
  margin-top: 8px;
}

.trip-card-participants {
  font-size: 12px;
  color: rgba(245, 240, 232, 0.5);
  margin-top: 4px;
}

@media (hover: hover) {
  .trip-card:hover {
    transform: scale(1.02);
  }

  .trip-card:hover .trip-card-bg {
    filter: brightness(1.1);
  }
}

@media (max-width: 768px) {
  .trip-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .trip-card {
    height: 300px;
  }
}

/* Trip detail page */
.trip-back-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-olive);
  text-decoration: none;
  margin-bottom: 8px;
}

/* Single-line trip stats: date range · visits · pins · participants */
.trip-summary-bar {
  text-align: center;
  font-size: 14px;
  color: var(--color-navy);
  margin-bottom: 32px;
}

/* Photo grid - large, editorial photos from across the trip. The first
   photo gets a bigger feature tile; the rest fall into a clean grid. */
.trip-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-auto-rows: 160px;
  gap: 10px;
}

.trip-photo-tile {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(26, 35, 50, 0.15);
  padding: 0;
  background: none;
  cursor: pointer;
}

.trip-photo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.trip-photo-tile:hover img {
  transform: scale(1.04);
}

.trip-photo-tile:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

@media (min-width: 768px) {
  .trip-photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-auto-rows: 200px;
    gap: 14px;
  }
}

.trip-photos-view-all {
  display: block;
  margin: 14px auto 0;
  padding: 0;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-olive);
  cursor: pointer;
  text-align: center;
}

.trip-photos-view-all:hover {
  text-decoration: underline;
}

/* Trip map - shows every pin visited on this trip */
.trip-map {
  width: 100%;
  height: 250px;
  border-radius: 8px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .trip-map {
    height: 400px;
  }
}

/* Visit feed - reverse chronological, editorial feel with thin separators
   instead of boxed cards */
.trip-visit-list {
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
}

.trip-visit-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid rgba(201, 169, 110, 0.25);
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.trip-visit-card:hover {
  background-color: rgba(201, 169, 110, 0.08);
}

.trip-visit-card:first-child {
  padding-top: 0;
}

.trip-visit-card:last-child {
  border-bottom: none;
}

.trip-visit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trip-visit-pin {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--color-navy);
  text-decoration: none;
}

.trip-visit-pin:hover {
  text-decoration: underline;
}

.trip-visit-pin-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  color: white;
}

.trip-visit-date {
  font-size: 13px;
  color: rgba(26, 35, 50, 0.6);
  white-space: nowrap;
}

.trip-visit-user {
  font-size: 13px;
  color: var(--color-olive);
}

.trip-visit-rating {
  color: var(--color-tan);
  font-size: 16px;
}

.trip-visit-note {
  font-size: 14px;
  color: var(--text-on-light);
  line-height: 1.7;
  white-space: pre-wrap;
}

.trip-visit-conditions {
  font-size: 13px;
  color: rgba(26, 35, 50, 0.65);
}

/* Photo strip - 3-4 large thumbnails, "+N" overlay if there are more */
.trip-visit-photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 4px;
}

@media (min-width: 600px) {
  .trip-visit-photos {
    grid-template-columns: repeat(4, 1fr);
  }
}

.trip-visit-photo {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.trip-visit-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trip-visit-photo-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 35, 50, 0.55);
  color: var(--color-cream);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
}

/* Visit detail page */
.visit-content {
  max-width: 860px;
}

.visit-breadcrumb {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-olive);
  margin-bottom: 20px;
}

.visit-breadcrumb a {
  color: var(--color-olive);
  text-decoration: none;
}

.visit-breadcrumb a:hover {
  text-decoration: underline;
}

.visit-breadcrumb-sep {
  margin: 0 8px;
  color: rgba(26, 35, 50, 0.35);
}

/* Photo gallery - single photo fills the width; multiple photos become a
   horizontal swipeable strip with scroll-snap, a count overlay, and dots */
.visit-gallery-section {
  position: relative;
  margin-bottom: 28px;
}

.visit-gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  background: var(--color-navy);
  scrollbar-width: none;
}

.visit-gallery::-webkit-scrollbar {
  display: none;
}

.visit-gallery-photo {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
}

.visit-gallery-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 768px) {
  .visit-gallery-photo {
    aspect-ratio: 16 / 9;
  }
}

.visit-gallery-counter {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(26, 35, 50, 0.65);
  color: var(--color-cream);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

.visit-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.visit-gallery-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(26, 35, 50, 0.2);
  border: none;
  padding: 0;
  cursor: pointer;
}

.visit-gallery-dot.active {
  background: var(--color-tan);
}

/* Visit details */
.visit-details {
  margin-bottom: 28px;
}

.visit-details-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.visit-edit-page-btn {
  flex-shrink: 0;
  margin-top: 4px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--color-olive);
  background: rgba(74, 92, 58, 0.1);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.visit-edit-page-btn:hover {
  background: rgba(74, 92, 58, 0.18);
}

.visit-pin-name {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: normal;
  color: var(--color-navy);
  margin: 0 0 10px 0;
}

.visit-pin-name a {
  color: inherit;
  text-decoration: none;
}

.visit-pin-name a:hover {
  text-decoration: underline;
}

.visit-trip-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-olive);
  background: rgba(74, 92, 58, 0.1);
  border-radius: 999px;
  padding: 5px 14px;
  text-decoration: none;
  margin-bottom: 14px;
}

.visit-meta {
  font-size: 14px;
  color: rgba(26, 35, 50, 0.6);
  margin-bottom: 8px;
}

.visit-rating {
  color: var(--color-tan);
  font-size: 20px;
  margin-bottom: 10px;
}

.visit-note {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-on-light);
  white-space: pre-wrap;
  margin: 0 0 10px 0;
}

.visit-conditions {
  font-size: 14px;
  color: rgba(26, 35, 50, 0.6);
}

/* Mini map - shows just this pin's location */
.visit-map-section {
  margin-bottom: 28px;
}

.visit-map {
  width: 100%;
  height: 220px;
  border-radius: 8px;
  overflow: hidden;
}

/* Previous/Next visit navigation */
.visit-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 48px;
  border-top: 1px solid rgba(201, 169, 110, 0.25);
}

.visit-nav-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-olive);
  text-decoration: none;
  padding: 10px 4px;
}

.visit-nav-next {
  margin-left: auto;
  text-align: right;
}

/* Full-screen lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(26, 35, 50, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.lightbox.hidden {
  display: none;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close,
.lightbox-arrow {
  position: absolute;
  border: none;
  border-radius: 50%;
  background: rgba(245, 240, 232, 0.12);
  color: var(--color-cream);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close {
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 24px;
}

.lightbox-arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 28px;
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-cream);
  font-size: 13px;
  font-weight: 700;
  background: rgba(26, 35, 50, 0.5);
  padding: 5px 14px;
  border-radius: 999px;
}

/* Trip page lightbox - adds a caption below the photo with pin/visit info */
.trip-lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw;
  max-height: 90vh;
}

.trip-lightbox-img {
  max-width: 92vw;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 4px;
}

.trip-lightbox-caption {
  margin-top: 14px;
  max-width: 92vw;
  text-align: center;
}

.trip-lightbox-counter {
  display: inline-block;
  color: var(--color-cream);
  font-size: 12px;
  font-weight: 700;
  background: rgba(245, 240, 232, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.trip-lightbox-meta {
  color: var(--color-cream);
  font-size: 13px;
  opacity: 0.85;
}

.trip-lightbox-visit-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-tan);
  text-decoration: none;
}

.trip-lightbox-visit-link:hover {
  text-decoration: underline;
}

.trip-lightbox-visit-link.hidden {
  display: none;
}
