/* Weblytics mega-menu navigation — dropdown panels with previews
   NOTE: the original header styles are scoped with [data-astro-cid-z4jru4n3],
   which injected markup cannot match. Everything the nav needs is redeclared
   here so it never depends on Astro's generated scope hash. */

.site-nav {
  position: relative;
}

/* ---------- horizontal nav list ---------- */

.wl-nav {
  display: none; /* mobile: the existing mobile menu takes over */
  align-items: center;
  gap: clamp(1.25rem, 2vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .wl-nav {
    display: flex;
  }
}

.wl-nav-item {
  /* static so the panel anchors to .site-nav, not the item */
  position: static;
  margin: 0;
  padding: 0;
}

.wl-nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 2.75rem;
  color: rgba(10, 25, 47, 0.7);
  font-size: 0.825rem;
  font-weight: 650;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.wl-nav-trigger::after {
  content: "";
  width: 0.34rem;
  height: 0.34rem;
  margin-top: -0.2rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.5;
  transform: rotate(45deg);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.wl-nav-trigger:hover,
.wl-nav-trigger[aria-expanded="true"] {
  color: var(--color-navy, #0a192f);
}

.wl-nav-trigger[aria-expanded="true"]::after {
  opacity: 1;
  transform: rotate(-135deg);
}

/* ---------- brand ---------- */

.site-header .site-brand {
  gap: 0.62rem;
  color: var(--color-navy, #0a192f);
  font-family: var(--font-display, "Poppins", sans-serif);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.site-header .site-brand img {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.62rem;
  box-shadow:
    0 1px 2px rgba(10, 25, 47, 0.16),
    0 8px 20px -12px rgba(0, 102, 255, 0.6);
  transition: transform 0.22s ease;
}

.site-header .site-brand:hover img {
  transform: translateY(-1px) rotate(-3deg);
}

.site-header .site-brand span {
  line-height: 1;
}

/* ---------- panel ---------- */

.wl-mega {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 50%;
  z-index: 60;
  width: min(94vw, 64rem);
  padding: 1.35rem;
  border: 1px solid rgba(10, 25, 47, 0.1);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 2px 6px -2px rgba(10, 25, 47, 0.12),
    0 30px 70px -30px rgba(10, 25, 47, 0.45);
  backdrop-filter: blur(16px) saturate(1.15);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.wl-mega[data-state="open"] {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.wl-mega-inner {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr);
  gap: 1.4rem;
}

/* left category rail */
.wl-mega-rail {
  padding-right: 1.3rem;
  border-right: 1px solid rgba(10, 25, 47, 0.09);
}

.wl-mega-rail p,
.wl-mega-group > p {
  margin: 0 0 0.65rem;
  color: rgba(10, 25, 47, 0.42);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.wl-mega-rail ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wl-mega-rail a {
  display: block;
  padding: 0.42rem 0.55rem;
  border-radius: 0.5rem;
  color: var(--color-navy, #0a192f);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.wl-mega-rail a:hover {
  background: rgba(0, 102, 255, 0.07);
  color: var(--color-brand, #0066ff);
}

/* ---------- preview cards ---------- */

.wl-mega-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wl-mega-card {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.55rem;
  border-radius: 0.8rem;
  transition: background-color 0.16s ease;
}

.wl-mega-card:hover {
  background: rgba(0, 102, 255, 0.06);
}

/* photo thumbnails */
.wl-mega-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.55rem;
  background: #eef3fa;
  box-shadow: inset 0 0 0 1px rgba(10, 25, 47, 0.09);
}

.wl-mega-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.wl-mega-card:hover .wl-mega-thumb img {
  transform: scale(1.07);
}

.wl-mega-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(10, 25, 47, 0.22));
  pointer-events: none;
}

/* icon tiles (items without a photo) */
.wl-mega-thumb[data-tone] {
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.wl-mega-thumb[data-tone]::after {
  background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.28), transparent 62%);
}

.wl-mega-thumb[data-tone] svg {
  position: relative;
  z-index: 1;
  width: 1.55rem;
  height: 1.55rem;
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.wl-mega-card:hover .wl-mega-thumb[data-tone] svg {
  transform: scale(1.12);
}

.wl-mega-thumb[data-tone="blue"] {
  background: linear-gradient(140deg, #2a80ff, #0b3f9e);
}

.wl-mega-thumb[data-tone="cyan"] {
  background: linear-gradient(140deg, #17b6e0, #0a5c86);
}

.wl-mega-thumb[data-tone="green"] {
  background: linear-gradient(140deg, #18b47c, #0c6a4f);
}

.wl-mega-thumb[data-tone="purple"] {
  background: linear-gradient(140deg, #7268d8, #2f4c9c);
}

.wl-mega-thumb[data-tone="navy"] {
  background: linear-gradient(140deg, #1d3f63, #0a192f);
}

.wl-mega-text {
  min-width: 0;
}

.wl-mega-title {
  display: block;
  color: var(--color-navy, #0a192f);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  transition: color 0.16s ease;
}

.wl-mega-card:hover .wl-mega-title {
  color: var(--color-brand, #0066ff);
}

.wl-mega-tag {
  display: block;
  margin-top: 0.14rem;
  color: rgba(0, 102, 255, 0.78);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wl-mega-desc {
  display: block;
  margin-top: 0.3rem;
  color: rgba(52, 68, 91, 0.78);
  font-size: 0.72rem;
  line-height: 1.5;
}

/* footer strip */
.wl-mega-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(10, 25, 47, 0.09);
}

.wl-mega-foot span {
  color: rgba(52, 68, 91, 0.7);
  font-size: 0.72rem;
}

.wl-mega-foot a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-brand, #0066ff);
  font-size: 0.76rem;
  font-weight: 700;
}

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

/* ---------- narrow screens ---------- */

@media (max-width: 62rem) {
  .wl-mega-inner {
    grid-template-columns: 1fr;
  }

  .wl-mega-rail {
    padding-right: 0;
    padding-bottom: 1rem;
    border-right: 0;
    border-bottom: 1px solid rgba(10, 25, 47, 0.09);
  }

  .wl-mega-rail ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
}

/* below the header's own 48rem breakpoint the mobile menu handles navigation */
@media (max-width: 47.99rem) {
  .wl-mega {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wl-mega,
  .wl-nav-trigger::after,
  .wl-mega-thumb img,
  .wl-mega-thumb[data-tone] svg,
  .site-header .site-brand img {
    transition: none;
  }
}
