/* ISEJ site stylesheet.
   Colours, type and spacing follow tokens.css in the ISEJ web kit (~/isej_identity/assets/web_kit).
   Three colours only: navy, warm white, ochre. Square corners, hairline rules, no boxes, no shadows.
   Ochre marks things (rules, underlines, one contour line); it never carries body text on warm white. */

:root {
  --isej-navy: #1B2A4A;
  --isej-navy-deep: #142038;
  --isej-warm-white: #F6F2EA;
  --isej-ochre: #B08D57;
  --isej-ochre-text: #7B633D;
  --isej-navy-85: #3C4862;
  --isej-navy-45: #9398A2;
  --isej-navy-10: #E0DEDA;
  --isej-hair: rgb(27 42 74 / 0.2);

  --isej-font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --isej-font-text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --isej-nav-tracking: 0.14em;
  --isej-step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --isej-step-0: clamp(1.05rem, 1rem + 0.25vw, 1.15rem);
  --isej-step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --isej-step-2: clamp(1.6rem, 1.4rem + 1vw, 2.1rem);
  --isej-step-3: clamp(2rem, 1.6rem + 2vw, 3rem);
  --isej-step-4: clamp(2.5rem, 1.8rem + 3.5vw, 5rem);
  --isej-measure: 34rem;

  --isej-gutter: clamp(1rem, 4vw, 5rem);
  --isej-radius: 0;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--isej-warm-white);
  color: var(--isej-navy);
  font-family: var(--isej-font-text);
  font-size: var(--isej-step-0);
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums;
}
.tabular { font-variant-numeric: lining-nums tabular-nums; }

.wrap {
  width: min(100% - 2 * var(--isej-gutter), 72rem);
  margin-inline: auto;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--isej-ochre);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--isej-navy); outline-offset: 4px; }

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--isej-navy);
  color: var(--isej-warm-white);
  padding: 0.5rem 0.9rem;
}
.skip:focus { left: 0.5rem; z-index: 10; }

/* Tracked capitals: navigation and section labels only */
.masthead nav, h2 {
  font-family: var(--isej-font-display);
  font-size: var(--isej-step--1);
  font-weight: 400;
  letter-spacing: var(--isej-nav-tracking);
  text-transform: uppercase;
}

/* Masthead: lockup left, one row of links right, as in the kit's header mock */
header.masthead .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--isej-hair);
}
.masthead .logo { display: block; line-height: 0; }
.masthead .logo img {
  display: block;
  width: clamp(15rem, 60vw, 24rem);
  margin-left: -2%;
  height: auto;
}
.masthead nav { display: flex; flex-wrap: wrap; gap: 0.25rem clamp(0.9rem, 1.8vw, 1.8rem); }
.masthead nav a { text-decoration: none; padding-block: 0.25rem; }
.masthead nav a:hover,
.masthead nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--isej-ochre);
  text-underline-offset: 0.3em;
}

/* Home: the cover. Navy ground, the line at the top, the field drawing in below. */
.cover {
  background: var(--isej-navy);
  color: var(--isej-warm-white);
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 78vh;
  overflow: hidden;
}
.cover .wrap { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 3vw, 2.5rem); }
.cover .date {
  font-family: var(--isej-font-display);
  font-size: var(--isej-step--1);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--isej-ochre);
  margin: 0 0 1.2rem;
}
.cover h1 {
  font-family: var(--isej-font-display);
  font-weight: 700;
  font-size: var(--isej-step-4);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
  max-width: 16ch;
}
.cover p { margin: 0; max-width: var(--isej-measure); }
.cover svg {
  display: block;
  width: 100%;
  height: clamp(14rem, 36vw, 30rem);
  align-self: end;
}

/* Inner pages: title at the top left, the page's window on the field in the lower band */
.banner { position: relative; overflow: hidden; }
.banner .wrap { position: relative; z-index: 1; padding-block: clamp(3rem, 7vw, 5rem) clamp(5rem, 14vw, 11rem); }
.banner img.field-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 0 100%;
  z-index: 0;
}
h1 {
  font-family: var(--isej-font-display);
  font-weight: 700;
  font-size: var(--isej-step-3);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  max-width: 18ch;
}
.lede { font-size: var(--isej-step-1); line-height: 1.45; max-width: var(--isej-measure); margin: 0; }

main { flex: 1 0 auto; }

/* Sections on a twelve-column grid: label in 1–3, text in 4–9, wide figures in 4–12 */
section.block { padding-block: clamp(2rem, 4vw, 3rem) clamp(2.5rem, 5vw, 4rem); }
section.block + section.block .wrap { border-top: 1px solid var(--isej-hair); padding-top: clamp(2rem, 4vw, 3rem); }
section.block .wrap { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.5rem; row-gap: 1rem; }
section.block h2 { grid-column: 1 / -1; margin: 0.35rem 0 0; }
section.block .body { grid-column: 1 / -1; }
section.block .wide { grid-column: 1 / -1; }
section.block .wide.full { grid-column: 1 / -1; }
@media (min-width: 52rem) {
  section.block h2 { grid-column: 1 / 4; }
  section.block .body { grid-column: 4 / 10; }
  section.block .wide { grid-column: 4 / 13; }
  section.block .wide.full { grid-column: 1 / 13; margin-top: 1rem; }
}
h2 { color: var(--isej-navy-85); }
h3 {
  font-family: var(--isej-font-display);
  font-size: var(--isej-step-0);
  font-weight: 400;
  font-style: italic;
  line-height: 1.3;
  margin: 1.6rem 0 0.35rem;
}
.body > h3:first-child { margin-top: 0; }
.body p { margin: 0 0 1rem; max-width: var(--isej-measure); }
.body p:last-child { margin-bottom: 0; }
.body ul, .body ol { padding-left: 1.2rem; margin: 0 0 1rem; max-width: var(--isej-measure); }
.body li { margin: 0 0 0.3rem; }
.more { display: inline-block; margin-top: 0.5rem; }
.more::after { content: " \2192"; }

/* Catalogue lists: a narrow metadata column and a title column, hairline between rows */
.list, .body .list { list-style: none; margin: 0.5rem 0 0; padding: 0; max-width: none; }
.list li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  column-gap: 1.5rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--isej-hair);
}
.list li:last-child { border-bottom: 1px solid var(--isej-hair); }
.list li > span:first-child { font-variant-numeric: lining-nums tabular-nums; color: var(--isej-navy-85); }
.list li b { font-weight: 400; font-family: var(--isej-font-display); font-size: var(--isej-step-0); }
.list li small { display: block; grid-column: 2; color: var(--isej-navy-85); font-size: var(--isej-step--1); }
.list.plain li { grid-template-columns: 2.5rem 1fr; }
.list.roles li { grid-template-columns: 1fr 1fr; }
.list.roles li > span:first-child { font-family: var(--isej-font-display); color: var(--isej-navy); }

/* Figures: full width of the text columns, caption in words */
figure.fig { margin: 0.5rem 0 0; }
figure.fig img { display: block; width: 100%; height: auto; }
figure.fig figcaption { font-size: var(--isej-step--1); color: var(--isej-navy-85); margin-top: 0.6rem; max-width: var(--isej-measure); }
.fig img.fig-desktop { display: none; }
.fig img.fig-mobile { display: block; max-width: 24rem; }
@media (min-width: 52rem) {
  .fig img.fig-desktop { display: block; }
  .fig img.fig-mobile { display: none; }
}

/* Footer: one row, a colophon, nothing else */
footer {
  margin-top: clamp(2rem, 5vw, 4rem);
  border-top: 1px solid var(--isej-hair);
  padding-block: 1.5rem 2.5rem;
  font-size: var(--isej-step--1);
  color: var(--isej-navy-85);
}
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 2rem; }
footer p { margin: 0; }
footer nav a { margin-right: 1.2rem; }
footer nav a:last-child { margin-right: 0; }

/* Page not found */
.notfound .wrap { padding-block: clamp(3rem, 8vw, 6rem); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Print: the text, without navigation or the field */
@media print {
  .masthead nav, .cover svg, .banner img.field-bg, .skip { display: none; }
  .cover { background: none; color: var(--isej-navy); min-height: 0; }
  .cover .date { color: var(--isej-navy-85); }
  a { text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  section.block .wrap, footer .wrap { display: block; }
  figure.fig img.fig-mobile { display: none; }
}

/* ---- Third pass ------------------------------------------------------ */

/* Sticky masthead: full lockup at the top of a page, the mark once scrolled */
header.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--isej-warm-white);
}
header.masthead .wrap { transition: padding 0.15s; }
.masthead .logo img.mark { display: none; }
header.masthead.stuck .wrap { padding-block: 0.6rem; }
header.masthead.stuck .logo img.lockup { width: clamp(10rem, 30vw, 12rem); }
header.masthead.on-navy { background: var(--isej-navy); color: var(--isej-warm-white); }
header.masthead.on-navy .wrap { border-bottom-color: rgb(246 242 234 / 0.25); }
header.masthead.on-navy.stuck { background: var(--isej-warm-white); color: var(--isej-navy); }
header.masthead.on-navy.stuck .wrap { border-bottom-color: var(--isej-hair); }
.masthead .logo img.lockup.light { display: none; }
header.masthead.on-navy.stuck .logo img.lockup:not(.light) { display: none; }
header.masthead.on-navy.stuck .logo img.lockup.light { display: block; }
.cover .wrap { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
#hero.drawn .c { animation: none; stroke-dashoffset: 0; }

/* Issue block: a navy plate with the issue number, the contents beside it */
.issue { padding-block: clamp(2rem, 4vw, 3rem) clamp(2.5rem, 5vw, 4rem); }
.issue .wrap { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.5rem; row-gap: 1.5rem; }
.issue .plate { grid-column: 1 / -1; position: relative; background: var(--isej-navy); color: var(--isej-warm-white); padding: 2rem 2rem 2rem 3.6rem; }
.issue .contents { grid-column: 1 / -1; margin: 0; }
@media (min-width: 52rem) {
  .issue .plate { grid-column: 1 / 5; }
  .issue .contents { grid-column: 5 / 13; align-self: center; }
}
.issue .spine {
  position: absolute; left: 1.1rem; top: 2rem;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--isej-font-display); font-size: var(--isej-step--1);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--isej-ochre);
}
.issue .label { font-family: var(--isej-font-display); font-size: var(--isej-step--1); letter-spacing: 0.14em; text-transform: uppercase; color: var(--isej-ochre); margin: 0 0 1rem; }
.issue .title { font-family: var(--isej-font-display); font-weight: 700; font-size: var(--isej-step-2); line-height: 1.15; margin: 0 0 1rem; }
.issue .plate p:last-child { margin: 0; font-size: var(--isej-step--1); color: var(--isej-navy-45); }
.issue .contents li small { color: var(--isej-navy-45); }

/* Navy band: a section on navy with the route drawn in warm white */
.band { background: var(--isej-navy); color: var(--isej-warm-white); padding-block: clamp(2.5rem, 5vw, 4rem); margin-top: clamp(1rem, 2vw, 2rem); }
.band .wrap { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.5rem; row-gap: 1.5rem; }
.band h2 { grid-column: 1 / -1; color: var(--isej-ochre); margin: 0.35rem 0 0; }
.band .body { grid-column: 1 / -1; }
.band .wide.full { grid-column: 1 / -1; margin: 0; }
@media (min-width: 52rem) { .band h2 { grid-column: 1 / 4; } .band .body { grid-column: 4 / 10; } }
.band a { text-decoration-color: var(--isej-ochre); }
.band figure.fig img { opacity: 0.95; }

/* Statement: one paragraph in a hairline frame */
.statement { padding-block: clamp(2.5rem, 5vw, 4rem); }
.statement .wrap { border: 1px solid var(--isej-hair); padding: clamp(1.5rem, 4vw, 3rem); }
.statement p { margin: 0; font-family: var(--isej-font-display); font-size: var(--isej-step-1); line-height: 1.45; max-width: 40rem; }

/* Submit: a sticky at-a-glance column in the otherwise empty right columns */
section.block .side { grid-column: 1 / -1; }
@media (min-width: 52rem) {
  section.block .side { grid-column: 10 / 13; grid-row: 1 / span 2; position: sticky; top: 5rem; align-self: start; }
}
.side .label { font-family: var(--isej-font-display); font-size: var(--isej-step--1); letter-spacing: 0.14em; text-transform: uppercase; color: var(--isej-navy-85); margin: 0.35rem 0 0; }
.side .list li { grid-template-columns: 5.5rem 1fr; padding: 0.4rem 0; }
.side .list li b { font-family: var(--isej-font-text); font-size: var(--isej-step--1); color: var(--isej-navy-85); }

/* Map: the atlas as navigation */
.atlas { padding-block: 0 clamp(2.5rem, 5vw, 4rem); }
.atlas svg { display: block; width: 100%; height: auto; background: var(--isej-navy); }
.atlas .atlas-link { cursor: pointer; }
.atlas .atlas-link .ring { transition: fill 0.2s; }
.atlas .atlas-link:hover .ring, .atlas .atlas-link:focus-visible .ring { fill: var(--isej-ochre); }
.atlas .atlas-link:focus-visible { outline: 2px solid var(--isej-ochre); }
.atlas svg:has(.atlas-link:hover) .atlas-link:not(:hover) { opacity: 0.5; }
.atlas .legend { display: none; margin: 1rem 0 0; padding-left: 1.4rem; columns: 2; font-family: var(--isej-font-display); }
@media (max-width: 40rem) {
  .atlas .lab, .atlas .feat { display: none; }
  .atlas .legend { display: block; }
}
