/*
 * Restaurant Trail blocks — hand-compiled from
 * resources/assets/sass/blocks/_restaurant-trail.scss
 *
 * Shipped outside the SCSS build (which can't run on the current Node version).
 * Keep this file in sync with the partial.
 *
 *   .rt-overview  Restaurant Trail Map block (consolidated map + pin popups)
 *   .rt-entry     Restaurant Trail Entry block (one restaurant per block)
 *   .rt-toc       "Trail Stops" dock (bottom-center tab -> expanding list)
 */

/* ---- Restaurant Trail Map block (consolidated map) ----
   Root carries a modifier from the block's align setting:
   --full (trail default) / --wide / --content (align "None") */
.rt-overview {
  --rt-pad: clamp(1.25rem, 4vw, 4rem);
  margin: 2.5rem auto 3rem;
}

.rt-overview .rt-overview__map {
  margin: 0 auto;
  height: clamp(420px, 55vh, 560px);
  background: #dde5e3;
  scroll-margin-top: 70px;
}

/* Alignment modifiers */
.rt-overview--full,
.rt-overview--wide {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.rt-overview--full .rt-overview__map { max-width: 1920px; }
.rt-overview--wide .rt-overview__map {
  max-width: min(1400px, calc(100vw - 2.5rem));
  border-radius: 14px;
}
.rt-overview--content {
  max-width: 1200px;
  padding: 0 var(--rt-pad);
}
.rt-overview--content .rt-overview__map { border-radius: 14px; }

.rt-overview .rt-overview__hint {
  margin: 0.8rem auto 0;
  padding: 0 var(--rt-pad);
  text-align: center;
  font-size: 0.92rem;
  color: #6b7a79;
}

/* ---- Pin popups (Leaflet renders them inside the map container) ---- */
.rt-overview .rt-pop__name {
  margin: 0 0 0.15rem;
  font-weight: 800;
  font-size: 1.02rem;
  color: #1a2e2e;
}
.rt-overview .rt-pop__city {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #5b6b6a;
}
.rt-overview .rt-pop__link {
  font-weight: 700;
  color: #4a8587;
}

/* Editor-only placeholder shown before any entry blocks are saved. */
.rt-overview--empty {
  width: auto;
  margin: 0;
  padding: 2rem;
  background: #dde5e3;
  border-radius: 10px;
  color: #3c4a49;
}

/* ---- Restaurant Trail Entry block: its own centered 1200px column ---- */
.rt-entry {
  --rt-pad: clamp(1.25rem, 4vw, 4rem);
  max-width: 1200px;
  margin: 0 auto 5rem;
  padding: 0 var(--rt-pad);
  color: #3c4a49;
  scroll-margin-top: 90px; /* clear the fixed mobile top bar on jump links */
  outline: none;           /* entries receive programmatic focus after jumps */
}

/* ---- Head: centered numbered intro ---- */
.rt-entry .rt-entry__head {
  margin-bottom: 2.5rem;
  text-align: center;
}

.rt-entry .rt-entry__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

/* Stop number — matches this stop's numbered pin on the trail map. */
.rt-entry .rt-entry__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: #2c4a4a;
  color: #fff;
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1;
}

/* City chip. With coordinates it's a link back to the trail map (opens that
   stop's popup); otherwise a plain label. */
.rt-entry .rt-entry__city {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.05rem 0.55rem 0.85rem;
  background: #fff;
  color: #2c4a4a;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1;
  text-decoration: none;
}
.rt-entry a.rt-entry__city {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rt-entry a.rt-entry__city:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.rt-entry .rt-entry__pin { color: #4a8587; flex: none; }

.rt-entry .rt-entry__name {
  margin: 0 0 1rem;
  color: #1a2e2e;
  font-weight: 800;
  line-height: 1.1;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.rt-entry .rt-entry__rule {
  width: 130px;
  height: 0;
  margin: 0 auto 1.25rem;
  border: 0;
  border-top: 2px solid #c9d3d1;
}

.rt-entry .rt-entry__desc {
  max-width: 820px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.7;
}
.rt-entry .rt-entry__desc p { margin: 0 0 1rem; }
.rt-entry .rt-entry__desc p:last-child { margin-bottom: 0; }

/* Website button under the description. */
.rt-entry .rt-entry__site {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.4rem;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  background: #4a8587;
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(44, 74, 74, 0.22);
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.rt-entry .rt-entry__site:hover {
  background: #2c4a4a;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(44, 74, 74, 0.3);
  color: #fff;
}
.rt-entry .rt-entry__site svg { flex: none; }

/* ---- Gallery: pure-CSS hover accordion ---- */
.rt-entry .rt-gallery {
  display: flex;
  gap: 0.5rem;
  height: 440px;
  overflow: hidden;
  border-radius: 14px;
}

.rt-entry .rt-gallery__item {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  transition: flex-grow 0.45s ease;
}
.rt-entry .rt-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rt-entry .rt-gallery__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.6rem 0.9rem;
  margin: 0;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.3;
  background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0));
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease 0.15s, transform 0.25s ease 0.15s;
  pointer-events: none;
}
.rt-entry .rt-gallery__item:first-child .rt-gallery__caption { opacity: 1; transform: none; }
.rt-entry .rt-gallery:hover .rt-gallery__item:first-child .rt-gallery__caption { opacity: 0; transform: translateY(4px); }
.rt-entry .rt-gallery__item:hover .rt-gallery__caption { opacity: 1; transform: none; }
.rt-entry .rt-gallery__item:first-child { flex-grow: 4; }
.rt-entry .rt-gallery:hover .rt-gallery__item:first-child { flex-grow: 1; }
.rt-entry .rt-gallery__item:hover { flex-grow: 4; }

/* ---- Tabs: two big circular toggles ---- */
.rt-entry .rt-tabs {
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  margin: 3rem 0 0;
}

.rt-entry .rt-tab {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  cursor: pointer;
  width: clamp(140px, 17vw, 200px);
  height: clamp(140px, 17vw, 200px);
  border-radius: 50%;
  background: #4a8587;
  color: #fff;
  font-weight: 700;
  font-size: clamp(1.1rem, 1.6vw, 1.6rem);
  line-height: 1.15;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  box-shadow: 0 8px 20px rgba(44, 74, 74, 0.25);
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}
.rt-entry .rt-tab:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(44, 74, 74, 0.32);
}
.rt-entry .rt-tab.is-active {
  background: #2c4a4a;
  box-shadow: 0 0 0 6px rgba(74, 133, 135, 0.35), 0 12px 26px rgba(44, 74, 74, 0.32);
}

/* ---- Reveal panels ---- */
.rt-entry .rt-panel {
  display: block;
  margin-top: 2.5rem;
  animation: rtFade 0.28s ease;
}
.rt-entry .rt-panel[hidden] { display: none; }

/* About — text left, image right */
.rt-entry .rt-panel--about .rt-panel__inner {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}
.rt-entry .rt-panel--about .rt-panel__text { flex: 1 1 50%; }
.rt-entry .rt-panel--about .rt-panel__media { flex: 1 1 50%; }
.rt-entry .rt-panel--about .rt-panel__media img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
}

.rt-entry .rt-panel__title {
  margin: 0 0 1rem;
  color: #1a2e2e;
  font-weight: 800;
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  line-height: 1.15;
}

.rt-entry .rt-panel__rule {
  width: 130px;
  height: 0;
  margin: 0 0 1.25rem;
  border: 0;
  border-top: 2px solid #c9d3d1;
}

.rt-entry .rt-panel__body {
  font-size: 1.05rem;
  line-height: 1.7;
}
.rt-entry .rt-panel__body p { margin: 0 0 1rem; }
.rt-entry .rt-panel__body p:last-child { margin-bottom: 0; }

/* Additional Info — full-bleed dark band */
.rt-entry .rt-panel--info {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: #2c4a4a;
  color: #fff;
  padding: 4rem var(--rt-pad);
  overflow: hidden;
}
.rt-entry .rt-panel--info .rt-panel__inner { max-width: 1100px; margin: 0 auto; }
.rt-entry .rt-panel--info .rt-panel__title { color: #fff; text-align: center; }
.rt-entry .rt-panel--info .rt-panel__intro {
  max-width: 760px;
  margin: 0 auto 2.5rem;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
}

.rt-entry .rt-info-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
}

.rt-entry .rt-info-item {
  flex: 0 1 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rt-entry .rt-info-item__icon {
  width: clamp(120px, 14vw, 170px);
  height: clamp(120px, 14vw, 170px);
  border-radius: 50%;
  background: #efeae0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.rt-entry .rt-info-item__icon img {
  width: 58%;
  height: 58%;
  object-fit: contain;
  display: block;
}

.rt-entry .rt-info-item__caption {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

/* ---- "Trail Stops" dock: small bottom-right tab -> expanding popout ----
   Markup is <div role="navigation">, NOT <nav> — the theme styles bare nav
   elements (fixed/absolute, top 0, full width). top/width pinned anyway. */
.rt-toc {
  position: fixed;
  top: auto;
  left: auto;
  right: 1.25rem;
  bottom: 0;
  width: auto;
  transform: translateY(110%);
  z-index: 1500; /* above Leaflet panes/controls (<=1000) */
  transition: transform 0.3s ease;
}
.rt-toc.is-visible { transform: translateY(0); }

.rt-toc .rt-toc__toggle {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  border-radius: 12px 12px 0 0;
  background: #2c4a4a;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  box-shadow: 0 -4px 16px rgba(26, 46, 46, 0.25);
  transition: background-color 0.18s ease;
}
.rt-toc .rt-toc__toggle:hover { background: #4a8587; }
.rt-toc .rt-toc__toggle svg { flex: none; width: 16px; height: 16px; }

.rt-toc .rt-toc__chevron { transition: transform 0.25s ease; }
.rt-toc.is-open .rt-toc__chevron { transform: rotate(180deg); }

/* Expanded popout: floats above the tab, anchored right, bounded width. */
.rt-toc .rt-toc__panel {
  position: absolute;
  right: 0;
  left: auto;
  bottom: calc(100% + 0.6rem);
  width: min(540px, calc(100vw - 2rem));
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 44px rgba(26, 46, 46, 0.3);
  padding: 1.1rem 1.1rem 0.8rem;
  animation: rtFade 0.22s ease;
}
.rt-toc .rt-toc__panel[hidden] { display: none; }

.rt-toc .rt-toc__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
}

.rt-toc .rt-toc__title {
  margin: 0;
  font-weight: 800;
  font-size: 1.05rem;
  color: #1a2e2e;
}

.rt-toc .rt-toc__map-link {
  font-weight: 700;
  font-size: 0.95rem;
  color: #4a8587;
  text-decoration: none;
  white-space: nowrap;
}
.rt-toc .rt-toc__map-link:hover { text-decoration: underline; }

/* Two columns reading down (1-16 left, 17-32 right); --rt-toc-rows is set
   inline by the template to ceil(count/2). */
.rt-toc .rt-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(var(--rt-toc-rows, 99), auto);
  grid-template-columns: 1fr 1fr;
  column-gap: 1rem;
  max-height: min(55vh, 480px);
  overflow: auto;
  overscroll-behavior: contain;
}
.rt-toc .rt-toc__list li { margin: 0; }

.rt-toc .rt-toc__link {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: #3c4a49;
  text-decoration: none;
  font-size: 0.98rem;
  line-height: 1.3;
}
.rt-toc .rt-toc__link:hover { background: #eef3f2; }
.rt-toc .rt-toc__link.is-current { background: #e3ecea; }

.rt-toc .rt-toc__num {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: #e3ecea;
  color: #2c4a4a;
  font-weight: 800;
  font-size: 0.8rem;
}
.rt-toc .rt-toc__link.is-current .rt-toc__num {
  background: #2c4a4a;
  color: #fff;
}

.rt-toc .rt-toc__text {
  font-weight: 600;
  color: #1a2e2e;
}
.rt-toc .rt-toc__text small {
  display: block;
  margin-top: 1px;
  font-size: 0.8rem;
  font-weight: 400;
  color: #7a8a88;
}

/* ---- Mobile ---- */
@media (max-width: 781px) {
  .rt-overview { margin-bottom: 2rem; }
  .rt-overview .rt-overview__map { height: 380px; }

  .rt-entry { margin-bottom: 3.5rem; scroll-margin-top: 70px; }
  .rt-entry .rt-entry__head { margin-bottom: 1.75rem; }

  .rt-entry .rt-gallery { flex-wrap: wrap; height: auto; border-radius: 0; }
  .rt-entry .rt-gallery__item { flex: 1 1 calc(50% - 0.25rem); height: 180px; }
  .rt-entry .rt-gallery:hover .rt-gallery__item:first-child { flex-grow: 1; }
  .rt-entry .rt-gallery__item:hover { flex-grow: 1; }

  .rt-entry .rt-panel--about .rt-panel__inner { flex-direction: column; gap: 1.5rem; }
  .rt-entry .rt-panel--info { padding: 2.75rem var(--rt-pad); }
  .rt-entry .rt-info-grid { gap: 1.75rem; }

  /* Single readable column on small screens. */
  .rt-toc { right: 0.75rem; }
  .rt-toc .rt-toc__panel { padding: 0.9rem 0.8rem 0.6rem; width: min(540px, calc(100vw - 1.5rem)); }
  .rt-toc .rt-toc__list {
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: 1fr;
    max-height: min(60vh, 480px);
  }
}

/* ---- Theme defense ---- (see SCSS partial for rationale; these tie the
   wander-idaho template at (1,2,1) and win on cascade order) */
#app article.rt-entry .rt-entry__name,
#app article.rt-entry .rt-panel__title {
  width: auto;
  max-width: none;
  text-shadow: none;
}
#app article.rt-entry .rt-entry__name {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}
#app article.rt-entry .rt-panel__title {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
}
#app article.rt-entry .rt-entry__desc p,
#app article.rt-entry .rt-entry__desc ul,
#app article.rt-entry .rt-panel__body p,
#app article.rt-entry .rt-panel__body ul,
#app article.rt-entry .rt-panel__intro p {
  width: auto;
  max-width: none;
  margin: 0 0 1rem;
}
#app article.rt-entry .rt-entry__desc p:last-child,
#app article.rt-entry .rt-panel__body p:last-child,
#app article.rt-entry .rt-panel__intro p:last-child {
  margin-bottom: 0;
}
#app div.rt-overview .rt-overview__hint,
#app div.rt-overview .rt-pop__name,
#app div.rt-overview .rt-pop__city,
#app div.rt-toc .rt-toc__title {
  width: auto;
  max-width: none;
  text-shadow: none;
}

@keyframes rtFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Leaflet divIcon markers — strip the default white box so the SVG pin / count
   disc shows clean. Kept global to match Leaflet's own class placement. */
.rt-marker { background: none; border: 0; position: relative; }

/* Stop number inside the teardrop pin's white circle. */
.rt-marker__num {
  position: absolute;
  top: 10px;
  left: 0;
  width: 34px;
  text-align: center;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  color: #2c4a4a;
}

/* Count disc for stops that share identical coordinates. */
.rt-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #4a8587;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
