/* =============================================================================
 * burst.chrome.css - the shared header and footer (_partials/header.html and
 * footer.html), for every page including the DEX. Every rule is scoped under
 * .site-header or .site-footer: the DEX has its own .btn, .dropdown and .wrap,
 * and these rules must not reach them.
 * ========================================================================== */

.site-header .wrap, .site-footer .wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
@media (max-width: 768px) { .site-header .wrap, .site-footer .wrap { padding-inline: 16px; } }

/* --- header --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header > .wrap { min-height: 60px; gap: 1rem; }

.site-header .brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
.site-header .brand { white-space: nowrap; flex: none; }
.site-header .brand:hover { text-decoration: none; }
.site-header .brand img { width: 28px; height: 28px; }

.site-nav .nav-link {
  display: inline-flex; align-items: center; padding: 0 .7rem;
  color: var(--ink-2); text-decoration: none; font-size: .9375rem; font-weight: 500;
  border-radius: var(--radius);
}
.site-nav .nav-link:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.site-nav .nav-link[aria-current="page"] { color: var(--brand); font-weight: 600; }

.site-header .lang-select { background: transparent; color: var(--ink-2); border: 1px solid transparent; border-radius: var(--radius); padding: 0 .5rem; font-weight: 600; font-size: .875rem; cursor: pointer; }
.site-header .lang-select:hover { border-color: var(--line); }

.site-header .icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: transparent; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.site-header .icon-btn:hover { background: var(--surface-2); }
.site-header .icon-btn img { width: 20px; height: 20px; }

/* --- products dropdown ---------------------------------------------------- */
.site-header .dropdown { position: relative; }
.site-header .drop-toggle { display: inline-flex; align-items: center; gap: .35rem; padding: 0 .75rem; background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--ink); font-weight: 600; cursor: pointer; }
.site-header .drop-toggle:hover { border-color: var(--line); background: var(--surface-2); }
.site-header .drop-toggle .chev { transition: transform .15s ease; }

.site-header .drop-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 320px; max-width: min(92vw, 380px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: .4rem;
  display: none; z-index: 60;
}
.site-header .dropdown.open .drop-panel { display: block; }
/* Phones: the panel is wider than the space left of the Products button, so
   anchor it to the sticky header instead and keep 16px from both edges. */
@media (max-width: 640px) {
  .site-header .dropdown { position: static; }
  .site-header .drop-panel {
    left: 16px; right: 16px; top: calc(100% + 4px);
    min-width: 0; max-width: none;
    max-height: calc(100vh - 88px); max-height: calc(100dvh - 88px); overflow-y: auto;
  }
}
.site-header .drop-item { display: block; padding: .6rem .7rem; border-radius: var(--radius); text-decoration: none; color: var(--ink); text-transform: none; font-size: 1rem; font-weight: 400; }
.site-header .drop-item:hover { background: var(--surface-2); text-decoration: none; }
.site-header .drop-item strong { display: block; font-size: .9375rem; }
.site-header .drop-item em { display: block; font-style: normal; font-size: .8125rem; color: var(--ink-3); line-height: 1.4; margin-top: 2px; }

/* --- footer --------------------------------------------------------------- */
.site-footer { margin-top: 5rem; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .wrap { padding-block: 2.5rem 1.5rem; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; }
.footer-cols .footer-h { margin: 0 0 .75rem; font-size: .875rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-3); }
.footer-cols a { display: block; padding: .3rem 0; color: var(--ink-2); text-decoration: none; font-size: .9375rem; }
.footer-cols a:hover { color: var(--brand); text-decoration: underline; }
.footer-base { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .875rem; }

/* Theme toggle: show the icon for the theme you would switch TO. Driven purely
   by CSS so the control is never a blank box waiting on JS. */
.site-header .icon-btn { color: var(--ink-2); }
.site-header .icon-btn:hover { color: var(--ink); }
.site-header .icon-btn .icon-moon { display: none; }
.site-header .icon-btn .icon-sun  { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-header .icon-btn .icon-sun  { display: none; }
  :root:not([data-theme="light"]) .site-header .icon-btn .icon-moon { display: block; }
}
:root[data-theme="dark"] .site-header .icon-btn .icon-sun  { display: none; }
:root[data-theme="dark"] .site-header .icon-btn .icon-moon { display: block; }
:root[data-theme="light"] .site-header .icon-btn .icon-sun  { display: block; }
:root[data-theme="light"] .site-header .icon-btn .icon-moon { display: none; }

/* Tap targets: 44px is the floor for header and footer controls. */
.site-header a, .site-header button, .site-header select, .site-footer a { min-height: 44px; }
