/* ───────────────────────────────────────────────────────────────────
   powerstacks-nav.css
   ─────────────────────
   Full marketing-site header ported from src/components/Header.astro.
   Overrides the older 40px banner styling in microsoft-learn.css.

   Brand tokens:
     --ps-navy:       #051441
     --ps-navy-light: #0A1F5E
     --ps-blue:       #6EC1E4
     --ps-green:      #61CE70   (Get Started CTA)
     --ps-green-dark: #4CB55C
   ─────────────────────────────────────────────────────────────────── */

:root {
  --ps-navy: #051441;
  --ps-navy-light: #0A1F5E;
  --ps-blue: #6EC1E4;
  --ps-green: #61CE70;
  --ps-green-dark: #4CB55C;
  --ps-hero-start: #3221AA;
  --ps-hero-end: #5670F0;
  --ps-nav-height: 64px;
}

/* ─── Site-wide font to match marketing ─────────────────────────── */
body, .md-typeset {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif !important;
}

/* ─── Override Material's default .md-banner styling from microsoft-learn.css ─── */
.md-banner {
  background: transparent !important;
  overflow: visible !important;
  height: var(--ps-nav-height) !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 100 !important;
  width: 100% !important;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.md-banner__inner {
  display: block !important;
  height: var(--ps-nav-height) !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
}

/* Compensate for fixed banner height */
body {
  padding-top: var(--ps-nav-height) !important;
}

/* Hide the old simple nav styles — powerstacks-nav uses its own */
.ps-global-nav,
.ps-global-nav__inner,
.ps-global-nav__brand,
.ps-global-nav__site-links,
.ps-global-nav__cta {
  display: none !important;
}

/* ─── Hide Material's built-in header (search bar) ──────────────── */
.md-header,
.md-tabs {
  display: none !important;
}

/* ─── The new marketing-parity header ─────────────────────────── */

.ps-header {
  height: var(--ps-nav-height);
  display: flex;
  align-items: center;
  color: #ffffff;
}

.ps-header__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem;
  height: var(--ps-nav-height);
}

@media (min-width: 640px)  { .ps-header__nav { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .ps-header__nav { padding: 0 2rem;   } }

/* ─── Logo + brand text ─────────────────────────────────────── */
.ps-header__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  text-decoration: none !important;
  color: #ffffff !important;
  margin-right: 1rem;
}
.ps-header__logo {
  width: 32px;
  height: 32px;
  display: block;
}
.ps-header__brand-text {
  font-size: 1.25rem;        /* text-xl */
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  transition: color 0.3s ease;
}

/* ─── Nav links container (visible on lg+) ───────────────────── */
.ps-header__links {
  display: none;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}
@media (min-width: 1024px) {
  .ps-header__links { display: flex; }
}

/* ─── Nav link base (Blog) + dropdown triggers ─────────────── */
.ps-header__link,
.ps-dropdown__trigger {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.875rem;       /* text-sm */
  font-weight: 500;
  color: rgba(255,255,255,0.9) !important;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.ps-header__link:hover,
.ps-dropdown__trigger:hover,
.ps-dropdown--open .ps-dropdown__trigger {
  color: #ffffff !important;
  background: rgba(255,255,255,0.1);
  outline: none;
}

.ps-dropdown__chevron {
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.ps-dropdown:hover .ps-dropdown__chevron,
.ps-dropdown--open .ps-dropdown__chevron {
  transform: rotate(180deg);
}

/* ─── Dropdown menus ─────────────────────────────────────── */
.ps-dropdown {
  position: relative;
}
.ps-dropdown__menu {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  min-width: 240px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 200;
}
.ps-dropdown:hover .ps-dropdown__menu,
.ps-dropdown:focus-within .ps-dropdown__menu,
.ps-dropdown--open .ps-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.ps-dropdown__menu a {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #334155 !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}
.ps-dropdown__menu a:hover {
  background: #f8fafc;
  color: var(--ps-navy) !important;
}
.ps-dropdown__divider {
  height: 1px;
  background: #e2e8f0;
  margin: 0.35rem 0;
}

/* Widen Solutions dropdown (7 items) */
.ps-dropdown:first-child .ps-dropdown__menu {
  min-width: 280px;
}

/* ─── Get Started CTA — marketing btn-primary (brand-green) ── */
.ps-header__cta {
  display: none;
  flex-shrink: 0;
  margin-left: 0.75rem;
  background: var(--ps-green);
  color: #ffffff !important;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none !important;
  transition: background 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.ps-header__cta:hover {
  background: var(--ps-green-dark);
  color: #ffffff !important;
}
@media (min-width: 640px) {
  .ps-header__cta { display: inline-flex; align-items: center; }
}

/* ─── Mobile hamburger toggle ───────────────────────────── */
.ps-header__mobile-toggle {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 0.5rem;
  cursor: pointer;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 1024px) {
  .ps-header__mobile-toggle { display: none; }
}

/* ─── Mobile menu (below nav when open) ─────────────────── */
.ps-mobile-menu {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 1rem;
  position: fixed;
  top: var(--ps-nav-height);
  left: 0;
  right: 0;
  max-height: calc(100vh - var(--ps-nav-height));
  overflow-y: auto;
  z-index: 99;
}
.ps-mobile-menu[hidden] { display: none; }
.ps-mobile-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: #334155 !important;
  text-decoration: none !important;
  font-size: 0.9rem;
  border-radius: 4px;
}
.ps-mobile-menu a:hover { background: #f8fafc; color: var(--ps-navy) !important; }
.ps-mobile-menu__heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin: 1rem 0 0.25rem;
  padding: 0 0.75rem;
}
.ps-mobile-menu__heading:first-child { margin-top: 0; }
.ps-mobile-menu__cta {
  display: block;
  margin-top: 1rem !important;
  background: var(--ps-green);
  color: #ffffff !important;
  text-align: center;
  font-weight: 600;
  padding: 0.75rem !important;
  border-radius: 8px;
}

/* ─── Scrolled state — white header with shadow ─────────── */
.ps-header.ps-header--scrolled {
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border-bottom-color: #e2e8f0;
}
.ps-header.ps-header--scrolled .ps-header__brand-text,
.ps-header.ps-header--scrolled .ps-header__link,
.ps-header.ps-header--scrolled .ps-dropdown__trigger {
  color: #334155 !important;
}
.ps-header.ps-header--scrolled .ps-header__brand-text { color: var(--ps-navy) !important; }
.ps-header.ps-header--scrolled .ps-header__link:hover,
.ps-header.ps-header--scrolled .ps-dropdown__trigger:hover,
.ps-header.ps-header--scrolled .ps-dropdown--open .ps-dropdown__trigger {
  background: #f1f5f9;
  color: var(--ps-navy) !important;
}
.ps-header.ps-header--scrolled .ps-header__mobile-toggle {
  color: var(--ps-navy);
}

/* Also apply scrolled state when .md-banner has the class (since md-banner wraps) */
.md-banner { background: linear-gradient(90deg, var(--ps-hero-start), var(--ps-hero-end)) !important; }
.md-banner:has(.ps-header--scrolled) { background: #ffffff !important; }

/* ─── Sidebar positioning under new 64px header ─────────── */
.md-sidebar--primary,
.md-sidebar--secondary {
  top: var(--ps-nav-height) !important;
  height: calc(100vh - var(--ps-nav-height)) !important;
  z-index: 5 !important;
}

/* ─── Close the gap between fixed nav and content ────────── */
/* Material's .md-header and .md-tabs are hidden but still in the DOM.
   The gap comes from Material's default spacing on .md-main + .md-grid.
   Pull the hero up and ensure zero top spacing on all wrappers. */
.md-main {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.md-main__inner {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.md-content {
  padding-top: 0 !important;
}
.md-content__inner {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.md-content__inner::before {
  display: none !important;
}
/* Landing pages (hero-banner) hide toc/navigation so the negative
   margin closes the gap cleanly. Article pages have sidebars so
   the hero needs to sit BELOW the nav, not pull up under it. */
.hero-banner {
  margin-top: -1.5rem !important;
}
.md-typeset h1:first-of-type:not(.hero-banner h1) {
  margin-top: 0 !important;
  padding-top: 2.5rem !important;
}

/* ─── Quick-link card icons ─────────────────────────────── */
.quick-link-card {
  position: relative;
  padding-left: 3rem !important;
}
.quick-link-card .card-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  opacity: 0.7;
}
.quick-link-card .card-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.quick-link-card .card-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* ─── Nav alignment — match marketing site spacing ──────────────── */
/* Marketing uses justify-between: logo left, nav items center, CTA right.
   The nav items should have breathing room from the logo, not hard-left. */
.ps-header__links {
  margin-left: auto;
  margin-right: auto;
}

/* ─── Fix navigation tabs (re-enabled for sidebar scoping but hidden) ── */
/* Material's .md-tabs is re-enabled via navigation.tabs in mkdocs.yml
   to scope the sidebar to the current product. The tab bar itself is
   hidden — our header's Learn dropdown handles product switching. */
.md-tabs {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* ─── Assistant Widget ──────────────────────────────── */

#ps-assistant-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}
#ps-assistant-toggle {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--ps-navy);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(5, 20, 65, 0.35);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
#ps-assistant-toggle:hover {
  background: var(--ps-navy-light);
  transform: scale(1.07);
  box-shadow: 0 6px 20px rgba(5, 20, 65, 0.45);
}
#ps-assistant-toggle svg { width: 24px; height: 24px; pointer-events: none; }

#ps-assistant-panel {
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 400px;
  height: 600px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(5, 20, 65, 0.18);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
#ps-assistant-panel.ps-open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}
#ps-assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--ps-hero-start), var(--ps-hero-end));
  color: #ffffff;
  flex-shrink: 0;
}
#ps-assistant-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
#ps-assistant-title svg { width: 18px; height: 18px; flex-shrink: 0; }
#ps-assistant-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#ps-assistant-close:hover { color: #ffffff; background: rgba(255, 255, 255, 0.15); }
#ps-assistant-close svg { width: 16px; height: 16px; }
#ps-assistant-body { flex: 1; overflow: hidden; }
#ps-assistant-iframe { width: 100%; height: 100%; border: none; display: block; }

@media (max-width: 480px) {
  #ps-assistant-root { bottom: 16px; right: 16px; }
  #ps-assistant-panel {
    position: fixed;
    bottom: 0; right: 0; left: 0;
    width: 100%;
    height: 90dvh;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
  }
}

/* ─── Release notes list (from release_archive macro) ──── */
.ps-release-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 2rem;
}
.ps-release-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.ps-release-list li:last-child { border-bottom: none; }
.ps-release-list li a { color: var(--ps-hero-start); text-decoration: none; }
.ps-release-list li a:hover { text-decoration: underline; }
.ps-release-list__date { color: #64748b; font-size: 0.9em; }

/* ─── Two-column layout for product landing pages ─────────────── */
.ps-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 3rem;
}
@media (max-width: 768px) {
  .ps-two-col {
    grid-template-columns: 1fr;
  }
}

/* ─── Footer — matches marketing site Footer.astro ──────────────── */

.ps-footer {
  background: #EFF2F9;
  border-top: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.875rem;
}
.ps-footer__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 4rem 1rem 2rem;
}
@media (min-width: 640px) { .ps-footer__inner { padding: 4rem 1.5rem 2rem; } }
@media (min-width: 1024px) { .ps-footer__inner { padding: 4rem 2rem 2rem; } }

.ps-footer__columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}
@media (min-width: 768px) {
  .ps-footer__columns { grid-template-columns: repeat(5, 1fr); }
}
.ps-footer__heading {
  color: #1e293b;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.ps-footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ps-footer__list li { margin-bottom: 0.5rem; }
.ps-footer__list a {
  color: #64748b !important;
  text-decoration: none !important;
  transition: color 0.15s ease;
}
.ps-footer__list a:hover { color: var(--ps-blue) !important; }

.ps-footer__contact { margin-top: 1.5rem; }
.ps-footer__contact p { margin: 0.25rem 0; color: #64748b; }
.ps-footer__contact-label { font-weight: 500; color: #334155; }
.ps-footer__contact a { color: #64748b !important; text-decoration: none !important; }
.ps-footer__contact a:hover { color: var(--ps-blue) !important; }

.ps-footer__bottom {
  border-top: 1px solid #cbd5e1;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
@media (min-width: 640px) {
  .ps-footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}
.ps-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ps-footer__logo { width: 28px; height: 28px; }
.ps-footer__brand-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ps-navy);
}
.ps-footer__social {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.ps-footer__social a { color: #94a3b8; transition: color 0.15s ease; }
.ps-footer__social a:hover { color: var(--ps-blue); }
.ps-footer__social-icon { width: 20px; height: 20px; }

.ps-footer__legal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
}
.ps-footer__legal a { color: #64748b !important; text-decoration: none !important; }
.ps-footer__legal a:hover { color: var(--ps-blue) !important; }
.ps-footer__legal-sep { color: #cbd5e1; }

.ps-footer__copy {
  color: #64748b;
  margin: 0;
}
