/* ==========================================================================
   unplancul.fr — « Dessous de soie »
   Reset anti-distorsion EN PREMIER (regle reseau 2026-06-17)
   ========================================================================== */

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

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

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --c-bg:      #F5E6EA;  /* rose dragee */
  --c-bg-alt:  #FFFFFF;
  --c-ink:     #2A1220;  /* aubergine */
  --c-accent:  #B3123E;  /* carmin */
  --c-muted:   #7A4E63;  /* mauve fume */
  --c-dark:    #3A1630;  /* prune */
  --c-line:    #E0C6CE;
  --c-ink-on-dark: #F7E9EC;

  --f-display: 'Bodoni Moda', 'Times New Roman', Georgia, serif;
  --f-body:    'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* echelle typographique — raison 1.25 (Elements of Typographic Style) */
  --t-xs:  0.8rem;
  --t-sm:  0.9rem;
  --t-base: 1.0625rem;
  --t-md:  1.3rem;
  --t-lg:  1.625rem;
  --t-xl:  2.05rem;
  --t-2xl: 2.6rem;
  --t-3xl: 3.25rem;
  --t-4xl: 4rem;

  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2.25rem;
  --s-5: 3.5rem;
  --s-6: 5rem;
  --s-7: 7rem;

  --w-text: 68ch;     /* mesure de lecture */
  --w-wide: 1180px;
  --gutter: 1rem;     /* 16px mobile, regle reseau */
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.7;
  font-weight: 400;
}

h1, h2, h3, h4 {
  font-family: var(--f-display);
  color: var(--c-ink);
  line-height: 1.15;
  margin: 0 0 var(--s-2);
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 5.2vw, var(--t-3xl)); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.4vw, var(--t-xl)); margin-top: var(--s-5); }
h3 { font-size: clamp(1.2rem, 2.4vw, var(--t-md)); margin-top: var(--s-4); color: var(--c-dark); }
h4 { font-size: var(--t-base); margin-top: var(--s-3); }

p { margin: 0 0 var(--s-2); }

a { color: var(--c-accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--c-dark); }

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

strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--c-line); margin: var(--s-4) 0; }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.wrap { max-width: var(--w-wide); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--text { max-width: var(--w-text); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--s-5); }
.section--alt { background: var(--c-bg-alt); }
.section--dark { background: var(--c-dark); color: var(--c-ink-on-dark); }
.section--dark h2, .section--dark h3 { color: var(--c-ink-on-dark); }
.section--dark a { color: #F0B8C6; }

/* --------------------------------------------------------------------------
   Wrappers anti-distorsion (regle reseau — jamais object-fit sur <img> seul)
   -------------------------------------------------------------------------- */
.img-hero     { aspect-ratio: 16 / 9; overflow: hidden; }
.img-card     { aspect-ratio: 3 / 2;  overflow: hidden; }
.img-body     { aspect-ratio: 3 / 2;  overflow: hidden; }
.img-portrait { aspect-ratio: 1 / 1;  overflow: hidden; border-radius: 50%; }

.img-hero img, .img-card img, .img-body img, .img-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* --------------------------------------------------------------------------
   Feston de dentelle — LA signature du site (seul ornement)
   -------------------------------------------------------------------------- */
.feston {
  display: block;
  width: 100%;
  height: 26px;
  color: var(--c-bg);        /* la couleur = le fond qu'on vient « poser » */
  margin: 0;
  pointer-events: none;
}
.feston--alt  { color: var(--c-bg-alt); }
.feston--dark { color: var(--c-dark); }
.feston svg { display: block; width: 100%; height: 100%; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: 68px;
}
.brand {
  font-family: var(--f-display);
  font-size: var(--t-md);
  font-weight: 700;
  color: var(--c-ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand span { color: var(--c-accent); }

.nav { display: flex; gap: var(--s-3); align-items: center; }
.nav a {
  color: var(--c-ink);
  text-decoration: none;
  font-size: var(--t-sm);
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current='page'] {
  color: var(--c-accent);
  border-bottom-color: var(--c-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--c-line);
  border-radius: 3px;
  padding: 0.45rem 0.6rem;
  color: var(--c-ink);
  font-size: var(--t-sm);
  cursor: pointer;
}

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    inset: 68px 0 auto;
    background: var(--c-bg-alt);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--s-2) var(--gutter);
    border-bottom: 1px solid var(--c-line);
    display: none;
  }
  .nav[data-open='true'] { display: flex; }
  .nav a { padding-block: 0.7rem; border-bottom: 1px solid var(--c-line); }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { position: relative; background: var(--c-dark); }
.hero__media { position: relative; }
.hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(42,18,32,.84) 0%, rgba(42,18,32,.5) 46%, rgba(42,18,32,.12) 100%);
}
.hero__inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
}
.hero__text { max-width: 36rem; color: #FFF6F8; padding-inline: var(--gutter); }
.hero__text h1 { color: #FFF6F8; margin-bottom: var(--s-2); }
.hero__text p {
  font-size: clamp(1rem, 1.9vw, var(--t-md));
  color: #F3DDE2;
  margin-bottom: 0;
  max-width: 30rem;
}
.hero__feston { position: absolute; left: 0; right: 0; bottom: -1px; }

/* Texte a droite quand le sujet de la photo occupe la gauche */
.hero__text--right { margin-left: auto; }
.hero--right .hero__media::after {
  background: linear-gradient(260deg, rgba(42,18,32,.84) 0%, rgba(42,18,32,.5) 46%, rgba(42,18,32,.12) 100%);
}

@media (max-width: 760px) {
  .hero__media::after,
  .hero--right .hero__media::after {
    background: linear-gradient(180deg, rgba(42,18,32,.35) 0%, rgba(42,18,32,.88) 68%);
  }
  .hero__text--right { margin-left: 0; }
  .hero__inner { align-items: flex-end; padding-bottom: var(--s-4); }
  .img-hero { aspect-ratio: 4 / 5; }
}

/* Hero compact des pages de pilier */
.hero--pilier .img-hero { aspect-ratio: 21 / 9; }
@media (max-width: 760px) { .hero--pilier .img-hero { aspect-ratio: 3 / 2; } }

/* --------------------------------------------------------------------------
   Cards — haut en arche (rappel discret du feston)
   -------------------------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-3);
  list-style: none;
  margin: 0;
  padding: 0;
}
.card {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-line);
  border-radius: 10rem 10rem 4px 4px / 3.2rem 3.2rem 4px 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card .img-card { border-radius: inherit; border-end-start-radius: 0; border-end-end-radius: 0; }
.card__body { padding: var(--s-2) var(--s-3) var(--s-3); display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  font-size: var(--t-xs);
  color: var(--c-muted);
}
.card__cat { color: var(--c-accent); font-weight: 600; }
.card__date { font-variant-numeric: tabular-nums; }
.card__title {
  font-family: var(--f-display);
  font-size: var(--t-md);
  line-height: 1.22;
  margin: 0;
  font-weight: 600;
}
.card__title a { color: var(--c-ink); text-decoration: none; }
.card__title a:hover { color: var(--c-accent); }
.card__summary { font-size: var(--t-sm); color: var(--c-muted); margin: 0; }

/* --------------------------------------------------------------------------
   Corps d'article
   -------------------------------------------------------------------------- */
.article-body { max-width: var(--w-text); margin-inline: auto; }
.article-body > * { max-width: 100%; }
.article-body p,
.article-body li { font-size: var(--t-base); }

.article-meta {
  font-size: var(--t-sm);
  color: var(--c-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: baseline;
  margin-bottom: var(--s-3);
}
.article-meta time { font-variant-numeric: tabular-nums; }

/* Listes — puces explicites (plusieurs sites du reseau n'en avaient aucune) */
.article-body ul,
.article-body ol { padding-left: 1.4rem; margin: 0 0 var(--s-2); }
.article-body ul { list-style: disc; }
.article-body ul ul { list-style: circle; margin-top: 0.3rem; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 0.45rem; }
.article-body li::marker { color: var(--c-accent); }

/* Tableaux — styles explicites (dette reseau recurrente) */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s-3) 0;
  font-size: var(--t-sm);
  display: block;
  overflow-x: auto;
}
.article-body thead th {
  background: var(--c-dark);
  color: var(--c-ink-on-dark);
  font-family: var(--f-body);
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 0.8rem;
}
.article-body tbody td {
  border-bottom: 1px solid var(--c-line);
  padding: 0.6rem 0.8rem;
  vertical-align: top;
}
.article-body tbody tr:nth-child(even) { background: #FBF2F4; }

.article-body blockquote {
  margin: var(--s-3) 0;
  padding: 0.2rem 0 0.2rem var(--s-2);
  border-left: 3px solid var(--c-accent);
  font-family: var(--f-display);
  font-size: var(--t-md);
  line-height: 1.45;
  color: var(--c-dark);
}
.article-body blockquote p:last-child { margin-bottom: 0; }

.article-body code {
  background: #FBF2F4;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.92em;
}

/* Figures et legendes — figcaption TOUJOURS visible et style */
.article-body figure { margin: var(--s-4) 0; }
.article-body figure .img-body { border-radius: 4px; }
.article-body figcaption,
figcaption {
  display: block;
  position: static;
  margin-top: 0.6rem;
  font-size: var(--t-xs);
  line-height: 1.5;
  color: var(--c-muted);
  font-style: italic;
  padding-left: 0.7rem;
  border-left: 2px solid var(--c-line);
}

/* Sommaire — la classe .article-sommaire est exigee par le hook reseau */
.article-sommaire {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-line);
  border-radius: 4px;
  padding: var(--s-2) var(--s-3);
  margin: var(--s-3) 0 var(--s-4);
  font-size: var(--t-sm);
}
.article-sommaire > p,
.article-sommaire__titre,
.article-sommaire strong {
  font-family: var(--f-display);
  font-size: var(--t-base);
  font-weight: 600;
  margin-top: 0;
}
.article-sommaire__titre { color: var(--c-dark); }
.article-sommaire ol { margin-bottom: 0; }
.article-sommaire a { text-decoration: none; }
.article-sommaire a:hover { text-decoration: underline; }

/* Bloc « A lire aussi » — classe exigee par le hook maillage */
.article-nav-related {
  margin: var(--s-4) 0;
  padding: var(--s-2) var(--s-3);
  background: #FBF2F4;
  border-left: 3px solid var(--c-accent);
  border-radius: 0 4px 4px 0;
  font-size: var(--t-sm);
}
.article-nav-related ul { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.faq { max-width: var(--w-text); margin-inline: auto; }
.faq details {
  border-bottom: 1px solid var(--c-line);
  padding: var(--s-2) 0;
}
.faq summary {
  cursor: pointer;
  font-family: var(--f-display);
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--c-dark);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--s-2);
  align-items: baseline;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  color: var(--c-accent);
  font-family: var(--f-body);
  font-weight: 400;
  flex: none;
}
.faq details[open] summary::after { content: '–'; }
.faq details > p { margin-top: var(--s-1); margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Filtre de categorie du blog
   -------------------------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--s-4);
  padding: 0;
  list-style: none;
}
.filters button {
  font-family: var(--f-body);
  font-size: var(--t-sm);
  background: transparent;
  color: var(--c-ink);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  cursor: pointer;
}
.filters button:hover { border-color: var(--c-accent); color: var(--c-accent); }
.filters button[aria-pressed='true'] {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #FFF;
}
.card[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Formulaire
   -------------------------------------------------------------------------- */
.form { max-width: 34rem; display: grid; gap: var(--s-2); }
.form label { font-size: var(--t-sm); font-weight: 600; display: grid; gap: 0.35rem; }
.form input, .form textarea {
  font-family: var(--f-body);
  font-size: var(--t-base);
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--c-line);
  border-radius: 3px;
  background: var(--c-bg-alt);
  color: var(--c-ink);
  width: 100%;
}
.form textarea { min-height: 9rem; resize: vertical; }
.btn {
  font-family: var(--f-body);
  font-size: var(--t-base);
  font-weight: 600;
  background: var(--c-accent);
  color: #FFF;
  border: 1px solid var(--c-accent);
  border-radius: 3px;
  padding: 0.7rem 1.6rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  justify-self: start;
}
.btn:hover { background: var(--c-dark); border-color: var(--c-dark); color: #FFF; }
.form__status { font-size: var(--t-sm); margin: 0; }
.form__status[data-state='ok'] { color: #1C6B3A; }
.form__status[data-state='err'] { color: var(--c-accent); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--c-dark);
  color: var(--c-ink-on-dark);
  padding-block: var(--s-5) var(--s-3);
  font-size: var(--t-sm);
}
.site-footer a { color: #F0B8C6; }
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--s-3);
}
.site-footer h2 {
  font-size: var(--t-base);
  margin: 0 0 var(--s-1);
  color: var(--c-ink-on-dark);
  font-family: var(--f-body);
  font-weight: 600;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.site-footer__legal {
  margin-top: var(--s-4);
  padding-top: var(--s-2);
  border-top: 1px solid rgba(247,233,236,.22);
  color: #D8B6C0;
}
.adults-only {
  display: inline-block;
  border: 1px solid #F0B8C6;
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-size: var(--t-xs);
  font-weight: 600;
  color: #F0B8C6;
  margin-bottom: var(--s-1);
}

/* --------------------------------------------------------------------------
   Utilitaires
   -------------------------------------------------------------------------- */
.lede {
  font-size: clamp(1.1rem, 2vw, var(--t-md));
  line-height: 1.55;
  color: var(--c-dark);
  max-width: 38rem;
}
.pilier-intro { max-width: var(--w-text); margin-inline: auto; }
.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--c-accent);
  color: #FFF;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: var(--gutter); top: 0.5rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
