/* =============================================================
   Supplete — Shared Site Elements
   Header + Footer styles shared across all pages.
   Source of truth: Content/Publishing/Shared_Site_Elements/
   ============================================================= */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Gilda+Display&family=Nunito:wght@400;600;700&family=Raleway:wght@400;600;700&family=Roboto:wght@400;500;700&display=swap');

/* CSS variables used by header/footer */
:root {
  --site-bg: #ffffff;
  --site-text: #273247;
  --site-line: #dfe8f2;
  --site-blue: #3576c6;
  --site-blue-deep: #2965af;
  --site-navy: #202735;
  --site-container: 1120px;
}

/* Container */
.container {
  width: min(var(--site-container), calc(100% - 32px));
  margin: 0 auto;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  background: #fff;
  border-bottom: 1px solid #eef2f7;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-family: 'Gilda Display', Georgia, serif;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13px;
  font-family: 'Raleway', sans-serif;
  font-weight: 450;
  margin-left: auto;
}

.nav a {
  color: inherit;
  text-decoration: none;
}

.nav a:hover {
  color: var(--site-blue-deep);
  text-decoration: underline;
}

/* ── Language selector ──────────────────────────────────────── */
/* Stamped as the last child of .header-inner (see wca.translation
   lang_selector), so on desktop it is simply the final flex item and lands
   exactly on the header container's CONTENT edge — the same line the article
   panel ends on. That edge is not reachable from here by calculation: every
   template gives the header container its own width and padding.
   Mobile keeps the pre-existing absolute layout in the <=820px block below. */
.lang-switcher {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 60;
  font-family: 'Raleway', sans-serif;
}

@media (min-width: 821px) {
  .site-header .header-inner {
    justify-content: flex-start;
  }

  .site-header .nav {
    margin-left: auto; /* keeps brand left, nav + pill grouped right */
    margin-right: 0;
  }

  .lang-switcher {
    position: static;
    flex: 0 0 auto;
  }

  /* Some templates size their body column independently of the header
     container, so the pill is nudged onto that column's edge. Percentages
     resolve against .header-inner's content box, which is what makes the
     format-a offset collapse on its own once the column goes fluid and
     already fills the header width. */
  body.format-a .lang-switcher {
    margin-right: max(0px, calc(100% - 1105px));
  }

  body.format-d .lang-switcher {
    margin-right: -118px; /* format-d's body column overflows its own container */
  }
}

.lang-switcher details {
  position: relative;
}

.lang-switcher summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  padding: 5px 10px;
  border: 1px solid #eef2f7;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}

.lang-switcher summary::-webkit-details-marker {
  display: none;
}

.lang-switcher summary::after {
  content: "▾";
  font-size: 9px;
  opacity: .55;
}

.lang-switcher details[open] summary::after {
  content: "▴";
}

.lang-switcher img {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .08);
}

.lang-switcher ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  min-width: 160px;
  max-height: 70vh;
  overflow: auto;
}

.lang-switcher li a,
.lang-switcher li span[aria-current] {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.lang-switcher li a:hover {
  background: #f4f7fb;
  color: var(--site-blue-deep);
}

.lang-switcher li span[aria-current] {
  font-weight: 700;
  background: #f4f7fb;
}

@media (max-width: 820px) {
  /* Drop below the slim mobile header (absolute, not fixed: scrolls away
     with the page) so it never collides with the nav links. */
  .lang-switcher {
    position: absolute;
    top: 46px;
    right: 8px;
  }

  .lang-switcher summary {
    padding: 4px 8px;
    font-size: 11px;
  }

  .lang-switcher img {
    width: 16px;
    height: 12px;
  }

  .site-header .nav {
    margin-right: 0;
  }
}


/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--site-navy);
  color: #fff;
  margin-top: 0;
}

.footer-top {
  padding: 28px 0 30px;
  display: grid;
  grid-template-columns: 1.15fr repeat(3, 0.85fr);
  gap: 36px;
  align-items: start;
}

.footer-brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-brand-block img.logo {
  width: 60px;
  height: auto;
  object-fit: contain;
}

.footer-brand-name {
  font-family: 'Gilda Display', Georgia, serif;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.footer-brand-block .tagline {
  margin: 16px 0 0;
  font-family: 'Gilda Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 400;
}

.footer-heading {
  margin: 0 0 12px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'Gilda Display', Georgia, serif;
}

.footer-links a {
  display: block;
  color: rgba(255, 255, 255, 0.94);
  margin-bottom: 6px;
  font-size: 0.78rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding: 16px 0 18px;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #fff;
  font-size: 0.78rem;
}

.socials {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 1rem;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .footer-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .header-inner {
    min-height: auto;
    padding: 6px 0;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
  }

  .brand {
    gap: 6px;
  }

  .brand img {
    width: 24px;
    height: 24px;
  }

  .brand-name {
    font-size: 0.82rem;
  }

  .nav {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px 10px;
    font-size: 11px;
    margin-left: auto;
  }

  .nav a {
    white-space: nowrap;
  }

  .footer-top {
    padding: 20px 0;
    gap: 24px;
  }

  .footer-brand-block img.logo {
    width: 52px;
  }

  .footer-heading {
    font-size: 0.65rem;
  }

  .footer-links a {
    font-size: 0.72rem;
    margin-bottom: 4px;
  }

  .footer-bottom {
    padding: 10px 0 12px;
  }

  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.72rem;
    gap: 10px;
  }
}
