/* ============================================================
   SwissStone — feuille de style du thème
   Fusion des styles de la maquette : index.html, partenaires.html,
   projets/residence-les-vergers.html
   ============================================================ */

:root {
  --ink: #161B26;
  --stone: #8B92A3;
  --paper: #F4F5F7;
  /* Accent sur fond clair (paper/white) : 5.19:1 sur --paper, conforme AA */
  --gold: #5C6878;
  /* Accent sur fond sombre (--ink) : 6.72:1. Le --gold seul n'y tombe qu'à 3.04:1,
     sous le minimum AA de 4.5:1, d'où cette variante éclaircie. */
  --gold-light: #94A3B8;
  --line: #DDE0E6;
  --white: #FFFFFF;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-weight: 300;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ============ HEADER ============ */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--ink);
  border-bottom: 1px solid rgba(245,243,240,0.08);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 32px;
  max-width: 1180px;
  margin: 0 auto;
}

.logo {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
}

/* Logo officiel : version horizontale blanche (header & footer sur fond sombre) */
.logo-mark {
  height: 44px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

@media (max-width: 640px) {
  .logo-mark { height: 34px; }
}

nav ul {
  display: flex;
  gap: 36px;
  list-style: none;
}

nav ul li a {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #B7BBC7;
  transition: color 0.2s ease;
}

nav ul li a:hover,
nav ul li a:focus-visible,
nav ul li a.active {
  color: var(--paper);
}

/* ============ BURGER (mobile) ============ */
.nav-toggle {
  display: none;
  position: relative;
  z-index: 210;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav-toggle-bar {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--paper);
  border-radius: 2px;
  transition: transform 0.4s cubic-bezier(0.7, 0, 0.2, 1),
              opacity 0.25s ease,
              width 0.4s cubic-bezier(0.7, 0, 0.2, 1);
}

/* La barre du milieu est plus courte : petit détail qui rend le burger vivant */
.nav-toggle-bar:nth-child(2) { width: 18px; }

.nav-toggle:hover .nav-toggle-bar:nth-child(2) { width: 26px; }

/* Croix animée à l'ouverture */
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ============ MENU PLEIN ÉCRAN (mobile) ============ */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

.mobile-menu.is-open { display: block; }

.mobile-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 13, 20, 0.6);
  opacity: 0;
  transition: opacity 0.45s ease;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.mobile-menu.is-active .mobile-menu-backdrop { opacity: 1; }

.mobile-menu-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(88vw, 420px);
  background: var(--ink);
  border-left: 1px solid rgba(245, 243, 240, 0.1);
  padding: 120px 34px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform 0.55s cubic-bezier(0.65, 0, 0.2, 1);
  box-shadow: -30px 0 60px rgba(0, 0, 0, 0.35);
}

.mobile-menu.is-active .mobile-menu-panel { transform: translateX(0); }

.mobile-menu-panel ul {
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu-panel li {
  border-bottom: 1px solid rgba(245, 243, 240, 0.08);
  /* Cascade : chaque ligne entre avec un léger décalage */
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
  transition-delay: calc(var(--i) * 65ms + 120ms);
}

.mobile-menu.is-active .mobile-menu-panel li {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu-panel li a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 20px 2px;
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--paper);
  text-transform: none;
  transition: color 0.25s ease, padding-left 0.3s ease;
}

.mobile-menu-panel li a:hover,
.mobile-menu-panel li a:focus-visible,
.mobile-menu-panel li a.active {
  color: var(--gold-light);
  padding-left: 10px;
}

.mobile-menu-panel li a:focus-visible {
  outline: 1px solid var(--gold-light);
  outline-offset: -4px;
}

.mm-num {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--gold-light);
  flex-shrink: 0;
}

.mm-label { flex: 1; }

.mobile-menu-foot {
  margin-top: 40px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
  opacity: 0;
  transition: opacity 0.5s ease 0.45s;
}

.mobile-menu.is-active .mobile-menu-foot { opacity: 1; }

/* Bloque le défilement de la page quand le menu est ouvert */
body.menu-open { overflow: hidden; }

/* Le header passe au-dessus du panneau pendant l'ouverture :
   sans cela, le burger (devenu croix) serait recouvert et il
   n'y aurait plus de bouton de fermeture visible. */
body.menu-open header { z-index: 220; }

/* ============ HERO (accueil) ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
}

.hero-photo {
  position: absolute;
  inset: -44vh 0;
  display: block;
  width: 100%;
  height: calc(100% + 88vh);
  object-fit: cover;
  z-index: 0;
  transform: translate3d(0, var(--hero-photo-y, 0), 0) scale(1.08);
  will-change: transform;
  pointer-events: none;
  background: #161B26;
}

/* Accessibilité : on fige la vidéo de fond si l'utilisateur réduit les animations. */
@media (prefers-reduced-motion: reduce) {
  video.hero-photo {
    display: none;
  }

  .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: #161B26 url("../video/hero-building-poster.jpg") center / cover no-repeat;
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(22,27,38,0.94) 0%, rgba(22,27,38,0.82) 45%, rgba(22,27,38,0.55) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 140px 32px 100px;
  width: 100%;
  transform: translate3d(0, var(--hero-content-y, 0), 0);
  will-change: transform;
}

.hero-content > * {
  animation: heroRise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-content > :nth-child(2) { animation-delay: 0.08s; }
.hero-content > :nth-child(3) { animation-delay: 0.16s; }
.hero-content > :nth-child(4) { animation-delay: 0.24s; }

.hero-eyebrow {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 28px;
  font-weight: 500;
}

.hero h1 {
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1.02;
  font-weight: 500;
  max-width: 900px;
}

.hero h1 em {
  font-style: italic;
  color: #A9AFBC;
  font-weight: 400;
}

.hero-sub {
  margin-top: 32px;
  max-width: 480px;
  font-size: 18px;
  color: #C9CDD6;
  font-weight: 300;
}

.hero-cta {
  margin-top: 48px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-scroll-cue {
  position: absolute;
  left: max(32px, calc((100vw - 1180px) / 2 + 32px));
  bottom: 32px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: rgba(244, 245, 247, 0.72);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.hero-scroll-cue:hover,
.hero-scroll-cue:focus-visible {
  color: var(--paper);
}

.hero-scroll-cue:focus-visible {
  outline: 1px solid rgba(244, 245, 247, 0.65);
  outline-offset: 8px;
}

.hero-scroll-cue.is-hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.hero-scroll-cue i {
  position: relative;
  display: block;
  width: 1px;
  height: 56px;
  background: rgba(244, 245, 247, 0.22);
  overflow: hidden;
}

.hero-scroll-cue i::after {
  content: '';
  position: absolute;
  left: 0;
  top: -56px;
  width: 1px;
  height: 56px;
  background: var(--paper);
  animation: scrollCueLine 1.65s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes heroRise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollCueLine {
  0% { transform: translateY(0); }
  55%, 100% { transform: translateY(112px); }
}

/* ============ BOUTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
}

/* Fond clair + texte sombre : 9.77:1. L'ancien fond --gold ne donnait que
   3.04:1 avec le texte --ink, illisible sur la photo du hero. */
.btn-primary {
  background: #B8C4D6;
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--white);
}

/* Bordure à 0.55 : à 0.3 elle ne donnait que 2.55:1 sur le hero,
   sous le seuil AA de 3:1 pour un élément d'interface. */
.btn-outline {
  border-color: rgba(245,243,240,0.55);
  color: var(--paper);
}

.btn-outline:hover {
  border-color: var(--gold-light);
  color: var(--gold-light);
}

.btn-outline-dark {
  border-color: var(--line);
  color: var(--ink);
}

.btn-outline-dark:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ============ SECTIONS ============ */
section { padding: 110px 0; }

.section-head {
  max-width: 640px;
  margin-bottom: 64px;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 16px;
  display: block;
}

.section-head h2 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 500;
  line-height: 1.15;
}

.section-head p {
  margin-top: 20px;
  color: var(--stone);
  font-size: 17px;
}

/* ============ ABOUT ============ */
.about { background: var(--white); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 8px;
}

.stat-num {
  font-family: 'Fraunces', serif;
  font-size: 44px;
  font-weight: 500;
  color: var(--ink);
}

.stat-label {
  font-size: 13px;
  color: var(--stone);
  margin-top: 6px;
  letter-spacing: 0.04em;
}

.about-text p {
  color: #4A5063;
  font-size: 17px;
  margin-bottom: 20px;
}

.about-text p:last-child { margin-bottom: 0; }

/* ============ PROJETS — ONGLETS & CARTES ============ */
.projects-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--line);
}

.tab-btn {
  background: none;
  border: none;
  padding: 16px 4px;
  margin-right: 36px;
  font-family: 'Fraunces', serif;
  font-size: 18px;
  color: var(--stone);
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.tab-btn::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 100%; height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.tab-btn.active { color: var(--ink); }
.tab-btn.active::after { transform: scaleX(1); }

.tab-btn:hover { color: var(--ink); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.4s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.project-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.project-card {
  display: block;
  border: 1px solid var(--line);
  background: var(--white);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}

.project-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(92, 104, 120, 0.35);
  box-shadow: 0 24px 52px rgba(28,34,48,0.14);
}

/* Ratio volontairement proche de celui du slider de la fiche projet (~2.4).
   Plus l'écart de ratio est faible, moins la transition partagée a de recadrage
   à rattraper : c'est ce qui rend le morphing stable. */
.project-image {
  aspect-ratio: 2.4 / 1;
  background: var(--line);
  position: relative;
  overflow: hidden;
}

.project-image::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 42%, rgba(22, 27, 38, 0.45) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.project-image.is-future img {
  filter: grayscale(0.7) brightness(1.05);
}

.project-image.is-future::after {
  content: 'Projet à venir';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  background: rgba(22,27,38,0.35);
  z-index: 2;
}

.project-card:hover .project-image img {
  transform: scale(1.075);
}

.project-card:hover .project-image::before { opacity: 1; }

.project-body { padding: 24px; }

.project-status {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 2px;
  display: inline-block;
  margin-bottom: 14px;
}

.status-realise { background: #E8EAED; color: #5C6878; }
.status-cours { background: #DEE2E8; color: #3A4250; }
.status-venir { background: #ECEDF0; color: #8B92A3; }

.project-body h3 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 8px;
}

.project-loc {
  font-size: 13px;
  color: var(--stone);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.project-desc {
  font-size: 14px;
  color: #6B7080;
}

.project-link {
  display: inline-flex;
  align-items: center;
  margin-top: 20px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateX(-8px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.project-link::after {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
  margin-left: 10px;
}

.project-card:hover .project-link,
.project-card:focus-visible .project-link {
  opacity: 1;
  transform: translateX(0);
}

/* ============ APPROCHE ============ */
.approach {
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}

.approach::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(244, 245, 247, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(244, 245, 247, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  pointer-events: none;
}

.approach .container {
  position: relative;
  z-index: 1;
}

.approach .section-head h2 { color: var(--paper); }
.approach .section-head p { color: #B7BBC7; }

.approach-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(245,243,240,0.1);
}

.approach-timeline {
  position: relative;
  background: transparent;
  gap: 0;
}

.approach-timeline::before {
  content: '';
  position: absolute;
  top: 35px;
  left: 12.5%;
  right: 12.5%;
  height: 1px;
  background: rgba(244, 245, 247, 0.14);
}

.approach-timeline::after {
  content: '';
  position: absolute;
  top: 35px;
  left: 12.5%;
  width: calc(75% * var(--timeline-progress, 0));
  height: 1px;
  background: var(--gold-light);
  transition: width 0.5s ease;
}

.approach-item {
  background: var(--ink);
  padding: 72px 28px 36px;
  border: 1px solid rgba(245,243,240,0.1);
  position: relative;
  min-height: 250px;
  transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.approach-item::before {
  content: '';
  position: absolute;
  top: 28px;
  left: 28px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid rgba(148, 163, 184, 0.65);
  z-index: 2;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.approach-item.is-active,
.approach-item:hover {
  background: #1D2432;
  border-color: rgba(148, 163, 184, 0.32);
  transform: translateY(-4px);
}

.approach-item.is-active::before,
.approach-item:hover::before {
  background: var(--gold-light);
  box-shadow: 0 0 0 7px rgba(148, 163, 184, 0.12);
}

.approach-num {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  color: var(--gold-light);
  margin-bottom: 18px;
  letter-spacing: 0.05em;
}

.approach-item h4 {
  font-size: 19px;
  margin-bottom: 10px;
  font-weight: 500;
}

.approach-item p {
  font-size: 14px;
  color: #B7BBC7;
}

/* ============ CONTACT ============ */
.contact { background: var(--white); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
}

.contact-info p {
  color: var(--stone);
  margin-bottom: 32px;
  font-size: 16px;
}

.contact-detail {
  margin-bottom: 24px;
}

.contact-detail .label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 6px;
}

.contact-detail .value {
  font-size: 17px;
}

/* Le formulaire est posé sur une carte : les champs blancs disparaissaient
   sur le fond blanc de la section contact. */
#contactForm {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 40px;
}

form { display: flex; flex-direction: column; gap: 22px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 10px;
  display: block;
  font-weight: 600;
}

input, textarea, select {
  width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder, textarea::placeholder { color: #AEB4C0; }

input:hover, textarea:hover, select:hover { border-color: #C3C8D2; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(92, 104, 120, 0.12);
}

textarea { resize: vertical; min-height: 150px; }

/* Chevron dessiné en CSS : le rendu natif du select cassait l'unité
   visuelle avec les autres champs. */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238B92A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
}

.form-submit {
  align-self: flex-start;
  margin-top: 6px;
  padding: 17px 40px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 4px;
}

.form-submit:hover {
  background: #2C3548;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(22, 27, 38, 0.18);
}

.form-submit:active { transform: translateY(0); box-shadow: none; }

.form-submit:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.form-feedback {
  padding: 13px 16px;
  border: 1px solid #B3563E;
  border-radius: 4px;
  background: rgba(179, 86, 62, 0.07);
  color: #B3563E;
  font-size: 14px;
}

.form-success {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 56px 32px;
  text-align: center;
  color: var(--ink);
}

.form-success svg { color: var(--gold); }

.form-success-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  margin: 16px 0 8px;
}

.form-success-text { color: var(--stone); }

/* Le reveal au scroll a été retiré : son `transform` sur .project-card créait
   un conteneur de mise en page qui neutralisait la transition partagée
   (view-transition-name: cover-<slug>) entre la vignette et la fiche projet. */

/* ============ BREADCRUMB ============ */
/* Variante fiche projet : simple, sous le header fixe */
.breadcrumb {
  padding: 120px 0 24px;
  font-size: 13px;
  color: var(--stone);
  letter-spacing: 0.04em;
}

.breadcrumb a { color: var(--stone); transition: color 0.2s ease; }
.breadcrumb a:hover { color: var(--ink); }

/* Variante bandeau (page partenaires) */
.breadcrumb-band {
  padding: 102px 0 0;
  font-size: 13px;
  color: var(--stone);
  letter-spacing: 0.04em;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.breadcrumb-band a { color: var(--stone); transition: color 0.2s ease; }
.breadcrumb-band a:hover { color: var(--ink); }

.breadcrumb-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 32px;
}

/* ============ PAGE HERO (pages intérieures) ============ */
.page-hero {
  background: var(--ink);
  color: var(--paper);
  padding: 72px 0 64px;
}

.page-hero .eyebrow {
  color: var(--gold-light);
  margin-bottom: 20px;
}

.page-hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--paper);
}

.page-hero h1 em {
  font-style: normal;
  color: var(--stone);
}

.page-hero p {
  font-size: 17px;
  color: #B7BBC7;
  max-width: 600px;
  line-height: 1.7;
}

/* ============ PARTENAIRES ============ */
.partner-category {
  margin-bottom: 64px;
}

.partner-category:last-child { margin-bottom: 0; }

.category-title {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.partner-card {
  background: var(--white);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 0.2s ease;
}

.partner-card:hover { background: var(--paper); }

.partner-logo-zone {
  height: 52px;
  display: flex;
  align-items: center;
}

.partner-logo {
  max-height: 100%;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.partner-logo-placeholder {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.partner-name {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}

.partner-role {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--stone);
}

.partner-desc {
  font-size: 14px;
  color: #6B7080;
  line-height: 1.65;
  flex-grow: 1;
}

.partner-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  transition: gap 0.2s ease;
}

.partner-link:hover { gap: 10px; }

/* ============ VALEURS PARTENARIALES ============ */
.values-section { background: var(--white); }

.values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  margin-top: 40px;
}

.value-item {
  background: var(--white);
  padding: 36px 28px;
}

.value-num {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  color: var(--gold);
  margin-bottom: 18px;
  letter-spacing: 0.05em;
}

.value-item h4 {
  font-size: 18px;
  margin-bottom: 10px;
}

.value-item p {
  font-size: 14px;
  color: var(--stone);
  line-height: 1.65;
}

/* ============ CTA BAND ============ */
.cta-band {
  background: var(--ink);
  color: var(--paper);
  padding: 72px 0;
}

.cta-band-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
}

.cta-band h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  color: var(--paper);
  max-width: 520px;
  line-height: 1.2;
}

.cta-band p {
  font-size: 15px;
  color: #B7BBC7;
  margin-top: 12px;
  max-width: 480px;
}

.cta-band .btn { white-space: nowrap; }

.cta-band .btn-primary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.cta-band .btn-primary:hover { background: var(--white); }

.cta-band .btn-outline {
  background: transparent;
  color: var(--paper);
  border-color: rgba(245,243,240,0.25);
}

.cta-band .btn-outline:hover { border-color: var(--paper); color: var(--paper); }

.cta-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ============ FICHE PROJET ============ */
.project-hero {
  padding-bottom: 56px;
}

.project-hero .project-status { margin-bottom: 18px; }

.project-hero h1 {
  font-size: clamp(36px, 5.5vw, 56px);
  line-height: 1.1;
  margin-bottom: 12px;
}

.project-hero-loc {
  font-size: 17px;
  color: var(--stone);
}

/* Slider */
/* Même ratio que .project-image : la vignette et cette photo partagent un
   view-transition-name, et un ratio identique supprime tout recadrage
   pendant le morphing (l'image se contente de grandir en place). */
.slider-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 2.4 / 1;
  max-height: 520px;
  margin-bottom: 40px;
  background: var(--ink);
}

.slider-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  flex-shrink: 0;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide-caption {
  position: absolute;
  bottom: 16px;
  left: 20px;
  background: rgba(22, 27, 38, 0.72);
  color: var(--paper);
  font-size: 12px;
  padding: 5px 12px;
  letter-spacing: 0.04em;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(22, 27, 38, 0.65);
  border: 1px solid rgba(245, 243, 240, 0.15);
  color: var(--paper);
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 10;
}

.slider-btn:hover { background: rgba(22, 27, 38, 0.92); }
.slider-btn.prev { left: 16px; }
.slider-btn.next { right: 16px; }

.slider-counter {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(22, 27, 38, 0.65);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  z-index: 10;
}

.slider-dots {
  position: absolute;
  bottom: 16px;
  right: 20px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(245, 243, 240, 0.35);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.dot.active { background: var(--paper); transform: scale(1.3); }

.slider-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 40px;
  margin-top: -28px;
  padding: 0 0 8px;
}

.slider-thumbs::-webkit-scrollbar { display: none; }

.thumb {
  flex-shrink: 0;
  width: 80px;
  height: 52px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.5;
}

.thumb.active { border-color: var(--ink); opacity: 1; }
.thumb:hover { opacity: 0.85; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Contenu fiche projet */
.project-content {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  padding-bottom: 100px;
}

.project-description p {
  color: #4A5063;
  font-size: 17px;
  margin-bottom: 20px;
}

.project-description h2 {
  font-size: 24px;
  margin: 36px 0 16px;
}

.project-facts {
  list-style: none;
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.project-facts li {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.project-facts .fact-label { color: var(--stone); }
.project-facts .fact-value { font-weight: 500; }

/* Sidebar fiche projet */
.project-sidebar {
  align-self: start;
}

.project-sidebar .btn { width: 100%; }

.project-sidebar .btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.project-sidebar .btn-primary:hover { background: #2C3548; }

.sidebar-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 28px;
  margin-bottom: 24px;
}

.sidebar-card h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.sidebar-card .sidebar-note {
  font-size: 14px;
  color: var(--stone);
  margin-bottom: 20px;
}

/* Réservé aux lecteurs d'écran : retiré du flux visuel, pas de l'arbre d'accessibilité. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.project-map {
  position: relative;
  width: 100%;
  height: 240px;
  border: 1px solid rgba(20, 31, 38, 0.12);
  box-shadow: 0 18px 38px rgba(20, 31, 38, 0.12);
  margin-bottom: 16px;
  overflow: hidden;
  background: #dfe8e2;
  cursor: pointer;
}

/* Grille de tuiles centrée sur le projet : positionnée au centre de la carte,
   puis recalée par translate() selon le décalage sous-tuile calculé côté Twig. */
.project-map-tiles {
  position: absolute;
  top: 50%;
  left: 50%;
  filter: saturate(0.55) contrast(1.08) sepia(0.08);
  pointer-events: none;
}

.project-map-row {
  display: flex;
}

.project-map-tiles img {
  display: block;
  width: 256px;
  height: 256px;
  max-width: none;
}

.project-map-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 2px 10px rgba(20, 31, 38, 0.45);
  pointer-events: none;
}

.project-map-credit {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  color: var(--ink);
}

.project-map-credit a {
  color: inherit;
}

.project-map-trigger {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 14px;
  border: 0;
  background: linear-gradient(180deg, rgba(20, 31, 38, 0) 45%, rgba(20, 31, 38, 0.34));
  cursor: pointer;
  text-decoration: none;
}

.project-map-trigger span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid rgba(20, 31, 38, 0.12);
  box-shadow: 0 10px 24px rgba(20, 31, 38, 0.16);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-map-trigger:focus-visible span,
.project-map-trigger:hover span {
  background: var(--ink);
  color: var(--paper);
}

@media (max-width: 720px) {
  .project-map-trigger {
    padding: 10px;
  }
}

.project-address {
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 4px;
}

.project-address-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
  font-weight: 600;
  margin-bottom: 8px;
}

/* Prix */
.price-card {
  background: var(--ink);
  color: var(--paper);
  padding: 24px 28px;
  margin-bottom: 24px;
}

.price-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  font-weight: 600;
  margin-bottom: 8px;
}

.price-value {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 6px;
}

.price-note {
  font-size: 12px;
  color: #8E94A6;
}

/* ============ FOOTER ============ */
footer {
  background: var(--ink);
  color: #8E94A6;
  padding: 56px 0 32px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(245,243,240,0.08);
  margin-bottom: 24px;
}

.footer-logo {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--paper);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-links {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 14px;
  color: #B7BBC7;
  transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--gold); }

.footer-bottom {
  font-size: 13px;
  color: #6B7080;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-legal {
  display: flex;
  gap: 20px;
}

.footer-legal a { transition: color 0.2s ease; }
.footer-legal a:hover { color: var(--paper); }

/* Crédit agence : un cran plus discret que la ligne de copyright */
.footer-credit {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(245,243,240,0.06);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #565B6B;
  text-align: center;
}

.footer-credit a {
  color: #767C8C;
  transition: color 0.2s ease;
}

.footer-credit a:hover { color: var(--paper); }

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  header nav[aria-label="Navigation principale"] { display: none; }
  .nav-toggle { display: flex; }
  .nav { padding: 16px 22px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .project-list { grid-template-columns: 1fr; }
  .approach-grid { grid-template-columns: 1fr 1fr; }
  .approach-timeline::before,
  .approach-timeline::after { display: none; }
  .approach-item { padding-top: 58px; }
  .form-row { grid-template-columns: 1fr; }
  #contactForm { padding: 28px 22px; }
  .form-submit { align-self: stretch; width: 100%; }
  section { padding: 72px 0; }
  .partner-grid { grid-template-columns: 1fr 1fr; }
  .values-grid { grid-template-columns: 1fr 1fr; }
  .cta-band-inner { flex-direction: column; }
  .project-content { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 520px) {
  .approach-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; gap: 24px; }
  .hero-content { padding: 120px 24px 80px; }
  .hero-scroll-cue {
    left: 24px;
    bottom: 22px;
  }
  .hero-scroll-cue span { display: none; }
  .projects-tabs { overflow-x: auto; }
  /* Ratio un peu moins large sur mobile (la carte est pleine largeur). Les deux
     éléments du morphing gardent le même ratio, sinon le recadrage réapparaît. */
  .project-image,
  .slider-wrap { aspect-ratio: 1.9 / 1; }
  .partner-grid { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
}

/* ============ TRANSITIONS DE PAGE (Turbo + View Transitions API) ============
   Turbo lit <meta name="turbo-view-transition" content="same-origin"> et pose
   data-turbo-visit-direction sur <html> (forward | back | none).
   Navigateurs sans View Transitions API : bascule instantanée, sans dégradation. */

/* Le fondu croisé par défaut fait se chevaucher les deux pages et produit un
   gris laiteux. On le neutralise pour piloter chaque état nous-mêmes. */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* Défaut (visites « none ») : fondu vertical discret.
   L'entrante démarre presque opaque et sur une durée courte : si les deux
   pages sont simultanément translucides, le fond du document transparaît
   et produit un flash blanc au milieu de la transition. */
::view-transition-old(root) {
  animation: vt-fade-out 0.18s cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(root) {
  animation: vt-rise-in 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Aller : la page sortante recule légèrement et s'estompe, l'entrante monte
   par-dessus. La profondeur (scale) lit mieux qu'un simple glissement latéral. */
html[data-turbo-visit-direction="forward"]::view-transition-old(root) {
  animation: vt-recede 0.2s cubic-bezier(0.4, 0, 1, 1) both;
}

html[data-turbo-visit-direction="forward"]::view-transition-new(root) {
  animation: vt-rise-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Retour : mouvement inverse — l'ancienne page avance vers le lecteur et sort,
   la nouvelle revient de l'arrière-plan. */
html[data-turbo-visit-direction="back"]::view-transition-old(root) {
  animation: vt-advance 0.2s cubic-bezier(0.4, 0, 1, 1) both;
}

html[data-turbo-visit-direction="back"]::view-transition-new(root) {
  animation: vt-return 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes vt-fade-out {
  to { opacity: 0; }
}

/* Départ à 0.35 et non 0 : la page entrante est déjà largement visible quand la
   sortante finit de s'effacer, ce qui supprime le temps mort blanc entre les deux.
   Le glissement, lui, reste perceptible. */
@keyframes vt-rise-in {
  from { opacity: 0.35; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes vt-recede {
  to { opacity: 0; transform: scale(0.985); }
}

@keyframes vt-advance {
  to { opacity: 0; transform: scale(1.015); }
}

@keyframes vt-return {
  from { opacity: 0.35; transform: scale(0.994); }
  to { opacity: 1; transform: scale(1); }
}

/* ---- Entrée du texte de la fiche projet ----
   Pendant une visite Turbo, ::view-transition-new(root) est un instantané figé :
   les animations CSS portées par les éléments de la page n'y tournent pas — elles
   ne démarrent qu'une fois la transition finie, donc trop tard, et le texte
   apparaît d'un bloc. Les blocs de texte sont donc nommés : le navigateur leur
   crée un groupe propre, réellement animable pendant la transition. */
.project-hero .project-status { view-transition-name: proj-status; }
.project-hero h1 { view-transition-name: proj-title; }
.project-hero-loc { view-transition-name: proj-loc; }
.project-content { view-transition-name: proj-body; }

::view-transition-new(proj-status),
::view-transition-new(proj-title),
::view-transition-new(proj-loc),
::view-transition-new(proj-body) {
  animation: project-text-in 0.42s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* La version sortante ne doit pas rester superposée pendant que l'entrante monte. */
::view-transition-old(proj-status),
::view-transition-old(proj-title),
::view-transition-old(proj-loc),
::view-transition-old(proj-body) {
  animation: vt-fade-out 0.12s linear both;
}

::view-transition-new(proj-status) { animation-delay: 0.14s; }
::view-transition-new(proj-title) { animation-delay: 0.2s; }
::view-transition-new(proj-loc) { animation-delay: 0.26s; }
::view-transition-new(proj-body) { animation-delay: 0.32s; }

/* Ces groupes ne doivent pas hériter du morphing lent de l'image (0.5s) :
   ils ne se déplacent pas, ils montent sur place. */
::view-transition-group(proj-status),
::view-transition-group(proj-title),
::view-transition-group(proj-loc),
::view-transition-group(proj-body) {
  animation-duration: 0.42s;
}

/* Les captures de texte gardent leur taille propre : le recadrage `cover`
   appliqué plus bas aux images déformerait les lignes. */
::view-transition-old(proj-status),
::view-transition-new(proj-status),
::view-transition-old(proj-title),
::view-transition-new(proj-title),
::view-transition-old(proj-loc),
::view-transition-new(proj-loc),
::view-transition-old(proj-body),
::view-transition-new(proj-body) {
  position: static;
  width: auto;
  height: auto;
  object-fit: fill;
}

@keyframes project-text-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header et footer restent fixes pendant la transition : ils sont nommés,
   donc animés indépendamment de la racine (sinon ils glisseraient aussi). */
header { view-transition-name: site-header; }
footer { view-transition-name: site-footer; }

::view-transition-old(site-header),
::view-transition-new(site-header),
::view-transition-old(site-footer),
::view-transition-new(site-footer) {
  animation: none;
  mix-blend-mode: normal;
}

/* ---- Transition partagée : l'image du projet ----
   La vignette de la carte et la 1re photo de la fiche portent le même
   view-transition-name (cover-<slug>, posé côté serveur). Le navigateur
   interpole alors position et taille : la vignette « devient » la grande photo.
   C'est l'effet le plus marquant de l'ensemble. */
/* Courbe volontairement régulière (proche d'un ease-in-out doux) : la courbe
   très « expo » utilisée ailleurs parcourt 90% du trajet dans le premier tiers
   du temps, ce qui donne un déplacement saccadé sur une aussi longue distance. */
::view-transition-group(project-cover) {
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pas de fondu croisé sur l'image partagée : elle doit rester nette et
   pleinement visible pendant tout son déplacement. */
::view-transition-image-pair(project-cover) {
  isolation: none;
}

/* Les deux captures se superposent en occupant tout le groupe. Sans cela,
   chacune garde sa taille propre et s'ancre en haut à gauche : l'image semble
   alors « grandir depuis le haut » au lieu de se déplacer d'un bloc.
   `cover` + centrage garde le cadrage stable pendant tout le trajet.
   Ciblé sur le seul groupe de l'image (nom fixe `project-cover`) et non sur `*` :
   appliqué à tous les groupes, ce recadrage déformait aussi les instantanés plein
   écran (header, footer, racine) et vidait l'écran sur les visites sans image
   partagée — d'où la page blanche entre l'accueil et une page sans projet. */
::view-transition-old(project-cover),
::view-transition-new(project-cover) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Redéclaré après la règle générique : sinon `*` écraserait la durée de root. */
::view-transition-group(root) {
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }

  /* Les pseudo-éléments de view transition ne sont pas atteints par `*` */
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ============ BANDEAU COOKIES (JanVince.SmallGDPR) ============
   Le plugin expose toute sa palette en variables --sg-*. On les remappe
   sur les couleurs SwissStone plutôt que de modifier le CSS du plugin,
   qui serait écrasé à la prochaine mise à jour. Le reste du bloc réaligne
   les formes (angles droits, boutons capitales) sur le reste du site. */
:root {
  --sg-bg: var(--ink);
  --sg-text: var(--paper);
  --sg-text-muted: #B7BBC7;
  /* Bouton principal : même couple que .btn-primary du site (9.77:1 sur --ink) */
  --sg-primary: #B8C4D6;
  --sg-primary-hover: var(--white);
  --sg-primary-text: var(--ink);
  --sg-border: rgba(245,243,240,0.16);
  --sg-border-hover: rgba(245,243,240,0.55);
  --sg-glyph-bg: rgba(184,196,214,0.12);
  /* Le site n'utilise aucun arrondi sur ses blocs et boutons */
  --sg-radius: 0;
  --sg-radius-pill: 0;
  --sg-shadow: 0 18px 48px -12px rgba(22,27,38,0.55);
}

#cookies-bar.cookies-bar,
.sg-dialog,
.cookies-manage {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
}

#cookies-bar.cookies-bar .title,
.sg-dialog__title,
.cookies-manage__title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Boutons : reprise du gabarit .btn du thème (capitales, interlettrage large) */
#cookies-bar.cookies-bar .buttons a,
.sg-dialog__footer a,
.cookies-manage .btn-primary {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 13px 26px;
  transition: all 0.25s ease;
}

#cookies-bar.cookies-bar .btn-settings {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* En dessous de 640px les deux boutons se partagent la largeur : l'interlettrage
   des capitales faisait passer « Tout accepter » sur deux lignes. */
@media (max-width: 640px) {
  #cookies-bar.cookies-bar .buttons a {
    padding: 13px 12px;
    letter-spacing: 0.03em;
    white-space: nowrap;
  }
}

/* Cases à cocher : angles droits comme le reste des éléments de formulaire */
.list-cookies .form-check-input {
  border-radius: 0;
}

.sg-dialog::backdrop {
  background: rgba(22,27,38,0.6);
}

/* Le plugin fixe une largeur sur le <dialog> sans rétablir `margin: auto`,
   que la feuille de l'agent utilisateur annule dès qu'une largeur est posée :
   la modale se colle alors en haut à gauche. On la recentre. */
.sg-dialog[open] {
  margin: auto;
}

/* Page /gdpr : la liste s'affiche sur fond clair, on repasse en encre sombre */
.cookies-manage {
  --sg-list-label: var(--ink);
  --sg-list-muted: var(--stone);
  --sg-list-border: var(--line);
  --sg-list-input-bg: var(--white);
  --sg-primary-text: var(--white);
  --sg-primary: var(--ink);
  --sg-primary-hover: #2C3548;
}

/* ============ PAGES LÉGALES (confidentialité, mentions légales) ============ */
.legal-prose {
  max-width: 720px;
}

.legal-updated {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--stone);
  padding-bottom: 28px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--line);
}

.legal-prose h2 {
  font-size: 24px;
  margin-top: 52px;
  margin-bottom: 18px;
}

.legal-prose h2:first-of-type { margin-top: 0; }

.legal-prose h3 {
  font-size: 17px;
  margin-top: 32px;
  margin-bottom: 12px;
}

.legal-prose p {
  margin-bottom: 18px;
  line-height: 1.8;
}

.legal-prose ul {
  margin: 0 0 18px;
  padding-left: 20px;
}

.legal-prose li {
  margin-bottom: 10px;
  line-height: 1.8;
}

.legal-prose strong { font-weight: 500; }

.legal-prose a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

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

/* Encart de gestion des cookies inséré dans le corps de la page */
.legal-cookies-manage {
  margin: 36px 0 44px;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--line);
}

/* Le composant porte son propre titre h2 ; il ferait doublon dans l'encart. */
.legal-cookies-manage .cookies-manage__title { display: none; }

.legal-cookies-manage .cookies-manage .list-cookies { margin-top: 0; }

@media (max-width: 640px) {
  .legal-cookies-manage { padding: 24px 20px; }
  .legal-prose h2 { font-size: 21px; margin-top: 42px; }
}

/* ============ PAGE 404 ============ */
/* Pas de fil d'Ariane ici : l'URL demandée n'existe pas, il n'y a donc pas de
   position réelle dans l'arborescence. Le hero compense le header fixe. */
.error-hero {
  padding-top: 152px;
  padding-bottom: 88px;
}

.error-code {
  font-family: 'Fraunces', serif;
  font-size: clamp(80px, 15vw, 168px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
  color: rgba(245,243,240,0.09);
  margin-bottom: 12px;
}

.error-hero h1 em {
  font-style: normal;
  color: var(--stone);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

/* Suggestions de navigation */
.error-links h2 {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: var(--stone);
  margin-bottom: 28px;
}

.error-links-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}

.error-link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding-left: 20px;
  transition: background 0.25s ease, padding-left 0.25s ease;
}

.error-link:first-child { padding-left: 0; }
.error-link:last-child { border-right: none; }

.error-link:hover {
  background: var(--white);
  padding-left: 28px;
}

.error-link:first-child:hover { padding-left: 8px; }

.error-link-num {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--gold);
  flex-shrink: 0;
}

.error-link-label {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 500;
}

@media (max-width: 860px) {
  .error-links-grid { grid-template-columns: repeat(2, 1fr); }
  .error-link:nth-child(2n) { border-right: none; }
  .error-link:nth-child(odd) { padding-left: 0; }
  .error-link:nth-child(odd):hover { padding-left: 8px; }
}

@media (max-width: 560px) {
  .error-hero { padding-top: 128px; }
  .error-links-grid { grid-template-columns: 1fr; }
  .error-link { border-right: none; padding-left: 0; }
  .error-link:hover { padding-left: 8px; }
  .error-actions .btn { width: 100%; }
}
