/*!
 * GLP BB Mega Menu — v0.1.0
 * Brand: navy #0b1f3a + gold #c9a45c (Oxygen palette color(1)/color(2))
 * Triggers: hover on .menu-item-31 (Practice Areas) or .menu-item-678 (custom Locations parent)
 *           OR keyboard focus inside those items.
 */

:root {
  --glp-mm-navy: #0b1f3a;
  --glp-mm-navy-2: #122c54;
  --glp-mm-gold: #c9a45c;
  --glp-mm-gold-soft: #e9d3a4;
  --glp-mm-text: #f3f4f6;
  --glp-mm-text-muted: #c8cdd6;
  --glp-mm-border: rgba(201, 164, 92, 0.25);
  --glp-mm-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

/* ---- container ---- */
.glp-megamenu {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 9999;
  background: var(--glp-mm-navy);
  color: var(--glp-mm-text);
  border-top: 3px solid var(--glp-mm-gold);
  box-shadow: var(--glp-mm-shadow);
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  font-family: inherit;
}
.glp-megamenu[hidden] { display: none; }
.glp-megamenu.is-open {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* When body has Oxygen sticky header, push the panel below it. JS sets
   --glp-mm-top to the header bottom in pixels. */
.glp-megamenu.is-open { top: var(--glp-mm-top, 96px); }

/* ---- inner layout ---- */
.glp-megamenu-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 32px 40px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 36px;
}
.glp-megamenu-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.glp-megamenu-col {
  min-width: 0;
}
.glp-megamenu-heading {
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--glp-mm-gold);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--glp-mm-border);
  font-weight: 600;
}
.glp-megamenu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.glp-megamenu-list li { margin: 0 0 4px; }

.glp-megamenu-link {
  display: block;
  padding: 8px 10px 8px 12px;
  color: var(--glp-mm-text);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.35;
  border-left: 2px solid transparent;
  border-radius: 2px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.glp-megamenu-link:hover,
.glp-megamenu-link:focus,
.glp-megamenu-link.is-active {
  background: var(--glp-mm-navy-2);
  border-left-color: var(--glp-mm-gold);
  color: var(--glp-mm-gold-soft);
  outline: none;
}
.glp-megamenu-link:focus-visible {
  outline: 2px solid var(--glp-mm-gold);
  outline-offset: 2px;
}

/* ---- preview pane ---- */
.glp-megamenu-preview {
  position: relative;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: flex-start;
}
.glp-megamenu-preview-img {
  display: block;
  width: 320px;
  height: 320px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #051226;
  border: 1px solid var(--glp-mm-border);
  border-radius: 4px;
  transition: opacity 220ms ease;
  opacity: 1;
}
.glp-megamenu-preview-img.is-swapping { opacity: 0; }
.glp-megamenu-preview-cta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.glp-megamenu-preview-caption {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--glp-mm-gold);
  font-weight: 600;
  text-align: center;
  min-height: 1em;
}
.glp-megamenu-preview-btn {
  display: block;
  padding: 14px 18px;
  background: var(--glp-mm-gold);
  color: var(--glp-mm-navy);
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  border-radius: 4px;
  transition: background 160ms ease, color 160ms ease, transform 120ms ease;
}
.glp-megamenu-preview-btn:hover,
.glp-megamenu-preview-btn:focus {
  background: var(--glp-mm-gold-soft);
  color: var(--glp-mm-navy);
  transform: translateY(-1px);
  outline: none;
}
.glp-megamenu-preview-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  color: var(--glp-mm-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid var(--glp-mm-border);
  border-radius: 4px;
  transition: color 160ms ease, border-color 160ms ease;
}
.glp-megamenu-preview-phone:hover,
.glp-megamenu-preview-phone:focus {
  color: var(--glp-mm-gold);
  border-color: var(--glp-mm-gold);
  outline: none;
}

/* ---- column filtering: when a trigger sets data-active-col on the panel,
       hide the other columns and let the active one expand to fill the
       available column space. Without data-active-col we fall back to the
       3-column layout (used during initial render before any trigger fires). */
.glp-megamenu[data-active-col] .glp-megamenu-cols {
  grid-template-columns: 1fr;
}
.glp-megamenu[data-active-col="practice_areas"] .glp-megamenu-col:not([data-col="practice_areas"]),
.glp-megamenu[data-active-col="locations"] .glp-megamenu-col:not([data-col="locations"]),
.glp-megamenu[data-active-col="attorneys"] .glp-megamenu-col:not([data-col="attorneys"]),
.glp-megamenu[data-active-col="resources"] .glp-megamenu-col:not([data-col="resources"]) {
  display: none;
}
/* Practice Areas column has 13 items — render as 2-col grid when expanded */
.glp-megamenu[data-active-col="practice_areas"] .glp-megamenu-list,
.glp-megamenu[data-active-col="locations"] .glp-megamenu-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 28px;
}
/* Attorney cards: bigger spacing, card layout */
.glp-megamenu[data-active-col="attorneys"] .glp-megamenu-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.glp-megamenu[data-active-col="attorneys"] .glp-megamenu-link {
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
}

/* ---- mobile (accordion) ---- */
@media (max-width: 900px) {
  .glp-megamenu.is-open { top: 0; height: 100vh; overflow-y: auto; }
  .glp-megamenu-inner {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px 18px 60px;
  }
  .glp-megamenu-cols {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .glp-megamenu-col {
    border-bottom: 1px solid var(--glp-mm-border);
    padding-bottom: 8px;
  }
  .glp-megamenu-heading {
    cursor: pointer;
    margin: 0;
    padding: 14px 4px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .glp-megamenu-heading::after {
    content: "+";
    font-size: 22px;
    line-height: 1;
    color: var(--glp-mm-gold);
    transition: transform 200ms ease;
  }
  .glp-megamenu-col.is-open .glp-megamenu-heading::after { content: "−"; }
  .glp-megamenu-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 250ms ease;
    padding-bottom: 0;
  }
  .glp-megamenu-col.is-open .glp-megamenu-list {
    max-height: 800px;
    padding-bottom: 8px;
  }
  .glp-megamenu-preview { display: none; }
}

/* ---- close button (added by JS) ---- */
.glp-megamenu-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 1px solid var(--glp-mm-border);
  color: var(--glp-mm-text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.glp-megamenu-close:hover { background: var(--glp-mm-navy-2); color: var(--glp-mm-gold); }

/* ---- backdrop ---- */
.glp-megamenu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 9998;
}
.glp-megamenu-backdrop.is-open { opacity: 1; pointer-events: none; }

/* Hover bridge — fills the 38px gap between the nav bar and the panel so the
   menu does not close while the cursor crosses from a nav item into the panel. */
.glp-megamenu.is-open::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -38px;
  height: 38px;
}
