: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 */
#navbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--color-navy);
  color: var(--color-cream);
  padding: 12px 14px;
  z-index: 6;
}

.navbar-brand {
  max-width: 60%;
  color: inherit;
  text-decoration: none;
}

/* Condensed wordmark sizing to fit the navbar */
.navbar-brand .wordmark-name {
  font-size: clamp(15px, 4.5vw, 19px);
}

.navbar-brand .wordmark-underline {
  margin-top: 3px;
}

.navbar-brand .wordmark-rule {
  margin-bottom: 3px;
}

.navbar-brand .wordmark-tagline {
  font-size: 7px;
  letter-spacing: 2px;
}

.navbar-actions {
  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;
}

/* Map fills all remaining space below the navbar + 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);
}

/* Mobile: collapse to a single icon button that expands into the input */
@media (max-width: 640px) {
  .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;
}

#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-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;
}

.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;
  }
}

.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-serif);
  font-weight: normal;
  font-size: clamp(1.8rem, 6vw, 3rem);
  letter-spacing: 0.04em;
  color: var(--color-cream);
  margin: 0;
}

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

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

/* Section navigation tabs (Home / Map / Trips / Conditions / Admin) -
   persistent on every logged-in page, directly below #navbar */
.nav-tabs {
  flex-shrink: 0;
  display: flex;
  background: var(--color-navy);
  border-top: 1px solid rgba(201, 169, 110, 0.15);
}

.nav-tab {
  flex: 1;
  text-align: center;
  padding: 12px 6px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-cream);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-tab:hover,
.nav-tab:active,
.nav-tab.active {
  color: var(--color-tan);
  border-bottom-color: var(--color-tan);
}

/* 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');
}

.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');
}

/* 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-section {
  margin-bottom: 48px;
}

.home-section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  font-weight: normal;
  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);
}

/* Recent photos grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 220px));
  justify-content: center;
  gap: 20px;
}

.photo-card {
  display: block;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(26, 35, 50, 0.15);
  text-decoration: none;
  color: inherit;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-card-body {
  padding: 12px;
  text-align: center;
}

.photo-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-card-date {
  font-size: 12px;
  color: rgba(26, 35, 50, 0.55);
  margin-top: 4px;
}

/* Recent trip placeholder */
.trip-placeholder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 2px dashed rgba(201, 169, 110, 0.6);
  border-radius: 8px;
  padding: 48px 24px;
  text-align: center;
  font-size: 15px;
  color: rgba(26, 35, 50, 0.65);
}

.trip-placeholder-icon {
  font-size: 32px;
}

/* 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;
}

/* Trips page */
.trip-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 640px;
  margin: 0 auto;
}

.trip-card {
  display: block;
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(26, 35, 50, 0.15);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease;
}

.trip-card:hover {
  box-shadow: 0 2px 8px rgba(26, 35, 50, 0.25);
}

.trip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.trip-card-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: normal;
  color: var(--color-navy);
  margin: 0;
}

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

.trip-card-stats {
  font-size: 13px;
  color: var(--color-olive);
  margin-top: 6px;
}

.trip-card-participants {
  font-size: 13px;
  color: rgba(26, 35, 50, 0.6);
  margin-top: 4px;
}

.trip-card-photos {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.trip-card-photo {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
}

.trip-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  padding: 48px 24px;
  background: #fff;
  border: 2px dashed rgba(201, 169, 110, 0.6);
  border-radius: 8px;
  font-size: 15px;
  color: rgba(26, 35, 50, 0.65);
}

.trip-empty p {
  margin: 0;
}

/* 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);
}

.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 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;
  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);
}

.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-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;
}
