/*
Theme Name: Divorce en Ligne
Theme URI: https://divorce-en-ligne.fr/
Author: divorce-en-ligne.fr
Description: Thème WordPress léger, rapide et orienté SEO pour un site éditorial juridique consacré au divorce.
Version: 1.13.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
Text Domain: divorce-en-ligne
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --bg: #fcf8e9;
  --surface: #fffdf5;
  --surface-soft: rgba(255, 253, 245, .9);
  --text: #3f3a31;
  --muted: #766f61;
  --line: #d8cfbb;
  --brand: #5f5849;
  --brand-2: #80745d;
  --accent: #978a70;
  --site-max: 1840px;
  --reading: 1260px;
  --front-reading: 1500px;
  --radius: 18px;
  --shadow: 0 12px 34px rgba(72, 62, 43, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--brand-2); }
button, input, textarea, select { font: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 9999;
  background: #fff; color: #000; padding: .7rem 1rem; border-radius: 6px;
}
.skip-link:focus { left: 8px; }

/* Header intégré dans l'illustration haute. Le menu principal reste réservé aux pages du site. */
.masthead-scene {
  position: relative;
  background: var(--bg);
  isolation: isolate;
}
.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  background: transparent;
}
.admin-bar .site-header { top: 32px; }
.header-inner {
  width: min(var(--site-max), calc(100% - 36px));
  margin: auto;
  min-height: 86px;
  padding-top: 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}
.site-branding { display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 6px 2px; }
.custom-logo { max-height: 46px; width: auto; }
.branding-copy { min-width: 0; }
.site-title { margin: 0; font-size: clamp(1.28rem, 1.6vw, 1.65rem); line-height: 1.06; font-weight: 760; letter-spacing: -.02em; }
.site-title a { color: #50493c; text-decoration: none; text-shadow: 0 1px 0 rgba(255,255,255,.55), 0 2px 10px rgba(252,248,233,.4); }
.site-kicker { margin: .28rem 0 0; color: var(--muted); font-size: .82rem; line-height: 1.22; text-shadow: 0 1px 0 rgba(255,255,255,.55), 0 2px 10px rgba(252,248,233,.45); }

.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; justify-content: flex-end; }
.primary-nav a {
  display: block;
  padding: .56rem .8rem;
  color: #514b40;
  text-decoration: none;
  font-weight: 650;
  font-size: .88rem;
  border-radius: 999px;
  background: rgba(255,255,255,.32);
  border: 1px solid rgba(120,110,90,.09);
}
.primary-nav a:hover, .primary-nav .current-menu-item > a { background: rgba(255,255,255,.7); color: var(--brand-2); }
.menu-toggle { display: none; border: 1px solid rgba(120,110,90,.18); background: rgba(255,255,255,.64); color: var(--brand); padding: .52rem .75rem; border-radius: 999px; cursor: pointer; }

.site-banner { width: 100%; overflow: hidden; background: var(--bg); }
.site-banner img { width: 100%; height: auto; display: block; }

/* Sommaire fixe compact : un petit bouton permanent, une grille dense au clic, aucun défilement interne sur desktop. */
.page-toc-shell {
  position: fixed;
  top: 108px;
  right: 18px;
  z-index: 160;
  width: auto;
  margin: 0;
}
.admin-bar .page-toc-shell { top: 140px; }
.page-toc {
  width: auto;
  border: 1px solid rgba(125,113,91,.18);
  border-radius: 14px;
  background: rgba(255,253,245,.96);
  box-shadow: 0 12px 30px rgba(72,62,43,.11);
  backdrop-filter: blur(8px);
}
.page-toc summary {
  list-style: none;
  cursor: pointer;
  min-width: 122px;
  padding: 8px 10px 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #514a3d;
  user-select: none;
}
.page-toc summary::-webkit-details-marker { display: none; }
.page-toc summary::after {
  content: "＋";
  margin-left: 2px;
  font-size: .94rem;
  line-height: 1;
  color: var(--brand-2);
}
.page-toc[open] summary::after { content: "−"; }
.toc-summary-title { font-weight: 760; font-size: .82rem; letter-spacing: .01em; }
.toc-count {
  display: inline-flex;
  min-width: 24px;
  height: 20px;
  padding: 0 5px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(147,134,109,.12);
  color: var(--muted);
  font-size: .67rem;
  font-weight: 700;
}
.toc-panel {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: min(900px, calc(100vw - 36px));
  padding: 10px;
  border: 1px solid rgba(125,113,91,.16);
  border-radius: 14px;
  background: rgba(255,253,245,.985);
  box-shadow: 0 18px 42px rgba(72,62,43,.13);
}
.toc-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px 7px;
}
.toc-panel li { min-width: 0; }
.toc-panel a {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-height: 28px;
  padding: 4px 5px;
  border-radius: 7px;
  color: #5a5346;
  text-decoration: none;
  font-size: .72rem;
  line-height: 1.18;
}
.toc-panel a:hover,
.toc-panel a:focus { background: rgba(147,134,109,.1); }
.toc-number {
  flex: 0 0 auto;
  min-width: 19px;
  color: #988b72;
  font-size: .63rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  padding-top: 1px;
}

.site-main {
  width: min(var(--site-max), calc(100% - 22px));
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.content-shell { padding: 8px 0 20px; }
.content-shell-front {
  padding-top: 0;
  margin-top: -456px;
}
.reading-width { max-width: var(--reading); margin-inline: auto; }
.front-content { max-width: var(--front-reading); }

.breadcrumbs { max-width: var(--reading); margin: 14px auto 0; color: var(--muted); font-size: .84rem; }
.breadcrumbs a { color: var(--muted); }

.hero {
  background: rgba(255,253,245,.82);
  border: 1px solid rgba(125,113,91,.13);
  border-radius: 18px;
  padding: clamp(22px, 3.3vw, 40px);
  margin: 12px auto 34px;
  box-shadow: 0 9px 24px rgba(72,62,43,.04);
}
.front-hero {
  max-width: min(1080px, calc(100% - 44px));
  position: relative;
  z-index: 3;
  margin: -412px auto 330px auto;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  text-align: center;
}
.hero-inner { max-width: 980px; margin: 0 auto; }
.eyebrow { margin: 0 auto 6px; color: var(--brand-2); font-weight: 760; text-transform: uppercase; letter-spacing: .075em; font-size: .7rem; text-shadow: 0 1px 0 rgba(255,255,255,.55), 0 8px 22px rgba(252,248,233,.55); max-width: 460px; text-align: center; }

h1, h2, h3, h4 { color: #4b4539; line-height: 1.22; letter-spacing: -.014em; text-wrap: balance; }
h1 { font-size: clamp(1.72rem, 2.2vw, 2.38rem); margin: 0 0 13px; }
.front-hero h1 { text-shadow: 0 1px 0 rgba(255,255,255,.58), 0 10px 26px rgba(252,248,233,.58); max-width: 980px; margin-left: auto; margin-right: auto; font-size: clamp(1.7rem, 2.4vw, 2.6rem); line-height: 1.12; text-align: center; }
h2 { font-size: clamp(1.26rem, 1.45vw, 1.56rem); margin: 2em 0 .52em; }
h3 { font-size: clamp(1.08rem, 1.22vw, 1.28rem); margin: 1.55em 0 .46em; }
h4 { font-size: 1.03rem; margin: 1.35em 0 .4em; }
p, ul, ol, blockquote, table { margin-top: 0; margin-bottom: 1.16em; }
.entry-content > :first-child { margin-top: 0; }
.entry-content > p:first-of-type { font-size: 1.035rem; }
.entry-content ul, .entry-content ol { padding-left: 1.32em; }
.entry-content li + li { margin-top: .3em; }
.entry-content strong { color: #474236; }
.entry-content blockquote {
  margin: 1.7rem 0; padding: .95rem 1.18rem;
  border-left: 3px solid var(--accent); background: rgba(255,255,255,.4);
  border-radius: 0 9px 9px 0;
}
.entry-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; background: rgba(255,255,255,.48); }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: .68rem .78rem; text-align: left; vertical-align: top; }
.entry-content th { background: #f0eadc; }
.entry-content h2[id] { scroll-margin-top: 24px; }

.entry-header { max-width: var(--reading); margin: 0 auto 24px; }
.entry-title { margin-bottom: 10px; }
.entry-meta { color: var(--muted); font-size: .84rem; }
.entry-content { max-width: var(--reading); margin: 0 auto; }
.entry-content .alignwide { width: min(1600px, 100vw - 22px); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.entry-content .alignfull { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { background: rgba(255,255,255,.42); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 6px 20px rgba(72,62,43,.03); }
.card h2, .card h3 { margin-top: 0; }
.card a { text-decoration: none; }

.post-list { display: grid; gap: 16px; max-width: 1320px; margin: 0 auto; }
.post-item { background: rgba(255,255,255,.42); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.post-item h2 { margin: 0 0 7px; font-size: 1.28rem; }
.post-item p:last-child { margin-bottom: 0; }

.pagination { margin-top: 32px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.page-numbers { padding: .38rem .66rem; background: rgba(255,255,255,.46); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.page-numbers.current { background: var(--brand); color: #fff; border-color: var(--brand); }

.search-form { display: flex; gap: 8px; max-width: 660px; }
.search-field { flex: 1; min-width: 0; border: 1px solid #cfc6b1; border-radius: 8px; padding: .7rem .82rem; background: rgba(255,255,255,.58); }
.search-submit { border: 0; border-radius: 8px; padding: .7rem .95rem; background: var(--brand); color: #fff; cursor: pointer; }

/* Footer : texte réellement posé dans la grande zone claire de l'illustration, sans ligne de séparation. */
.site-footer {
  background: var(--bg);
  color: var(--text);
  margin-top: -210px;
  position: relative;
  z-index: 1;
}
.footer-scene {
  position: relative;
  overflow: hidden;
  min-height: 420px;
}
.footer-scene-image { width: 100%; height: auto; display: block; margin-top: -165px; }
.footer-overlay {
  position: absolute;
  inset: auto 0 4% 0;
  z-index: 2;
}
.footer-inner {
  width: min(var(--site-max), calc(100% - 36px));
  margin: auto;
  padding: 0;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 34px;
  align-items: start;
}
.footer-copy { max-width: 620px; padding: 0; }
.footer-title { color: #514a3d; margin: 0 0 5px; font-size: 1.02rem; font-weight: 760; text-shadow: 0 1px 0 rgba(255,255,255,.55), 0 2px 10px rgba(252,248,233,.4); }
.site-footer p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.45; text-shadow: 0 1px 0 rgba(255,255,255,.52), 0 2px 10px rgba(252,248,233,.35); }
.footer-copyright { margin-top: 7px !important; font-size: .75rem !important; color: #8a816f !important; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 16px; }
.footer-nav a { color: var(--brand); text-decoration: none; font-size: .83rem; display: inline-block; text-shadow: 0 1px 0 rgba(255,255,255,.45); }
.footer-nav a:hover { color: var(--brand-2); }

.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 100000; background: #fff; padding: 12px; color: #000; }

@media (max-width: 1300px) {
  :root { --reading: 1120px; --front-reading: 1260px; }
  .toc-panel { width: min(820px, calc(100vw - 32px)); }
  .toc-panel ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 950px) {
  :root { --reading: 900px; --front-reading: 930px; }
  .admin-bar .site-header { top: 46px; }
  .menu-toggle { display: inline-flex; }
  .primary-nav { display: none; position: absolute; right: 12px; top: 70px; width: min(330px, calc(100vw - 24px)); background: rgba(255,253,245,.97); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 9px; }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { display: block; }
  .primary-nav li + li { border-top: 1px solid rgba(120,110,90,.12); }
  .primary-nav a { background: transparent; border: 0; border-radius: 8px; padding: 10px 8px; }
  .site-kicker { display: none; }
  .page-toc-shell { top: 88px; right: 10px; }
  .admin-bar .page-toc-shell { top: 134px; }
  .toc-panel { width: min(700px, calc(100vw - 20px)); }
  .toc-panel ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 12px; }
  .footer-nav ul { justify-content: flex-start; }
  .footer-overlay { inset: auto 0 2%; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-inner, .site-main, .footer-inner { width: min(100% - 14px, var(--site-max)); }
  .header-inner { min-height: 66px; }
  .site-title { font-size: 1.18rem; }
  .custom-logo { max-height: 36px; }
  .content-shell-front { margin-top: -290px; }
  .page-toc-shell { top: auto; right: 9px; bottom: 12px; }
  .admin-bar .page-toc-shell { top: auto; }
  .page-toc summary { min-width: 112px; padding: 8px 9px 8px 10px; }
  .toc-panel { position: absolute; top: auto; right: 0; bottom: calc(100% + 7px); width: calc(100vw - 18px); }
  .toc-panel ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 5px; }
  .toc-panel a { font-size: .69rem; min-height: 27px; padding: 4px; }
  .hero { border-radius: 14px; padding: 21px 16px; margin-top: 8px; }
  .hero-inner { margin: 0; }
  .eyebrow { margin-left: 0; margin-right: 0; text-align: left; max-width: none; }
  .front-hero h1 { max-width: none; margin-left: 0; margin-right: 0; text-align: left; }
  .front-hero { max-width: calc(100% - 24px); margin: -188px auto 170px auto; text-align: left; }
  h1 { font-size: clamp(1.6rem, 7vw, 2.05rem); }
  h2 { font-size: clamp(1.2rem, 5vw, 1.42rem); }
  .content-shell { padding-bottom: 18px; }
  .footer-scene { min-height: auto; }
  .footer-overlay { position: static; padding: 0 0 12px; margin-top: -78px; }
  .footer-scene-image { margin-top: -72px; margin-bottom: -4px; }
  .site-footer { margin-top: -72px; }
  .site-branding { padding: 4px 2px; }
}


.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 170;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(125,113,91,.18);
  border-radius: 999px;
  background: rgba(255,253,245,.94);
  color: #514a3d;
  box-shadow: 0 10px 24px rgba(72,62,43,.12);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: rgba(255,255,255,.98);
  color: var(--brand-2);
}

@media (max-width: 640px) {
  .back-to-top {
    right: 12px;
    bottom: 68px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
