/* Renov and Paint, feuille de style commune */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque.woff2") format("woff2-variations"),
       url("/assets/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --wall: #F4F5F2;
  --paper: #FFFFFF;
  --ink: #14232B;
  --muted: #4B5D66;
  --deep: #1E5A78;
  --paint: #9FD3E6;
  --line: #D8DDD8;
  --sw-interieur: #C9D6C3;
  --sw-exterieur: #9FD3E6;
  --sw-amenagement: #7FA27A;
  --sw-materiel: #E2B85C;
  --font: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
p { margin: 0 0 1em; }

a { color: var(--deep); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--deep); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.5rem 1rem; z-index: 10; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* En-tête */
.site-header { border-bottom: 1px solid var(--line); background: var(--wall); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.5rem;
}
.brand {
  font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none;
  background-image: linear-gradient(var(--paint), var(--paint));
  background-repeat: no-repeat; background-position: 0 85%; background-size: 100% 0.38em;
  padding: 0 0.06em;
}

.menu-toggle {
  display: none; font: inherit; font-weight: 600; color: var(--ink);
  background: none; border: 1px solid var(--ink); border-radius: 4px;
  padding: 0.35rem 0.9rem; cursor: pointer;
}

.nav ul { list-style: none; margin: 0; padding: 0; }
.nav > ul { display: flex; gap: 0.25rem; }
.nav li { position: relative; }
.nav a { text-decoration: none; color: var(--ink); }
.nav > ul > li > a {
  display: block; padding: 0.6rem 0.8rem; font-weight: 600; font-size: 0.98rem; border-radius: 4px;
}
.nav > ul > li > a:hover, .nav > ul > li > a[aria-current="page"] { background: var(--paper); }
.nav .sub {
  position: absolute; top: 100%; left: 0; min-width: 15rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.4rem; box-shadow: 0 12px 28px rgba(20, 35, 43, 0.12);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s; z-index: 5;
}
.nav li:hover > .sub, .nav li:focus-within > .sub { opacity: 1; visibility: visible; transform: none; }
.nav .sub a { display: block; padding: 0.5rem 0.7rem; border-radius: 4px; font-size: 0.95rem; }
.nav .sub a:hover { background: var(--wall); }

@media (max-width: 880px) {
  .menu-toggle { display: inline-block; }
  .site-header .wrap { flex-wrap: wrap; }
  .nav { display: none; width: 100%; padding-bottom: 1rem; }
  .nav.open { display: block; }
  .nav > ul { flex-direction: column; gap: 0; }
  .nav .sub {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; background: none; padding: 0 0 0.4rem 0.8rem; min-width: 0;
  }
  .nav .sub a { padding: 0.35rem 0.7rem; color: var(--muted); }
}

/* Accueil : introduction */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 4vw, 3rem); }
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4.4rem); font-weight: 800; max-width: 16ch;
  font-variation-settings: "opsz" 96;
}
.stroke {
  background-image: linear-gradient(var(--paint), var(--paint));
  background-repeat: no-repeat; background-position: 0 88%; background-size: 100% 0.36em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  animation: roll 1.1s cubic-bezier(.65, .05, .25, 1) 0.2s both;
}
@keyframes roll { from { background-size: 0% 0.36em; } to { background-size: 100% 0.36em; } }
.hero .lead { margin-top: 1.5rem; max-width: 38rem; font-size: clamp(1.08rem, 1.6vw, 1.22rem); color: var(--muted); }
.hero-img { margin-top: clamp(2rem, 4vw, 3rem); }
.hero-img img {
  width: 100%; aspect-ratio: 16 / 7; object-fit: cover; object-position: center 40%; border-radius: 6px;
}

/* Accueil : rubriques */
.rubrique { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--line); }
.rubrique .wrap {
  display: grid; grid-template-columns: 5fr 7fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
}
.rubrique:nth-of-type(even) .wrap { grid-template-columns: 7fr 5fr; }
.rubrique:nth-of-type(even) .rubrique-img { order: 2; }
.rubrique-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.rubrique-text { max-width: 36rem; }
.rubrique h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 750; margin-bottom: 1rem; }
.rubrique h2 a { color: var(--ink); text-decoration: none; }
.rubrique h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.swatch {
  display: inline-block; width: 0.9em; height: 0.9em; border-radius: 2px;
  margin-right: 0.45em; vertical-align: -0.05em; box-shadow: inset 0 0 0 1px rgba(20, 35, 43, 0.12);
}
.sw-interieur { background: var(--sw-interieur); }
.sw-exterieur { background: var(--sw-exterieur); }
.sw-amenagement { background: var(--sw-amenagement); }
.sw-materiel { background: var(--sw-materiel); }

.pages { list-style: none; margin: 1.25rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.pages li { border-bottom: 1px solid var(--line); }
.pages a {
  display: block; padding: 0.7rem 0; font-weight: 600; color: var(--ink); text-decoration: none;
}
.pages a:hover { color: var(--deep); text-decoration: underline; }

@media (max-width: 760px) {
  .rubrique .wrap, .rubrique:nth-of-type(even) .wrap { grid-template-columns: 1fr; }
  .rubrique:nth-of-type(even) .rubrique-img { order: 0; }
}

/* Encadré éditorial */
.note { padding: clamp(2.5rem, 6vw, 4rem) 0; background: var(--paper); border-top: 1px solid var(--line); }
.note .wrap > div { max-width: 44rem; }
.note h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 750; margin-bottom: 1.1rem; }

/* Pied de page */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; font-size: 0.95rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.site-footer p { margin: 0; max-width: 28rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.site-footer a { color: var(--muted); }
.site-footer .copy { width: 100%; font-size: 0.875rem; }

@media (prefers-reduced-motion: reduce) {
  .stroke { animation: none; }
  .nav .sub { transition: none; }
}

/* Pages intérieures */
.page-head { padding: clamp(2rem, 5vw, 3.5rem) 0 0; }
.breadcrumb { font-size: 0.9rem; color: var(--muted); margin-bottom: 1.2rem; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.breadcrumb li + li::before { content: "/"; margin-right: 0.3rem; color: var(--line); }
.breadcrumb a { color: var(--muted); }
.page-head h1 {
  font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; max-width: 20ch;
  font-variation-settings: "opsz" 96;
}
.page-head .lead { margin-top: 1.2rem; max-width: 40rem; font-size: clamp(1.05rem, 1.5vw, 1.18rem); color: var(--muted); }
.page-img { margin-top: clamp(1.5rem, 3vw, 2.5rem); }
.page-img img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 6px; }

.prose { max-width: 42rem; padding: clamp(2rem, 4vw, 3rem) 0 clamp(2.5rem, 5vw, 4rem); }
.prose h2 { font-size: clamp(1.35rem, 2.2vw, 1.65rem); font-weight: 750; margin: 2.2rem 0 0.8rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2rem; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--deep); }
.prose strong { font-weight: 700; }

.subpages { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-width: 52rem; }
.subpages li { border-bottom: 1px solid var(--line); }
.subpages a {
  display: grid; grid-template-columns: 9rem 1fr; gap: 1.25rem; align-items: center;
  padding: 1.1rem 0; text-decoration: none; color: var(--ink);
}
.subpages img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.subpages strong { display: block; font-size: 1.15rem; margin-bottom: 0.2rem; }
.subpages span { color: var(--muted); font-size: 0.98rem; }
.subpages a:hover strong { color: var(--deep); text-decoration: underline; }
@media (max-width: 520px) { .subpages a { grid-template-columns: 6rem 1fr; gap: 0.9rem; } }

.related { background: var(--paper); border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; }
.related h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.8rem; }
.related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem 1.8rem; }
.related a { font-weight: 600; }
.prose .subpages { padding-left: 0; margin-top: 0.5rem; }
.prose .subpages li { margin-bottom: 0; }
