/* =====================================================================
   TR mega menu. Ported from the Silver Lining Recovery header (chrome.css),
   recolored to the Toronto Reptiles palette. A floating pill bar that sticks
   to the top; submenus open as a mega panel on desktop and as an accordion
   in a sheet on phones. Colors: primary #2D6A4F, mid #40916C, light #52B788,
   sage #F0F7F4, dark #1B3A2F, amber #B45309.
   ===================================================================== */

:root { --tr-nav-h: 72px; --tr-nav-max: 1320px; }

.tr-skip { position: absolute; left: -9999px; top: 0; z-index: 400; background: #fff; color: #1B3A2F; padding: 12px 18px; border-radius: 0 0 10px 0; }
.tr-skip:focus { left: 0; }

/* The theme sets overflow-x: hidden on html and body, which makes body a scroll
   container and stops position: sticky from working. clip blocks sideways
   scrolling the same way without creating a scroll container. */
html:has(body.tr-chrome-on), body.tr-chrome-on { overflow-x: clip; overflow-y: visible; }

/* one header: the theme's is hidden only when ours renders */
body.tr-chrome-on header.tr-header { display: none !important; }

/* ---------------- the bar ---------------- */
.tr-nav { position: sticky; top: 10px; z-index: 300; padding: 10px 20px 0; font-family: 'Nunito', system-ui, sans-serif; }
.admin-bar .tr-nav { top: 42px; }
.tr-nav__bar {
  max-width: var(--tr-nav-max); margin: 0 auto; min-height: var(--tr-nav-h);
  display: flex; align-items: center; gap: 18px; padding: 8px 12px 8px 20px;
  border-radius: 999px; background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(45, 106, 79, .12);
  box-shadow: 0 14px 38px -24px rgba(27, 58, 47, .55);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  transition: background .22s ease, box-shadow .22s ease;
}
body.tr-head-scrolled .tr-nav__bar { background: rgba(255, 255, 255, .98); box-shadow: 0 16px 40px -22px rgba(27, 58, 47, .6); }

.tr-nav__logo { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; text-decoration: none; }
.tr-nav__logo-img { display: block; height: 40px; width: auto; }
.tr-nav__logo-text { font-weight: 800; font-size: 18px; color: #1B3A2F; white-space: nowrap; }

.tr-nav__menu { flex: 1 1 auto; min-width: 0; }
.tr-nav__list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; gap: 2px; flex-wrap: nowrap; }
.tr-nav__item { position: static; }
.tr-nav__top {
  display: inline-flex; align-items: center; gap: 5px; padding: 10px 12px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 700; color: #1B3A2F; border-radius: 999px; white-space: nowrap; text-decoration: none;
  transition: background .16s ease, color .16s ease;
}
.tr-nav__top:hover, .tr-nav__top[aria-current] { background: #F0F7F4; color: #2D6A4F; }
.tr-nav__chev { transition: transform .18s ease; opacity: .6; }
.tr-nav__item--has-panel.is-open .tr-nav__chev { transform: rotate(180deg); }

.tr-nav__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.tr-nav__cta {
  display: inline-flex; align-items: center; padding: 12px 20px; border-radius: 999px;
  background: #2D6A4F; color: #fff; font-size: 14px; font-weight: 800; text-decoration: none; white-space: nowrap;
  border: 2px solid #2D6A4F; transition: background .16s ease, transform .16s ease, color .16s ease;
}
.tr-nav__cta:hover { background: #1B3A2F; border-color: #1B3A2F; transform: translateY(-1px); }
.tr-nav__cta--ghost { background: #fff; color: #2D6A4F; }
.tr-nav__cta--ghost:hover { background: #F0F7F4; color: #1B3A2F; border-color: #2D6A4F; }
.tr-nav__cta-short { display: none; }
header.tr-nav a.tr-nav__cta:not(.tr-nav__cta--ghost), header.tr-nav a.tr-nav__cta:not(.tr-nav__cta--ghost):hover { color: #fff; }

/* ---------------- mega panel ---------------- */
.tr-nav__panel {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(-6px);
  width: min(1180px, calc(100vw - 44px)); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.tr-nav__item--has-panel.is-open .tr-nav__panel { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
/* Hover bridge, part 2: covers the 10px gap above the panel across its full width */
.tr-nav__panel::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.tr-nav__panel-inner {
  position: relative; background: #fff; border: 1px solid #E5E7EB; border-radius: 22px; padding: 22px;
  box-shadow: 0 34px 74px -36px rgba(27, 58, 47, .6); overflow: hidden;
  max-height: calc(100vh - var(--tr-nav-h) - 60px); overflow-y: auto;
}
.tr-nav__panel-inner::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, #2D6A4F 0%, #52B788 55%, #D97706 100%); }
.tr-nav__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.tr-nav__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tr-nav__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tr-nav__link { position: relative; display: block; padding: 11px 12px 6px 32px; border-radius: 13px; text-decoration: none; transition: background .14s ease; }
.tr-nav__cell:not(.tr-nav__cell--has-sub) .tr-nav__link { padding-bottom: 11px; }
.tr-nav__link::before {
  content: ""; position: absolute; left: 13px; top: 17px; width: 9px; height: 9px; border-radius: 3px;
  background: #D8F3DC; box-shadow: inset 0 0 0 1.5px #40916C; transition: background .14s ease, transform .14s ease;
}
.tr-nav__cell:nth-child(3n+2) .tr-nav__link::before { background: #FEF3C7; box-shadow: inset 0 0 0 1.5px #D97706; }
.tr-nav__cell:nth-child(3n+3) .tr-nav__link::before { background: #E9F5DB; box-shadow: inset 0 0 0 1.5px #52B788; }
.tr-nav__link:hover { background: linear-gradient(120deg, #F0F7F4, #FFFBEB); }
.tr-nav__link:hover::before { transform: scale(1.18); background: #2D6A4F; }
.tr-nav__cell:nth-child(3n+2) .tr-nav__link:hover::before { background: #D97706; }
.tr-nav__cell:nth-child(3n+3) .tr-nav__link:hover::before { background: #52B788; }
.tr-nav__link-t { display: block; font-size: 15px; font-weight: 800; color: #1B3A2F; }
.tr-nav__link-d { display: block; margin-top: 3px; font-size: 13px; line-height: 1.45; color: #6B7280; }

/* third level: topic links under an animal tile */
.tr-nav__sub { list-style: none; margin: 0 0 8px; padding: 0 8px 0 32px; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.tr-nav__sublink {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; line-height: 1.5;
  color: #2D6A4F; background: #F0F7F4; text-decoration: none; transition: background .14s ease, color .14s ease;
}
.tr-nav__sublink:hover, .tr-nav__sublink[aria-current] { background: #2D6A4F; color: #fff; }

/* lead tile: each panel opens with its hub */
.tr-nav__cell--lead { grid-row: span 2; }
.tr-nav__lead {
  position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; min-height: 150px;
  padding: 18px 18px 20px; border-radius: 16px; text-decoration: none; overflow: hidden;
  background: linear-gradient(145deg, #1B3A2F 0%, #2D6A4F 55%, #40916C 100%); color: #fff;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tr-nav__lead::after { content: ""; position: absolute; right: -60px; bottom: -70px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(closest-side, rgba(217, 119, 6, .45), transparent); transition: transform .3s ease; }
.tr-nav__lead > span { position: relative; z-index: 1; }
header.tr-nav a.tr-nav__lead:hover, header.tr-nav a.tr-nav__lead:focus-visible { color: #fff; text-decoration: none; }
header.tr-nav a:hover, header.tr-nav a:focus { text-decoration: none; }
.tr-nav__lead:hover, .tr-nav__lead:focus-visible { transform: translateY(-2px); box-shadow: 0 18px 34px -18px rgba(27, 58, 47, .95); }
.tr-nav__lead:focus-visible { outline: 2px solid #fff; outline-offset: -5px; }
.tr-nav__lead:hover::after, .tr-nav__lead:focus-visible::after { transform: scale(1.45); }
.tr-nav__lead-k { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #FCD34D; }
.tr-nav__lead-t { font-size: 18px; font-weight: 800; line-height: 1.25; }
.tr-nav__lead-d { font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, .85); }
.tr-nav__lead-go { margin-top: auto; font-size: 18px; transition: transform .18s ease, color .18s ease; }
.tr-nav__lead:hover .tr-nav__lead-go, .tr-nav__lead:focus-visible .tr-nav__lead-go { transform: translateX(6px); color: #FCD34D; }

/* label link + chevron toggle */
.tr-nav__pair { position: relative; display: inline-flex; align-items: center; border-radius: 999px; transition: background .16s ease; }
/* Hover bridge, part 1: an invisible strip from the label down to the panel, so the
   pointer never leaves the menu item on its way down (the label sits mid-bar, about
   30px above the panel). Only as wide as the label, so it never covers other items. */
.tr-nav__item--has-panel > .tr-nav__pair::after { content: ""; position: absolute; left: -6px; right: -6px; top: 100%; height: 48px; }
.tr-nav__item--has-panel:hover .tr-nav__pair, .tr-nav__item--has-panel.is-open .tr-nav__pair { background: #F0F7F4; }
.tr-nav__pair .tr-nav__top { padding-right: 4px; background: none !important; }
.tr-nav__toggle { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 32px; margin-right: 4px; padding: 0; border: 0; background: none; cursor: pointer; color: #1B3A2F; border-radius: 999px; }
.tr-nav__toggle:focus-visible, .tr-nav__top:focus-visible, .tr-nav__link:focus-visible, .tr-nav__sublink:focus-visible, .tr-nav__cta:focus-visible { outline: 2px solid #40916C; outline-offset: 2px; }

/* burger */
.tr-nav__burger { display: none; width: 44px; height: 44px; border: 0; background: #F0F7F4; border-radius: 12px; cursor: pointer; align-items: center; justify-content: center; }
.tr-nav__burger-box { display: grid; gap: 4px; }
.tr-nav__burger-box span { display: block; width: 18px; height: 2px; background: #1B3A2F; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.tr-nav__burger[aria-expanded="true"] .tr-nav__burger-box span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.tr-nav__burger[aria-expanded="true"] .tr-nav__burger-box span:nth-child(2) { opacity: 0; }
.tr-nav__burger[aria-expanded="true"] .tr-nav__burger-box span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* tight: close items up before falling back to the burger */
body.tr-nav-tight .tr-nav__bar { gap: 8px; }
body.tr-nav-tight .tr-nav__list { gap: 0; }
body.tr-nav-tight .tr-nav__top { padding: 8px 8px; font-size: 14px; }
body.tr-nav-tight .tr-nav__pair .tr-nav__top { padding-right: 2px; }
body.tr-nav-tight .tr-nav__toggle { width: 20px; margin-right: 2px; }
body.tr-nav-tight .tr-nav__cta { padding-left: 15px; padding-right: 15px; }
body.tr-nav-tight .tr-nav__cta--ghost { display: none; }

/* ---------------- burger layout: phones, and any width where items don't fit ---------------- */
@media (max-width: 960px) {
  .tr-nav { padding: 8px 10px 0; top: 6px; }
  .tr-nav__bar { padding: 6px 8px 6px 14px; gap: 8px; min-height: 60px; background: rgba(255, 255, 255, .98); }
  .tr-nav__burger { display: inline-flex; }
  .tr-nav__actions { margin-left: auto; }
  .tr-nav__logo { flex: 0 1 auto; min-width: 0; }
  .tr-nav__logo-img { height: 34px; }
  .tr-nav__menu {
    position: fixed; inset: calc(60px + 10px) 4px auto 4px;
    max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px);
    overflow-y: auto; overscroll-behavior: contain; background: #fff; border-radius: 22px; padding: 10px;
    box-shadow: 0 30px 70px -30px rgba(27, 58, 47, .6); display: none;
  }
  body.tr-nav-open .tr-nav__menu { display: block; }
  .tr-nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .tr-nav__top { width: 100%; justify-content: space-between; padding: 14px 16px; border-radius: 12px; font-size: 16px; }
  .tr-nav__panel { position: static; transform: none; width: auto; opacity: 1; visibility: visible; pointer-events: auto; display: none; }
  .tr-nav__item--has-panel.is-open .tr-nav__panel { display: block; transform: none; }
  .tr-nav__panel-inner { border: 0; box-shadow: none; padding: 2px 4px 10px; background: transparent; max-height: none; overflow: visible; }
  .tr-nav__panel-inner::before { display: none; }
  .tr-nav__grid, .tr-nav__grid--3, .tr-nav__grid--4 { grid-template-columns: 1fr; }
  .tr-nav__link, .tr-nav__cell:not(.tr-nav__cell--has-sub) .tr-nav__link { padding: 11px 14px 11px 32px; }
  .tr-nav__link::before { top: 16px; }
  .tr-nav__link-d { display: none; }
  .tr-nav__sub { padding-left: 32px; margin-bottom: 6px; }
  .tr-nav__cell--lead { grid-row: auto; margin-bottom: 4px; }
  .tr-nav__lead { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; min-height: 0; padding: 13px 16px; border-radius: 14px; background: linear-gradient(120deg, #F0F7F4, #FFFBEB); color: #1B3A2F; box-shadow: none; }
  .tr-nav__lead::after, .tr-nav__lead-k, .tr-nav__lead-d { display: none; }
  .tr-nav__lead-t { font-size: 15px; color: #1B3A2F; }
  .tr-nav__lead-go { display: inline; margin: 0; color: #2D6A4F; font-size: 16px; }
  header.tr-nav a.tr-nav__lead:hover, header.tr-nav a.tr-nav__lead:focus-visible { transform: none; box-shadow: none; color: #1B3A2F; background: linear-gradient(120deg, #D8F3DC, #FEF3C7); }
  .tr-nav__pair { display: flex; width: 100%; justify-content: space-between; }
  .tr-nav__item--has-panel > .tr-nav__pair::after { display: none; }
  .tr-nav__pair .tr-nav__top { flex: 1 1 auto; padding: 14px 16px; }
  .tr-nav__toggle { width: 48px; height: 48px; margin: 0; background: #F0F7F4; border-radius: 12px; }
  .tr-nav__toggle .tr-nav__chev { width: 15px; height: 15px; opacity: .8; }
  .tr-nav__item--has-panel:hover .tr-nav__pair { background: none; }
  .tr-nav__cta--ghost { display: none; }
}
@media (max-width: 520px) {
  .tr-nav__logo-text { font-size: 16px; }
  .tr-nav__cta { padding: 10px 14px; font-size: 13px; }
  .tr-nav__cta-long { display: none; }
  .tr-nav__cta-short { display: inline; }
  .tr-nav__actions { gap: 6px; }
}
@media (max-width: 360px) {
  .tr-nav__logo-text { display: none; }
}

/* same burger layout when the fit check finds the items don't fit (body.tr-nav-collapsed) */
body.tr-nav-collapsed .tr-nav__burger { display: inline-flex; }
body.tr-nav-collapsed .tr-nav__actions { margin-left: auto; }
body.tr-nav-collapsed .tr-nav__menu { position: fixed; inset: calc(var(--tr-nav-h) + 24px) 20px auto auto; width: min(440px, calc(100vw - 40px)); max-height: calc(100dvh - var(--tr-nav-h) - 50px); overflow-y: auto; overscroll-behavior: contain; background: #fff; border-radius: 22px; padding: 10px; box-shadow: 0 30px 70px -30px rgba(27, 58, 47, .6); display: none; }
body.tr-nav-collapsed.tr-nav-open .tr-nav__menu { display: block; }
body.tr-nav-collapsed .tr-nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
body.tr-nav-collapsed .tr-nav__top { width: 100%; justify-content: space-between; padding: 14px 16px; border-radius: 12px; font-size: 16px; }
body.tr-nav-collapsed .tr-nav__panel { position: static; transform: none; width: auto; opacity: 1; visibility: visible; pointer-events: auto; display: none; }
body.tr-nav-collapsed .tr-nav__item--has-panel.is-open .tr-nav__panel { display: block; }
body.tr-nav-collapsed .tr-nav__panel-inner { border: 0; box-shadow: none; padding: 2px 4px 10px; background: transparent; max-height: none; overflow: visible; }
body.tr-nav-collapsed .tr-nav__panel-inner::before { display: none; }
body.tr-nav-collapsed .tr-nav__grid { grid-template-columns: 1fr; }
body.tr-nav-collapsed .tr-nav__link-d { display: none; }
body.tr-nav-collapsed .tr-nav__cell--lead { grid-row: auto; }
body.tr-nav-collapsed .tr-nav__lead { min-height: 0; padding: 13px 16px; }
body.tr-nav-collapsed .tr-nav__lead-d, body.tr-nav-collapsed .tr-nav__lead-k { display: none; }
body.tr-nav-collapsed .tr-nav__pair { display: flex; width: 100%; justify-content: space-between; }
body.tr-nav-collapsed .tr-nav__item--has-panel > .tr-nav__pair::after { display: none; }
body.tr-nav-collapsed .tr-nav__pair .tr-nav__top { flex: 1 1 auto; }
body.tr-nav-collapsed .tr-nav__toggle { width: 48px; height: 48px; margin: 0; background: #F0F7F4; border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
  .tr-nav__bar, .tr-nav__panel, .tr-nav__chev, .tr-nav__lead, .tr-nav__lead::after, .tr-nav__lead-go, .tr-nav__cta { transition: none; }
  .tr-nav__lead:hover, .tr-nav__lead:focus-visible, .tr-nav__cta:hover { transform: none; }
}
