/* The site's header and footer (build.py header_html, footer_html), on the site's pages and on the worker's own (the gift buyer's page …):
   one look for both (Alex). Colours and fonts come from the page's own :root; the defaults below cover a page without them. */
:root { --wrap: 1120px; --gutter: 24px; }
@media (max-width: 480px) { :root { --gutter: 16px; } }
.top.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
/* the header stays on screen while scrolling (Alex); the paper colour runs edge to edge behind it */
/* (on a layer behind it, so the clip that stops the shadow spilling down doesn't cut off the language menu) */
.top { position: sticky; top: 0; z-index: 20; }
.top::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--paper);
  box-shadow: 0 0 0 100vmax var(--paper); clip-path: inset(0 -100vmax); transition: box-shadow .2s; }
.top.scrolled::before { box-shadow: 0 0 0 100vmax var(--paper), 0 1px 0 100vmax var(--line); clip-path: inset(0 -100vmax -1px); }
.top img { height: 34px; width: auto; display: block; }
.top nav { display: flex; gap: 20px; flex-wrap: wrap; font-size: 16px; }
.top nav a { text-decoration: none; } .top nav a:hover { text-decoration: underline; }
/* the language switch: a dropdown (Alex); a click outside closes it (script at the end of the page) */
.langs { position: relative; }
.langs summary { cursor: pointer; list-style: none; white-space: nowrap; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 2px 3px 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.langs[open] summary::after { transform: rotate(-135deg); margin-bottom: -1px; }
.langs ul { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; margin: 0; padding: 6px 0; list-style: none;
  background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(53, 43, 62, .12); min-width: 140px; }
.langs li a { display: block; padding: 8px 16px; }
.langs li a:hover { background: var(--paper); text-decoration: none; }
@media (max-width: 860px) {
  .top { flex-wrap: wrap; }
  .top nav { width: 100%; gap: 8px 18px; }
  .langs ul { left: 0; right: auto; max-width: calc(100vw - 32px); }   /* the switch sits at a row start when the nav wraps */
}
@media (max-width: 480px) {
  .top { padding-top: 20px; padding-bottom: 20px; } .top img { height: 28px; } .top nav { gap: 14px; font-size: 15px; }
}
.top nav a.nav-gift { color: var(--coral); font-weight: 700; }
/* the app on every page: a small button at the header's end (Alex, 2026-11-02); on phones it shares the logo's row */
.top nav { margin-left: auto; }
.nav-app { order: 3; flex: none; background: var(--plum); color: var(--white); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 9px 18px; border-radius: 99px; white-space: nowrap; }
.nav-app:hover { background: #1f1826; color: var(--white); }
@media (max-width: 860px) { .top nav { order: 4; margin-left: 0; } .nav-app { order: 2; margin-left: auto; } }
@media (max-width: 480px) { .nav-app { font-size: 14px; padding: 8px 14px; } }
.top nav a.nav-gift { display: inline-flex; align-items: center; gap: 6px; }
.top nav a.nav-gift svg { flex: none; margin-top: -2px; }
/* the footer: terms and privacy on every page (Alex) */
footer { border-top: 1px solid var(--line); padding: 36px 0 48px; font-size: 15px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
footer .credits p { margin: 0 0 6px; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
/* the scrollbar's room kept on every page, so the centred header doesn't shift between pages (Alex: it wobbled) */
html { scrollbar-gutter: stable; }
