/* Desktop "Services" dropdown v3 (partials/header.php .services-menu.sm-mega) — loaded site-wide.
   Overrides the old gold list in styles.css. The mobile services panel is separate markup and untouched. */

.services-toggle .services-caret { transition: transform 0.25s ease; }
.services-dropdown:hover .services-caret,
.services-dropdown:focus-within .services-caret { transform: rotate(180deg); }

.services-menu.sm-mega {
  left: 50%;
  top: calc(100% + 14px);
  width: 640px;
  min-width: 0;
  max-width: none;                  /* styles.css caps every element at 100% of its parent (the "Services" word) */
  padding: 18px 18px 0;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(1, 1, 126, 0.08);
  box-shadow: 0 30px 70px -20px rgba(1, 1, 126, 0.35), 0 2px 6px rgba(1, 1, 126, 0.05);
  transform: translateX(-50%) translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0.22s;
  overflow: hidden;
}
.services-menu.sm-mega::before {    /* invisible bridge so the menu stays open crossing the gap */
  content: "";
  position: absolute;
  left: 0; right: 0; top: -16px;
  height: 16px;
}
.services-menu.sm-mega::after {     /* gold edge */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-accent));
}
.services-dropdown:hover .services-menu.sm-mega,
.services-dropdown:focus-within .services-menu.sm-mega,
.services-dropdown.active .services-menu.sm-mega {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.sm-label {
  margin: 4px 6px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-accent);
}
.sm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }

.services-menu.sm-mega a.sm-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  white-space: normal;
  color: var(--navy);
  transition: background-color 0.18s ease;
}
.services-menu.sm-mega a.sm-item + a.sm-item { border-top: 0; }
.services-menu.sm-mega a.sm-item:hover,
.services-menu.sm-mega a.sm-item:focus-visible { background: var(--hv2-cream, #faf7f0); outline: none; }
.sm-item img {
  width: 56px; height: 56px;
  border-radius: 12px;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.sm-item:hover img { transform: scale(1.06) rotate(-2deg); }
.sm-text { display: grid; gap: 2px; min-width: 0; }
.sm-text strong { font-size: 0.95rem; font-weight: 800; line-height: 1.25; color: var(--navy); transition: color 0.18s ease; }
.sm-item:hover .sm-text strong { color: var(--gold-accent); }
.sm-text span {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--gray-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sm-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 14px -18px 0;
  max-width: none;
  padding: 14px 24px;
  background: var(--hv2-cream, #faf7f0);
  border-top: 1px solid rgba(1, 1, 126, 0.07);
  font-size: 0.85rem;
  color: var(--gray-dark);
}
.sm-foot > span { margin-right: auto; }
.services-menu.sm-mega .sm-foot a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
  color: var(--navy);
  background: none;
}
.services-menu.sm-mega .sm-foot a + a { border-top: 0; }
.services-menu.sm-mega .sm-foot-link { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.services-menu.sm-mega .sm-foot a.sm-foot-cta { padding: 9px 16px; border-radius: 999px; background: var(--navy); color: #fff; transition: background-color 0.2s ease, color 0.2s ease; }
.services-menu.sm-mega .sm-foot a.sm-foot-cta:hover { background: var(--gold); color: var(--navy); }
.services-menu.sm-mega .sm-foot a.sm-foot-link:hover { background: transparent; color: var(--gold-accent); }

/* ---------- Desktop menu links: gold underline on hover (replaces the grey pill) ---------- */
@media (min-width: 1380px) {
  .nav-container .nav-item {
    position: relative;
    background: transparent !important;
  }
  .nav-container .nav-item::after {
    content: "";
    position: absolute;
    left: 1.25rem;
    right: 1.25rem;
    bottom: 2px;
    height: 3px;
    border-radius: 3px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .nav-container .nav-item:hover::after,
  .nav-container .nav-item:focus-visible::after,
  .services-dropdown:hover .services-toggle::after,
  .services-dropdown:focus-within .services-toggle::after { transform: scaleX(1); }
  .nav-container .nav-item:focus-visible { outline: none; }
  .services-toggle::after { right: calc(1.25rem + 18px); }   /* stop before the caret */
}

/* ---------- "About" dropdown (About Us / Our Team) ---------- */
.nav-dropdown { position: relative; }
.nav-dd-toggle { display: inline-flex; align-items: center; gap: 6px; }
.nav-dd-caret { transition: transform 0.25s ease; }
.nav-dd-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--navy);
}
.nav-dd-icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(1, 1, 126, 0.07);
  color: var(--navy);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.25s ease;
}
.nav-dd-item:hover .nav-dd-icon,
.nav-dd-item:focus-visible .nav-dd-icon { background: var(--gold); color: var(--navy); transform: rotate(-4deg) scale(1.05); }
.nav-dd-text { display: grid; gap: 2px; min-width: 0; }
.nav-dd-text strong { font-size: 0.95rem; font-weight: 800; line-height: 1.25; transition: color 0.18s ease; }
.nav-dd-text span { font-size: 0.8rem; font-weight: 500; line-height: 1.4; color: var(--gray-dark); }

@media (min-width: 1380px) {
  .nav-dd-menu {
    position: absolute;
    left: 50%;
    top: calc(100% + 14px);
    z-index: 1000;
    width: 280px;
    max-width: none;
    padding: 14px 10px 10px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(1, 1, 126, 0.08);
    box-shadow: 0 30px 70px -20px rgba(1, 1, 126, 0.35), 0 2px 6px rgba(1, 1, 126, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px);
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0.22s;
    overflow: hidden;
  }
  .nav-dd-menu::before {             /* invisible bridge so the menu stays open crossing the gap */
    content: "";
    position: absolute;
    left: 0; right: 0; top: -16px;
    height: 16px;
  }
  .nav-dd-menu::after {              /* gold edge */
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--gold-accent));
  }
  .nav-dropdown:hover .nav-dd-menu,
  .nav-dropdown:focus-within .nav-dd-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
  .nav-dropdown:hover .nav-dd-caret,
  .nav-dropdown:focus-within .nav-dd-caret { transform: rotate(180deg); }
  .nav-dd-item { padding: 10px 12px; border-radius: 12px; transition: background-color 0.18s ease; }
  .nav-dd-item:hover,
  .nav-dd-item:focus-visible { background: var(--hv2-cream, #faf7f0); outline: none; }
  .nav-dd-item:hover strong { color: var(--gold-accent); }
  .nav-dropdown:hover .nav-dd-toggle::after,
  .nav-dropdown:focus-within .nav-dd-toggle::after { transform: scaleX(1); }
  .nav-dd-toggle::after { right: calc(1.25rem + 18px) !important; }
}

/* Mobile/tablet menu: sub-links sit indented under "About" */
@media (max-width: 1379px) {
  .nav-dropdown { width: 100%; }
  .nav-dd-caret { display: none; }
  .nav-dd-menu {
    display: grid;
    gap: 2px;
    margin: 0 0 0.35rem 1rem;
    padding-left: 0.85rem;
    border-left: 3px solid var(--gold);
  }
  .nav-dd-item { padding: 0.35rem 0.5rem; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .nav-dd-icon { width: 32px; height: 32px; border-radius: 10px; }
  .nav-dd-icon svg { width: 17px; height: 17px; }
  .nav-dd-text span { display: none; }
  .nav-dd-text strong { font-size: 16px; font-weight: 700; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-container .nav-item::after,
  .services-menu.sm-mega, .sm-item img, .services-caret,
  .nav-dd-menu, .nav-dd-caret, .nav-dd-icon { transition: none; }
}
