/*
  Lancashire Solutions shared menu system
  Purpose: sticky header, Beam-style dropdowns, mobile menu and theme toggle.
*/

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-shell {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  position: relative;
  z-index: 4;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: linear-gradient(140deg, var(--plum), var(--rose));
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  flex: 0 0 auto;
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
}
.brand-mark::before { width: 58px; height: 58px; left: -26px; top: -22px; }
.brand-mark::after { width: 28px; height: 28px; right: -7px; bottom: -7px; }
.brand-mark.logo-mark {
  background: transparent;
  border: 0;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: none;
}
.brand-mark.logo-mark::before,
.brand-mark.logo-mark::after {
  content: none;
}
.brand-mark.logo-mark img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0;
}

.nav-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  min-width: 0;
  position: relative;
  z-index: 4;
}
.desktop-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  min-width: 0;
}
.beam-menu-item { position: relative; }
.beam-trigger,
.mobile-menu-toggle,
.theme-toggle-menu {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 0.86rem;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.beam-trigger::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.74;
}
.beam-menu-item:hover .beam-trigger,
.beam-menu-item:focus-within .beam-trigger,
.beam-menu-item.open .beam-trigger,
.mobile-menu-toggle:hover,
.mobile-menu-toggle[aria-expanded="true"],
.theme-toggle-menu:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}
.theme-toggle-menu {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
  color: var(--text);
}
.mobile-menu-toggle { display: none; }
.hamburger {
  width: 18px;
  height: 12px;
  position: relative;
  display: inline-block;
}
.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.hamburger::before { top: 1px; }
.hamburger::after { top: 9px; }

.beam-panel {
  position: fixed;
  top: 86px;
  left: 50%;
  width: min(920px, calc(100vw - 2rem));
  max-height: calc(100dvh - 104px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transform: translateX(-50%);
  display: none;
  z-index: 1000;
  padding: 0;
}
.beam-menu-item:hover .beam-panel,
.beam-menu-item:focus-within .beam-panel,
.beam-menu-item.open .beam-panel {
  display: block;
}
.beam-panel-shell {
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.18fr);
  gap: 0.85rem;
  padding: 0.9rem;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.beam-panel-intro {
  min-height: 100%;
  padding: 1.1rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, var(--soft-plum), transparent 46%),
    linear-gradient(145deg, var(--soft-rose), var(--soft-ink));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}
.beam-panel-intro span {
  width: fit-content;
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.beam-panel-intro strong {
  display: block;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.02;
  letter-spacing: -0.052em;
  max-width: 10ch;
}
.beam-panel-intro p {
  color: var(--muted);
  font-size: 0.94rem;
  max-width: 34ch;
}
.beam-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
  align-content: start;
}
.beam-panel-talk .beam-link-grid { grid-template-columns: 1fr; }
.beam-link {
  min-height: 86px;
  padding: 0.95rem;
  border-radius: 21px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
}
.beam-link:hover,
.beam-link:focus-visible {
  background: var(--surface-strong);
  border-color: var(--line-strong);
  outline: none;
}
.beam-icon {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--plum), var(--rose));
  color: #fff;
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.beam-link strong {
  display: block;
  font-size: 0.99rem;
  letter-spacing: -0.025em;
  margin-bottom: 0.12rem;
}
.beam-link span:not(.beam-icon) {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}
.beam-arrow {
  color: var(--rose);
  font-weight: 900;
}

.mobile-menu-panel {
  display: none;
  position: fixed;
  left: 1rem;
  right: 1rem;
  top: 86px;
  max-height: calc(100dvh - 104px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.75rem;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 95%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  z-index: 1000;
}
.mobile-menu-panel.open { display: grid; gap: 0.65rem; }
.mobile-menu-panel details {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  overflow: hidden;
}
.mobile-menu-panel summary {
  min-height: 56px;
  padding: 0 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text);
  font-weight: 850;
  letter-spacing: -0.02em;
}
.mobile-menu-panel summary::-webkit-details-marker { display: none; }
.mobile-menu-panel summary::after {
  content: "+";
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  flex-shrink: 0;
}
.mobile-menu-panel details[open] summary::after { content: "−"; }
.mobile-link-list {
  display: grid;
  gap: 0.5rem;
  padding: 0 0.65rem 0.65rem;
}
.mobile-link-list .beam-link {
  min-height: 74px;
  border-radius: 18px;
  background: var(--surface-strong);
}

@media (max-width: 980px) {
  .desktop-menu { display: none; }
  .mobile-menu-toggle { display: inline-flex; }
  .nav-group { gap: 0.5rem; }
}

@media (max-width: 760px) {
  .nav-shell { align-items: center; padding: 0.9rem 0; }
  .nav-group { flex-direction: row; align-items: center; width: auto; }
  .mobile-menu-panel { top: 78px; max-height: calc(100dvh - 92px); }
  .beam-panel { top: 78px; max-height: calc(100dvh - 92px); }
}

@media (max-width: 560px) {
  .brand span:last-child { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; }
  .theme-toggle-menu { display: none; }
}
