/* Full-screen coffee discovery feed. All selectors are scoped to explore/community. */
.explore-feed {
  --explore-ink: #fff;
  --explore-muted: rgb(255 255 255 / 78%);
  --explore-accent: #b8f1d4;
  --explore-shadow: 0 1px 14px rgb(0 0 0 / 32%);
  --explore-rail-size: 48px;
  --explore-gap: 18px;
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100dvh;
  min-height: 100%;
  overflow: hidden;
  background: #111;
  color: var(--explore-ink);
  overscroll-behavior: contain;
}

/* CoffeeHey! shell integration: Explore becomes the immersive centre tab while
   the persistent three-tab navigation remains reachable. */
body.explore-mode #map,
body.explore-mode > .app-shell > .topbar,
body.explore-mode > .app-shell > .map-tools,
body.explore-mode #sheet-handle,
body.explore-mode #browse-panel > :not(#results) { display: none !important; }
body.explore-mode .sheet {
  inset: 0;
  width: 100%;
  height: 100dvh !important;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: #111;
}
body.explore-mode #browse-panel { background: #111; }
body.explore-mode #results { overflow: hidden; }
body.explore-mode .explore-feed { height: calc(100dvh - 64px - env(safe-area-inset-bottom, 0px)); }
body.explore-mode .explore-feed__card { height: 100%; min-height: 100%; }
body.explore-mode .tabbar {
  position: relative;
  z-index: 8;
  color: #aaa;
  border-color: rgb(255 255 255 / 12%);
  background: #111;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.explore-mode .tab { color: #a9a9ae; }
body.explore-mode .tab.active { color: #b8f1d4; background: rgb(184 241 212 / 10%); }
body.explore-mode .explore-feed__body,
body.explore-mode .explore-feed__rail { bottom: calc(24px + env(safe-area-inset-bottom)); }

.explore-feed__viewport {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scroll-behavior: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: none;
}

.explore-feed__viewport.is-feed-dragging {
  scroll-snap-type: none;
  touch-action: none;
}

.explore-feed__viewport::-webkit-scrollbar { display: none; }

.explore-feed__card {
  position: relative;
  display: grid;
  width: 100%;
  height: 100dvh;
  min-height: 100%;
  overflow: hidden;
  isolation: isolate;
  contain: layout paint;
  background: #171717;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.explore-feed__media,
.explore-feed__poster,
.explore-feed__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.explore-feed__media,
.explore-feed__poster {
  z-index: -2;
  object-fit: cover;
  object-position: center;
  background: #20211f;
  pointer-events: none;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.explore-feed__card.is-active .explore-feed__media,
.explore-feed__card.is-active .explore-feed__poster { will-change: transform; }

.explore-feed__shade {
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(0 0 0 / 26%) 0%, transparent 20%, transparent 44%, rgb(0 0 0 / 16%) 57%, rgb(0 0 0 / 79%) 100%),
    linear-gradient(90deg, rgb(0 0 0 / 16%), transparent 38%, transparent 72%, rgb(0 0 0 / 18%));
}

.explore-feed__topbar {
  position: absolute;
  z-index: 2;
  inset: max(12px, env(safe-area-inset-top)) 16px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.explore-feed__topbar > * { pointer-events: auto; }
.explore-feed__top-controls { display: flex; gap: 8px; }

.explore-feed__location-prompt {
  position: absolute;
  z-index: 3;
  top: calc(max(12px, env(safe-area-inset-top)) + 58px);
  left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(74vw, 330px);
  padding: 10px 13px;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 18px;
  background: rgb(18 18 18 / 52%);
  color: #fff;
  text-align: left;
  box-shadow: var(--explore-shadow);
  backdrop-filter: blur(14px);
}
.explore-feed__location-prompt svg { width: 21px; height: 21px; color: var(--explore-accent); }
.explore-feed__location-prompt span { display: grid; gap: 2px; }
.explore-feed__location-prompt strong { font-size: 13px; line-height: 1.25; }
.explore-feed__location-prompt small { color: var(--explore-muted); font-size: 10px; line-height: 1.25; }

.explore-feed__eyebrow {
  max-width: min(62vw, 360px);
  overflow: hidden;
  color: var(--explore-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.3;
  text-overflow: ellipsis;
  text-shadow: var(--explore-shadow);
  text-transform: uppercase;
  white-space: nowrap;
}

.explore-feed__sound,
.explore-feed__more,
.explore-feed__action,
.explore-feed__follow,
.explore-feed__comments-close {
  display: inline-grid;
  place-items: center;
  color: #fff;
  border: 0;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.explore-feed__sound,
.explore-feed__more {
  width: 42px;
  height: 42px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 50%;
  background: rgb(20 20 20 / 40%);
  backdrop-filter: blur(12px);
}

.explore-feed__sound svg,
.explore-feed__more svg,
.explore-feed__action svg { width: 25px; height: 25px; }

.explore-feed__body {
  position: absolute;
  inset: auto 0 calc(20px + env(safe-area-inset-bottom)) 18px;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  min-width: 0;
  pointer-events: none;
}

.explore-feed__metadata {
  width: min(100%, 560px);
  min-width: 0;
  padding: 0 calc(82px + env(safe-area-inset-right)) 8px 0;
  text-shadow: var(--explore-shadow);
  pointer-events: auto;
}

.explore-feed__shop-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  max-width: 100%;
  margin: 0 0 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
}

.explore-feed__shop-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explore-feed__location {
  display: block;
  margin-top: 3px;
  color: var(--explore-muted);
  font-size: 12px;
  font-weight: 550;
}

.explore-feed__caption {
  max-width: 48ch;
  margin: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.explore-feed__reference { display: inline-flex; margin: 0 0 7px; padding: 4px 8px; border: 1px solid rgb(255 255 255 / 34%); border-radius: 999px; background: rgb(12 12 12 / 42%); color: #fff; font-size: 10px; font-weight: 750; backdrop-filter: blur(8px); }

.explore-feed__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.explore-feed__tag {
  padding: 4px 8px;
  color: #fff;
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  font-size: 11px;
  line-height: 1.2;
  backdrop-filter: blur(8px);
}

.explore-feed__rail {
  position: absolute;
  z-index: 2;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--explore-gap);
  width: 54px;
  pointer-events: auto;
}

.explore-feed__profile-action {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--explore-rail-size);
  height: var(--explore-rail-size);
  margin-bottom: 2px;
  color: #fff;
  text-decoration: none;
}

.explore-feed__avatar {
  width: 44px;
  height: 44px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #625446;
  object-fit: cover;
  box-shadow: var(--explore-shadow);
  padding: 0;
  overflow: hidden;
}
.explore-feed__avatar img { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.explore-feed__avatar--fallback {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #2a8461, #176345);
}
.explore-feed__avatar--fallback svg { width: 23px; height: 23px; }

.explore-feed__follow {
  position: absolute;
  right: 0;
  bottom: -9px;
  width: 28px;
  height: 28px;
  border: 1px solid rgb(0 0 0 / 12%);
  border-radius: 50%;
  background: #ef554d;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgb(0 0 0 / 24%);
}

.explore-feed__follow[aria-pressed="true"] { background: #278864; }

.explore-feed__action-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 52px;
  color: #fff;
  text-shadow: var(--explore-shadow);
}

.explore-feed__action {
  width: 48px;
  height: 44px;
  padding: 0;
  background: transparent;
  filter: drop-shadow(0 2px 5px rgb(0 0 0 / 42%));
}

.explore-feed__action[data-feed-like][aria-pressed="true"] { color: #ff5368; }
.explore-feed__action[data-feed-like][aria-pressed="true"] svg,
.explore-feed__bookmark[aria-pressed="true"] svg { fill: currentColor; }
.explore-feed__bookmark[aria-pressed="true"] { color: var(--explore-accent); }
.explore-feed__action-count { font-size: 11px; font-weight: 700; line-height: 1.15; }

.explore-feed__double-heart {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: clamp(84px, 25vw, 148px);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.3) rotate(-14deg);
  filter: drop-shadow(0 6px 24px rgb(0 0 0 / 38%));
}

.explore-feed__double-heart svg { display: block; width: 100%; height: auto; }
.explore-feed__double-heart.is-visible { animation: explore-heart-pop 820ms cubic-bezier(.2,.8,.25,1) both; }

.explore-save-flight {
  position: fixed;
  z-index: 1000;
  width: 44px;
  height: 44px;
  color: var(--explore-accent);
  pointer-events: none;
  filter: drop-shadow(0 5px 10px rgb(0 0 0 / 35%));
}
.explore-save-flight svg { width: 100%; height: 100%; fill: currentColor; }
.tab.save-arrived { animation: saved-tab-arrival 520ms cubic-bezier(.2,.8,.25,1); }
@keyframes saved-tab-arrival {
  0%,100% { transform: scale(1); }
  45% { transform: scale(1.14); color: #278864; }
}

@keyframes explore-heart-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-14deg); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(6deg); }
  42% { transform: translate(-50%, -50%) scale(.95) rotate(0); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(.85) rotate(0); }
}

.explore-feed__comments-backdrop {
  position: absolute;
  z-index: 5;
  inset: 0;
  border: 0;
  background: rgb(0 0 0 / 48%);
}

.explore-feed__comments {
  position: absolute;
  z-index: 6;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(76dvh, 720px);
  min-height: min(42dvh, 360px);
  overflow: hidden;
  color: #222;
  border-radius: 20px 20px 0 0;
  background: #fff;
  box-shadow: 0 -12px 36px rgb(0 0 0 / 20%);
  padding-bottom: env(safe-area-inset-bottom);
}

.explore-feed__comments[hidden],
.explore-feed__comments-backdrop[hidden] { display: none; }

.explore-feed__comments-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 12px 56px;
  border-bottom: 1px solid #efeff1;
  font-size: 14px;
  font-weight: 750;
}

.explore-feed__comments-close {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 42px;
  height: 42px;
  color: #555;
  border-radius: 50%;
  background: transparent;
  font-size: 25px;
}

.explore-feed__comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.explore-feed__comment {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 10px 0;
  color: #2a2a2d;
  font-size: 13px;
  line-height: 1.4;
}

.explore-feed__comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e9eee9;
  object-fit: cover;
}

.explore-feed__comment-author { display: block; margin-bottom: 2px; color: #727278; font-size: 11px; font-weight: 700; }
.explore-feed__comment-like { color: #78787d; font-size: 11px; }

.explore-feed__comment-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 12px;
  border-top: 1px solid #efeff1;
  background: #fff;
}

.explore-feed__comment-input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 10px 14px;
  color: #222;
  border: 1px solid #e5e5e8;
  border-radius: 999px;
  background: #f7f7f8;
  font: inherit;
  font-size: 13px;
}

.explore-feed__comment-submit {
  min-width: 48px;
  min-height: 42px;
  padding: 0 8px;
  color: #25805e;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.explore-feed :is(button, a, input):focus-visible {
  outline: 3px solid #aaf0d0;
  outline-offset: 3px;
}

.explore-feed__visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  clip-path: inset(50%) !important;
}

@media (min-width: 700px) {
  .explore-feed {
    width: min(100%, 480px);
    height: min(100dvh, 900px);
    min-height: min(100dvh, 680px);
    margin-inline: auto;
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgb(0 0 0 / 24%);
  }

  .explore-feed__card { height: 100%; min-height: 100%; }
  .explore-feed__comments { border-radius: 20px 20px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .explore-feed__viewport { scroll-behavior: auto; }
  .explore-feed__double-heart.is-visible { animation: none; opacity: 1; transform: translate(-50%, -50%); }
  .tab.save-arrived { animation: none; }
  .explore-feed *,
  .explore-feed *::before,
  .explore-feed *::after { transition-duration: .01ms !important; }
}
