/* Site header and footer, shared by every page (including Lab articles, which have their own
   stylesheet for the article itself). Uses the colour variables defined on each page. */

/* ---------- header ---------- */
.site-header { border-bottom: 3px solid var(--ink); background: var(--cream); position: sticky; top: 0; z-index: 2000; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; letter-spacing: .38em; font-size: .95rem; }
.brand svg { width: 34px; height: 34px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; font-weight: 700; font-size: .85rem;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { background: var(--cream-soft); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--cream); }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--cream); padding: 56px 0 40px; font-size: .95rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer .brand { margin-bottom: 14px; }
.site-footer h4 { margin: 0 0 12px; font-size: .75rem; letter-spacing: .28em; text-transform: uppercase; color: var(--coral); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--coral); text-decoration: underline; }
.fine { grid-column: 1 / -1; border-top: 2px solid #4a4448; padding-top: 24px; font-size: .82rem; color: #cdbfa8; }

.fine-link { color: inherit; margin-left: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Phones and small tablets: one slim line. Logo mark on the left, short menu labels on the right. */
@media (max-width: 860px) {
  .site-header .wrap { flex-direction: row; min-height: 52px; gap: 10px; padding-block: 6px; padding-left: 14px; padding-right: 10px; }
  .brand { font-size: 0; letter-spacing: 0; gap: 0; flex: 0 0 auto; }
  .brand svg { width: 30px; height: 30px; }
  .nav { flex-wrap: nowrap; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 9px; font-size: .7rem; letter-spacing: .06em; white-space: nowrap; }
  .nav-x { display: none; }            /* "The Lab" -> "Lab", "Your country" -> "Country" */
  .site-footer .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .nav a { padding: 6px 7px; font-size: .66rem; letter-spacing: .04em; }
}

/* ---------- back to top ---------- */
.to-top {
  position: fixed; right: 16px; bottom: 18px; z-index: 1500; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  background: var(--ink); color: var(--cream); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--coral);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 18px; height: 18px; }
.to-top:hover { background: var(--coral); color: var(--ink); }
.consent ~ .to-top { bottom: 96px; }

/* article headings a touch smaller on phones */
@media (max-width: 860px) {
  body main .hero h1 { font-size: 2.3rem; }
  body main article h2 { font-size: 1.55rem; }
}
