/*
 * Shared site header + footer chrome, loaded on every public marketing page.
 * Self-contained: uses its own --sc-* custom properties (never the page's
 * own --text/--bg/etc.) so a page's local design tokens can't change the
 * chrome's colours out from under it, and so this stylesheet doesn't leak
 * tokens onto the rest of the page either.
 *
 * Markup source of truth: scripts/lib/site-chrome/header.html + footer.html
 * (applied via scripts/apply-site-chrome.mjs). Edit the chrome here and in
 * those partials together — this file only styles the classes they emit.
 */

:root {
  --sc-bg: #081018;
  --sc-border: rgba(255, 255, 255, 0.08);
  --sc-border-strong: rgba(255, 255, 255, 0.14);
  --sc-text: #eaf2f6;
  --sc-text-strong: #ffffff;
  --sc-text-muted: #8597a8;
  --sc-text-dim: #7d8fa1;
  --sc-accent: #38e8ff;
  --sc-accent-strong: #0a7d91;
  --sc-radius-sm: 10px;
  --sc-container: 1120px;
  --sc-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(8, 16, 24, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sc-border);
  font-family: var(--sc-font);
}
.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  max-width: var(--sc-container);
  margin: 0 auto;
}
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--sc-text-strong);
}
.site-header .brand img { width: 30px; height: 30px; }
.site-header .site-nav { display: flex; gap: 26px; }
.site-header .site-nav a {
  text-decoration: none;
  color: var(--sc-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}
.site-header .site-nav a:hover { color: var(--sc-text-strong); }
.site-header .site-nav a[aria-current="page"] { color: var(--sc-text-strong); }
.site-header .header-actions { display: flex; align-items: center; gap: 10px; }
.site-header .btn-download {
  /* White text on the plain --sc-accent blue is only 3.68:1 — fails WCAG AA
     4.5:1 for normal text. --sc-accent-strong clears 5.17:1. */
  background: var(--sc-accent-strong);
  color: #fff;
  text-decoration: none;
  padding: 9px 18px;
  border-radius: var(--sc-radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  transition: filter 0.2s;
}
.site-header .btn-download:hover { filter: brightness(0.88); }
.site-header .menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--sc-border-strong);
  border-radius: var(--sc-radius-sm);
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--sc-text-strong);
}
.site-header .menu-toggle svg { width: 20px; height: 20px; }
.site-header .mobile-menu {
  display: flex;
  flex-direction: column;
  padding: 8px 24px 18px;
  border-top: 1px solid var(--sc-border);
}
.site-header .mobile-menu a {
  padding: 12px 0;
  text-decoration: none;
  color: var(--sc-text);
  font-weight: 600;
  border-bottom: 1px solid var(--sc-border);
}
.site-header .mobile-menu a:last-child { border-bottom: none; }
.site-header .mobile-menu[hidden] { display: none; }
.site-header .mobile-menu a[aria-current="page"] { color: var(--sc-accent); }

@media (max-width: 900px) {
  .site-header .site-nav { display: none; }
  .site-header .menu-toggle { display: flex; }
}

/* === footer === */
footer.footer {
  padding: 56px 0 28px;
  border-top: 1px solid var(--sc-border);
  background: var(--sc-bg);
  font-family: var(--sc-font);
}
footer.footer .container { max-width: var(--sc-container); margin: 0 auto; padding: 0 24px; }
footer.footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}
footer.footer .footer-col h3 {
  /* --sc-text-dim on --sc-bg is 3.75:1 — fails WCAG AA 4.5:1. --sc-text-muted
     clears 6.96:1. */
  font-size: 0.78rem;
  color: var(--sc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
footer.footer .footer-col a {
  display: block;
  color: var(--sc-text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 5px 0;
}
footer.footer .footer-col a:hover { color: var(--sc-accent); }
footer.footer .footer-more summary {
  cursor: pointer;
  color: var(--sc-accent);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 0;
  list-style: none;
}
footer.footer .footer-more summary::-webkit-details-marker { display: none; }
footer.footer .footer-more summary::after { content: '+'; margin-left: 6px; }
footer.footer .footer-more[open] summary::after { content: '\2212'; }
footer.footer .footer-guides-more { padding-top: 2px; }
@media (min-width: 901px) {
  footer.footer .footer-more summary { display: none; }
  footer.footer .footer-more:not([open]) .footer-guides-more { display: block; }
}
footer.footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--sc-border);
}
footer.footer .footer-social { display: flex; gap: 16px; }
footer.footer .footer-social a { color: var(--sc-text-dim); display: flex; }
footer.footer .footer-social a:hover { color: var(--sc-text); }
/* Both below were --sc-text-dim on --sc-bg (3.75:1, fails WCAG AA 4.5:1);
   --sc-text-muted clears 6.96:1. */
footer.footer .copyright { color: var(--sc-text-muted); font-size: 0.82rem; }
footer.footer .footer-attribution {
  max-width: var(--sc-container);
  margin: 14px auto 0;
  padding: 0 24px;
  text-align: center;
  color: var(--sc-text-muted);
  font-size: 0.8rem;
}
footer.footer .footer-attribution a { color: var(--sc-text-muted); }

@media (max-width: 900px) {
  footer.footer { padding: 28px 0 16px; }
  footer.footer .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 16px; margin-bottom: 16px; }
  footer.footer .footer-col h3 { font-size: 0.68rem; margin-bottom: 6px; }
  /* 0.8rem (12.8px) * line-height 1.3 + padding 3px top/bottom was ~22.6px —
     under the 24px minimum touch-target size. */
  footer.footer .footer-col a { font-size: 0.8rem; padding: 4px 0; line-height: 1.4; min-height: 24px; }
  footer.footer .footer-bottom { padding-top: 12px; }
  footer.footer .footer-attribution { font-size: 0.72rem; margin-top: 10px; }
}

/* === language switcher (docs/prd-marketing-site-localisation.md) ===
 * Lives in the header, as the first child of .header-actions (see
 * scripts/lib/site-i18n/generate.mjs's injectSwitcherBlock). A JS-free
 * <details> disclosure: summary shows the current language code, the list
 * is an absolutely-positioned dropdown so it never pushes the download
 * button / menu toggle around.
 */
.site-header .lang-switch {
  position: relative;
  font-family: var(--sc-font);
}
.site-header .lang-switch summary {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--sc-border-strong);
  border-radius: var(--sc-radius-sm);
  color: var(--sc-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.site-header .lang-switch summary::-webkit-details-marker { display: none; }
.site-header .lang-switch summary::after { content: '\25be'; font-size: 0.65rem; }
.site-header .lang-switch:hover summary,
.site-header .lang-switch[open] summary { color: var(--sc-text-strong); border-color: var(--sc-text-muted); }
.site-header .lang-switch ul {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 150px;
  background: var(--sc-bg);
  border: 1px solid var(--sc-border-strong);
  border-radius: var(--sc-radius-sm);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  z-index: 10;
}
.site-header .lang-switch li { margin: 0; }
.site-header .lang-switch a,
.site-header .lang-switch strong {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.88rem;
  text-decoration: none;
}
.site-header .lang-switch a { color: var(--sc-text); }
.site-header .lang-switch a:hover { background: var(--sc-border); color: var(--sc-text-strong); }
.site-header .lang-switch strong { color: var(--sc-text-strong); font-weight: 700; }

/* === language suggestion banner === */
.lang-suggest-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(8, 16, 24, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--sc-border-strong);
  border-radius: var(--sc-radius-sm);
  padding: 12px 14px;
  font-family: var(--sc-font);
  font-size: 0.86rem;
  color: var(--sc-text);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.lang-suggest-banner .lang-suggest-link {
  color: var(--sc-accent);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.lang-suggest-banner .lang-suggest-link:hover { text-decoration: underline; }
.lang-suggest-banner .lang-suggest-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--sc-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}
@media (max-width: 480px) {
  .lang-suggest-banner { left: 8px; right: 8px; bottom: 8px; font-size: 0.82rem; }
}
/* Sit above the homepage's sticky mobile CTA once it slides in, instead of covering it. */
.lang-suggest-banner { transition: bottom 0.25s ease; }
body:has(#sticky-cta.visible) .lang-suggest-banner {
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}
