/*
 * site.css — the shared site header, page bar and footer for every andrs.nu page.
 *
 * The header and footer markup (between the site-header:start/end and
 * site-footer:start/end comments) is stamped into each page by
 * .github/scripts/sync_layout.py. Don't edit it by hand in a page: change the
 * script, run it, and bump SITE_CSS_VERSION there if this file changed.
 * CI fails when a page's header or footer no longer matches.
 *
 * Uses each page's own :root variables (--ink, --gold, --rule, --pad).
 */

/* ── SITE HEADER ─────────────────────────────────────── */
.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: clamp(20px, 3vw, 36px) 0 12px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: clamp(48px, 7vw, 96px);
}

/* A page bar or status bar sits directly under the header and owns the spacing below it. */
.site-header:has(+ .page-bar),
.site-header:has(+ .status-bar) { margin-bottom: 0; }

.site-header-logo {
  display: flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

/* Explicit colour/font so the alt-text fallback never renders in link-blue. */
.site-header-logo img {
  height: 24px;
  width: auto;
  flex-shrink: 0;
  display: block;
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}

.site-header-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(9px, 1vw, 11px);
  letter-spacing: 0.06em;
  text-align: center;
  white-space: nowrap;
  color: #6a6460;
}

.site-header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

.site-header-nav a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(9px, 1vw, 11px);
  letter-spacing: 0.1em;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.site-header-nav a:hover { color: var(--gold); }

/* The section you're in */
.site-header-nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.site-header-nav a[aria-current="page"]:hover { border-bottom-color: var(--gold); }

.site-header-nav a.nav-highlight {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* Fixed-width slot for the NL/EN toggle, so the nav sits in the same place on
   pages without a Dutch translation (the slot is then empty). */
.lang-slot {
  display: inline-flex;
  width: 44px;
  height: 28px;
  flex-shrink: 0;
}

.lang-slot .lang-toggle-btn {
  width: 100%;
  height: 100%;
  line-height: 1;
}

/* ── PAGE BAR (page-specific line under the header) ──── */
.page-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(9px, 1vw, 11px);
  letter-spacing: 0.06em;
  line-height: 1.6;
  color: #6a6460;
}

.page-bar-section {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.page-bar-section + .page-bar-meta::before {
  content: '·';
  margin: 0 0.8em;
}

.page-bar strong { font-weight: 600; }

.page-bar a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.page-bar a:hover { color: var(--gold); }

/* ── SITE FOOTER ─────────────────────────────────────── */
.site-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 8px 24px;
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: 14px;
  border-top: 1px solid var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(9px, 1vw, 11px);
  letter-spacing: 0.06em;
  line-height: 1.9;
  color: var(--ink);
}

.site-footer strong { font-weight: 600; }

/* No global link styling on this site: every footer link declares its own. */
.site-footer a,
.site-footer-cookies {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer a:hover,
.site-footer-cookies:hover { color: var(--gold); }

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 20px;
  letter-spacing: 0.1em;
}

.site-footer-social {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
}

.site-footer-social a {
  display: flex;
  color: rgba(26, 23, 20, 0.5);
}

.site-footer-social svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.site-footer-legal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(26, 23, 20, 0.12);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(26, 23, 20, 0.5);
}

.site-footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
}

/* Manage cookies is a button (it opens the cookie settings, it doesn't navigate). */
.site-footer-cookies {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

/* ── ARTICLE PAGES ───────────────────────────────────── */
/* Articles share the full page frame (so the header matches every other page)
   but keep their reading column at the width they always had. */
.page--article > :not(.site-header):not(.page-bar):not(footer) {
  max-width: 648px;
  margin-left: auto;
  margin-right: auto;
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 960px) {
  .site-header-meta { display: none; }
}

@media (max-width: 700px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .site-header-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
    row-gap: 8px;
    column-gap: 16px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .site-footer-nav {
    justify-content: flex-start;
    column-gap: 16px;
  }

  /* Legal links wrap here; drop the · separators so none dangles at a line end. */
  .site-footer-legal-links > span[aria-hidden="true"] { display: none; }
}
