.trip-report h2 {
  margin: 3rem 0 1.25rem;
}

.trip-report p {
  text-align: left;
}

.trip-report .trip-photo,
.trip-report .trip-video,
.trip-report .trip-pair {
  margin: 2rem 0;
}

.trip-photo a {
  display: block;
  cursor: zoom-in;
}

.trip-report .trip-photo img,
.trip-report .trip-video video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 42rem;
  object-fit: contain;
  margin: 0;
  border-radius: 3px;
}

.trip-report .trip-video video {
  background: #111;
}

.trip-report .trip-hero {
  margin-top: 0;
}

.trip-report .trip-activity {
  max-width: 30rem;
  margin-right: auto;
  margin-left: auto;
}

.trip-route {
  margin: 2.5rem 0;
}

.trip-route-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.trip-report .trip-route-heading h2 {
  margin: 0;
}

.trip-route-views:not([hidden]) {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.trip-route-views button {
  min-height: 44px;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: .4rem .65rem;
  background: white;
  color: #333;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
}

.trip-map {
  height: 500px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #f1f0ea;
  isolation: isolate;
}

.trip-map-fallback {
  padding: 1.5rem;
}

/* Keep the blog's image rules from shifting Leaflet's map tiles. */
.trip-report .trip-map img {
  margin: 0;
}

.trip-map-marker {
  border: 2px solid white;
  border-radius: 50%;
  background: #34584d;
  box-shadow: 0 1px 4px #0005;
  color: white;
  font: bold 12px/20px Arial, sans-serif;
  text-align: center;
}

.trip-map .leaflet-popup-content p {
  margin: .6rem 0;
  font-size: .9rem;
}

.trip-route-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  padding: 0;
  margin: 1rem 0 .5rem;
  list-style: none;
  font-size: .85rem;
}

.trip-route-line {
  display: inline-block;
  width: 1.5rem;
  margin-right: .4rem;
  vertical-align: middle;
  border-top: 3px solid #34584d;
}

.trip-route-line-bike { border-color: #a36620; border-top-style: dotted; }
.trip-route-line-train { border-color: #586d87; border-top-style: dashed; }

.trip-report .trip-route-note,
.trip-report .trip-map-status {
  font-size: .9rem;
  color: #666;
}

.trip-route-stops {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.trip-route-stops li { min-width: 0; }

.trip-report .trip-route-stop {
  display: flex;
  align-items: center;
  gap: .5rem;
  height: 100%;
  padding: .5rem;
  border: 1px solid #e5e5e5;
  border-radius: 3px;
  text-decoration: none;
  font-size: .9rem;
}

.trip-route-stop:hover,
.trip-route-stop[aria-current] { background: #f1f4f2; border-color: #34584d; }
.trip-route-stop small { display: block; color: #666; }

.trip-stop-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #34584d;
  color: white;
  font: 12px/1 Arial, sans-serif;
}

.trip-route a:focus-visible,
.trip-route button:focus-visible,
.trip-map-marker:focus-visible { outline: 3px solid #6386ae; outline-offset: 3px; }

.trip-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 1rem;
}

.trip-report .trip-pair .trip-photo {
  margin: 0;
}

.trip-report .trip-source {
  color: #666;
  font-size: .9rem;
  margin-top: 2rem;
}

.trip-gallery {
  border-top: 1px solid #e5e5e5;
  margin-top: 3rem;
}

.trip-gallery-grid {
  columns: 3;
  column-gap: 1rem;
}

.trip-report .trip-gallery-grid figure {
  break-inside: avoid;
  margin: 0 0 1rem;
}

.trip-report .trip-gallery-grid img,
.trip-report .trip-gallery-grid video {
  max-height: none;
}

.trip-photo a:focus-visible,
.trip-lightbox button:focus-visible {
  outline: 3px solid #6386ae;
  outline-offset: 4px;
}

.trip-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 4rem;
  border: 0;
  background: rgba(15, 15, 15, .97);
  color: white;
}

.trip-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.trip-lightbox::backdrop {
  background: #111;
}

html:has(.trip-lightbox[open]) {
  overflow: hidden;
}

.trip-lightbox figure {
  margin: 0;
  max-width: 100%;
}

.trip-lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 12rem);
  margin: 0 auto;
  object-fit: contain;
}

.trip-lightbox figcaption {
  margin-top: 1rem;
  text-align: center;
  font-size: .9rem;
}

.trip-lightbox button {
  position: absolute;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #333;
  color: #fff;
  font: 2rem/1 Georgia, serif;
  cursor: pointer;
}

.trip-lightbox button:hover {
  background: #555;
}

.trip-lightbox-close { top: 1rem; right: 1rem; }
.trip-lightbox-prev { top: calc(50% - 22px); left: .75rem; }
.trip-lightbox-next { top: calc(50% - 22px); right: .75rem; }

@media (max-width: 600px) {
  .trip-route-heading { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .trip-route-views:not([hidden]) { justify-content: flex-start; }
  .trip-map { height: 400px; }
  .trip-route-stops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trip-pair { grid-template-columns: 1fr; }
  .trip-gallery-grid { columns: 2; column-gap: .6rem; }
  .trip-report .trip-gallery-grid figure { margin-bottom: .6rem; }
  .trip-lightbox { padding: 4rem .75rem; }
  .trip-lightbox-prev, .trip-lightbox-next { top: auto; bottom: 1rem; }
}
