/* ─── Regulatory Ecosystem switcher ─────────────────────────────────────────
   The 2×2 grid trigger left of the brand and the left-docked panel beneath
   the header. Markup ships in every page's <nav>; behavior in ecosystem.js.
   Brand accents are each sibling's shipped wordmark colour (News emerald,
   Events purple, Academy orange, Jobs royal blue from regulatoryjobs.com). */

.eco-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-light, #687489);
  cursor: pointer;
  /* Wordmark-to-trigger gap matches the header's R-to-wordmark gap (.brand-link gap: 28px). */
  margin-left: 28px;
  transition: background 0.15s ease, color 0.15s ease;
}
.eco-trigger:hover,
.eco-trigger[aria-expanded="true"] {
  background: rgba(16, 109, 55, 0.08);
  color: var(--accent, #b91c1c);
}
.eco-trigger:focus-visible {
  outline: 2px solid var(--accent, #b91c1c);
  outline-offset: 2px;
}
.eco-trigger svg { display: block; }

.eco-panel {
  /* The sheet's left edge lines up with the header's R logo and its right
     edge runs slightly past the trigger's, so it hangs directly under the
     header lockup. The nav's backdrop-filter makes it the containing block for
     fixed descendants, but the nav is full-width and pinned to the viewport
     top, so the coordinates coincide. ecosystem.js sets --eco-top / --eco-left
     / --eco-w to the nav's bottom, the R's left edge, and the trigger's right
     edge on open. */
  position: fixed;
  top: calc(var(--eco-top, 104px) + 10px);
  left: var(--eco-left, 16px);
  width: min(
    calc(var(--eco-w, 460px) + 54px - var(--eco-left, 16px)),
    calc(100vw - var(--eco-left, 16px) - 16px)
  );
  max-height: calc(100dvh - var(--eco-top, 104px) - 26px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px 20px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(13, 37, 69, 0.13), 0 4px 16px rgba(13, 37, 69, 0.05);
  z-index: 210;
  opacity: 0;
  transform: translateY(-10px);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)),
    transform 0.22s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)),
    visibility 0s linear 0.22s;
}
.eco-panel.is-open {
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.22s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)),
    transform 0.22s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
}
/* The panel itself receives programmatic focus on open; the ring belongs on the
   cards as the user tabs, not on the container (id beats the global ring rule). */
#eco-panel:focus,
#eco-panel:focus-visible { outline: none; }

/* Ruled title: the divider lines run the full panel width (.eco-titlebar), and
   the hover sweep covers those dividers edge to edge — the pseudos ride the
   block-level link, whose box spans the bar and meets its borders, so hovering
   anywhere along the bar sweeps both rules in full. Same category-link sweep
   (2px #44ef8c at 0.32s); the title links to /ecosystem. */
.eco-titlebar {
  border-top: 1px solid var(--border, #e2e8f0);
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.eco-title {
  position: relative;
  display: block;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.25;
  color: var(--accent, #b91c1c);
  text-decoration: none;
  padding: 11px 0;
}
.eco-title::before,
.eco-title::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #44ef8c;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.eco-title::before { top: -1px; }
.eco-title::after { bottom: -1px; }
.eco-title:hover::before,
.eco-title:hover::after,
.eco-title:focus-visible::before,
.eco-title:focus-visible::after {
  transform: scaleX(1);
}
.eco-sub {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted, #4a5568);
}

.eco-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 20px;
}

.eco-card--news { --eco-a: #0d9f4a; }
.eco-card--events { --eco-a: #781cb9; }
.eco-card--academy { --eco-a: #ff7900; }
.eco-card--jobs { --eco-a: #1c4eb9; }
.eco-card--leadership { --eco-a: #b91c1c; }
.eco-card--toolkit { --eco-a: #8d4715; }

/* Placeholder card (site not launched yet): a plain div, not a link — no lift,
   no sweep. The Coming Soon pill rides its own line above the brand row,
   centered on the wordmark's span: .eco-wordmark-wrap takes the wordmark's
   place in the flex row (same shrink behavior) and anchors the
   absolutely-positioned pill; the row's top margin reserves the pill's line. */
.eco-card--soon { cursor: default; }
.eco-card--soon:hover {
  transform: none;
  border-color: var(--border, #e2e8f0);
  box-shadow: none;
}
.eco-card--soon:hover::after { transform: scaleX(0); opacity: 0; }
.eco-card--soon:hover .eco-card-brand { transform: none; }
.eco-card--soon .eco-card-top { margin-top: 30px; }
.eco-wordmark-wrap {
  position: relative;
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
}
.eco-soon {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--eco-a);
  background: rgba(141, 71, 21, 0.09);
}
.eco-card--jobs .eco-soon { background: rgba(28, 78, 185, 0.08); }

.eco-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px 15px;
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  text-decoration: none;
  overflow: hidden;
  transition:
    transform 0.22s var(--ease-out-quint, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow 0.22s var(--ease-out-quint, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color 0.22s ease;
}
.eco-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong, #cbd5e0);
  box-shadow: 0 14px 34px rgba(13, 37, 69, 0.1);
}
.eco-card:focus-visible {
  outline: 2px solid var(--eco-a);
  outline-offset: 2px;
}
/* The brand accent: a thin line drawn along the card's base on hover/focus. */
.eco-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 2px;
  background: var(--eco-a);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  transition:
    transform 0.25s var(--ease-out-quint, cubic-bezier(0.22, 1, 0.36, 1)),
    opacity 0.18s ease;
}
.eco-card:hover::after,
.eco-card:focus-visible::after {
  transform: none;
  opacity: 1;
}

.eco-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
}
/* The card lockup mirrors the header lockup 1:1 (R 57.6 / wordmark 51.15 /
   gap 28px) so each sister brand reads at the host header's own scale; the
   arrow then occupies the far end of the row — the trigger's slot. When the
   row runs short (the panel ends at the trigger), the wordmark alone shrinks,
   aspect-safe via object-fit. */
.eco-card-brand {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 28px;
  min-width: 0;
  transform-origin: left center;
  transition: transform 0.22s var(--ease-out-quint, cubic-bezier(0.22, 1, 0.36, 1));
}
.eco-card-brand img { display: block; width: auto; }
.eco-card-brand .eco-r { flex: none; height: 57.6px; border-radius: 21%; }
.eco-card-brand .eco-wordmark {
  flex: 0 1 auto;
  min-width: 0;
  height: 51.15px;
  object-fit: contain;
  object-position: left center;
}
.eco-card:hover .eco-card-brand { transform: scale(1.03); }

.eco-arrow {
  flex: none;
  color: var(--text-light, #687489);
  transition:
    transform 0.22s var(--ease-out-quint, cubic-bezier(0.22, 1, 0.36, 1)),
    color 0.15s ease;
}
.eco-card:hover .eco-arrow,
.eco-card:focus-visible .eco-arrow {
  transform: translateX(3px);
  color: var(--eco-a);
}

.eco-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted, #4a5568);
}


@media (max-width: 1280px) {
  /* The header collapses .brand-link's gap to 0 in this band; keep a usable minimum. */
  .eco-trigger { margin-left: 8px; }
}

@media (max-width: 768px) {
  /* Full-width sheet under the (10px-padded, blur-free) mobile header. */
  .eco-panel {
    left: 12px;
    right: 12px;
    width: auto;
    padding: 26px 20px 20px;
    border-radius: 18px;
  }
  /* The brand is the flex row's order-1 item on mobile; the trigger follows it. */
  .eco-trigger { order: 1; margin-left: 4px; }
  .eco-title { font-size: 15.5px; padding: 11px 0; }
  .eco-sub { font-size: 14px; }
  .eco-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
  .eco-card { padding: 18px 18px 17px; gap: 10px; }
  .eco-card::after { left: 18px; right: 18px; }
  .eco-card-brand { gap: 18px; }
  .eco-card-brand .eco-r { height: 41px; }
  .eco-card-brand .eco-wordmark { height: 36px; }
}

@media (max-width: 460px) {
  /* The centered wordmark leaves no room for both the R mark and the trigger;
     the trigger takes the R's slot (the wordmark itself still reads REGULATORY).
     This sheet only loads on pages that carry the switcher, so plain scoping is safe. */
  .brand-link .brand-r { display: none; }
}
@media (max-width: 400px) {
  .eco-trigger { width: 40px; margin-right: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .eco-panel {
    transform: none;
    transition: opacity 0.12s linear, visibility 0s linear 0.12s;
  }
  .eco-panel.is-open { transition: opacity 0.12s linear; }
  .eco-card,
  .eco-card::after,
  .eco-card-brand,
  .eco-arrow,
  .eco-title::before,
  .eco-title::after {
    transition: none;
  }
  .eco-card:hover { transform: none; }
  .eco-card:hover .eco-card-brand { transform: none; }
  .eco-card:hover .eco-arrow,
  .eco-explore:hover svg { transform: none; }
}

@media print {
  .eco-trigger,
  .eco-panel { display: none; }
}
