/* ESTATE-SIMPLIFY-2026-11-02: grouped dropdown chrome + hub sections.
   Pure CSS pattern (details/summary + :focus-within) — no JS, no inline
   handlers, fully inside the site's enforcing CSP (style-src 'self'). */
.mainnav .nav-group, .site-nav .nav-group { position: relative; flex: 0 0 auto; }
.mainnav .nav-group summary, .site-nav .nav-group summary {
  display: inline-flex; align-items: center; min-height: 44px; padding: .35em .8em;
  color: var(--txt, #d7e0d8); font-weight: 600; border-radius: 8px; white-space: nowrap;
  cursor: pointer; list-style: none; transition: color .18s ease, background-color .18s ease;
}
.mainnav .nav-group summary::-webkit-details-marker, .site-nav .nav-group summary::-webkit-details-marker { display: none; }
.mainnav .nav-group summary::after, .site-nav .nav-group summary::after { content: "\25BE"; margin-left: .4em; font-size: .8em; color: var(--grn, #00e676); }
.mainnav .nav-group summary:hover, .site-nav .nav-group summary:hover { color: var(--grn, #00e676); background: rgba(0,230,118,.08); }
.mainnav .nav-group[open ] summary, .site-nav .nav-group[open ] summary { color: var(--grn, #00e676); background: rgba(0,230,118,.13); }
.mainnav .nav-menu, .site-nav .nav-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 1300; min-width: 240px;
  display: flex; flex-direction: column; gap: 2px; padding: 8px;
  background: var(--panel2, #101511); border: 1px solid var(--line, #1d2b20);
  border-radius: var(--r-m, 12px); box-shadow: var(--shadow-2, 0 22px 54px rgba(0,0,0,.55));
}
.mainnav .nav-menu a, .site-nav .nav-menu a {
  display: flex; align-items: center; min-height: 40px; padding: .35em .7em;
  color: var(--txt, #d7e0d8); font-weight: 600; border-radius: 8px; white-space: nowrap;
}
.mainnav .nav-menu a:hover, .site-nav .nav-menu a:hover { color: var(--grn, #00e676); background: rgba(0,230,118,.08); text-decoration: none; }
.mainnav .nav-menu a.active, .site-nav .nav-menu a.active { color: var(--grn, #00e676); background: rgba(0,230,118,.13); box-shadow: inset 0 0 0 1px rgba(0,230,118,.28); }
.mainnav .nav-group:last-of-type .nav-menu, .site-nav .nav-group:last-of-type .nav-menu { left: auto; right: 0; }
@media (max-width: 860px) {
  .mainnav .nav-menu, .site-nav .nav-menu { position: absolute; }
}
.hub-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line-soft, #141d16); scroll-margin-top: 96px; }
section[id] { scroll-margin-top: 96px; }
.foot-contact { display: block; margin-top: 8px; color: var(--dim, #7d8a7e); font-size: .92em; }

/* SWEEP1-2026-11-03: active-page highlight restored for grouped menus.
   The link-level .active (inside the open menu) existed since the
   simplification, but nothing showed at the top level with menus
   closed. The group containing the current page now lights its
   summary (server-rendered data-active in base/base_es; applied by
   static/js/nav-active.js on the static chrome), and the Book CTA
   lights on its own page. Same green, no new colors. */
.mainnav .nav-group[data-active="true"] summary, .site-nav .nav-group[data-active="true"] summary { color: var(--grn, #00e676); background: rgba(0,230,118,.10); box-shadow: inset 0 -2px 0 var(--grn, #00e676); }
.mainnav a.nav-cta.active, .site-nav a.nav-cta.active { box-shadow: inset 0 0 0 2px rgba(0,0,0,.45), 0 0 0 2px var(--grn, #00e676); }

/* ESTATE-PREMIUM-2026-11-03 (Sweep 1): dropdown panel finish —
   translucent deep panel with blur (progressive enhancement),
   the deep shadow stack, item radius/hover tint, and a focus
   ring on the group summary. The .active / [data-active]
   highlight rules above are untouched and keep working exactly
   as restored in the polish sweep. */
.mainnav .nav-menu, .site-nav .nav-menu {
  background: rgba(6,8,6,.94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(0,230,118,.16); border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 24px 60px rgba(0,0,0,.55);
}
.mainnav .nav-menu a, .site-nav .nav-menu a {
  border-radius: 8px;
  transition: color .16s ease, background-color .16s ease;
}
.mainnav .nav-group summary:focus-visible, .site-nav .nav-group summary:focus-visible {
  outline: 2px solid #00e676; outline-offset: 2px;
}
.mainnav .nav-cta, .site-nav .nav-cta {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 8px 24px rgba(0,230,118,.16);
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.mainnav .nav-cta:hover, .site-nav .nav-cta:hover { transform: translateY(-1px); }
.mainnav .nav-pulse, .site-nav .nav-pulse {
  display: inline-flex; align-items: center; min-height: 36px;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
  border: 1px solid rgba(0,230,118,.32); color: #00e676;
  font-size: .85rem; font-weight: 700; text-decoration: none;
  transition: background-color .16s ease, transform .16s ease;
}
.mainnav .nav-pulse:hover, .site-nav .nav-pulse:hover { background: rgba(0,230,118,.08); transform: translateY(-1px); }
.mainnav a.nav-pulse.active, .site-nav a.nav-pulse.active { box-shadow: 0 0 0 2px #00e676; }
.hub-section { border-top: 1px solid rgba(255,255,255,.06); margin-top: 40px; padding-top: 32px; }
@media (prefers-reduced-motion: reduce) {
  .mainnav .nav-menu a, .site-nav .nav-menu a,
  .mainnav .nav-cta, .site-nav .nav-cta { transition: none !important; }
  .mainnav .nav-cta:hover, .site-nav .nav-cta:hover { transform: none; }
}

/* NAV-HUNT-2026-11-07 B-01: the app chrome's .mainnav got
   overflow-x:auto from style.css at every viewport <= 4150px,
   which makes overflow-y compute to auto too: the nav became a
   one-row-tall two-axis scroll container and every open dropdown
   panel (position:absolute, hanging below the row) was clipped
   invisible and unclickable. The nav wraps instead of scrolling
   sideways, so no scroll container ever clips the panels. */
@media (max-width: 4150px) {
  .mainnav { overflow: visible; flex-wrap: wrap; }
}

/* NAV-HUNT-2026-11-07 B-03: on small phones an open panel from a
   later group could run past the right edge (only the last group
   was right-anchored and panels had no width cap). Cap the panel
   to the viewport and right-anchor the last four groups so every
   panel stays on-screen. */
@media (max-width: 860px) {
  .mainnav .nav-menu, .site-nav .nav-menu { max-width: calc(100vw - 24px); }
  .mainnav .nav-group:nth-of-type(n+4) .nav-menu, .site-nav .nav-group:nth-of-type(n+4) .nav-menu { left: auto; right: 0; }
  /* Coordinator replica finding (same hunt): <details> is not the
     only element type inside the nav — the brand anchor precedes
     the groups, so :nth-of-type counts it and shifts the anchor
     set one group late (EN group 3 / ES group 3 sit right of
     centre on phones and their panels ran past the right edge).
     Anchor from group 3 so every right-of-centre panel is
     covered on both chrome families. */
  .mainnav .nav-group:nth-of-type(n+3) .nav-menu, .site-nav .nav-group:nth-of-type(n+3) .nav-menu { left: auto; right: 0; }
}

/* NAV-FIX-2026-11-18: on phones the wrapped nav puts two groups per
   row, so group-anchored panels ran off both edges - left-anchored
   panels past the right edge, right-anchored panels from row-start
   groups past the left edge (owner report: half the menus not
   visible). At phone widths the panels now anchor to the nav
   itself: groups go static, the nav becomes the containing block,
   and every panel opens directly under the nav at the nav's edge,
   always on-screen. Desktop placement is unchanged. */
@media (max-width: 860px) {
  .mainnav, .site-nav { position: relative; }
  .mainnav .nav-group, .site-nav .nav-group { position: static; }
}
