/* ============================================
   50 Favorite Places to Camp — structural CSS.
   Colors come from ultralight theme tokens (--surface, --content, --muted,
   --border, --primary, --raised, --emphasis), so the whole page follows the
   light/dark toggle automatically. Typography is ultralight Geist via the
   .text-* classes applied in the components. Scoped under .story-50-favorites.
   ============================================ */

.story-50-favorites {
  --header-h: 57px;
  --fav-accent: var(--primary);
  --fav-shadow: 0 10px 34px rgba(0, 0, 0, 0.1);
  --fav-shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.08);
  background: var(--surface);
  color: var(--content);
}

/* ============================================
   HERO — vibrant photo collage behind a contained text panel
   ============================================ */

.fav-hero {
  position: relative;
  z-index: 0;
  min-height: 92vh;
  min-height: 92svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 88px 20px 64px;
  overflow: hidden;
  background: var(--surface);
}

.fav-hero-collage {
  position: absolute;
  inset: 16px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  grid-auto-flow: dense;
  gap: 8px;
  overflow: hidden;
}

@media (min-width: 769px) {
  .fav-hero-collage {
    inset: 24px;
  }
}

.fav-hero-tile {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--raised);
}

.fav-hero-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 0.9s ease-in-out;
}

.fav-hero-tile img.is-shown {
  opacity: 1;
}

/* Tiles currently changing ken-burns with a soft ease; ~1-2 run at once with no
   gap. Base scale is 1.1 so when the one-shot ends there is no snap back. */
.fav-hero-tile img.is-kb {
  animation: fav-kenburns 3s ease-in-out forwards;
}

@keyframes fav-kenburns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.1);
  }
}

.fav-hero-panel {
  position: relative;
  z-index: 2;
  width: min(640px, 100%);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  padding: 48px 44px 40px;
}

@media (max-width: 640px) {
  /* Hero panel becomes a faux floating sheet: full width, locked to the bottom
     of the viewport, sitting over the collage (rounded top only). */
  .fav-hero {
    align-items: flex-end;
    padding: 0;
  }
  .fav-hero-panel {
    width: 100%;
    padding: 22px 20px 26px;
    border-radius: 26px 26px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.22);
  }
  /* Drop the in-sheet logo (the header already shows it) and tighten everything
     so more of the collage shows above the sheet. */
  .fav-hero-panel .fav-hero-logo {
    display: none;
  }
  .fav-hero-panel h1 {
    font-size: clamp(2.1rem, 8.8vw, 2.6rem);
    line-height: 1.08;
    margin-top: 0;
  }
  .fav-hero-panel .fav-hero-year {
    margin: 10px 0 12px;
  }
  .fav-hero-panel .text-large {
    margin-bottom: 16px;
  }
  .fav-hero-panel .fav-hero-explore {
    margin-top: 16px;
  }
}

@media (max-width: 768px) {
  .fav-hero-collage {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
  }
}

@media (min-width: 769px) and (max-width: 1023px) {
  .fav-hero-collage {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(4, 1fr);
  }
}

.fav-hero-year {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 14px 0 18px;
}

.fav-hero-year-rule {
  display: block;
  width: clamp(36px, 14vw, 84px);
  height: 1px;
  background: var(--border);
}

/* Explore-the-list primary CTA wrapper */
.fav-hero-explore {
  margin-top: 26px;
}

.fav-hero-explore .fav-bob {
  animation: fav-bob 2s ease-in-out infinite;
}

@keyframes fav-bob {
  0%,
  100% {
    transform: translateY(-3px);
  }
  50% {
    transform: translateY(3px);
  }
}

/* Hipcamp logo in the hero panel (replaces the eyebrow) */
.fav-hero-logo {
  margin: 0 auto 4px;
  display: block;
}

/* Pulsing down-arrow circle that pulls readers down to the intro */
.fav-hero-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(236, 80, 23, 0.3);
  animation: fav-arrow-pulse 2.4s ease-in-out infinite;
  transition: transform 0.15s ease-out;
}

.fav-hero-arrow:hover {
  transform: scale(1.08);
}

@keyframes fav-arrow-pulse {
  0%,
  100% {
    box-shadow: 0 6px 18px rgba(236, 80, 23, 0.3);
  }
  50% {
    box-shadow: 0 8px 28px rgba(236, 80, 23, 0.55);
  }
}

/* Hipcamp logo that fades into the header once past the intro */
.fav-header-logo {
  opacity: 0;
  pointer-events: none;
}

.fav-header-logo.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Intro dual CTAs (explore the list / browse the map) */
.fav-intro-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 40px;
}

/* ============================================
   SHARE ACTIONS — centered, scale-only hover
   ============================================ */

.fav-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fav-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--content);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9999px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease-out;
}

.fav-share-btn:hover {
  transform: scale(1.06);
}

.fav-share-btn:active {
  transform: scale(0.98);
}

/* ============================================
   SECTION RHYTHM
   ============================================ */

.fav-intro-body p + p {
  margin-top: 1.1em;
}

.fav-intro-dropcap::first-letter {
  initial-letter: 2;
  -webkit-initial-letter: 2;
  font-weight: 800;
  color: var(--emphasis);
  margin-right: 0.08em;
}

/* ============================================
   SCROLLYTELLING LAYOUT
   ============================================ */

.story-50-favorites #scrolly {
  position: relative;
  background: var(--surface);
}

.story-50-favorites #scrolly-map {
  position: sticky;
  top: var(--header-h);
  width: 100%;
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  z-index: 1;
  background: var(--surface);
}

.story-50-favorites #scrolly-map > div:first-child {
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.story-50-favorites #scrolly-map::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--raised);
  animation: fav-skeleton-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.story-50-favorites #scrolly-map.is-loaded > div:first-child {
  opacity: 1;
}

.story-50-favorites #scrolly-map.is-loaded::before {
  display: none;
}

@media (min-width: 769px) {
  .story-50-favorites #scrolly-map {
    padding: 24px;
    background: var(--surface);
  }

  .story-50-favorites #scrolly-map > div:first-child {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--fav-shadow);
  }

  .story-50-favorites #scrolly-map::before {
    inset: 24px;
    border-radius: 20px;
  }
}

/* Scrolling text column — overlaps the sticky map */
.story-50-favorites #scrolly-text {
  position: relative;
  z-index: 2;
  width: 480px;
  margin-top: calc(-100vh + var(--header-h));
  margin-top: calc(-100dvh + var(--header-h));
  pointer-events: none;
}

.story-50-favorites .step {
  min-height: 86vh;
  display: flex;
  align-items: center;
  padding: 60px 56px;
  pointer-events: none;
  scroll-margin-top: var(--header-h);
}

.story-50-favorites .step:first-of-type {
  min-height: calc(135vh - var(--header-h));
  padding-bottom: 45vh;
}

.story-50-favorites .step:first-of-type .step-card {
  scroll-margin-top: calc(var(--header-h) + 40px);
}

/* The 'full' chapter is a normal-height step so navigating into it scrolls the
   card up cleanly (no extra-tall in-between hold). */

/* ============================================
   STEP CARDS
   ============================================ */

.story-50-favorites .step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--fav-shadow);
  border-radius: 18px;
  padding: 26px 26px 22px;
  max-width: 420px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-50-favorites .step.is-active .step-card {
  opacity: 1;
  transform: translateY(0);
}

.story-50-favorites:not(.map-ready) .step.is-active .step-card {
  opacity: 0;
}

.story-50-favorites .step-card h2 {
  margin-bottom: 8px;
}

.story-50-favorites .step-card .step-body {
  margin-bottom: 4px;
}

/* Member-place list inside a region card — soft rounded hover, no rules */
.story-50-favorites .fav-step-places {
  list-style: none;
  padding: 0;
  margin: 14px 0 2px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.story-50-favorites .fav-step-places a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--content);
  transition:
    background 0.15s,
    color 0.15s;
}

.story-50-favorites .fav-step-place-name {
  flex: 1;
  min-width: 0;
}

.story-50-favorites .fav-step-place-loc {
  flex-shrink: 0;
  color: var(--muted);
  text-align: right;
  font-family: var(--font-mono), ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.story-50-favorites .fav-step-places a:hover {
  background: var(--raised);
}

/* Step CTAs */
.story-50-favorites .step-cta-wrap {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.story-50-favorites .step-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 9999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition:
    opacity 0.2s,
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}

.story-50-favorites .step-cta-primary {
  background: var(--fav-accent);
  color: #fff;
  flex: 1;
}

.story-50-favorites .step-cta-primary:hover {
  opacity: 0.9;
}

.story-50-favorites .step-cta-ghost {
  background: transparent;
  color: var(--content);
  border: 1px solid var(--border);
}

.story-50-favorites .step-cta-ghost:hover {
  border-color: var(--fav-accent);
  color: var(--fav-accent);
}

/* Hide the scrolly card while a listing card / explore mode is active */
.story-50-favorites.has-listing-card .step.is-active .step-card,
.story-50-favorites.scrolly-hidden .step.is-active .step-card {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ============================================
   STEPPER — jump between regions
   ============================================ */

.fav-stepper {
  position: absolute;
  bottom: 44px;
  right: 44px;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.5s ease-out;
  display: flex;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 11px 18px;
  box-shadow: var(--fav-shadow);
  pointer-events: auto;
}

.fav-stepper.is-visible {
  opacity: 1;
}

.fav-stepper-item {
  display: flex;
  align-items: flex-start;
}

.fav-stepper-seg {
  width: 20px;
  height: 2px;
  background: var(--border);
  margin-top: 5px;
  flex-shrink: 0;
  transition: background 0.3s;
}

.fav-stepper-seg.is-filled {
  background: var(--fav-accent);
  opacity: 0.55;
}

.fav-stepper-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.fav-stepper-point:hover .fav-stepper-dot {
  transform: scale(1.3);
}

.fav-stepper-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s;
  flex-shrink: 0;
}

.fav-stepper-point.is-past .fav-stepper-dot {
  background: var(--fav-accent);
  opacity: 0.5;
}

.fav-stepper-point.is-active .fav-stepper-dot {
  background: var(--fav-accent);
  opacity: 1;
  width: 13px;
  height: 13px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fav-accent) 22%, transparent);
}

.fav-stepper-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.3s;
}

.fav-stepper-point.is-active .fav-stepper-label {
  color: var(--fav-accent);
}

.story-50-favorites.user-exploring .fav-stepper {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Return-to-tour pill */
.fav-return-pill {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  background: var(--surface);
  color: var(--content);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 9px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--fav-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
}

.fav-return-pill.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.fav-return-pill:hover {
  border-color: var(--fav-accent);
  color: var(--fav-accent);
}

/* ============================================
   LISTING PINS (Hipcamp tent in a theme-inverting circle)
   ============================================ */

.fav-listing-pin {
  display: block;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  transition:
    transform 0.15s ease-out,
    opacity 0.2s ease-out,
    filter 0.15s ease-out;
}

.fav-listing-pin svg {
  width: 30px;
  height: auto;
  display: block;
}

.fav-listing-pin.is-dimmed {
  opacity: 0.4;
}

.fav-listing-pin.is-dimmed svg {
  width: 22px;
}

.fav-listing-pin:hover {
  transform: scale(1.12);
}

.fav-listing-pin[data-active] {
  transform: scale(1.18);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

/* Region-card list hover pops the matching pin in the primary color. */
.fav-listing-pin.is-hovered {
  transform: scale(1.25);
  z-index: 100;
}

.fav-listing-pin.is-hovered .fill-emphasis {
  fill: var(--primary) !important;
}

/* Name pill shown above the pin while hovering its region-card list item. */
.fav-pin-pill {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 10px;
  z-index: 110;
  background: var(--emphasis);
  color: var(--surface);
  font-family: var(--font-mono), ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 7px 13px;
  border-radius: 9999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

/* Pin card pop-in */
.fav-listing-card-anim {
  pointer-events: auto;
  animation: fav-card-pop-in 0.15s ease-out both;
}

@keyframes fav-card-pop-in {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fav-skeleton-pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* ============================================
   LISTING / GRID CARD MEDIA (shared)
   ============================================ */

.fav-card-photo {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--raised);
}

.fav-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition:
    opacity 0.4s ease-out,
    transform 0.4s ease-out;
}

.fav-card-photo img.is-loaded {
  opacity: 1;
}

.fav-card-photo-empty {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--raised),
    color-mix(in srgb, var(--raised) 70%, var(--border))
  );
}

/* Award pill over the photo */
.fav-award-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-block;
  background: color-mix(in srgb, var(--emphasis) 84%, transparent);
  color: var(--surface);
  border-radius: 9999px;
  padding: 4px 10px;
  font-family: var(--font-mono), ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* ============================================
   FULL LIST GRID
   ============================================ */

.fav-grid-region {
  margin-bottom: 56px;
}

.fav-grid-region:last-child {
  margin-bottom: 0;
}

.fav-grid-region-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.fav-grid-region-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  color: var(--content);
}

.fav-grid-region-count {
  margin-left: auto;
  color: var(--muted);
}

.fav-grid-region-body {
  max-width: 640px;
  margin: -6px 0 30px;
  color: var(--muted);
  line-height: 1.6;
}

.fav-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 18px;
}

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

@media (min-width: 960px) {
  .fav-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Card shell (used by both grid cards and map pin cards) */
.fav-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 10px;
  box-shadow: var(--fav-shadow-sm);
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out;
}

.fav-grid-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--fav-shadow);
}

.fav-grid-card:hover .fav-card-photo img {
  transform: scale(1.04);
}

.fav-card .fav-card-photo {
  aspect-ratio: 4 / 3;
  border-radius: 11px;
}

.fav-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 6px 6px;
  flex: 1;
}

.fav-card-loc {
  font-family: var(--font-mono), ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.fav-card-blurb {
  margin-top: 2px;
  flex: 1;
}

/* The "From $X" CTA button sits above the cover-link overlay. */
.fav-card-cta {
  margin-top: 12px;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* Stretched cover link makes the whole card clickable while the CTA button
   stays a separate, real <a href>. */
.fav-card-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

/* ============================================
   MAP PIN CARD (compact variant of the card)
   ============================================ */

.fav-listing-card {
  position: relative;
  width: 296px;
  max-width: 78vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  text-decoration: none;
  color: inherit;
  display: block;
}

.fav-listing-card .fav-card-photo {
  aspect-ratio: 16 / 10;
  border-radius: 10px;
}

/* Mobile: the preview renders as a faux floating sheet locked to the bottom,
   full width, sitting over the map (rendered via a portal to escape the map's
   transformed markers). Desktop keeps the pin-anchored floating card. */
.fav-listing-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  animation: fav-sheet-up 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.fav-listing-sheet .fav-listing-card {
  width: 100%;
  max-width: none;
  border-radius: 18px 18px 0 0;
  border-bottom: none;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
}

.fav-listing-sheet .fav-listing-card .fav-card-photo {
  aspect-ratio: 16 / 7;
  border-radius: 10px;
}

@keyframes fav-sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.fav-listing-card-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--content);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: transform 0.15s;
}

.fav-listing-card-close:hover {
  transform: scale(1.1);
}

.fav-listing-card-body {
  display: flex;
  flex-direction: column;
  padding: 10px 6px 4px;
}

/* ============================================
   MAPBOX GL OVERRIDES
   ============================================ */

.story-50-favorites .mapboxgl-canvas {
  background: var(--surface) !important;
}

.story-50-favorites .mapboxgl-ctrl-attrib {
  font-size: 10px !important;
  background: color-mix(in srgb, var(--surface) 70%, transparent) !important;
  color: var(--muted) !important;
}

.story-50-favorites .mapboxgl-ctrl-attrib a {
  color: var(--muted) !important;
}

.story-50-favorites .mapboxgl-ctrl-top-right {
  top: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
}

.story-50-favorites .mapboxgl-ctrl-top-right .mapboxgl-ctrl {
  margin-top: 0 !important;
}

.story-50-favorites.user-exploring .mapboxgl-ctrl-top-right {
  opacity: 1;
  pointer-events: auto;
}

.story-50-favorites .mapboxgl-ctrl-group {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: var(--fav-shadow-sm) !important;
  overflow: hidden;
}

.story-50-favorites .mapboxgl-ctrl-group button {
  width: 28px !important;
  height: 28px !important;
  background: transparent !important;
}

.story-50-favorites .mapboxgl-ctrl-group button + button {
  border-top: 1px solid var(--border) !important;
}

.story-50-favorites .mapboxgl-ctrl-group button .mapboxgl-ctrl-icon {
  filter: var(--fav-ctrl-icon-filter, none);
}

.dark .story-50-favorites .mapboxgl-ctrl-group button .mapboxgl-ctrl-icon {
  filter: invert(1);
}

.story-50-favorites .mapboxgl-ctrl-group button:hover {
  background: var(--raised) !important;
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .story-50-favorites .fav-scroll-cue svg,
  .story-50-favorites .fav-hero-tile img,
  .story-50-favorites .fav-card-photo img {
    animation: none;
    transition: none;
  }
  .story-50-favorites .step-card {
    transition: none;
  }
}

/* ============================================
   MOBILE — scrollytelling overrides
   ============================================ */

@media (max-width: 768px) {
  .story-50-favorites #scrolly-text {
    width: 100%;
    margin-top: calc(-100vh + var(--header-h));
    margin-top: calc(-100dvh + var(--header-h));
  }

  .story-50-favorites .step {
    min-height: 100vh;
    min-height: 100svh;
    align-items: flex-end;
    padding: 0 12px 24px;
  }

  .story-50-favorites .step:first-of-type {
    min-height: 100vh;
    min-height: 100svh;
    padding-bottom: 24px;
  }

  .story-50-favorites .step-card {
    max-width: none;
    width: 100%;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22);
  }

  .fav-stepper {
    padding: 9px 12px;
    bottom: auto;
    top: 18px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .fav-stepper-seg {
    width: 10px;
  }

  .fav-stepper-label {
    font-size: 0.52rem;
  }

  .fav-return-pill {
    top: 18px;
  }
}
