/* HEATHBOUND - shared design
   Palette taken from Jon Mackay's poster: warm paper, deep heath-green ink, moon cream. */

:root {
  --paper: #f3eee1;
  --paper-deep: #e9e2c5;      /* the cream hidden in the hero PNG; used for panels */
  --stone: #e6e1d5;           /* warm stone ground for artist pages and design C */
  --box-dark: #3e3e3c;        /* dark grey inside the artwork boxes (Artists 2026, Available Works) */
  --ink: #1c2925;             /* green-black, from the poster's frame lines */
  --ink-soft: #4a5652;
  --heath: #1f4f46;           /* deep sky green, used sparingly */
  --moon: #ecdfc2;
  --rule: color-mix(in srgb, var(--ink) 35%, transparent);

  --display: "mendl-sans-dusk", "Gill Sans", "Futura", sans-serif;
  --body: "Alegreya Sans", "Gill Sans", sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: clamp(3rem, 7vw, 5rem);
  --space-6: clamp(4.5rem, 11vw, 8rem);

  --read: 34rem;   /* narrow reading column */
  --wide: 76rem;   /* galleries */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.0625rem, 0.98rem + 0.3vw, 1.1875rem);
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--heath); }
:focus-visible { outline: 2px solid var(--heath); outline-offset: 3px; }
p { margin: 0 0 1em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Display type ---------- */
.display, h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  line-height: 1.25;
  margin: 0;
}
.eyebrow {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* The poster block: big HEATHBOUND, with a smaller Mendl line justified to the same width. */
.poster { container-type: inline-size; width: 100%; margin-inline: auto; text-align: center; }
.wordmark {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: calc(100cqi / 7.75);
  letter-spacing: 0.14em;
  margin-right: -0.14em;     /* cancel trailing letter-space so it centres truly */
  line-height: 1;
  white-space: nowrap;
}
.justified {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: clamp(0.8125rem, 2.6cqi, 1.125rem);
  line-height: 1.9;
  text-align: justify;
  text-align-last: center;
  hyphens: none;
  margin: 0;
}
.poster .justified { margin-top: 1.4em; }
.dot { display: inline-block; margin: 0 .35em; }

/* Thin double rule, an echo of the poster frame */
.double-rule { border: 0; height: 5px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); width: 100%; margin: 0; }
.short-rule { border: 0; border-top: 1px solid var(--ink); width: 3rem; margin: 1.1rem auto 0; }

/* ---------- Header ---------- */
.site-header {
  padding: var(--space-3) var(--gutter);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .75rem 2rem;
}
.site-header__mark {
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.24em; font-size: .95rem; text-decoration: none;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; }
.site-nav a {
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.18em; font-size: .75rem; text-decoration: none;
  padding-block: .35rem; border-bottom: 1px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: currentColor; color: inherit; }
.site-header--home { justify-content: center; }
.site-header--home .site-header__mark { display: none; }
@media (max-width: 40rem) {
  .site-header { flex-direction: column; align-items: center; text-align: center; }
  .site-nav ul { justify-content: center; gap: .25rem 1.25rem; }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--space-6);
  padding: var(--space-4) var(--gutter) var(--space-5);
  text-align: center;
  font-size: .875rem;
  color: var(--ink-soft);
}
.site-footer__line { font-family: var(--display); text-transform: uppercase; letter-spacing: .2em; font-size: .7rem; margin-bottom: 1.25rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.5rem; }
.site-footer small { font-size: .75rem; }

/* ---------- Layout helpers ---------- */
.read { max-width: var(--read); margin-inline: auto; padding-inline: var(--gutter); box-sizing: content-box; }
.wide { max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Captions (catalogue style) ---------- */
.caption {
  font-family: var(--body); font-style: italic; font-size: .875rem; line-height: 1.5; color: var(--ink-soft);
  margin-top: .9rem;
}
.caption .sep { font-style: normal; color: var(--rule); margin: 0 .45em; }
.caption .title { color: var(--ink); }

/* ---------- Home: shared pieces ---------- */
.artist-roll { width: 100%; max-width: 46rem; margin-inline: auto; text-align: center; container-type: inline-size; }
.artist-roll .justified { font-size: clamp(0.875rem, 3.1cqi, 1.3rem); line-height: 2.1; }
.artist-roll a { text-decoration: none; white-space: nowrap; }
.artist-roll a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.artist-roll .eyebrow { display: block; margin-bottom: 1.25rem; }
.note-2027 { text-align: center; max-width: 30rem; margin-inline: auto; }
.note-2027 p { margin: 0 0 .35rem; }
.note-2027 .eyebrow { display: block; margin-bottom: .8rem; }
.credit { font-style: italic; font-size: .875rem; color: var(--ink-soft); text-align: center; }

/* Comparison switcher, only shown when ?hero= is used */
.hero-switch {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 50;
  display: flex; gap: .25rem; align-items: center;
  background: var(--paper); border: 1px solid var(--rule); padding: .35rem .5rem;
  font-family: var(--display); font-size: .7rem; letter-spacing: .15em; text-transform: uppercase;
}
.hero-switch a { text-decoration: none; padding: .2rem .45rem; }
.hero-switch a[aria-current="true"] { background: var(--ink); color: var(--paper); }

/* ---------- Not-yet-built page ---------- */
.placeholder { text-align: center; padding-block: var(--space-6); }
.placeholder p { color: var(--ink-soft); }
.hero-switch[hidden] { display: none; }
.justified { position: relative; }
.justified .item { display: inline-block; margin-inline: 0.55em; }
.justified .gapdot { position: absolute; transform: translateX(-50%); pointer-events: none; }
.justified:has(.item) { margin-inline: -0.55em; }  /* so the outer names line up with the block edges */
.nw { white-space: nowrap; }
.justified--short { font-size: clamp(0.8125rem, 3.1cqi, 1.35rem); text-align: center; }

/* Phones: smaller, tighter Mendl so justified lines stay even; names centred */
@media (max-width: 40rem) {
  .justified { font-size: 0.75rem; letter-spacing: 0.1em; }
  .justified--short { font-size: 0.8125rem; }
  .artist-roll .justified { text-align: center; font-size: 0.875rem; line-height: 2.2; }
}

/* ---------- Masthead: HEATHBOUND always visible, above the menu ---------- */
.site-header--masthead {
  position: sticky; top: 0; z-index: 10;
  flex-direction: column; align-items: center; gap: .6rem;
  padding: clamp(1rem, 2.4vw, 1.6rem) var(--gutter) clamp(.75rem, 1.6vw, 1rem);
  background: var(--paper);
}
.site-header--masthead .site-header__mark { display: none; }
.masthead {
  display: inline-flex; flex-direction: column; align-items: stretch;
  font-family: var(--display); text-transform: uppercase; text-decoration: none;
  font-size: clamp(2rem, 1.2rem + 4.2vw, 4.25rem); line-height: 1;
}
.masthead:hover { color: inherit; }
.masthead__name { font-weight: 600; letter-spacing: 0.16em; margin-right: -0.16em; }
/* The tagline is set at 37% of the name size and spread to exactly the same width */
.masthead__tag {
  display: flex; justify-content: space-between;
  font-weight: 400; font-size: 0.37em; letter-spacing: 0.14em; margin: 0.22em -0.14em 0 0;
}
.site-header--masthead .site-nav ul { justify-content: center; }

/* ---------- Main menu with sub-pages ---------- */
.site-nav > ul > li { position: relative; }
.nav-top {
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.2em; font-size: .78rem;
  padding: .35rem 0; border-bottom: 1px solid transparent; text-decoration: none;
}
.nav-top:hover, .nav-top.is-current, .nav-top[aria-current="page"], .has-sub.is-open > .nav-top { border-bottom-color: currentColor; color: inherit; }
.site-nav > ul { gap: .5rem 2.75rem; }
.site-nav .sub {
  display: none; position: absolute; z-index: 20; top: 100%; left: 50%; transform: translateX(-50%);
  list-style: none; margin: 0; padding: .7rem 1.4rem; min-width: max-content;
  background: var(--paper); border: 1px solid var(--rule);
  box-shadow: 0 8px 20px -10px rgb(28 41 37 / .25);
  text-align: center;
}
.sub::before { content: ""; position: absolute; left: 0; right: 0; top: -0.6rem; height: 0.6rem; } /* bridge for the mouse */
.has-sub { padding-bottom: 0; }
.site-nav .has-sub.is-open > .sub { display: block; }
@media (hover: hover) { .site-nav .has-sub:hover > .sub { display: block; } }
.site-nav .sub { margin-top: .5rem; }
.sub a {
  display: block; padding: .4rem 0;
  font-family: var(--display); text-transform: uppercase; letter-spacing: .16em; font-size: .7rem; text-decoration: none;
}
.sub a:hover, .sub a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3em; }

/* Footer: HEATHBOUND a touch heavier */
.site-footer__name { font-weight: 600; font-size: 1.25em; color: var(--ink); }

/* Sub-menu links: a single underline on hover */
.site-nav .sub a, .site-nav .sub a:hover, .site-nav .sub a[aria-current="page"] { border-bottom: 0; }

/* No elastic bounce at the top/bottom of the page on laptops; and paper above the
   header in case a browser bounces anyway, so the picture never peeks out. */
html { overscroll-behavior-y: none; }
.site-header--masthead::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 100vh; background: var(--paper); }

/* ---------- Body font: Alegreya Sans ----------
   Slightly opened tracking; font-size-adjust brings its small x-height up to a comfortable reading size.
   Mendl text is left exactly as set. */
body { font-size-adjust: 0.5; letter-spacing: 0.03em; }
:is(.display, h1, h2, h3, .eyebrow, .wordmark, .justified, .site-header__mark, .masthead, .site-footer__line, .lineup, .setlines, .hero-switch, .artist__links, .artist__pager) { font-size-adjust: none; }

/* Comparison switch: two rows */
.hero-switch { flex-direction: column; align-items: stretch; gap: .2rem; }
.hero-switch > div { display: flex; align-items: center; gap: .15rem; }
.hero-switch > div > span { min-width: 3.2rem; }

/* Main menu in Alegreya Sans */
.nav-top, .site-nav .sub a { font-family: var(--body); font-weight: 500; font-size: .82rem; letter-spacing: .2em; font-size-adjust: none; }
.nav-top { display: inline-block; line-height: 1.5; vertical-align: baseline; }
.site-nav .sub a { font-size: .75rem; letter-spacing: .16em; }

/* Phones: keep the footer line on one line */
@media (max-width: 40rem) {
  .site-footer__line { white-space: nowrap; letter-spacing: .14em; font-size: min(.7rem, calc((100vw - 2 * var(--gutter)) / 32.5)); }
}

/* ---------- Shared pieces of the Heathbound look ---------- */
/* Cream card with a double-line border, an echo of the poster frame */
.card {
  position: relative; max-width: 40rem; margin-inline: auto;
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  padding: clamp(2rem, 6vw, 3.5rem) clamp(1.5rem, 6vw, 3.5rem);
  border: 1px solid var(--ink);
}
.card::before { content: ""; position: absolute; inset: 4px; border: 1px solid var(--ink); pointer-events: none; }
/* Small heading in Alegreya capitals, as "HEATHBOUND 2026" at the start of the home page */
.card-heading { font-family: var(--body); font-weight: 400; font-size: 0.97rem; line-height: 1.7; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); font-size-adjust: 0.5; }
/* Double rule under the fixed header, and the footer mirroring it.
   The first line is the edge of the paper; the second floats just beyond it,
   so the picture (or page colour) shows through the gap. */
:root { --rule-ink: rgb(28 41 37 / .55); --rule-gap: 4px; }
.has-masthead .site-header--masthead { border-bottom: 1px solid var(--rule-ink); }
.has-masthead .site-header--masthead::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%;
  height: var(--rule-gap); border-bottom: 1px solid var(--rule-ink); pointer-events: none;
}
.has-masthead .site-footer {
  position: relative; z-index: 1; background: var(--paper);
  border-top: 1px solid var(--rule-ink);
  padding-top: calc(clamp(0.75rem, 1.6vw, 1rem) + 0.35rem);   /* same gap as below the menu */
}
.has-masthead .site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%;
  height: var(--rule-gap); border-top: 1px solid var(--rule-ink); pointer-events: none;
}
.hero-switch > div { flex-wrap: wrap; max-width: calc(100vw - 2rem); }
.hero-switch a { white-space: nowrap; }

/* Text in every card sits centred top to bottom: no extra space after the last line or before the first */
.card > :first-child, .card > :first-child > :first-child { margin-top: 0; }
.card > :last-child, .card > :last-child > :last-child { margin-bottom: 0; }
