/* Header and menu (Raouf 2026-10-14: "like Armadillo, our logo in the middle", "a jaw-dropping menu animation, unique and artful").
   The header is three parts: the menu toggle and quick links on the left, the logo in the middle, visit / phone / scheme on the right.
   The menu is "the rug unrolls": a dark woven panel let down from the top like a rug from its rod, the rolled rug and its fringe
   riding the edge; the links are woven in one by one like weft threads, a gold thread under the one in focus, and on wide screens a
   photo for each link fades in beside the list. Closing rolls it back up. Clip-path and transform only (compositor friendly); reduced
   motion and data-motion="none" get a plain fade; without JavaScript the Menu link opens it through #site-nav:target.
   Research (2026): Codrops clip-path reveals, Awwwards menu overlays, the native focus and Escape rules of a modal. */

/* ---------- the three-part header ---------- */
.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-3, 12px);
}
.hd-left, .hd-right { display: flex; align-items: center; gap: var(--sp-5, 24px); min-width: 0; position: relative; z-index: 2; }
.hd-right { justify-content: flex-end; gap: var(--sp-4, 16px); }
.site-header .brand { grid-column: 2; margin: 0; justify-self: center; position: relative; z-index: 2; }

.nav-toggle {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px 0 0; margin: 0;
  background: none; border: 0; color: var(--c-text); font: 500 var(--fs-ui) / 1 var(--font-ui); letter-spacing: 0.04em; cursor: pointer;
}
.nav-toggle-icon { position: relative; display: inline-block; width: 24px; height: 10px; }
.nav-toggle-icon i { position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; border-radius: 1px;
  transition: transform 0.5s cubic-bezier(0.7, 0, 0.2, 1), width 0.5s cubic-bezier(0.7, 0, 0.2, 1); }
.nav-toggle-icon i:first-child { top: 0; }
.nav-toggle-icon i:last-child { bottom: 0; width: 70%; }
.nav-toggle:hover .nav-toggle-icon i:last-child { width: 100%; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon i:first-child { transform: translateY(4.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon i:last-child { width: 100%; transform: translateY(-4.25px) rotate(-45deg); }
.site-header .nav-nojs { display: inline-flex; text-decoration: none; }
/* the button needs nav.js; until nav.js marks the page (html.nav-js) the Menu link stands in for it (script disabled or blocked) */
html:not(.nav-js) .site-header button.nav-toggle, html.nav-js .site-header .nav-nojs, html.nav-js .menu-close-nojs { display: none; }

.quick-nav, .site-header .header-phone { display: none; }
.quick-nav { gap: var(--sp-5, 24px); }
.quick-nav a, .header-visit {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--c-text); font: 400 var(--fs-ui) / 1 var(--font-ui);
  text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 calc(50% + 0.85em) / 0 1px no-repeat;
  transition: background-size 0.35s cubic-bezier(0.6, 0, 0.2, 1);
}
.quick-nav a:hover, .header-visit:hover, .quick-nav a[aria-current="page"] { background-size: 100% 1px; }
.site-header .header-phone { align-items: center; min-height: 44px; color: var(--c-text); font: 600 var(--fs-ui) / 1 var(--font-ui); text-decoration: none; white-space: nowrap; }

@media (min-width: 1100px) {
  .site-header .brand { font-size: 1.875rem; }
  .brand-name { font-size: 2.875rem; }
  .brand-sub { font-size: 0.75rem; }
  .quick-nav { display: inline-flex; }
}
/* pages that open on a full-width photo (the home hero, the contact banner: body class has-photo-header from inc/pages.php): the header
   lies on the photo, transparent, its words white; the phone menu panel keeps its own colours */
body.has-photo-header .site-header { position: absolute; top: 0; left: 0; right: 0; background: transparent; box-shadow: none; }
body.has-photo-header .site-header :is(.brand, .brand-sub, .nav-toggle, .header-phone, .viewing-count, .scheme-toggle, .nav-nojs, .quick-nav a, .header-visit) { color: var(--c-on-photo); }
body.has-photo-header .site-header .brand-sub { opacity: 0.9; }
body.has-photo-header .site-header .header-phone { border-color: color-mix(in srgb, var(--c-on-photo) 35%, transparent); }
body.has-photo-header .site-header :is(a, button):focus-visible { outline-color: var(--c-on-photo); }

/* ---------- the menu: the rug unrolls ---------- */
.site-nav {
  --unroll: 0.95s;
  --ease-unroll: cubic-bezier(0.76, 0, 0.24, 1);
  position: fixed; inset: 0; z-index: 1;
  display: block; visibility: hidden;
  overflow-y: auto; overscroll-behavior: contain;
  color: var(--c-on-band);
  /* a dark rug in the brand espresso with a fine weft and warp, so it reads as woven, not as a flat panel */
  background:
    repeating-linear-gradient(to bottom, color-mix(in srgb, var(--c-on-band) 3%, transparent) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(to right, color-mix(in srgb, var(--c-on-band) 2.5%, transparent) 0 1px, transparent 1px 5px),
    var(--c-band-oxblood);
  clip-path: inset(0 0 100% 0);
  transition: clip-path var(--unroll) var(--ease-unroll), visibility 0s linear var(--unroll);
}
.site-nav.is-open, .site-nav:target {
  visibility: visible;
  clip-path: inset(0 0 0 0);
  transition: clip-path var(--unroll) var(--ease-unroll), visibility 0s;
}
/* the rolled rug rides the edge as it lets down, then rests out of sight; it comes back as the menu rolls up */
.menu-roll {
  position: fixed; left: 0; right: 0; top: 0; z-index: 3; height: 34px; pointer-events: none;
  transform: translateY(-100%);
  transition: transform var(--unroll) var(--ease-unroll), opacity 0.25s ease 0s;
}
.site-nav.is-open .menu-roll {
  transform: translateY(calc(100dvh - 100%));
  opacity: 0;
  transition: transform var(--unroll) var(--ease-unroll), opacity 0.3s ease calc(var(--unroll) - 0.1s);
}
.menu-roll-body {
  position: absolute; inset: 0 0 6px; border-radius: 12px / 50%;
  background:
    linear-gradient(to bottom, color-mix(in srgb, var(--c-ink) 55%, transparent), transparent 30%, transparent 60%, color-mix(in srgb, var(--c-ink) 60%, transparent)),
    repeating-linear-gradient(to bottom, color-mix(in srgb, var(--c-band-saffron) 70%, var(--c-band-oxblood)) 0 3px, color-mix(in srgb, var(--c-band-saffron) 45%, var(--c-band-oxblood)) 3px 6px);
  box-shadow: 0 14px 22px -10px color-mix(in srgb, var(--c-ink) 70%, transparent);
}
.menu-fringe {
  position: absolute; left: 3%; right: 3%; bottom: 0; height: 8px;
  background: repeating-linear-gradient(to right, color-mix(in srgb, var(--c-on-band) 80%, transparent) 0 1.5px, transparent 1.5px 5px);
  -webkit-mask: linear-gradient(to bottom, var(--c-ink) 40%, transparent); mask: linear-gradient(to bottom, var(--c-ink) 40%, transparent);
}

.menu-inner {
  min-height: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: var(--sp-6, 32px);
  padding: calc(var(--header-h, 56px) + var(--sp-6, 32px)) var(--gutter, 16px) var(--sp-7, 48px);
  max-width: var(--page-max, 1440px); margin-inline: auto;
}
.menu-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.menu-list li { overflow: hidden; }
.menu-list li[hidden] { display: none; }
.menu-list a {
  position: relative; display: flex; align-items: baseline; gap: var(--sp-4, 16px); min-height: 48px; padding: 6px 0;
  color: var(--c-on-band); text-decoration: none;
}
.menu-num { flex: 0 0 2.2em; font: 500 0.75rem / 1 var(--font-ui); letter-spacing: 0.14em; color: color-mix(in srgb, var(--c-on-band) 65%, transparent); }
.menu-word {
  display: inline-block; font: 400 clamp(1.5rem, 3vw, 2.5rem) / 1.12 var(--font-display); letter-spacing: -0.005em;   /* smaller (Raouf 2026-10-14) */
  /* woven in: each line is drawn across from left to right like a weft thread, one after another */
  clip-path: inset(0 100% 0 0); translate: 0 0.12em;
  transition: clip-path 0.45s cubic-bezier(0.6, 0, 0.2, 1), translate 0.45s cubic-bezier(0.6, 0, 0.2, 1);
}
.site-nav.is-open .menu-word, .site-nav:target .menu-word {
  clip-path: inset(0 0 0 0); translate: 0 0;
  transition: clip-path 0.8s cubic-bezier(0.65, 0, 0.15, 1) calc(var(--unroll) * 0.55 + var(--i, 0) * 75ms),
              translate 0.8s cubic-bezier(0.65, 0, 0.15, 1) calc(var(--unroll) * 0.55 + var(--i, 0) * 75ms);
}
/* the gold thread: drawn under the link in focus or under the pointer */
.menu-list a::after {
  content: ""; position: absolute; left: calc(2.2em + var(--sp-4, 16px)); right: auto; bottom: 4px; width: min(100%, 14ch); height: 1.5px;
  background: var(--c-band-saffron); transform: scaleX(0); transform-origin: left; transition: transform 0.5s cubic-bezier(0.6, 0, 0.2, 1);
}
.menu-list a:hover::after, .menu-list a:focus-visible::after, .menu-list a[aria-current="page"]::after { transform: scaleX(1); }
.menu-list a:hover .menu-word, .menu-list a:focus-visible .menu-word { font-style: italic; }
.menu-list a:focus-visible { outline: 2px solid var(--c-on-band); outline-offset: 4px; }

/* two columns of links: the main pages, and the collections with a few more pages (the original site's Collections menu) */
.menu-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-6, 32px); }
.menu-label { margin: 0 0 var(--sp-3, 12px); color: color-mix(in srgb, var(--c-on-band) 70%, transparent); font: 500 0.75rem / 1 var(--font-ui); letter-spacing: 0.16em; }
.menu-sub { list-style: none; margin: 0 0 var(--sp-5, 24px); padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.menu-sub li { overflow: hidden; }
.menu-sub a { display: inline-flex; align-items: center; min-height: 40px; color: var(--c-on-band); font: 400 1.0625rem / 1.2 var(--font-ui); text-decoration: none;
  clip-path: inset(0 100% 0 0); transition: clip-path 0.4s cubic-bezier(0.6, 0, 0.2, 1);
  background: linear-gradient(var(--c-band-saffron), var(--c-band-saffron)) 0 calc(100% - 6px) / 0 1.5px no-repeat; }
.site-nav.is-open .menu-sub a, .site-nav:target .menu-sub a { clip-path: inset(0 0 0 0);
  transition: clip-path 0.7s cubic-bezier(0.65, 0, 0.15, 1) calc(var(--unroll) * 0.6 + var(--i, 0) * 70ms), background-size 0.45s cubic-bezier(0.6, 0, 0.2, 1); }
.menu-sub a:hover, .menu-sub a:focus-visible, .menu-sub a[aria-current="page"] { background-size: 100% 1.5px; }
.menu-sub a:focus-visible { outline: 2px solid var(--c-on-band); outline-offset: 3px; }
@media (min-width: 700px) { .menu-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-8, 72px); } }
.menu-photos { display: none; }
.menu-foot {
  display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px) var(--sp-5, 24px); margin: 0; padding-top: var(--sp-5, 24px);
  border-top: 1px solid color-mix(in srgb, var(--c-on-band) 22%, transparent);
  font: 400 var(--fs-ui) / 1.5 var(--font-ui); color: color-mix(in srgb, var(--c-on-band) 85%, transparent);
  opacity: 0; transition: opacity 0.3s ease;
}
.site-nav.is-open .menu-foot, .site-nav:target .menu-foot { opacity: 1; transition: opacity 0.6s ease calc(var(--unroll) + 0.25s); }
.menu-foot a { color: var(--c-on-band); text-underline-offset: 4px; }
.menu-close-nojs { color: var(--c-on-band); }

@media (min-width: 900px) {
  .menu-inner { grid-template-columns: minmax(0, 2fr) minmax(0, 0.9fr); grid-template-rows: 1fr auto; column-gap: var(--sp-8, 72px); }
  .menu-cols { align-self: center; }
  .menu-foot { grid-column: 1 / -1; }
  /* a photo for each link, beside the list: the one in focus fades in and settles, the rest fade away */
  .menu-photos { display: block; position: relative; align-self: center; justify-self: end; width: min(100%, 22rem); aspect-ratio: 3 / 4; margin: 0;
    overflow: hidden; opacity: 0; transform: translateY(24px); transition: opacity 0.4s ease, transform 0.4s ease; }
  .site-nav.is-open .menu-photos { opacity: 1; transform: none; transition: opacity 0.9s ease calc(var(--unroll) * 0.7), transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--unroll) * 0.7); }
  .menu-photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; scale: 1.08;
    transition: opacity 0.6s ease, scale 1.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .menu-photos img.is-on { opacity: 1; scale: 1; }
}

/* while the menu is open: the page does not scroll, the header's words turn light on the dark rug */
html.menu-open { overflow: hidden; }
html.menu-open .site-header { background: transparent; box-shadow: none; }
html.menu-open .site-header :is(.brand, .brand-sub, .nav-toggle, .quick-nav a, .header-visit, .header-phone, .viewing-count, .scheme-toggle) { color: var(--c-on-band); }
html.menu-open .site-header .header-phone { border-color: color-mix(in srgb, var(--c-on-band) 30%, transparent); }

/* reduced motion, or the visitor's own choice of "none": a plain fade, nothing slides or unrolls */
@media (prefers-reduced-motion: reduce) {
  .site-nav, .site-nav.is-open { clip-path: none; opacity: 0; transition: opacity 0.2s ease, visibility 0s linear 0.2s; }
  .site-nav.is-open { opacity: 1; transition: opacity 0.2s ease, visibility 0s; }
  .menu-roll { display: none; }
  .menu-word, .site-nav.is-open .menu-word { clip-path: none; translate: none; transition: none; }
  .menu-photos img { transition: opacity 0.2s ease; scale: 1; }
}
html:is([data-motion="none"], [data-motion="reduced"]) .site-nav { clip-path: none; opacity: 0; transition: opacity 0.2s ease, visibility 0s linear 0.2s; }
html:is([data-motion="none"], [data-motion="reduced"]) .site-nav.is-open { opacity: 1; transition: opacity 0.2s ease, visibility 0s; }
html:is([data-motion="none"], [data-motion="reduced"]) .menu-roll { display: none; }
html:is([data-motion="none"], [data-motion="reduced"]) :is(.menu-word, .site-nav.is-open .menu-word, .menu-sub a) { clip-path: none; translate: none; transition: none; }
@media (prefers-reduced-motion: reduce) { .menu-sub a { clip-path: none; transition: none; } }

/* the top bar fills on approach (Raouf 2026-10-14, after hali.com.au): over a photo the bar is clear with white words; when the pointer
   comes onto it, or keyboard focus enters it, it fills with the page colour and its words turn dark, so every link reads clearly
   (WCAG 1.4.3 over a photo, 2.4.7 focus visible). Not while the menu is open (the menu has its own colours). */
body.has-photo-header .site-header { transition: background-color 0.45s ease, box-shadow 0.45s ease; }
body.has-photo-header .site-header :is(.brand, .brand-sub, .nav-toggle, .viewing-count, .scheme-toggle, .nav-nojs, .header-visit) { transition: color 0.45s ease; }
html:not(.menu-open) body.has-photo-header .site-header:is(:hover, :focus-within) { background: var(--c-page); box-shadow: 0 1px 0 var(--c-rule); }
html:not(.menu-open) body.has-photo-header .site-header:is(:hover, :focus-within) :is(.brand, .brand-sub, .nav-toggle, .viewing-count, .scheme-toggle, .nav-nojs, .header-visit) { color: var(--c-text); }
html:not(.menu-open) body.has-photo-header .site-header:is(:hover, :focus-within) :is(a, button):focus-visible { outline-color: var(--c-focus); }
@media (prefers-reduced-motion: reduce) { body.has-photo-header .site-header, body.has-photo-header .site-header * { transition: none; } }
