/* Shared, progressively enhanced site shell for the public DevsOff pages. */

:where(html, body) {
  inline-size: 100%;
  max-inline-size: 100%;
}

:where(body > header, body > main, body > footer) {
  max-inline-size: 100%;
}

:where(img, picture, video, canvas, svg) {
  max-inline-size: 100%;
}

:where(main, section, .container, .hero, .hero-grid, .split, .workspace) {
  min-inline-size: 0;
}

main :where(h1, h2, h3, p, li, dd) {
  overflow-wrap: break-word;
}

/* Keep decorative layers inside their layout boxes without clipping focus rings. */
.plan-shell::before,
.plan-shell::after {
  right: 0 !important;
}

.site-shell-header,
.site-shell-row {
  max-inline-size: 100%;
}

.site-menu-toggle {
  display: none;
  flex: 0 0 44px;
  inline-size: 44px;
  block-size: 44px;
  margin: 0;
  padding: 10px;
  border: 1px solid #cbd5e8;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: #0b1c44;
  background: #fff;
  box-shadow: 0 6px 18px rgba(24, 49, 105, 0.1);
  cursor: pointer;
}

.site-menu-toggle:hover {
  border-color: #9fb3dc;
  background: #f7f9ff;
}

.site-menu-toggle__bar {
  display: block;
  inline-size: 21px;
  block-size: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  transition: transform 160ms ease, opacity 160ms ease;
}

.site-menu-toggle[aria-expanded="true"] .site-menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-menu-toggle[aria-expanded="true"] .site-menu-toggle__bar:nth-child(2) {
  opacity: 0;
}

.site-menu-toggle[aria-expanded="true"] .site-menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-menu-toggle:focus-visible,
.site-primary-nav a:focus-visible {
  outline: 3px solid #1458ff;
  outline-offset: 2px;
}

/* JS marks a header compact only when its original page CSS has hidden Primary. */
.site-shell-header[data-site-shell-compact="true"] .site-shell-row {
  position: relative;
  flex-wrap: nowrap;
  gap: clamp(0.55rem, 2vw, 1rem) !important;
}

.site-shell-header[data-site-shell-compact="true"] .site-menu-toggle {
  display: inline-flex;
  margin-inline-start: auto;
}

.site-shell-header[data-site-shell-compact="true"] .site-shell-row > .site-menu-toggle ~ :is(.nav-actions, .actions) {
  margin-inline-start: 0 !important;
}

.site-shell-header[data-site-shell-compact="true"] .site-primary-nav {
  position: absolute;
  z-index: 1000;
  inset-block-start: calc(100% + 0.5rem);
  inset-inline-end: 0;
  inline-size: min(22rem, calc(100vw - 2rem));
  max-block-size: calc(100dvh - 7rem);
  margin: 0 !important;
  padding: 0.55rem;
  border: 1px solid #d7dfef;
  border-radius: 14px;
  align-items: stretch !important;
  flex-direction: column;
  gap: 0.15rem !important;
  color: var(--text, var(--navy, #0b1c44));
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 20px 50px rgba(17, 39, 91, 0.2);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.site-shell-header[data-site-shell-compact="true"] .site-primary-nav:not([hidden]) {
  display: flex !important;
}

.site-shell-header[data-site-shell-compact="true"] .site-primary-nav[hidden] {
  display: none !important;
}

.site-shell-header[data-site-shell-compact="true"] .site-primary-nav a {
  display: block;
  inline-size: 100%;
  padding: 0.85rem 0.9rem !important;
  border-radius: 9px;
  line-height: 1.35;
}

.site-shell-header[data-site-shell-compact="true"] .site-primary-nav a:hover,
.site-shell-header[data-site-shell-compact="true"] .site-primary-nav a:focus-visible,
.site-shell-header[data-site-shell-compact="true"] .site-primary-nav a.active,
.site-shell-header[data-site-shell-compact="true"] .site-primary-nav a[aria-current="page"] {
  color: #0c4be8;
  background: #eef3ff;
}

.site-shell-header[data-site-shell-compact="true"] .site-primary-nav a::after {
  display: none !important;
}

@media (max-width: 620px) {
  .site-menu-toggle {
    flex-basis: 42px;
    inline-size: 42px;
    block-size: 42px;
    padding: 9px;
  }

  .site-shell-header[data-site-shell-compact="true"] .site-primary-nav {
    inline-size: min(21rem, calc(100vw - 1.5rem));
  }

  /* The Security illustration's rotated orbit was the mobile overflow source. */
  .visual .orbit {
    inset-inline: 8% !important;
  }

  .visual .orbit::before {
    inset-inline: 0 !important;
  }
}

@media (max-width: 360px) {
  .site-shell-header[data-site-shell-compact="true"] .brand-logo {
    inline-size: 110px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-menu-toggle__bar {
    transition: none;
  }
}
