/* Site-wide header + footer. Self-contained: works with or without tokens.css.
   Source markup: templates/partials/site-header.html.j2 and site-footer.html.j2. */

.site-header, .site-footer {
  --sc-bg: #000;
  --sc-text: var(--text, #f4f4f6);
  --sc-dim: var(--text-dim, #b5b5bb);
  --sc-border: var(--border, rgba(255,255,255,0.10));
  --sc-border-2: var(--border-2, rgba(255,255,255,0.18));
  --sc-surface: var(--surface-2, rgba(255,255,255,0.06));
  --sc-font: var(--font-display, 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  --sc-max: 1120px;
  --sc-gutter: 24px;
  font-family: var(--sc-font);
  color: var(--sc-text);
  box-sizing: border-box;
}
.site-header *, .site-footer * { box-sizing: border-box; }
.site-header a, .site-footer a { color: inherit; text-decoration: none; opacity: 1; }
/* Pages carry their own `nav {}` / `footer {}` element rules; pin everything they commonly set. */
.site-footer nav { margin: 0; padding: 0; background: none; border: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  width: 100%; margin: 0;
  background: rgba(0,0,0,0.88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--sc-border);
}
/* Doubled selector so page-level `nav {}` rules can't shift or un-center the bar. */
.site-header .site-header-inner {
  position: relative; background: none; border: 0;
  max-width: var(--sc-max); margin: 0 auto; padding: 0 var(--sc-gutter);
  min-height: 76px;
  display: flex; align-items: center; justify-content: flex-start; gap: 24px;
}
.site-header-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap;
}
.site-header-brand img { width: 40px; height: 40px; object-fit: contain; display: block; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.site-header-inner > * { margin: 0; line-height: 1.2; }
.site-header-links {
  display: flex; align-items: center; justify-content: flex-end; gap: 24px; flex: 1;
  font-size: 14px; font-weight: 600;
}
.site-header-links a { padding: 8px 0; }
.site-header-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.site-header-cta {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 18px; border: 1px solid var(--sc-border-2); border-radius: 30px;
  font-size: 14px; font-weight: 700; white-space: nowrap;
  color: #fff !important; background: var(--sc-surface);
}
.site-header-cta:hover { border-color: #fff; }
.site-header-menu { display: none; position: static; margin: 0; padding: 0; border: 0; background: none; }
.site-header-menu:not([open]) .site-header-menu-panel { display: none; }
.site-header-menu summary { list-style: none; cursor: pointer; }
.site-header-menu summary::-webkit-details-marker { display: none; }
.site-header a:focus-visible, .site-header summary:focus-visible,
.site-footer a:focus-visible { outline: 3px solid #4fc3f7; outline-offset: 2px; border-radius: 6px; }

@media (max-width: 760px) {
  .site-header .site-header-inner { min-height: 64px; gap: 12px; padding: 0 16px; }
  .site-header-links { display: none; }
  .site-header-cta { margin-left: auto; padding: 0 14px; font-size: 13px; }
  .site-header-menu { display: block; }
  .site-header-menu summary {
    width: 44px; height: 44px; display: grid; place-items: center;
    border-radius: 8px;
  }
  .site-header-burger, .site-header-burger::before, .site-header-burger::after {
    display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; content: "";
  }
  .site-header-burger { position: relative; }
  .site-header-burger::before { position: absolute; top: -6px; }
  .site-header-burger::after { position: absolute; top: 6px; }
  .site-header-menu[open] .site-header-burger { background: transparent; }
  .site-header-menu[open] .site-header-burger::before { top: 0; transform: rotate(45deg); }
  .site-header-menu[open] .site-header-burger::after { top: 0; transform: rotate(-45deg); }
  .site-header-menu-panel {
    position: absolute; top: 100%; left: 16px; right: 16px; z-index: 50;
    margin-top: 4px; padding: 8px 20px;
    border: 1px solid var(--sc-border-2); border-radius: 12px; background: #111;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  }
  .site-header-menu-panel a { display: block; padding: 14px 0; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--sc-border); }
  .site-header-menu-panel a:last-child { border-bottom: 0; }
}
@media (max-width: 380px) {
  .site-header-brand span { display: none; }
}
html { scroll-padding-top: 88px; }

/* ---------- Footer ---------- */
.site-footer {
  margin: 72px 0 0; padding: 0; border: 0; border-top: 1px solid var(--sc-border);
  background: var(--sc-bg); color: var(--sc-dim); font-size: 14px; text-align: center;
}
.site-footer-inner {
  max-width: var(--sc-max); margin: 0 auto; padding: 40px var(--sc-gutter) 32px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px;
}
.site-footer-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--sc-text); }
.site-footer-brand img { width: 36px; height: 36px; object-fit: contain; display: block; }
.site-footer-links, .site-footer-legal {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 24px; font-size: 14px; font-weight: 600;
}
.site-footer-links a, .site-footer-legal a { display: inline-block; padding: 10px 0; color: var(--sc-text); }
.site-footer-legal a { color: var(--sc-dim); font-weight: 500; }
.site-footer-links a:hover, .site-footer-legal a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-footer-social { display: flex; gap: 12px; justify-content: center; align-items: center; }
.site-footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--sc-surface); border: 1px solid var(--sc-border-2);
  transition: border-color 0.2s, transform 0.2s;
}
.site-footer-social a:hover { border-color: #fff; transform: translateY(-2px); }
.site-footer-social svg { width: 18px; height: 18px; fill: #ddd; }
.site-footer-disclaimer, .site-footer-note, .site-footer-copyright {
  margin: 0; max-width: 720px; font-size: 12px; line-height: 1.6; color: var(--sc-dim);
  font-family: var(--font-body, 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}
.site-footer-copyright { color: var(--text-mute, #7c7c84); }
@media (prefers-reduced-motion: reduce) { .site-footer-social a { transition: none; } }
@media print { .site-header, .site-footer { display: none !important; } }
