:root {
  --paper: #f7f3ec;
  --ink: #241d1e;
  --muted: #6c6060;
  --line: #dcd3c6;
  --accent: #8a2c46;
  --step: #efe6da;
  --tint: #f0dde0;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}

@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1718;
    --ink: #efe8e0;
    --muted: #a99d9b;
    --line: #3a3132;
    --accent: #e39ab0;
    --step: #2a2324;
    --tint: #3d2a30;
  }
}

@media screen {
  :root[data-theme="dark"] {
    --paper: #1b1718;
    --ink: #efe8e0;
    --muted: #a99d9b;
    --line: #3a3132;
    --accent: #e39ab0;
    --step: #2a2324;
    --tint: #3d2a30;
    color-scheme: dark;
  }

  :root[data-theme="light"] { color-scheme: light; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }

a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 3rem);
}

/* En-tête */
.masthead { padding-block: clamp(2rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem); background: var(--step); }
.masthead .icon { background: var(--paper); }

.masthead__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(1.25rem, 4vw, 2.5rem);
}

.eyebrow { font-size: .875rem; color: var(--muted); }

.actions { display: flex; gap: .5rem; }

.print, .theme {
  min-height: 2.75rem;
  padding: .5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: none;
  color: var(--ink);
  font: 500 .875rem/1 var(--sans);
  cursor: pointer;
}
.print:hover, .theme:hover { border-color: var(--accent); color: var(--accent); }

.theme {
  display: grid;
  place-items: center;
  width: 2.75rem;
  padding: 0;
}

.theme svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme svg[hidden] { display: none; }

h1 {
  font: 400 clamp(2.75rem, 9vw, 5.75rem)/1.02 var(--serif);
  letter-spacing: -.02em;
  text-wrap: balance;
}

.lede { margin-top: .75rem; font: 400 clamp(1.25rem, 3vw, 1.625rem)/1.3 var(--serif); color: var(--accent); }

.sublede { margin-top: .25rem; font-size: 1.0625rem; color: var(--muted); }

.contact { display: grid; gap: .5rem; margin-top: 1.25rem; color: var(--muted); }

.contact li {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.contact a { color: var(--ink); text-decoration: none; }
.contact a:hover { color: var(--accent); text-decoration: underline; }

.icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--tint);
}

.icon svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12rem;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

/* Mise en page */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  gap: clamp(2.5rem, 6vw, 5rem);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

section + section { margin-top: clamp(2.5rem, 6vw, 3.5rem); }

h2 {
  margin-bottom: 1.25rem;
  font: 400 1.625rem/1.2 var(--serif);
  color: var(--accent);
}

aside h2 { font-size: 1.25rem; margin-bottom: .75rem; }

.intro { font: 400 clamp(1.25rem, 2.6vw, 1.5rem)/1.4 var(--serif); margin-bottom: 1rem; }

/* L'escalier des échelons Rawbank */
.stairs { margin-top: 2.25rem; }
.stairs figcaption { margin-bottom: .75rem; font-size: .875rem; color: var(--muted); }

.stairs ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; align-items: end; }

.stairs li {
  --n: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-height: calc(6.5rem + var(--n) * 1.5rem);
  padding: .75rem;
  border-top: 2px solid var(--accent);
  background: var(--step);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.3;
}
.stairs li:nth-child(2) { --n: 1; }
.stairs li:nth-child(3) { --n: 2; }
.stairs li:nth-child(4) { --n: 3; }

.stairs time { font: 400 1.25rem/1.2 var(--serif); color: var(--accent); }

/* Entrées */
.entry {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  column-gap: 1.5rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
}
.entry > * { grid-column: 2; }
.entry > .when { grid-column: 1; grid-row: 1 / span 2; padding-top: .2rem; font-size: .875rem; line-height: 1.4; color: var(--muted); }

h3 { font: 600 1.0625rem/1.35 var(--sans); }
.org { color: var(--accent); font-weight: 500; }
.org + p { margin-top: .5rem; }
h3 a { color: inherit; }

.entry ul { margin-top: .5rem; }
.entry li { position: relative; padding-left: 1rem; }
.entry li + li { margin-top: .25rem; }
.entry li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: .5rem;
  height: 1px;
  background: var(--accent);
}

/* Colonne latérale */
.plain li { padding-block: .5rem; border-top: 1px solid var(--line); }
.plain--text li { padding-block: .75rem; font-size: .9375rem; line-height: 1.5; }

dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .5rem;
  border-top: 1px solid var(--line);
}
dd { color: var(--muted); }

/* Pied de page */
.footer { background: var(--step); }

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem 3rem;
  padding-block: clamp(2rem, 5vw, 3rem);
}

.footer__name { font: 400 1.625rem/1.2 var(--serif); }
.footer__meta { margin-top: .25rem; font-size: .875rem; color: var(--muted); }

.footer .contact { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin-top: 0; }
.footer .icon { background: var(--paper); }

@media (max-width: 56rem) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 36rem) {
  .identity { grid-template-columns: minmax(0, 1fr); }
  .contact li { min-height: 2.75rem; }
  .portrait { grid-row: 1; width: 10rem; }
  .stairs ol { grid-template-columns: minmax(0, 1fr); }
  .stairs li {
    flex-direction: row;
    align-items: baseline;
    gap: .75rem;
    min-height: 0;
    margin-left: calc(var(--n) * 1rem);
    padding: .5rem .75rem;
  }
  .entry { grid-template-columns: minmax(0, 1fr); }
  .entry > *, .entry > .when { grid-column: 1; grid-row: auto; }
  .entry > .when { padding-top: 0; }
}

@media print {
  @page { size: A4; margin: 13mm 14mm; }

  :root {
    --paper: #fff;
    --ink: #1c1617;
    --muted: #5a4f4f;
    --line: #d5ccc0;
    --accent: #8a2c46;
    --tint: #f0dde0;
    color-scheme: light;
  }

  body { font-size: 9pt; line-height: 1.36; }
  .wrap { max-width: none; padding-inline: 0; }
  .print, .stairs, .eyebrow { display: none; }
  .masthead { padding-block: 0 10pt; background: none; border-bottom: 1px solid var(--line); }
  .masthead .icon { background: var(--tint); }
  .masthead__top { display: none; }
  .identity { grid-template-columns: minmax(0, 1fr) 20mm; gap: 8mm; align-items: center; }
  h1 { font-size: 30pt; }
  .lede { font-size: 13pt; margin-top: 2pt; }
  .contact { display: flex; flex-wrap: wrap; gap: 0 14pt; margin-top: 6pt; }
  .contact li { gap: 4pt; min-height: 0; }
  .icon { width: 14pt; height: 14pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .icon svg { width: 9pt; height: 9pt; }
  .layout { grid-template-columns: minmax(0, 1fr) 52mm; gap: 8mm; padding-block: 10pt; }
  section + section { margin-top: 12pt; }
  h2, aside h2 { font-size: 13pt; margin-bottom: 4pt; }
  .intro { font-size: 11pt; margin-bottom: 4pt; }
  .entry { grid-template-columns: 24mm minmax(0, 1fr); column-gap: 4mm; padding-block: 3pt; }
  .org + p { margin-top: 1pt; }
  .entry h3, .entry .org { break-after: avoid; }
  .entry li { break-inside: avoid; }
  .entry > .when { font-size: 8.5pt; padding-top: 0; }
  h3 { font-size: 10pt; }
  .entry ul { margin-top: 2pt; }
  .entry li + li { margin-top: 0; }
  .plain li, dl div { padding-block: 2pt; }
  .plain--text li { font-size: 8.5pt; line-height: 1.35; padding-block: 3pt; }
  .footer, .sublede, #presse { display: none; }
}
