html { scrollbar-gutter: stable; }
/* Portfolio Guillaume Lecomte — style « papier clair » */
:root {
  --paper: #f4f1ec;
  --paper-deep: #ebe6de;
  --ink: #1b1b1a;
  --muted: #7a756d;
  --line: #d9d3c9;
  --danger: #9b2c1f;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
picture { display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* En-tête */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  max-width: var(--max); margin: 0 auto; padding: 20px var(--gutter);
}
.site-header__logo img { width: clamp(150px, 22vw, 230px); }
.site-nav { display: flex; gap: clamp(14px, 2.5vw, 32px); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }
.site-nav a { text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-color: var(--ink); }
@media (max-width: 640px) {
  .site-header { flex-direction: column; gap: 10px; }
  .site-nav { gap: 16px; font-size: .7rem; letter-spacing: .12em; }
}

/* Trace en pointillés */
.trace { display: block; width: min(420px, 70%); height: 20px; margin: 22px auto 0; color: var(--muted); }
.trace path { stroke-dasharray: 4 7; }

/* Typographie */
.eyebrow { margin: 0 0 8px; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.eyebrow a { text-decoration: none; }
.page-title, .section-title { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400; line-height: 1.15; }
.page-title { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.section-title { margin-bottom: 28px; font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.page-meta { margin: 10px 0 0; color: var(--muted); font-size: .85rem; letter-spacing: .08em; }
.page-intro { max-width: 40em; margin: 18px auto 0; color: var(--muted); }
.lead { max-width: 30em; margin: 18px auto 0; font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1.4; }
.link-arrow {
  display: inline-block; padding-bottom: 3px; border-bottom: 1px solid var(--ink);
  font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
}
.link-arrow::after { content: ' →'; }

/* Mise en page */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 8vw, 96px) var(--gutter) 0; }
.section.narrow { max-width: 640px; }
.page-header { max-width: 900px; margin: 0 auto; padding: clamp(40px, 7vw, 80px) var(--gutter) 0; text-align: center; }
.empty { text-align: center; color: var(--muted); }

/* Accueil */
.hero__img { width: 100%; height: min(80vh, 900px); object-fit: cover; }
.intro { padding: 40px var(--gutter) 0; text-align: center; }
.intro__tagline { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 3vw, 2rem); }
.sky {
  display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: clamp(28px, 5vw, 64px); align-items: center;
  max-width: var(--max); margin: 0 auto; padding: clamp(56px, 9vw, 110px) var(--gutter) 0;
}
.sky__text p { color: var(--muted); }
.sky__mosaic { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: clamp(110px, 14vw, 190px); gap: 8px; }
.sky__mosaic a { overflow: hidden; background: var(--paper-deep); }
.sky__mosaic a:nth-child(1) { grid-column: span 4; grid-row: span 2; }
.sky__mosaic a:nth-child(2), .sky__mosaic a:nth-child(3) { grid-column: span 2; }
.sky__mosaic a:nth-child(4), .sky__mosaic a:nth-child(5) { grid-column: span 3; }
.sky__mosaic picture, .album-card__img picture, .theme-card picture { height: 100%; }
.sky__mosaic img, .album-card__img img, .theme-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.sky__mosaic a:hover img, .album-card:hover img, .theme-card:hover img { transform: scale(1.03); }
@media (max-width: 860px) { .sky { grid-template-columns: 1fr; } }

/* Cartes d'albums et de thèmes */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 40px 28px; }
.album-card { display: block; text-decoration: none; }
.album-card__img { aspect-ratio: 3 / 2; overflow: hidden; background: var(--paper-deep); }
.album-card__title { margin: 14px 0 2px; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.5rem; }
.album-card__meta { margin: 0; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 28px; }
.theme-card { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-deep); text-decoration: none; }
.theme-card__title {
  position: absolute; left: 0; bottom: 0; padding: 10px 22px 6px 0; background: var(--paper);
  font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 2.6vw, 2.1rem);
}

/* Mosaïque d'album (rangées justifiées par mosaic.js, grille simple sans JS) */
.mosaic {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px;
  max-width: 1600px; margin: clamp(40px, 6vw, 72px) auto 0; padding: 0 var(--gutter);
}
.mosaic.is-justified { display: flex; flex-wrap: wrap; }
.mosaic__item { display: block; overflow: hidden; background: var(--paper-deep); cursor: zoom-in; }
.mosaic:not(.is-justified) .mosaic__item { aspect-ratio: 1; }
.mosaic__item picture, .mosaic__item img { width: 100%; height: 100%; object-fit: cover; }
.draft-badge { display: inline-block; margin-top: 14px; padding: 4px 12px; border: 1px dashed var(--muted); font-size: .8rem; color: var(--muted); }

/* Visionneuse */
body.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-columns: 1fr auto; background: var(--paper); }
.viewer[hidden] { display: none; }
.viewer__stage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 0; margin: 0; padding: 56px 72px 24px; }
.viewer__stage picture { display: contents; }
.viewer__stage img { width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; box-shadow: 0 20px 50px rgba(27, 27, 26, .12); }
.viewer__caption { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: 1.15rem; text-align: center; }
.viewer__btn { position: absolute; z-index: 2; width: 52px; height: 52px; border: 0; background: none; color: var(--ink); font: 300 2.4rem/1 var(--serif); cursor: pointer; }
.viewer__btn:hover { color: var(--muted); }
.viewer__close { top: 8px; right: 8px; }
.viewer__info-toggle { top: 17px; right: 64px; width: 34px; height: 34px; border: 1px solid var(--ink); border-radius: 50%; font: italic 500 1.3rem/1 var(--serif); }
.viewer__prev { left: 8px; top: 50%; transform: translateY(-50%); }
.viewer__next { right: 8px; top: 50%; transform: translateY(-50%); }
.viewer:has(.viewer__info:not([hidden])) .viewer__next { right: 348px; }
.viewer__info { width: 340px; padding: 72px 24px 24px; overflow-y: auto; border-left: 1px solid var(--line); background: var(--paper); }
.viewer__title { margin: 0 0 8px; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.6rem; line-height: 1.2; }
.viewer__text { margin: 0 0 20px; color: var(--muted); }
.viewer__exif { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 20px; font-size: .88rem; }
.viewer__exif dt { color: var(--muted); }
.viewer__exif dd { margin: 0; }
.viewer__map { height: 200px; border: 1px solid var(--line); }
@media (max-width: 760px) {
  .viewer { grid-template-columns: 1fr; }
  .viewer__stage { padding: 56px 8px 64px; }
  .viewer__prev, .viewer__next { top: auto; bottom: 8px; transform: none; }
  .viewer__info { position: absolute; inset: auto 0 0 0; width: auto; max-height: 60vh; padding-top: 24px; border-left: 0; border-top: 1px solid var(--line); z-index: 3; }
  .viewer:has(.viewer__info:not([hidden])) .viewer__next { right: 8px; }
}

/* Carte */
.map-page { max-width: 1600px; margin: 0 auto; padding: 32px var(--gutter) 0; }
#map { height: min(75vh, 820px); border: 1px solid var(--line); background: var(--paper-deep); }
.leaflet-container { font-family: var(--sans); }
.map-popup { display: block; width: 220px; text-decoration: none; color: var(--ink); }
.map-popup img { width: 220px; height: 146px; margin-bottom: 6px; object-fit: cover; }
.map-popup span { display: block; font-family: var(--serif); font-style: italic; font-size: 1.1rem; }
.map-popup small { color: var(--muted); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(27, 27, 26, .18); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: var(--ink); color: var(--paper); font-family: var(--sans); }

/* Présentation */
.banner__img { width: 100%; height: min(60vh, 680px); object-fit: cover; object-position: 55% 40%; }
.about {
  display: grid; grid-template-columns: 2fr 3fr; gap: clamp(28px, 5vw, 72px); align-items: start;
  max-width: 1100px; margin: 0 auto; padding: clamp(48px, 7vw, 88px) var(--gutter) 0;
}
.about__img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.prose p { margin: 0 0 1.1em; }
.prose h2, .prose h3 { font-family: var(--serif); font-style: italic; font-weight: 400; }
.pilot { margin: 36px 0; padding-top: 20px; border-top: 1px solid var(--line); }
.pilot__title { margin: 0 0 12px; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.5rem; }
.pilot dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 0; }
.pilot dt { padding-top: 3px; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pilot dd { margin: 0; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }

/* Formulaire de contact */
.form { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 1rem; letter-spacing: normal; text-transform: none;
}
.field textarea { min-height: 180px; padding: 12px; border: 1px solid var(--line); resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field__error { color: var(--danger); letter-spacing: normal; text-transform: none; }
.hp { position: absolute; left: -9999px; }
.button {
  justify-self: start; padding: 16px 28px; border: 0; background: var(--ink); color: var(--paper); cursor: pointer;
  font: 500 .8rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase;
}
.button:hover { background: #3a3936; }
.notice { padding: 16px 20px; border: 1px solid var(--line); background: var(--paper-deep); }
.notice--error { border-color: #d7a39b; }

/* Pied de page et erreurs */
.site-footer { margin-top: clamp(72px, 10vw, 128px); padding: 0 var(--gutter) 40px; text-align: center; color: var(--muted); font-size: .8rem; }
.site-footer__logo { width: 160px; margin: 32px auto 16px; opacity: .85; }
.site-footer nav { display: flex; justify-content: center; gap: 24px; margin-bottom: 14px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.site-footer nav a { text-decoration: none; }
.site-footer p { margin: 0; }
.error-page { padding: clamp(60px, 12vw, 140px) var(--gutter); text-align: center; }
.error-page__code { margin: 0; font-family: var(--serif); font-size: 5rem; color: var(--muted); }
