/* Vendor directory nav v2 (2026-09-06). SOURCE file: copy of the NAV V2 block in
   dnsai.com/template/style/nav-fixes.css with html[data-theme=light] selectors added (this app stamps
   data-theme). Deploy as a NEW filename nav-v2-<ver>.css and point includes/layout.php at it — Cloudflare
   ignores ?v= under /vendor-directory/. Keep in sync with nav-fixes.css. */
/* ========================================================================
   NAV V2 (2026-09-06) — wide wordmark + sun/moon theme toggle.
   Scoped to .nav-v2 so the 15 per-family nav stylesheets cannot collide.
   Theme keys: html[data-dnsai-theme="light"] (set pre-paint by theme-init.php)
   and body.light-mode (what every family stylesheet already keys on).
   ======================================================================== */
:root {
  --nav-height: 72px;
  --nav-wordmark-h: 22px;
  --nav-wordmark-h-md: 18px;
  --nav-wordmark-h-sm: 18px;
}
.nav-v2 { gap: 0; }
.nav-v2 .nav-brand { display: flex; align-items: center; flex-shrink: 0; min-width: 0; }
.nav-v2 .nav-brand-link {
  display: flex; align-items: center; text-decoration: none;
  padding: 0 !important; margin: 0 !important; line-height: 0; opacity: 1; transition: opacity .2s ease;
}
.nav-v2 .nav-brand-link:hover { opacity: .85; }
.nav-v2 .nav-wordmark { display: none; line-height: 0; }
.nav-v2 .nav-wordmark img {
  height: var(--nav-wordmark-h) !important; width: auto !important; max-width: none !important; display: block; filter: none;
}
.nav-v2 .nav-wordmark--dark { display: block; }
body.light-mode .nav-v2 .nav-wordmark--dark,
html[data-dnsai-theme="light"] .nav-v2 .nav-wordmark--dark,
html[data-theme="light"] .nav-v2 .nav-wordmark--dark { display: none; }
body.light-mode .nav-v2 .nav-wordmark--light,
html[data-dnsai-theme="light"] .nav-v2 .nav-wordmark--light,
html[data-theme="light"] .nav-v2 .nav-wordmark--light { display: block; }

/* Links: drop the legacy 50px right margin (main.css) — the wordmark's width comes from here */
/* physical resets FIRST (families set margin-left/right), logical values LAST so they win in both LTR and RTL */
.nav-v2 .nav-links { margin-left: 0 !important; margin-right: 0 !important; margin-inline-start: 20px !important; margin-inline-end: 0 !important; }
.nav-v2 .nav-search { flex: 1 1 auto; min-width: 0; margin-left: 0 !important; margin-right: 0 !important; margin-inline-start: 16px !important; margin-inline-end: 12px !important; }

/* Right-hand action cluster: theme toggle + hamburger */
.nav-v2 .nav-actions { display: flex; align-items: center; gap: 4px; margin-inline-start: auto !important; flex-shrink: 0; }
.nav-v2 .nav-actions .menu-icon { margin-left: 0 !important; position: static !important; }

body.light-mode .nav-v2 .nav-actions .menu-icon,
html[data-dnsai-theme="light"] .nav-v2 .nav-actions .menu-icon,
html[data-theme="light"] .nav-v2 .nav-actions .menu-icon { color: #1a1a1a !important; text-shadow: none !important; }

/* Sun/moon toggle (markup: template/includes/theme-toggle.php).
   Box properties are !important: several page stylesheets ship `body.<page> button {width:35%; margin:15px; …}`
   and inline `button {padding … !important}` rules (domain-manager, dns-explorer clones) that outrank a class. */
.nav-v2 .nav-actions .theme-toggle {
  display: inline-flex !important; align-items: center; justify-content: center;
  width: 32px !important; height: 32px !important; min-width: 0 !important; max-width: none !important;
  border-radius: 50% !important; padding: 0 !important; margin: 0 !important; font-size: 0 !important; line-height: 0 !important;
  border: 0 !important; background: transparent !important; box-shadow: none !important; color: #d5dde6 !important;
  position: relative; top: 4px;  /* sits 4px lower to align with the nav links (owner request 2026-09-06) */
  cursor: pointer; flex-shrink: 0; -webkit-tap-highlight-color: transparent;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.nav-v2 .nav-actions .theme-toggle svg { width: 17px !important; height: 17px !important; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }
.nav-v2 .nav-actions .theme-toggle .icon-sun { display: none; }
.nav-v2 .nav-actions .theme-toggle:hover { color: #26c4ff !important; }
/* Page stylesheets ship generic button:hover / button:active gradients — never let them paint the toggle */
.nav-v2 .nav-actions .theme-toggle:hover, .nav-v2 .nav-actions .theme-toggle:focus, .nav-v2 .nav-actions .theme-toggle:active {
  background: transparent !important; border: 0 !important; box-shadow: none !important; transform: none !important;
}
.nav-v2 .nav-actions .theme-toggle:focus-visible { outline: 2px solid #26c4ff; outline-offset: 2px; }
body.light-mode .nav-v2 .nav-actions .theme-toggle,
html[data-dnsai-theme="light"] .nav-v2 .nav-actions .theme-toggle,
html[data-theme="light"] .nav-v2 .nav-actions .theme-toggle { color: #3b4756 !important; }
body.light-mode .nav-v2 .nav-actions .theme-toggle .icon-sun,
html[data-dnsai-theme="light"] .nav-v2 .nav-actions .theme-toggle .icon-sun,
html[data-theme="light"] .nav-v2 .nav-actions .theme-toggle .icon-sun { display: block; }
body.light-mode .nav-v2 .nav-actions .theme-toggle .icon-moon,
html[data-dnsai-theme="light"] .nav-v2 .nav-actions .theme-toggle .icon-moon,
html[data-theme="light"] .nav-v2 .nav-actions .theme-toggle .icon-moon { display: none; }
body.light-mode .nav-v2 .nav-actions .theme-toggle:hover,
html[data-dnsai-theme="light"] .nav-v2 .nav-actions .theme-toggle:hover,
html[data-theme="light"] .nav-v2 .nav-actions .theme-toggle:hover { color: #0054ff !important; }
body.light-mode .nav-v2 .nav-actions .theme-toggle:focus-visible,
html[data-dnsai-theme="light"] .nav-v2 .nav-actions .theme-toggle:focus-visible,
html[data-theme="light"] .nav-v2 .nav-actions .theme-toggle:focus-visible { outline-color: #0054ff; }

/* Breakpoints: wordmark shrinks, and links/search leave at <=900px (was 768px) so the
   769-900px band never overflows the hamburger off-canvas. */
@media (max-width: 1024px) {
  .nav-v2 .nav-wordmark img { height: var(--nav-wordmark-h-md) !important; }
}
@media (max-width: 1024px) {
  .nav-v2 .nav-links { display: none !important; }
  .nav-v2 .nav-search { display: none !important; }
}
@media (max-width: 768px) {
  /* Mobile: icon sat askew — 2px higher and 3px further right than the desktop offset (owner, 2026-09-06) */
  .nav-v2 .nav-actions .theme-toggle { top: 2px; left: 3px; }
}
@media (max-width: 600px) {
  .nav-v2 .nav-wordmark img { height: var(--nav-wordmark-h-sm) !important; }
  .nav-v2 .nav-actions .theme-toggle { width: 30px !important; height: 30px !important; }
}
@media (hover: none) and (pointer: coarse) {
  .nav-v2 .nav-actions .theme-toggle { min-width: 44px !important; min-height: 44px !important; }
}

/* Vendor directory light mode: the Utilities dropdown label was left white by Shared_Vendor_Landscape.css */
html[data-theme="light"] .nav-v2 .nav-links .nav-dropdown-toggle,
html[data-dnsai-theme="light"] .nav-v2 .nav-links .nav-dropdown-toggle,
body.light-mode .nav-v2 .nav-links .nav-dropdown-toggle { color: #1a1a1a !important; }

/* ========================================================================
   NAV V3 (2026-09-12) — Utilities as a 3-column panel, My Account dropdown on every page,
   click / keyboard / touch open state (.is-open set by theme.js). Hover still opens on
   hover-capable devices; on coarse pointers only .is-open shows the panel (so a tap toggles cleanly).
   Specificity is deliberately higher than the per-page .nav-dropdown rules in main/home/search css.
   ======================================================================== */
.nav-v2 .nav-dropdown .nav-dropdown-menu {
  opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none;
}
.nav-v2 .nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
.nav-v2 .nav-dropdown.is-open .nav-dropdown-toggle::after { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) {
  .nav-v2 .nav-dropdown:not(.is-open):hover .nav-dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
  }
}
@media (hover: none), (pointer: coarse) {
  .nav-v2 .nav-dropdown:not(.is-open):hover .nav-dropdown-menu { opacity: 0; visibility: hidden; pointer-events: none; }
}
.nav-v2 .nav-dropdown-toggle:focus-visible { outline: 2px solid #26c4ff; outline-offset: 3px; border-radius: 4px; }
body.light-mode .nav-v2 .nav-dropdown-toggle:focus-visible { outline-color: #0054ff; }

/* the Utilities panel */
.nav-v2 .nav-dropdown-menu.nav-mega {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content));
  column-gap: 6px;
  min-width: 0;
  width: max-content;
  max-width: min(760px, calc(100vw - 32px));
  padding: 10px 8px 8px;
  left: 0;
}
.nav-v2 .nav-mega .dropdown-col { min-width: 0; padding: 0 2px; }
.nav-v2 .nav-mega .dropdown-col a { white-space: nowrap; padding: 8px 14px; font-size: 14px; }
.nav-v2 .nav-mega .dropdown-section-header { padding: 6px 14px 4px; }
.nav-v2 .nav-mega .dropdown-foot {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 2px 4px;
  margin: 8px 8px 0; padding: 8px 4px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}
.nav-v2 .nav-mega .dropdown-foot a { padding: 5px 9px; font-size: 13px; opacity: .9; white-space: nowrap; }
.nav-v2 .nav-mega .dropdown-foot a:hover { opacity: 1; }
body.light-mode .nav-v2 .nav-mega .dropdown-foot { border-top-color: rgba(0, 0, 0, 0.10); }
/* The vendor nav dropdown panel is forced dark (#111 !important, from Shared_Vendor_Landscape.css)
   in every theme, so keep its contents light in light mode too — main.min.css otherwise flips the
   link text dark, producing dark-on-dark (unreadable). Higher specificity + !important to win. */
body.light-mode .nav-v2 .nav-dropdown-menu a,
html[data-theme="light"] .nav-v2 .nav-dropdown-menu a { color: #e5e7eb !important; }
body.light-mode .nav-v2 .nav-dropdown-menu a:hover,
html[data-theme="light"] .nav-v2 .nav-dropdown-menu a:hover { color: #ffffff !important; background: rgba(38,196,255,.15) !important; }
body.light-mode .nav-v2 .nav-dropdown-menu .dropdown-section-header,
html[data-theme="light"] .nav-v2 .nav-dropdown-menu .dropdown-section-header { color: #26c4ff !important; }
body.light-mode .nav-v2 .nav-mega .dropdown-foot { border-top-color: rgba(255,255,255,.12) !important; }
/* My Account panel keeps the classic single column */
.nav-v2 .nav-dropdown--account .nav-dropdown-menu { min-width: 230px; }
.nav-v2 .nav-dropdown--account .nav-dropdown-menu a { white-space: nowrap; }
/* keep the panel on screen: right-anchor when the bar is narrow */
@media (max-width: 1180px) {
  .nav-v2 .nav-dropdown-menu.nav-mega { grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(640px, calc(100vw - 32px)); }
  .nav-v2 .nav-mega .dropdown-col a { white-space: normal; }
}
@media (max-width: 1024px) {
  .nav-v2 .nav-dropdown-menu.nav-mega { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(480px, calc(100vw - 32px)); }
}

/* ---- flyout "My Accounts" block (copied from dnsai.com flyout.php inline styles; nav v3 2026-09-12) ---- */
.flyout-account-heading {
  display: block;
  padding: 8px 20px 10px;
  margin: 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #99a2b3;
}
.flyout-account-link {
  display: block;
  color: #aab4c4 !important;
  padding: 14px 20px;
  margin: 0 8px 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.35;
}
.flyout-account-note {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #5f7adb;
  margin-top: 5px;
  line-height: 1.4;
}
/* breathing room between the account block and the first drawer (2026-09-12) */
.flyout-menu .flyout-account-link + .flyout-drawer {
  margin-top: 14px !important;
}
.flyout-account-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.05);
}
.flyout-account-link::before {
  display: none !important;
}
body.light-mode .flyout-account-link {
  color: #666 !important;
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .flyout-account-link:hover {
  color: #000 !important;
  background: rgba(0, 0, 0, 0.04);
}

/* Flyout is a flex column at 100dvh: plain links (Home, My Accounts, Close) must never shrink when the menu is
   taller than the screen — without this they get clipped on phones (found 2026-09-12 during nav v3). */
.flyout-menu > a, .flyout-menu > .flyout-account-heading, .flyout-menu > .flyout-drawer { flex-shrink: 0; }
.flyout-menu .flyout-account-link, .flyout-menu .flyout-home-link { height: auto; max-height: none; overflow: visible; }

/* Dropdown panels must not inherit a page stylesheet's own dropdown layout (dns-assistant.css ships a 500px
   centred flex panel with display:none; the /secure/ assistant page loads it). Pin the shared geometry. */
.nav-v2 .nav-dropdown .nav-dropdown-menu:not(.nav-mega) { display: block; left: 0; right: auto; min-width: 220px; padding: 8px 0; gap: 0; }
.nav-v2 .nav-dropdown.is-open .nav-dropdown-menu:not(.nav-mega) { display: block; }
.nav-v2 .nav-dropdown-menu a { display: block; transform: none; }
.nav-v2 .nav-dropdown-menu a:hover { transform: none; }
.nav-v2 .nav-dropdown-menu .dropdown-section-header { display: block; }

