/* ==========================================================================
   Mega Menu (dropdown panel under Categories▾)
   Source of truth: designs/html/mega-menu-open.html + designs/html/design-tokens.css
   2026-04-15 refactor: replaces the Phase 1 full-screen Claret overlay with
   the CSS-only dropdown panel the mockups actually specified. Kept CSS-driven
   (:hover / :focus-within) so the menu works without JavaScript.
   ========================================================================== */

/* Dropdown wrapper around Categories trigger */
.nav-primary .dropdown {
  position: static;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.nav-primary .dropdown-trigger::after {
  content: "▾";
  margin-left: 6px;
  font-size: 10px;
  display: inline-block;
  transition: transform var(--dur-fast, 120ms) var(--ease-std, ease);
}

.nav-primary .dropdown:hover .dropdown-trigger::after,
.nav-primary .dropdown:focus-within .dropdown-trigger::after {
  transform: rotate(180deg);
}

.nav-primary .dropdown:hover .dropdown-trigger,
.nav-primary .dropdown:focus-within .dropdown-trigger {
  color: var(--color-claret);
  border-color: var(--color-claret);
}

/* Panel itself */
.mega-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--color-quarter-white);
  border-top: var(--rule-width, 1px) solid var(--color-rule);
  border-bottom: var(--rule-width, 1px) solid var(--color-rule);
  box-shadow: var(--shadow-3, 0 12px 32px rgba(4, 5, 3, 0.14));
  padding: var(--space-10) var(--gutter) var(--space-12);
  display: none;
  z-index: 60;
}

/* Bridge so the mouse can travel from the trigger into the panel
   without leaving the hover scope. Height is generous (24 px) to
   absorb the .site-header border-bottom + any sub-pixel rounding
   between .dropdown bottom and .mega-menu top. */
.mega-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -24px;
  height: 24px;
  background: transparent;
}

.nav-primary .dropdown:hover .mega-menu,
.nav-primary .dropdown:focus-within .mega-menu,
.site-header.mega-forced .mega-menu {
  display: block;
}

.mega-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
}

.mega-eyebrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-8);
  border-bottom: var(--rule-thick, 2px) solid var(--color-black);
}

.mega-eyebrow .label {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-shuttle-gray);
}

.mega-eyebrow a {
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-claret);
  text-decoration: none;
}

.mega-eyebrow a:hover {
  text-decoration: underline;
}

/* 7-column grid of category cards */
.mega-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-10) var(--space-8);
}

@media (max-width: 1200px) {
  .mega-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .mega-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mega-cat {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--space-4);
  align-items: start;
  text-decoration: none;
  color: var(--color-black);
  padding: var(--space-3);
  border-radius: var(--radius-sm, 2px);
  transition: background var(--dur-fast, 120ms) var(--ease-std, ease);
}

.mega-cat:hover {
  background: var(--color-satin-linen);
  text-decoration: none;
}

.mega-cat .icon {
  width: 48px;
  height: 48px;
  color: var(--color-claret);
}

.mega-cat .body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mega-cat .eyebrow {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-shuttle-gray);
}

.mega-cat .name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-black);
}

.mega-cat:hover .name {
  color: var(--color-claret);
}

.mega-cat .desc {
  font-family: var(--font-body-serif);
  font-size: 14px;
  color: var(--color-shuttle-gray);
  line-height: 1.45;
  margin-top: var(--space-1);
}

/* Foot row with Jump-to / Follow columns */
.mega-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6) var(--space-10);
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: var(--rule-width, 1px) solid var(--color-rule);
}

.mega-foot .col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* LYC-698: column labels are now <p class="mega-foot__col-label"> wrapped
   in a <nav aria-labelledby> landmark (was <h5> — h5 misused as nav label
   polluted the heading outline). Visual styling preserved verbatim. */
.mega-foot .col h5,
.mega-foot__col-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-shuttle-gray);
  margin: 0 0 var(--space-1);
}

.mega-foot a {
  font-family: var(--font-body-serif);
  font-size: 14px;
  color: var(--color-black);
  text-decoration: none;
}

.mega-foot a:hover {
  color: var(--color-claret);
}

/* Hide the whole dropdown on mobile. Hamburger + mobile drawer
   owns the small-screen experience. */
@media (max-width: 1023px) {
  .nav-primary .dropdown .mega-menu {
    display: none !important;
  }
}
