/* ---------------------------------------------------------------------------
   Shared hike tiles: the photo-first card rendered by /js/hike-tile.js, used by
   the home gallery/map/plot and the server-rendered pages' "More from this
   trailhead" / "More hikes near" sections. Base tile styles only -- the home
   page's mode-specific overrides (.explore.map-mode / .explore.plot-mode) stay
   in main.css.
   --------------------------------------------------------------------------- */

/* Masonry container for a set of tiles; in a narrow column (the hike-page
   sidebar) it naturally collapses to a single column. */
.tile-grid { columns: 250px; column-gap: 16px; }

.explore-tile {
  display: block; break-inside: avoid; margin: 0 0 16px;
  position: relative; border-radius: 14px; overflow: hidden; text-decoration: none;
  background: linear-gradient(135deg, #c9d1c2, #e4dac4);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s ease;
  will-change: transform;
}
.explore-tile:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 12px 26px rgba(35,45,35,.24);
  z-index: 1;
}
.explore-tile img { width: 100%; height: auto; display: block; object-fit: cover; opacity: 0; transition: opacity .5s ease; }
.explore-tile img.is-loaded { opacity: 1; }

/* Photo carousel inside a tile (touch only): horizontal scroll-snap so a side-swipe steps through
   a few shots of the hike without opening it. The scrollbar is hidden; vertical list scrolling is
   untouched (only a horizontal drag moves the carousel). Each slide's height comes from an inline
   aspect-ratio on the IMG (set to the hero's ratio, so the strip is uniform) -- the same reliable
   sizing the single-image path uses. Do NOT move the ratio to this flex container: mobile Safari
   won't resolve it and the slides collapse to zero height. */
.tile-carousel {
  display: flex; width: 100%;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tile-carousel::-webkit-scrollbar { display: none; }
.tile-carousel img.tile-slide {
  flex: 0 0 100%; width: 100%;
  object-fit: cover; scroll-snap-align: center;
}
/* Page dots, overlaid low-center on the media. */
.tile-dots {
  position: absolute; left: 0; right: 0; bottom: 8px; z-index: 2;
  display: flex; justify-content: center; gap: 5px; pointer-events: none;
}
.tile-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,.55); box-shadow: 0 0 2px rgba(0,0,0,.5);
  transition: background .15s ease, transform .15s ease;
}
.tile-dots span.on { background: #fff; transform: scale(1.25); }

/* Photoless hike: keep the tile shape with a soft sage-to-sand wash. */
.explore-tile-noimg { width: 100%; display: block; background: linear-gradient(135deg, #c9d1c2, #e4dac4); }
/* Photoless hike with a route: the trail drawn on a real topo map (route over the Esri image). */
.explore-tile-shape { width: 100%; display: block; background: #e7e2d4; }
.explore-tile-shape svg { width: 100%; height: 100%; display: block; }
.explore-tile-shape polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.explore-tile-shape .shape-halo { stroke: #fff; stroke-width: 5; opacity: .9; }
/* Route green -- the same colour the hike-detail map draws the route in, so every surface matches. */
.explore-tile-shape .shape-line { stroke: #1a8f47; stroke-width: 2.6; }

.explore-tile-cap {
  position: absolute; left: 0; right: 0; bottom: 0; color: #fff;
  padding: 28px 12px 10px;
  background: linear-gradient(to top, rgba(0,0,0,.72), transparent);
}
/* "Broader point of interest" eyebrow: the park/forest a hike lives in (e.g. Tilden
   Regional Park), a small uppercase label above the hike name. */
.explore-tile-area { font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; opacity: .82; margin-bottom: 3px; }
.explore-tile-name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.explore-tile:hover .explore-tile-name { text-decoration: underline; }
.explore-tile-meta { font-size: 12px; opacity: .9; margin-top: 2px; }

/* Wildness dot: glanceable wildness in the same color scale as the map dots. */
.wild-dot {
  position: absolute; bottom: 8px; right: 8px; z-index: 2;
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* Save (bookmark) control -- floats over a photo tile, and reused inline in map popups. */
.save-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: none; border-radius: 50%; cursor: pointer; color: #fff;
  background: rgba(20,24,20,.4); transition: background .15s ease, transform .15s ease;
}
.save-btn:hover { background: rgba(20,24,20,.62); transform: scale(1.08); }
.save-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.save-btn.is-saved { background: #e8590c; }
.save-btn.is-saved svg { fill: currentColor; }
