/* ==========================================================================
   Base : reset, typographie, utilitaires, contenu riche
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  font-feature-settings: "ss01", "cv05";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1 0 auto;
}

img,
svg,
video,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

a:hover {
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

ul[class],
ol[class] {
  list-style: none;
}

p {
  margin: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-6) 0;
}

address {
  font-style: normal;
}

/* Titres ----------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 500;
  line-height: var(--lh-snug);
  letter-spacing: var(--track-heading);
  text-wrap: balance;
}

h1,
.h1,
h2,
.h2,
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 0;
  font-optical-sizing: auto;
}

h1,
.h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-display);
}

.display {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-display);
}

h2,
.h2 {
  font-size: var(--fs-h2);
  line-height: 1.08;
}

h3,
.h3 {
  font-size: var(--fs-h3);
  font-weight: 500;
}

h4,
.h4 {
  font-size: var(--fs-h4);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 em,
h2 em,
.display em {
  font-style: italic;
  color: var(--accent-ink);
  font-variation-settings: "SOFT" 60, "WONK" 1;
}

.serif {
  font-family: var(--font-display);
  font-weight: 400;
}

/* Textes ----------------------------------------------------------------- */
.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 var(--space-4);
}

.lead {
  font-size: var(--fs-lg);
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: var(--fs-sm);
}

.xs {
  font-size: var(--fs-xs);
}

.text-center {
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed !important;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 1000;
  width: auto;
  height: auto;
  clip: auto;
  clip-path: none;
  padding: var(--space-3) var(--space-5);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-pill);
}

/* Conteneurs & sections ---------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - 2 * var(--gutter), var(--container-narrow));
}

.container--wide {
  width: min(100% - 2 * var(--gutter), var(--container-wide));
}

.section {
  padding-block: var(--section);
}

.section--sm {
  padding-block: var(--section-sm);
}

.section--soft {
  background: var(--paper-2);
}

.section--dark {
  background: var(--ink);
  color: var(--paper);
}

.section--dark .eyebrow {
  color: var(--accent);
}

.section--dark .muted {
  color: rgba(255, 255, 255, 0.6);
}

.section--line-top {
  border-top: 1px solid var(--line);
}

.section--line-bottom {
  border-bottom: 1px solid var(--line);
}

/* Grilles & piles ----------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--space-5);
}

.grid--2 {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

.stack > * + * {
  margin-top: var(--space-4);
}

.stack--sm > * + * {
  margin-top: var(--space-2);
}

.stack--lg > * + * {
  margin-top: var(--space-7);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.cluster--between {
  justify-content: space-between;
}

.flow > * + * {
  margin-top: var(--space-5);
}

/* Contenu riche -------------------------------------------------------------- */
.prose {
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--ink-2);
  text-wrap: pretty;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2,
.prose h3,
.prose h4 {
  color: var(--ink);
  margin-top: 2em;
}

.prose h2 {
  font-size: var(--fs-h3);
}

.prose h3 {
  font-family: var(--font-body);
  font-size: var(--fs-lg);
  font-weight: 600;
}

.prose h4 {
  font-size: var(--fs-md);
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose ul {
  list-style: none;
  padding-left: 0;
}

.prose ul > li {
  position: relative;
  padding-left: 1.5em;
}

.prose ul > li + li,
.prose ol > li + li {
  margin-top: 0.45em;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.72em;
  width: 0.5em;
  height: 1px;
  background: var(--accent);
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

.prose a:hover {
  color: var(--accent-ink);
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose blockquote {
  margin: 1.5em 0;
  padding: 0 0 0 1.25em;
  border-left: 2px solid var(--accent);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--ink);
}

.prose img {
  border-radius: var(--radius);
}

.prose figcaption {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: 0.5em;
}

.prose hr {
  margin: 2.5em 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.prose th,
.prose td {
  text-align: left;
  padding: 0.75em 0.5em;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.prose th {
  font-weight: 600;
  color: var(--ink);
}

.prose--lg {
  font-size: var(--fs-lg);
  line-height: 1.6;
}

/* Blocs Gutenberg de base (pages éditoriales) */
.wp-block-image img {
  border-radius: var(--radius);
}

.wp-block-quote {
  border-left: 2px solid var(--accent);
  padding-left: 1.25em;
  font-family: var(--font-display);
}

.alignwide {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.alignfull {
  width: 100%;
}

/* Placeholders visuels (pas encore de photo) -------------------------------- */
.placeholder {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #efe9e0 0%, #dcd3c7 100%);
  color: rgba(17, 17, 17, 0.28);
}

.placeholder--1 {
  background: linear-gradient(135deg, #ece7e1 0%, #cfc6ba 100%);
}

.placeholder--2 {
  background: linear-gradient(135deg, #e9e4dd 0%, #c9c1b6 100%);
}

.placeholder--3 {
  background: linear-gradient(135deg, #f1ece5 0%, #d6cdc0 100%);
}

.placeholder--4 {
  background: linear-gradient(135deg, #e6e0d7 0%, #c4bbaf 100%);
}

.placeholder__initial {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12cqw, 9rem);
  line-height: 1;
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

/* Apparition douce au scroll ------------------------------------------------- */
/* Masqué seulement quand JS est présent (html.js) : sans JS, tout est visible d'emblée. */
html.js [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(12px);
}

[data-reveal] {
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal]:not(.is-visible) {
    opacity: 1;
    transform: none;
  }

  [data-reveal] {
    transition: none;
  }
}

/* Sélection */
::selection {
  background: var(--accent-soft);
  color: var(--ink);
}
