/* Shared colours, local typefaces and site navigation. */
:root {
  --sheet: #f7f5ee;
  --paper-ink: #232622;
  --paper-muted: #555b53;
  --paper-rule: #cbc9bd;
  --stamp-red: #a52e24;
  --font-ui: 'Noto Sans HK', 'PingFang HK', 'Microsoft JhengHei', system-ui, sans-serif;
  --font-book: 'Noto Serif HK', 'Songti TC', 'PMingLiU', serif;
  --font-editorial: var(--font-book);
  --site-inset: clamp(1.15rem, 4.35vw, 4.5rem);
  --nav-bar: 4.25rem;
  --nav-end: calc(var(--nav-bar) + 1px);
}
body { background: var(--sheet); color: var(--paper-ink); }
::selection { background: #f1c8ad; color: #361816; }
body > header { position: sticky; inset-block-start: 0; z-index: 12; padding: 0; background: var(--sheet); color: var(--paper-ink); border: 0; border-bottom: 1px solid var(--paper-rule); }
.head, .foot {
  width: 100%; max-width: 104rem; margin-inline: auto;
  padding-inline: max(var(--site-inset), env(safe-area-inset-left)) max(var(--site-inset), env(safe-area-inset-right));
}
.head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--nav-bar); padding-block: 0; }
.head .brand, .foot .foot-brand {
  display: inline-flex; align-items: center; gap: .78rem; min-height: 44px;
  color: inherit; text-decoration: none; font: 760 clamp(1.1rem, 1rem + .35vw, 1.36rem)/1.3 var(--font-ui); letter-spacing: -.035em;
}
.brand .roof-sign, .foot-brand .roof-sign {
  display: inline-grid; place-items: center; position: relative; flex: none; width: 51px; height: 28px; padding-top: 1px;
  color: #fff7e7; background: #a52e24; border: 0; border-radius: 0;
  clip-path: polygon(10% 0, 90% 0, 98% 83%, 100% 84%, 100% 100%, 0 100%, 0 84%, 2% 83%);
  font: 800 16px/1 Arial,sans-serif; letter-spacing: -.055em;
}
.roof-sign::after { content: ''; position: absolute; inset: auto 4% 3px; height: 1px; background: #fae2cf; }
.head nav, .head .nav-links { display: flex; align-items: center; gap: 0; margin: 0; }
.head .nav-links { position: static; width: auto; height: auto; max-width: none; max-height: none; padding: 0; border: 0; color: inherit; background: transparent; }
.nav-toggle { display: none; }
.head nav a {
  display: inline-flex; align-items: center; justify-content: center; position: relative; min-height: 44px;
  padding: .5rem clamp(.35rem, .85vw, 1rem); border-radius: 0; color: #454940;
  font: 600 .92rem/1.4 var(--font-ui); text-decoration: none;
}
.head nav a:is(:hover, [aria-current]) { color: var(--stamp-red); background: transparent; text-decoration: underline; text-underline-offset: .45rem; text-decoration-thickness: 2px; }
.head nav a:last-child { padding-inline-end: 0; }
.skip { z-index: 20; color: var(--paper-ink); }
.head :focus-visible { outline: 2px solid var(--stamp-red); outline-offset: 3px; }
body > footer { background: #282d28; color: #f9f3e6; border-top: 1px solid #474c45; }
.foot {
  display: grid; grid-template-columns: minmax(13rem, 1fr) minmax(25rem, 1fr);
  align-items: start; gap: 2.25rem; padding-block: clamp(2rem, 4.2vw, 4.5rem);
}
.foot .foot-brand { justify-self: start; white-space: nowrap; }
.foot .foot-brand > span:not(.roof-sign) { width: auto; color: inherit; }
.foot .roof-sign { order: initial; background: #f0e5cd; color: #75291f; }
.foot .roof-sign::after { background: #a57161; }
.foot-links { display: grid; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; gap: clamp(.75rem, 2.7vw, 2.8rem); }
.foot-group { border-top: 1px solid #60665d; padding-top: .65rem; }
.foot-group strong { margin: .3rem 0 .4rem; color: #fff5dd; font-size: .92rem; font-weight: 700; }
.foot-links a { color: #d5d6cb; padding: 0; min-height: 39px; font-size: .91rem; }
.foot a:hover { color: #fff; }
.foot :focus-visible { outline: 2px solid #f5d59b; outline-offset: 3px; }
@media (max-width: 47.5em) {
  :root { --nav-bar: 3.6rem; }
  .head { flex-wrap: wrap; gap: .3rem .7rem; }
  .head .brand { min-width: 0; width: auto; gap: .45rem; white-space: normal; }
  .head nav { flex: none; }
  .head nav, .head .nav-links { flex-wrap: wrap; }
  .foot { grid-template-columns: 1fr; gap: 1.2rem; }
  .foot-links a { min-height: 44px; }
}
@supports selector(:popover-open) {
  @media (max-width: 47.5em) {
    .head { flex-wrap: nowrap; }
    .nav-toggle {
      display: inline-flex; align-items: center; gap: .65rem; min-height: 44px; padding: .35rem 0 .35rem .5rem;
      color: var(--paper-ink); background: transparent; border: 0; font: 650 .94rem/1.3 var(--font-ui); white-space: nowrap;
    }
    .nav-close-label { display: none; }
    .nav-icon { position: relative; width: 20px; height: 16px; }
    .nav-icon::before, .nav-icon::after { content: ''; position: absolute; top: 7px; left: 0; width: 20px; height: 2px; background: currentColor; }
    .nav-icon::before { transform: translateY(-3px); }
    .nav-icon::after { transform: translateY(3px); }
    nav:has(:popover-open) .nav-icon::before { transform: rotate(45deg); }
    nav:has(:popover-open) .nav-icon::after { transform: rotate(-45deg); }
    nav:has(:popover-open) .nav-open-label { display: none; }
    nav:has(:popover-open) .nav-close-label { display: inline; }
    .head .nav-links[popover] {
      display: none; position: fixed; inset: var(--nav-end) 0 0; width: 100%; height: calc(100% - var(--nav-end));
      height: calc(100dvh - var(--nav-end)); margin: 0; padding: .8rem var(--site-inset) max(1rem, env(safe-area-inset-bottom));
      background: var(--sheet); color: var(--paper-ink); overflow-y: auto; overscroll-behavior: contain;
    }
    .head .nav-links:popover-open { display: block; }
    .nav-links::backdrop { background: transparent; pointer-events: none; }
    html:has(.nav-links:popover-open) { overflow: hidden; }
    body:has(.nav-links:popover-open) > :is(.skip, main, footer) { interactivity: inert; }
    .head .nav-links a {
      min-height: 62px; justify-content: space-between; width: 100%; padding: .7rem .1rem; border-bottom: 1px solid var(--paper-rule);
      font-size: 1.18rem; font-weight: 650;
    }
    .head .nav-links a::after { content: '→' / ''; color: var(--stamp-red); font: 400 1.1rem/1 Arial,sans-serif; }
  }
}
@media (forced-colors: active) {
  .brand .roof-sign, .foot-brand .roof-sign { clip-path: none; border: 1px solid currentColor; }
}
