/* Aureïa — feuille de styles globale
   Palette autour de #6e0000 ; thèmes clair / sépia / sombre */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&display=swap");

:root {
  --brand: #6e0000;
  --brand-soft: #8a2a2a;
  --brand-ink: #3d0000;
  --accent: #a67c52;
  --bg: #f3eee6;
  --bg-elevated: #faf7f2;
  --bg-muted: #e8e0d4;
  --bg-pattern: rgba(110, 0, 0, 0.04);
  --text: #2a221c;
  --text-muted: #5c534a;
  --border: #d4c8b8;
  --placeholder: #c5bbb0;
  --focus: #6e0000;
  --shadow: 0 1px 0 rgba(42, 34, 28, 0.06);
  --radius: 2px;
  --font-brand: "Cormorant Garamond", "Palatino Linotype", Palatino, serif;
  --font-body: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", serif;
  --pad: clamp(1rem, 3.5vw, 2.5rem);
  --measure: 50rem;
  --nav-gap: 1.25rem;
  --transition: 180ms ease;
}

/* Lecture intermédiaire : papier chaud, luminosité entre clair et sombre */
[data-theme="sepia"] {
  --brand: #6e0000;
  --brand-soft: #8a2a2a;
  --brand-ink: #6e0000;
  --accent: #8b6840;
  --bg: #cbb99a;
  --bg-elevated: #e5d8c0;
  --bg-muted: #b8a584;
  --bg-pattern: rgba(110, 0, 0, 0.07);
  --text: #2a221c;
  --text-muted: #322c24;
  --border: #a89478;
  --placeholder: #9a8b74;
  --focus: #6e0000;
  --shadow: 0 1px 0 rgba(42, 34, 28, 0.1);
}

[data-theme="dark"] {
  --brand: #c45a5a;
  --brand-soft: #a84848;
  --brand-ink: #f0d8d8;
  --accent: #c4a57a;
  --bg: #1a1614;
  --bg-elevated: #24201c;
  --bg-muted: #2e2924;
  --bg-pattern: rgba(196, 90, 90, 0.06);
  --text: #ebe4da;
  --text-muted: #b0a598;
  --border: #3f3832;
  --placeholder: #4a433c;
  --focus: #c45a5a;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color var(--transition), color var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--transition);
}

a:hover {
  color: var(--brand-soft);
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 1000;
  padding: 0.5rem 0.85rem;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top var(--transition);
}

.skip-link:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.site-wrap {
  width: 100%;
  max-width: none;
  padding-inline: var(--pad);
  margin-inline: auto;
}

/* Colonne de lecture centrée — référence unique.
   À poser sur un wrapper ou <article>, jamais sur main.site-wrap. */
.prose {
  max-width: var(--measure);
  margin-inline: auto;
  width: 100%;
}

/* ——— Header / brand ——— */

.site-header {
  position: relative;
  z-index: 100;
  padding: 1.75rem 0 0;
  animation: rise 0.7s ease both;
}

.brand-block {
  text-align: center;
  margin-bottom: 1.25rem;
}

.brand-block a {
  text-decoration: none;
  color: inherit;
}

.brand-name {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(2.75rem, 8vw, 4.25rem);
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--brand);
  margin: 0;
}

.brand-slogan {
  font-family: var(--font-brand);
  font-weight: 500;
  font-style: normal;
  font-size: 2rem;
  opacity: 0.85;
  color: var(--text-muted);
  margin: 0.65rem 0 0;
  max-width: 28em;
  margin-inline: auto;
}

/* ——— Navigation (3 niveaux) ——— */

.site-nav {
  width: 100%;
  margin: 0;
  border-block: 1px solid var(--border);
  background: var(--bg-elevated);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-level-0 {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  padding: 0;
}

.nav-level-0 > li {
  position: relative;
  display: flex;
  align-items: stretch;
}

.nav-has-children {
  position: relative;
}

.nav-level-0 > li > a,
.nav-level-0 > li > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 0.85rem;
  font-family: var(--font-body);
  font-size: 1.3rem;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  min-height: 100%;
}
.nav-level-0 > li > a:hover,
.nav-level-0 > li > a[aria-current="page"],
.nav-has-children.is-open > a,
.nav-has-children:hover > a,
.nav-has-children:focus-within > a {
  color: var(--brand);
}

.nav-home svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

/* Sous-menus : hover + .is-open (clic) */
.nav-level-1,
.nav-level-2 {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 14rem;
  margin: 0;
  padding: 0.35rem 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 60;
}

/* Pont de survol sous le déclencheur */
.nav-has-children > .nav-level-1::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.75rem;
  height: 0.9rem;
}

.nav-has-children:hover > .nav-level-1,
.nav-has-children:focus-within > .nav-level-1,
.nav-has-children.is-open > .nav-level-1,
.nav-level-1 > .nav-has-children:hover > .nav-level-2,
.nav-level-1 > .nav-has-children:focus-within > .nav-level-2,
.nav-level-1 > .nav-has-children.is-open > .nav-level-2 {
  display: block;
}

.nav-level-1 > li,
.nav-level-2 > li {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
}

.nav-level-1 a,
.nav-level-2 a {
  display: block;
  width: 100%;
  padding: 0.7rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
  box-sizing: border-box;
  font-size: 1.3rem;
}

.nav-level-1 a:hover,
.nav-level-1 a:focus,
.nav-level-2 a:hover,
.nav-level-2 a:focus {
  background: var(--bg-muted);
  color: var(--brand);
}

.nav-level-2 {
  left: 100%;
  top: 0;
  padding-top: 0.35rem;
  margin-top: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 0.5rem;
  margin-left: 0.25rem;
  padding: 0 0.75rem;
  border-left: 1px solid var(--border);
}

.lang-switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  line-height: 0;
  flex-shrink: 0;
}

/* Cadre 3:2 identique ; drapeaux dessinés au même ratio */
.lang-switch-btn img,
.lang-switch-menu img,
.lang-flag {
  width: 2.25rem;
  height: 1.5rem;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  border: none;
  flex-shrink: 0;
  display: block;
}

.lang-switch-menu {
  display: none;
  position: absolute;
  left: 50%;
  right: auto;
  top: calc(100% + 0.2rem);
  transform: translateX(-50%);
  width: 3rem;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 70;
}

.lang-switch.is-open .lang-switch-menu {
  display: block;
}

.lang-switch-menu li {
  display: flex;
  justify-content: center;
}

.lang-switch-menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 1.5rem;
  padding: 0;
  margin: 0.2rem auto;
  text-decoration: none;
  color: var(--text);
  line-height: 0;
}

.lang-switch-menu a:hover {
  outline: 1px solid var(--border);
  outline-offset: 2px;
}

.nav-actions .theme-toggle {
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  min-height: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
}

.nav-actions .theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.nav-actions .theme-toggle .icon-sun,
.nav-actions .theme-toggle .icon-dusk,
.nav-actions .theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .nav-actions .theme-toggle .icon-sun,
:root:not([data-theme]) .nav-actions .theme-toggle .icon-sun {
  display: block;
}

[data-theme="sepia"] .nav-actions .theme-toggle .icon-dusk {
  display: block;
}

[data-theme="dark"] .nav-actions .theme-toggle .icon-moon {
  display: block;
}

/* ——— Main ——— */

main {
  position: relative;
  z-index: 1;
  padding: 5rem 0 3.5rem;
  animation: rise 0.85s ease 0.08s both;
}

.page-title {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(2.5rem, 4vw, 2.75rem);
  color: var(--brand);
  margin: 0 0 1.25rem;
  line-height: 1.15;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

h2 {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(2rem, 3.5vw, 2.2rem);
  color: var(--brand-ink);
  margin: 2rem 0 0.75rem;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

h3 {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.5vw, 1.75rem);
  margin: 1.25rem 0 0.5rem;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

h4, h5 {
  font-family: var(--font-brand);
  font-weight: 600;
  margin: 1rem 0 0.4rem;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

p {
  margin: 0 0 1rem;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.lead {
  font-size: 1.12rem;
  color: var(--text-muted);
}

/* Blocs déjà centrés : ne pas hériter du justify */
.brand-name,
.brand-slogan,
.tile--stack h2,
.tile--stack p,
.triptych-item h2,
.triptych-item p,
.tile-body h2,
.tile-body p,
.placeholder-box p {
  text-align: center;
  -webkit-hyphens: manual;
  hyphens: manual;
}

/* ——— Tuiles : contrat commun ———
   Grille : .tile-grid (alias .triptych, .article-grid)
   Tuile  : .tile      (alias .triptych-item, .article-card)
   Variantes : pile centrée (piliers / œuvres) | média+corps (articles)
*/

.tile-grid,
.triptych,
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 1.25rem 0 1.75rem;
  align-items: stretch;
}

.triptych {
  gap: 1.75rem;
  margin: 3rem 0 2.5rem;
}

.tile,
.triptych-item,
.article-card {
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

/* Variante pile (accueil piliers, page Œuvres) */
.tile--stack,
.triptych-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  padding: 1.25rem 0.75rem 1.5rem;
  animation: rise 0.8s ease both;
}

.triptych-item:nth-child(2),
.tile-grid > .tile--stack:nth-child(2) {
  animation-delay: 0.1s;
}

.triptych-item:nth-child(3),
.tile-grid > .tile--stack:nth-child(3) {
  animation-delay: 0.2s;
}

/* Corps de tuile : occupe l’espace libre et centre son contenu */
.tile-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  min-height: 0;
}

.tile--stack h2,
.triptych-item h2,
.tile-body h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.symbol {
  width: 6rem;
  height: 6rem;
  margin: 0 auto 1rem;
  flex-shrink: 0;
}

.symbol img,
.symbol svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.tile--stack p,
.triptych-item p,
.tile-body p {
  color: var(--text-muted);
  max-width: 22em;
  margin-inline: auto;
}

/* Bouton hors du corps centré → aligné en bas des colonnes */
.tile--stack > .btn,
.triptych-item > .btn,
.tile-action {
  margin-top: 0.75rem;
  align-self: center;
  flex-shrink: 0;
}

/* Variante média + corps (vignettes d’articles) */
.tile--media,
.article-card {
  display: grid;
  grid-template-columns: 25% 75%;
  min-height: 8.5rem;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color var(--transition), transform 220ms ease;
}

.tile--media:hover,
.article-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  color: inherit;
}

.article-card-media {
  background: var(--placeholder);
  min-height: 100%;
  overflow: hidden;
}

.article-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.25rem;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
}

.article-card-title {
  font-family: var(--font-brand);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
  color: var(--brand-ink);
  flex-shrink: 0;
}

.article-card-date {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.article-card-cats {
  font-size: 0.8rem;
  color: var(--accent);
  flex-shrink: 0;
}

.article-card-excerpt {
  --excerpt-lines: 3;
  margin: 0;
  margin-top: auto;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--excerpt-lines);
  line-clamp: var(--excerpt-lines);
  overflow: hidden;
  min-height: calc(3 * 1.45em);
  flex: 0 0 auto;
}

/* ——— Buttons ——— */

.btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn:hover {
  background: var(--brand-soft);
  border-color: var(--brand-soft);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--brand);
}

.btn-ghost:hover {
  background: var(--bg-muted);
  color: var(--brand);
}

.btn-placeholder {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.section-cta {
  margin: 2rem 0;
}

html[data-page="home"] .section-cta {
  text-align: center;
  -webkit-hyphens: manual;
  hyphens: manual;
}

/* ——— Journal tools ——— */

.journal-tools {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
  text-align: start;
}

.journal-tools p {
  text-align: start;
  -webkit-hyphens: manual;
  hyphens: manual;
}

/* Titres / outils alignés sur la grille de vignettes (hors .prose) */
html[data-page="journal"] .page-title,
html[data-page="home"] #latest-heading {
  text-align: start;
  -webkit-hyphens: manual;
  hyphens: manual;
}

.search-wrap {
  position: relative;
  max-width: 28rem;
}

.search-wrap input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font: inherit;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.search-results {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  max-height: 16rem;
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  z-index: 30;
}

.search-results.is-open {
  display: block;
}

.search-results a {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.search-results a:hover {
  background: var(--bg-muted);
}

.search-results .match-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}

.category-filters label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.92rem;
  cursor: pointer;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1.5rem;
}

.pagination a,
.pagination span {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius);
}

.pagination a:hover,
.pagination [aria-current="page"] {
  border-color: var(--brand);
  color: var(--brand);
}

.empty-state {
  color: var(--text-muted);
  font-style: italic;
  padding: 1rem 0;
}

/* ——— Doctrine FAQ ——— */

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0;
}

.faq summary {
  cursor: pointer;
  font-family: var(--font-brand);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--brand-ink);
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "+";
  display: inline-block;
  width: 1.25rem;
  color: var(--brand);
  font-weight: 700;
}

.faq details[open] summary::before {
  content: "−";
}

.faq details > *:not(summary) {
  margin-top: 0.65rem;
}

.criteria-list {
  padding-left: 1.25rem;
}

.criteria-list li {
  margin-bottom: 0.45rem;
}

/* ——— Article page ——— */

.article-meta {
  margin-bottom: 1.5rem;
}

.article-meta .article-categories a {
  margin-right: 0.5rem;
}

.article-meta time {
  display: block;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

.table-des-matieres {
  margin: 2rem 0 2.5rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.table-des-matieres[hidden] {
  display: none;
}

.toc-title {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
  text-align: start;
  -webkit-hyphens: manual;
  hyphens: manual;
  color: var(--brand-ink);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-item {
  margin: 0.2rem 0;
}

.toc-item a {
  text-decoration: none;
  text-align: start;
  -webkit-hyphens: manual;
  hyphens: manual;
}

.toc-item a:hover {
  text-decoration: underline;
}

.toc-h2 {
  padding-left: 0;
  font-weight: 600;
}

.toc-h3 {
  padding-left: 1rem;
}

.toc-h4 {
  padding-left: 2rem;
  font-size: 0.95em;
}

.toc-h5 {
  padding-left: 3rem;
  font-size: 0.9em;
}

.article-body img {
  margin: 1.25rem 0;
  border: 1px solid var(--border);
}

.article-nav-related {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.related-articles-heading {
  text-align: center;
  margin: 0 0 1.25rem;
  -webkit-hyphens: manual;
  hyphens: manual;
}

.article-nav-prevnext {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  max-width: none;
}

.article-prevnext-grid {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.article-prevnext-slot {
  display: flex;
  min-width: 0;
}

.article-prevnext-slot--empty {
  visibility: hidden;
  pointer-events: none;
}

.article-prevnext-slot .article-card {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  position: relative;
}

.article-card--compact {
  min-height: 6.5rem;
}

.article-card--compact .article-card-body {
  justify-content: center;
  padding: 1.15rem 1.35rem;
  padding-inline: 2.75rem 1.35rem;
}

.article-card--prevnext-next .article-card-body {
  padding-inline: 1.35rem 2.75rem;
}

.article-prevnext-chevron {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  pointer-events: none;
  z-index: 2;
}

.article-card--prevnext-prev .article-prevnext-chevron {
  left: 0.35rem;
}

.article-card--prevnext-next .article-prevnext-chevron {
  right: 0.35rem;
}

.article-card--prevnext-next .article-prevnext-chevron svg {
  transform: scaleX(-1);
}

.article-prevnext-chevron svg {
  display: block;
  width: 1.65rem;
  height: 3.3rem;
}

@media (max-width: 720px) {
  .article-prevnext-grid {
    grid-template-columns: 1fr;
  }

  .article-prevnext-slot--empty {
    display: none;
  }
}

/* ——— Support / contact ——— */

.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.placeholder-box {
  padding: 1.5rem;
  margin: 3rem 0;
  border: 1px dashed var(--border);
  background: var(--bg-muted);
  text-align: center;
  color: var(--text-muted);
}

/* ——— Footer ——— */

.site-footer {
  position: relative;
  z-index: 100;
  margin-top: auto;
  padding: 0 0 2rem;
  border-top: 1px solid var(--border);
}

.site-footer .site-nav {
  border-top: none;
}

/* Sous-menus du footer : ouverture vers le haut */
.site-footer .nav-level-1 {
  top: auto;
  bottom: 100%;
}

.site-footer .nav-has-children > .nav-level-1::before {
  top: auto;
  bottom: -0.75rem;
}

.site-footer .nav-level-2 {
  top: auto;
  bottom: 0;
}

.footer-legal {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 1.25rem 0 0;
}

.footer-legal a {
  color: var(--text-muted);
}

/* ——— Back to top ——— */

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--brand);
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: opacity var(--transition), transform var(--transition);
  z-index: 200;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.back-to-top svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

/* ——— Motion ——— */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* ——— Responsive ——— */

@media (max-width: 900px) {
  .tile-grid,
  .triptych,
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-level-2 {
    left: 0;
    top: 100%;
  }

  .site-footer .nav-level-2 {
    top: auto;
    bottom: 100%;
  }
}

@media (max-width: 600px) {
  .tile-grid,
  .triptych,
  .article-grid,
  .split-2 {
    grid-template-columns: 1fr;
  }

  .tile--media,
  .article-card {
    grid-template-columns: 30% 70%;
  }

  .nav-actions {
    border-left: none;
    margin-left: 0;
    padding-left: 0;
    width: 100%;
    justify-content: center;
  }

  .nav-level-0 {
    gap: 0.35rem 0.85rem;
  }
}
