/*
 * picodata.io top header — visual mirror of the Astro Header on the
 * marketing site so users don't notice when navigation crosses the
 * picodata.io / docs.picodata.io boundary.
 *
 * Source of truth: site/public/styles.css in picodata-landing (the
 * Header bar block). Any change there should be mirrored here. CSS
 * variables from the marketing site are inlined below so this file
 * has no external dependency.
 *
 * Scope: rules apply only inside .picodata-header. Material for MkDocs
 * default styles for .md-header__inner (breadcrumb + search) are not
 * touched.
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

/* === Brand tokens (mirrored from picodata.io site:root) === */
.picodata-header {
  --pico-fg:           #2C1322;  /* warm-plum near-black */
  --pico-fg-muted:     #4a5568;
  --pico-bg:           #ffffff;
  --pico-accent:       #E23956;  /* Pico Red */
  --pico-accent-hover: #B91B36;
  --pico-border:       #eaeaea;
  --pico-surface:      #f6f7f9;

  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--pico-bg);
  border-bottom: 1px solid var(--pico-border);
  position: relative;
  width: 100%;
}

.picodata-header * { box-sizing: border-box; }

/* === Topbar layout === */
.picodata-header .container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.picodata-header .topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

/* === Logo === */
.picodata-header .logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}
.picodata-header .logo img {
  display: block;
  height: 28px;
  width: auto;
}

/* === Top-level menu === */
.picodata-header nav.primary {
  display: flex;
  align-items: stretch;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.picodata-header .menu-item {
  display: flex;
  align-items: center;
}
.picodata-header .menu-trigger {
  display: inline-flex;
  align-items: center;
  height: 64px;
  padding: 0 14px;
  color: var(--pico-fg);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}
.picodata-header .menu-item:hover .menu-trigger,
.picodata-header .menu-item:focus-within .menu-trigger {
  color: var(--pico-accent);
}

/* === Mega-panel (full-width dropdown below the bar) === */
.picodata-header .mega-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--pico-bg);
  border-top: 1px solid var(--pico-border);
  border-bottom: 1px solid var(--pico-border);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.05);
  padding: 32px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 90;
}
.picodata-header .menu-item:hover .mega-panel,
.picodata-header .menu-item:focus-within .mega-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.picodata-header .mega-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}
.picodata-header .mega-label {
  color: var(--pico-accent);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.picodata-header .mega-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 36px;
}
.picodata-header .mega-link {
  display: block;
  text-decoration: none;
  color: var(--pico-fg);
  transition: color 0.15s ease;
}
.picodata-header .mega-link:hover {
  color: var(--pico-accent);
}
.picodata-header .mega-link:hover .mega-link-title {
  color: var(--pico-accent);
}
.picodata-header .mega-link-title {
  display: block;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}
.picodata-header .mega-items.is-rich .mega-link-title {
  font-weight: 700;
  font-size: 16px;
}
.picodata-header .mega-link-desc {
  display: block;
  font-size: 13px;
  color: var(--pico-fg-muted);
  line-height: 1.5;
  margin-top: 4px;
}
.picodata-header .mega-link.is-all .mega-link-title {
  color: var(--pico-accent);
}

/* === Right-side cluster: language, social, download, hamburger === */
.picodata-header .aux {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}
.picodata-header .aux-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--pico-fg-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.picodata-header .aux-icon:hover {
  color: var(--pico-accent);
  background: var(--pico-surface);
}
.picodata-header .nav-btn {
  display: inline-block;
  padding: 9px 18px;
  background: var(--pico-accent);
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}
.picodata-header .nav-btn:hover {
  background: var(--pico-accent-hover);
  color: #fff;
}

/* === Hamburger (mobile only) === */
.picodata-header .hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.picodata-header .hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--pico-fg);
  margin: 0 auto;
  border-radius: 1px;
}

/* === Mobile drawer (hidden on desktop) === */
.picodata-header .drawer { display: none; }

@media (max-width: 860px) {
  .picodata-header nav.primary { display: none; }
  .picodata-header .aux .aux-icon,
  .picodata-header .aux .nav-btn { display: none; }
  .picodata-header .hamburger { display: flex; }

  .picodata-header .drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--pico-bg);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  body.picodata-menu-open { overflow: hidden; }
  body.picodata-menu-open .picodata-header .drawer { transform: none; }

  .picodata-header .drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--pico-border);
    flex: 0 0 auto;
  }
  .picodata-header .drawer-close {
    background: none;
    border: 0;
    color: var(--pico-fg);
    cursor: pointer;
    padding: 8px;
    display: inline-flex;
  }
  .picodata-header .drawer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
  }
  .picodata-header .drawer-section {
    border-bottom: 1px solid var(--pico-border);
    padding: 0 24px;
  }
  .picodata-header .drawer-trigger {
    width: 100%;
    background: none;
    border: 0;
    padding: 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    color: var(--pico-fg);
    cursor: pointer;
    font-family: inherit;
  }
  .picodata-header .drawer-chevron {
    color: var(--pico-fg-muted);
    transition: transform 0.2s ease;
  }
  .picodata-header .drawer-section.is-open .drawer-chevron {
    transform: rotate(180deg);
  }
  .picodata-header .drawer-items {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 0 0 18px;
  }
  .picodata-header .drawer-section.is-open .drawer-items {
    display: flex;
  }
  .picodata-header .drawer-items a {
    color: var(--pico-fg);
    text-decoration: none;
    padding: 4px 0;
    font-size: 16px;
  }
  .picodata-header .drawer-items a.is-all {
    color: var(--pico-accent);
  }
  .picodata-header .drawer-foot {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    border-top: 1px solid var(--pico-border);
  }
  .picodata-header .drawer-foot .nav-btn { display: inline-block; }
  .picodata-header .drawer-icons {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .picodata-header .drawer-icons .aux-icon {
    display: inline-flex;
  }
}

@media (max-width: 1024px) and (min-width: 861px) {
  .picodata-header .menu-trigger { padding: 0 10px; font-size: 14px; }
  .picodata-header .aux { gap: 10px; }
}

/* === Material for MkDocs default header overrides ===
 * The .md-header itself stays sticky and full-width. Drop its default
 * shadow on the .picodata-header section (we draw our own bottom
 * border) and let the .md-header__inner row carry the breadcrumb. */
.md-header {
  background: transparent;
  color: inherit;
  box-shadow: none;
}
.md-header__inner {
  position: relative;
  z-index: 1;
  background: var(--md-default-bg-color);
  border-bottom: 1px solid rgba(31, 30, 30, 0.08);
}
.md-header[data-md-state="shadow"] {
  box-shadow: 0 0 0.2rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.4rem rgba(0, 0, 0, 0.2);
}
