/* The header and footer shared by every page. Loaded after each page's own styles. */
:root { --head-h:92px; --chrome-pad:clamp(16px, 3.2vw, 48px); }

/* ---------- header: one slim bar, and the simulated line right under it ---------- */
.site-header { position:sticky; top:0; z-index:5; color:var(--on-sky); }
.site-bar {
  display:flex; align-items:center; gap:8px clamp(18px, 2.6vw, 40px); min-height:60px; padding:0 var(--chrome-pad);
  background:var(--cobalt-deep); border-bottom:1px solid rgba(255,255,255,.12);
}
.brand { display:inline-flex; align-items:center; gap:9px; flex:0 0 auto; color:var(--on-sky); text-decoration:none; font:600 27px/1 var(--display); letter-spacing:-.005em; border-radius:8px; }
.brand:hover { color:#fff; }
.brand-mark { width:26px; height:26px; flex:0 0 auto; display:block; box-shadow:0 0 0 1px rgba(255,255,255,.2); border-radius:7px; }
.site-nav { display:flex; align-items:center; gap:clamp(14px, 1.8vw, 26px); min-width:0; font:500 15.5px/1.2 var(--sans); white-space:nowrap; }
.site-nav a { position:relative; display:inline-flex; align-items:center; min-height:40px; color:var(--on-sky-soft); text-decoration:none; border-radius:6px; transition:color .15s ease; }
.site-nav a:hover { color:#fff; }
.site-nav a[aria-current="page"] { color:#fff; }
.site-nav a[aria-current="page"]::after { content:""; position:absolute; left:0; right:0; bottom:3px; height:2px; border-radius:2px; background:var(--sun); }
.site-header :focus-visible, .site-foot :focus-visible { outline:2px solid #fff; outline-offset:2px; }
.finder { position:relative; flex:0 1 430px; min-width:0; margin-left:auto; }
.finder-msg:not(:empty) { position:absolute; left:0; right:0; top:40px; padding:6px 12px; border-radius:8px; background:var(--night); }
.simnote {
  margin:0; padding:6px var(--chrome-pad); text-align:center; font:500 14px/1.35 var(--sans); color:#fff3df;
  background:#04235f; border-bottom:1px solid rgba(255,181,71,.42);
}

/* ---------- the painting: its sky fades out of the page, its water into the footer, so neither edge can show ---------- */
.harbour { --from:var(--bg); position:relative; height:clamp(300px, 40vw, 680px); background:linear-gradient(180deg, var(--from) 0, var(--from) 36%, var(--night) 100%); }
.atlas .harbour { --from:var(--cobalt); }
/* On the paper pages the title already has the sky, so here it's only the sunset and the boats, rising out of the paper. */
body:not(:has(.atlas)) .harbour { height:clamp(240px, 27vw, 460px); background:linear-gradient(180deg, var(--from) 0, var(--from) 24%, var(--night) 100%); }
.harbour::before {
  content:""; position:absolute; inset:0; background:url("hero.webp") center bottom / max(100%, 900px) auto no-repeat;
  -webkit-mask-image:linear-gradient(180deg, transparent 0, #000 40%, #000 82%, transparent 100%);
  mask-image:linear-gradient(180deg, transparent 0, #000 40%, #000 82%, transparent 100%);
}

/* ---------- footer ---------- */
.site-foot { background:var(--night); color:var(--on-sky-soft); font:400 15px/1.5 var(--sans); }
.site-foot-in { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap:24px clamp(28px, 5vw, 80px); padding:clamp(20px, 3vw, 36px) var(--chrome-pad) clamp(28px, 3.4vw, 44px); }
.site-foot p { margin:0; max-width:46ch; }
.site-foot p + p, .site-foot .credits { margin-top:8px; }
.site-foot a:not(.brand) { color:#fff; text-decoration:underline; text-decoration-color:rgba(255,255,255,.45); text-underline-offset:3px; }
.site-foot a:not(.brand):hover { color:var(--sun); text-decoration-color:currentColor; }
.foot-brand .brand { margin-bottom:10px; font-size:24px; }
.foot-brand .brand-mark { width:22px; height:22px; }
.site-foot .credits { max-width:46ch; }
.site-foot .credits summary { cursor:pointer; color:#fff; width:fit-content; }
.site-foot .credits p { font-size:14px; }

@media (max-width:899px) {
  /* On a narrow screen the bar scrolls away, and only the simulated line stays. */
  .site-header { display:contents; }
  .site-bar { flex-wrap:wrap; justify-content:space-between; padding-top:6px; padding-bottom:10px; gap:0 12px; }
  .site-nav { font-size:15px; }
  .finder { flex:1 1 100%; max-width:none; margin:2px 0 0; }
  .simnote { position:sticky; top:0; z-index:5; }
  .harbour { height:clamp(300px, 88vw, 520px); }
  .harbour::before { background-size:auto 100%; background-position:30% bottom; }
  .site-foot-in { grid-template-columns:minmax(0, 1fr); }
  .site-foot p, .site-foot .credits { max-width:none; }
}
@media (max-width:519px) {
  .nav-map { display:none !important; } /* the wordmark goes to the map, and there isn't room for a third link */
}
@media (max-width:374px) {
  .brand { font-size:24px; gap:6px; }
  .brand-mark { width:22px; height:22px; }
  .site-nav { font-size:14px; gap:10px; }
}
