/*
 * Restaurant Trails Map — Figma-styled clone of the regions menu.
 * Scoped to #restaurant-trails-map so the original #ilra-regions-menu is untouched.
 *
 * NOTE: hand-shipped because the theme's webpack/node-sass build can't run on this
 * Node version. The maintainable source mirror lives at
 * resources/assets/sass/blocks/_restaurant-trails-map.scss — keep them in sync.
 */

/* Full-bleed split: teal map fills the LEFT half, the region panel fills the
   RIGHT half (a solid grey-green field, NOT a floating card). Overrides the
   theme breakout that would otherwise cap .wp-block-columns at 1182px. */
#restaurant-trails-map.wp-block-columns {
  margin: 0;
  max-width: 100%;
  position: relative;
  left: 0;
  transform: none;
  width: 100vw;
  gap: 0;
  align-items: stretch;
}

@media only screen and (min-width: 782px) {
  #restaurant-trails-map.wp-block-columns { min-height: 560px; }
}

/* The two halves: a hard 50/50 split on desktop. */
@media only screen and (min-width: 782px) {
  #restaurant-trails-map .svg-column,
  #restaurant-trails-map .float-column {
    flex: 1 1 50%;
    max-width: 50%;
    width: 50%;
  }
}

/* LEFT half — teal map field. */
#restaurant-trails-map .svg-column {
  background-color: #57a0a2;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* RIGHT half — solid grey-green panel (no card, no shadow, no radius).
   Content is centered vertically and horizontally within the half. */
#restaurant-trails-map .float-column {
  position: relative;
  top: auto;
  right: auto;
  margin: 0;
  background-color: #c8d3d2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2.5rem;
}

#restaurant-trails-map .svg-column figure { overflow: hidden; height: 100%; }

/* ---- SVG map (ported from regions-menu, kept on-brand teal) ---- */
#restaurant-trails-map .wp-block-image {
  height: 100%;
  margin: 0;
  width: 100%;
}

#restaurant-trails-map .wp-block-image img,
#restaurant-trails-map .wp-block-image svg {
  background-color: #57a0a2;
  height: 100%;
  margin: 0;
  width: 100%;
}

@media only screen and (min-width: 782px) {
  #restaurant-trails-map .wp-block-image img,
  #restaurant-trails-map .wp-block-image svg { min-height: 560px; }
}

#restaurant-trails-map .wp-block-image svg path { fill: #57a0a2; stroke: #fff; }
#restaurant-trails-map .wp-block-image svg g path { fill: #fff; opacity: 0.25; }
#restaurant-trails-map .wp-block-image svg a g path { opacity: 1; }

#restaurant-trails-map .wp-block-image svg .region {
  fill: #325454;
  transition: opacity 0.15s ease;
  opacity: 0.75;
}

#restaurant-trails-map .wp-block-image svg .is-active .region {
  opacity: 1;
  stroke-width: 5px;
}

/* ---- Region list: big Figma pills on the panel half ---- */
#restaurant-trails-map .restaurant-trails-menu {
  width: 100%;
  max-width: 640px;
}

/* No card chrome — the right half itself is the panel background. */
#restaurant-trails-map .restaurant-trails-menu .region-nav {
  width: 100%;
  background: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

/* "Choose a Restaurant Trail" heading — centered over the panel, per the Figma.
   The long, high-specificity selector (id + 3 classes + element) is intentional:
   it overrides the theme's global `.wander-idaho #app .fullwidth-template h2`
   rules (5rem / centered / text-shadow) that would otherwise apply here. */
#restaurant-trails-map .restaurant-trails-menu .region-nav h2.region-heading {
  margin: 0 0 1.75rem;
  width: auto;
  max-width: none;
  text-align: center;
  text-shadow: none;
  color: #1a2e2e;
  font-weight: 800;
  line-height: 1.1;
  font-size: clamp(1.8rem, 2.6vw, 2.8rem);
}

#restaurant-trails-map .restaurant-trails-menu .region-nav ul {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: regions;
  width: 100%;
}

#restaurant-trails-map .restaurant-trails-menu .region-nav > ul > li {
  margin-bottom: 1rem;
}

/* Bigger pill buttons (per "bigger buttons"): taller, larger type, rounder. */
#restaurant-trails-map .restaurant-trails-menu a.toggle {
  display: block;
  padding: 1.5rem 1.75rem;
  background-color: #fff;
  /* !important beats the theme's .fullwidth-template ul a { color:#c46f4a } (rust) */
  color: #263e3e !important;
  font-size: 1.35rem;
  line-height: 1.3;
  font-weight: 700;
  text-transform: none;
  text-align: center;
  text-decoration: none;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

#restaurant-trails-map .restaurant-trails-menu a.toggle:hover {
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

#restaurant-trails-map .restaurant-trails-menu a.toggle::before {
  counter-increment: regions;
  content: counter(regions) ". ";
  font-weight: 700;
}

/* subtitle (cities) hidden on inactive rows — name only, per the Figma */
#restaurant-trails-map .restaurant-trails-menu .cities {
  display: none;
  color: #554948;
  font-size: 0.85em;
  font-weight: 400;
  margin-top: 0.4rem;
}

#restaurant-trails-map .restaurant-trails-menu .cities em { display: none; }

/* active row — solid deep teal block, white text, top-rounded so it joins the info panel */
#restaurant-trails-map .restaurant-trails-menu a.toggle.is-active {
  background-color: #2c4a4a;
  color: #fff !important;
  border-radius: 18px 18px 0 0;
}

/* Regions whose food trail isn't published yet have no reveal panel, so the
   active pill stays fully rounded instead of opening into a panel below. */
#restaurant-trails-map .restaurant-trails-menu a.toggle--no-trail.is-active {
  border-radius: 18px;
}

#restaurant-trails-map .restaurant-trails-menu a.toggle.is-active .cities {
  display: block;
  color: rgba(255, 255, 255, 0.85);
}

/* expanded description + link (functional; styled light-on-dark) */
#restaurant-trails-map .restaurant-trails-menu .region-info {
  display: none;
  color: #fff;
  font-size: 0.95em;
}

#restaurant-trails-map .restaurant-trails-menu a.toggle.is-active + .region-info {
  display: block;
  background-color: #2c4a4a;
  padding: 0 1.75rem 1.5rem;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

#restaurant-trails-map .restaurant-trails-menu a.toggle:not(.is-active) + .region-info {
  display: none;
}

#restaurant-trails-map .restaurant-trails-menu .region-info li { list-style: none; }
#restaurant-trails-map .restaurant-trails-menu .region-info p { padding: 0.25em 0 0.75em; margin: 0; }

#restaurant-trails-map .restaurant-trails-menu .region-info a {
  color: #fff !important;
  font-weight: 700;
  display: block;
  text-align: center;
  text-decoration: underline;
}

#restaurant-trails-map .restaurant-trails-menu .region-info a::before { content: unset !important; }

/* ---- Mobile: stack the two halves (map on top, panel below) ---- */
@media only screen and (max-width: 781px) {
  #restaurant-trails-map.wp-block-columns { flex-wrap: wrap; }
  #restaurant-trails-map .svg-column,
  #restaurant-trails-map .float-column {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }
  #restaurant-trails-map .float-column { padding: 2.25rem 1.25rem; }
  #restaurant-trails-map .restaurant-trails-menu { max-width: 520px; margin: 0 auto; }
  /* Map sizes to its own aspect ratio (full width, natural height) so the
     contained map fills the strip — no crop, no tall teal void from the
     column stretching to the taller menu beside it. */
  #restaurant-trails-map .svg-column { align-self: flex-start; }
  #restaurant-trails-map .svg-column figure,
  #restaurant-trails-map .wp-block-image { height: auto; }
  #restaurant-trails-map .wp-block-image img,
  #restaurant-trails-map .wp-block-image svg {
    width: 100%;
    height: auto;
    aspect-ratio: 944 / 1518;
  }
  #restaurant-trails-map .restaurant-trails-menu a.toggle { font-size: 1.15rem; padding: 1.15rem 1.25rem; }
}

/* =========================================================================
   Restaurant Trails — "Newest Restaurant Trail Feature" band
   ========================================================================= */

/* Keep the intro card above the lifted band so it straddles the hero seam. */
.intro-paragraph { position: relative; z-index: 5; }

/* Lift the dark band up to meet the hero (closes the ~65px white gap). Scoped
   to desktop, where the hero is a fixed 750px; !important beats the block's
   inline margin-top:0. */
@media (min-width: 782px) {
  #app .fullwidth-template .rt-feature { margin-top: -65px !important; }
}

/* Section heading. Sits on the same 90%-wide, centered group constraint as the
   columns row below it (see .wp-block-columns rule) so the heading, separator,
   body and button all share one left edge — one tidy column. Overrides the
   theme's global .fullwidth-template h2 (max-width:800 + text-shadow). */
#app .fullwidth-template .rt-feature > h2 {
  width: 90%;
  max-width: none;
  margin: 0 auto 1.25rem;
  text-shadow: none;
}

/* Body fills the left column (override the theme's auto-centering of p). */
#app .fullwidth-template .rt-feature .wp-block-column p {
  max-width: none;
  width: auto;
  margin-left: 0;
  margin-right: 0;
}

/* Put the columns row on the SAME 90%-wide, centered group constraint as the
   heading, so heading + separator + body + button all line up on one left edge.
   Two theme rules fight us here: the global breakout
   `@media (min-width:1025px){ .wp-block-columns { width:1182px; left:50%;
   transform:translateX(-50%) } }`, and `.fullwidth-template .wp-block-columns
   { width:100% }`. Neutralize the breakout and match the heading's width:90%. */
#app .fullwidth-template .rt-feature .wp-block-columns {
  left: auto;
  transform: none;
  width: 90%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

/* Short, left-aligned accent rule under the heading (override the theme's
   centered 90%/800px separator). */
#app .fullwidth-template .rt-feature .wp-block-separator {
  width: 220px;
  max-width: 220px;
  margin: 0.25rem 0 1.75rem 0;
  border: none;
  border-top: 2px solid rgba(255, 255, 255, 0.5);
  background: none;
  height: 0;
  opacity: 1;
}
