@font-face {
  font-family: "sinistre";
  src: url("webfonts/Sinistre-StCaroline.woff2") format("woff2"),
       url("webfonts/Sinistre-StCaroline.woff") format("woff");
  font-display: swap;
}

* { box-sizing: border-box; }
:root {
  --screen: 100vh;
  --menu-height: 0px;
  --gutter: clamp(16px, 3vw, 48px);
}
@supports (height: 100svh) { :root { --screen: 100svh; } }
html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  scroll-padding-top: var(--menu-height);
}
body {
  margin: 0;
  background: #fff;
  color: #111;
  font-family: "sinistre", Georgia, serif;
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 44%;
  height: var(--screen);
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 5vh, 64px);
  overflow-y: auto;
}
.intro h2 {
  margin: 0;
  font-size: clamp(18px, 1.8vw, 28px);
  line-height: 1.4;
  font-weight: normal;
}
.intro a { text-decoration: underline; text-underline-offset: 3px; }
.section-nav { margin-top: auto; }
.section-nav p { margin: 0 0 12px; }
.section-nav a {
  display: block;
  color: #666;
  font-size: clamp(14px, 1.2vw, 19px);
  line-height: 1.4;
}
.section-nav p.active a,
.section-nav a:hover { color: #111; font-style: italic; }
.section-photo { width: 56%; margin-left: 44%; }
.section-photo section {
  height: calc(var(--screen) - var(--menu-height));
  padding: clamp(12px, 3vh, 32px) var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  scroll-snap-align: start;
}
.section-photo img {
  display: block;
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  height: auto;
  max-height: 70%;
  object-fit: contain;
}
#enseigne-13 img,
#enseigne img { height: 56%; }
#ampoules img { height: 39%; }
#ex-libris img { max-height: 80%; width: auto; max-width: 100%; }
#ex-libris h3 {
  margin: 0;
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.4;
  text-align: center;
  font-weight: normal;
}

/* Keep the same two-column composition on phones and tablets. */
@media (max-width: 900px) {
  :root { --gutter: clamp(10px, 2vw, 22px); }
  html, body { height: 100%; overflow: hidden; }
  .sidebar {
    position: fixed;
    width: 48%;
    height: var(--screen);
    padding: var(--gutter) 6px 12px var(--gutter);
    gap: 16px;
    overflow: hidden;
  }
  .intro { min-height: 0; overflow-y: auto; scrollbar-width: none; }
  .intro::-webkit-scrollbar, .section-nav::-webkit-scrollbar { display: none; }
  .intro h2 { font-size: clamp(12px, 2.1vw, 18px); line-height: 1.35; }
  .section-nav {
    margin-top: auto;
    flex: 0 0 auto;
    max-height: 55%;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .section-nav p { margin: 0 0 6px; }
  .section-nav p:last-child { margin-bottom: 0; }
  .section-nav a {
    padding-block: 3px;
    font-size: clamp(11px, 1.7vw, 15px);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  .section-photo {
    width: 52%;
    margin-left: 48%;
    height: var(--screen);
    overflow-y: auto;
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
  }
  .section-photo section { height: 100%; padding: 12px var(--gutter); gap: 12px; }
  #ex-libris h3 { font-size: clamp(10px, 1.5vw, 13px); }
}
/* Neutral grayscale; per-image ink levels matched while keeping paper white. */
.section-photo img {
  filter: grayscale(1) brightness(var(--image-brightness, 1)) contrast(var(--image-contrast, 1));
}
.section-photo img[src="img/ampoule-carre.jpeg"] { --image-brightness: 0.92178; --image-contrast: 1.18545; }
.section-photo img[src="img/ampoule-rondes.jpeg"] { --image-brightness: 0.96477; --image-contrast: 1.07580; }
.section-photo img[src="img/bouton.jpeg"] { --image-brightness: 0.97003; --image-contrast: 1.06375; }
.section-photo img[src="img/coquille-archange.jpeg"] { --image-brightness: 1.00000; --image-contrast: 1.00000; }
.section-photo img[src="img/coquille.jpeg"] { --image-brightness: 0.96722; --image-contrast: 1.07015; }
.section-photo img[src="img/enseigne-13.jpeg"] { --image-brightness: 0.99945; --image-contrast: 1.00111; }
.section-photo img[src="img/enseigne-jambes.jpeg"] { --image-brightness: 0.91114; --image-contrast: 1.21614; }
.section-photo img[src="img/home.jpeg"] { --image-brightness: 0.91945; --image-contrast: 1.19205; }
.section-photo img[src="img/mereau.jpeg"] { --image-brightness: 0.95290; --image-contrast: 1.10401; }
.section-photo img[src="img/plaque-coquille.jpeg"] { --image-brightness: 0.90281; --image-contrast: 1.24128; }
.section-photo img[src="img/plaques.jpeg"] { --image-brightness: 0.92506; --image-contrast: 1.17631; }

@media (min-width: 901px) {
  html, body { height: 100%; overflow: hidden; }
  .sidebar {
    overflow: hidden;
    gap: 16px;
    padding-bottom: 16px;
  }
  .intro h2 { font-size: clamp(14px, 2.7vh, 26px); line-height: 1.35; }
  .section-nav { margin-top: auto; flex-shrink: 0; }
  .section-nav p { margin: 0 0 5px; }
  .section-nav p:last-child { margin-bottom: 0; }
  .section-nav a { font-size: clamp(12px, 1.9vh, 18px); line-height: 1.2; }
  .section-photo {
    height: var(--screen);
    overflow-y: auto;
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
  }
  .section-photo section { height: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .section-photo { scroll-behavior: auto; scroll-snap-type: none; }
}