/* ==========================================================================
   Benoit Diagne — Diététicien
   Design tokens repris de l'interface Contrepoids
   ========================================================================== */

:root {
  /* Palette — jetons Contrepoids */
  --brand:        #C0781A;                  /* ocre de marque */
  --brand-ink:    #0E2A28;                  /* texte sur fond ocre */
  --ocre:         #B26E27;
  --bleuvert:     #0E2F29;
  --ivoire:       #E1DACC;
  --charbon:      #1D1D1D;

  --ink:          #2B2B28;
  --ink-soft:     #5C5B54;
  --ink-mute:     #85837A;
  --accent:       #D89038;
  --accent-deep:  #854F0C;
  --surface:      #EDE5D9;
  --surface-alt:  #F1EAE0;
  --paper:        #FBF8F4;
  --line:         #D9CFC0;
  --error:        #b00020;

  /* Typographie */
  --display: "Sora", "Inter", system-ui, sans-serif;
  --body:    "Manrope", "Inter", system-ui, sans-serif;

  /* Échelle modulaire 1.25 */
  --t-xs:   0.8rem;
  --t-sm:   0.9375rem;
  --t-base: 1.0625rem;
  --t-md:   1.1875rem;
  --t-lg:   1.5rem;
  --t-xl:   2rem;
  --t-2xl:  2.75rem;
  --t-3xl:  3.75rem;

  /* Rythme */
  --gap:      1rem;
  --gap-lg:   2rem;
  --section:  5.5rem;
  --measure:  66ch;
  --shell:    72rem;
}

@supports (color: oklch(60% .12 62)) {
  :root {
    --ocre:     oklch(60% .12 62);
    --bleuvert: oklch(28% .04 179);
    --ivoire:   oklch(89% .02 84);
    --charbon:  oklch(23% .00 190);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--t-base);
  line-height: 1.65;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

/* --------------------------------------------------------------- Typographie */

h1, h2, h3, h4, h5 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5.5vw, var(--t-3xl)); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.625rem, 3.4vw, var(--t-xl)); }
h3 { font-size: var(--t-lg); }
h4, h5 { font-size: var(--t-md); }

p, li { max-width: var(--measure); }
p { margin: 0 0 1.15em; }

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

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

strong { font-weight: 600; }

.lede {
  font-size: var(--t-md);
  color: var(--ink-soft);
  max-width: 54ch;
}

/* --------------------------------------------------------------- Ossature */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip:focus { left: 0; }

/* --------------------------------------------------------------- En-tête */

.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  min-height: 4.5rem;
}

.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-md);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
}
.wordmark span {
  display: block;
  font-family: var(--body);
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0.01em;
}

.nav { display: flex; align-items: center; gap: 1.75rem; }

.nav__list {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__list a {
  color: var(--ink);
  text-decoration: none;
  font-size: var(--t-sm);
  font-weight: 500;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav__list a:hover { border-bottom-color: var(--accent); }
.nav__list a[aria-current="page"] {
  border-bottom-color: var(--accent-deep);
  color: var(--accent-deep);
}

/* Sous-menu */
.nav__item { position: relative; }
.nav__sub {
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 19rem;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.5rem 0;
  list-style: none;
  margin: 0;
  display: none;
}
.nav__item:hover .nav__sub,
.nav__item:focus-within .nav__sub { display: block; }
.nav__sub a {
  display: block;
  padding: 0.5rem 1.25rem;
  border-bottom: 0;
  font-weight: 400;
}
.nav__sub a:hover { background: var(--surface-alt); border-bottom: 0; }

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: var(--t-sm);
  padding: 0.5rem 0.85rem;
  cursor: pointer;
}

/* --------------------------------------------------------------- Boutons */

.btn {
  display: inline-block;
  background: var(--brand);
  color: var(--brand-ink);
  font-family: var(--body);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border: 1px solid var(--brand);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--bleuvert); border-color: var(--bleuvert); color: var(--ivoire); }

.btn--quiet {
  background: transparent;
  color: var(--bleuvert);
  border-color: var(--bleuvert);
}
.btn--quiet:hover { background: var(--bleuvert); color: var(--ivoire); }

/* --------------------------------------------------------------- Hero */

.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(3rem, 8vw, var(--section));
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: end;
}

.hero h1 { margin-bottom: 0.4em; }

.hero__rule {
  width: 4.5rem;
  height: 3px;
  background: var(--accent);
  margin-bottom: 1.75rem;
}

.hero__aside {
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
  font-size: var(--t-sm);
  color: var(--ink-soft);
}
.hero__aside p { margin-bottom: 0.5em; }

/* --------------------------------------------------------------- Sections */

.band { padding-block: clamp(3rem, 7vw, var(--section)); }
.band + .band { padding-top: 0; }
.band--tint { background: var(--surface-alt); border-block: 1px solid var(--line); }
.band--tint + .band { padding-top: clamp(3rem, 7vw, var(--section)); }

/* Section à deux colonnes : titre à gauche, prose à droite */
.split {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-top: 2.25rem;
  border-top: 1px solid var(--line);
}
.split + .split { margin-top: 3.25rem; }
.split > h2 { margin: 0; position: sticky; top: 6rem; align-self: start; }
.split__body > :last-child { margin-bottom: 0; }

@media (max-width: 62rem) {
  .split { grid-template-columns: 1fr; }
  .split > h2 { position: static; }
}

/* --------------------------------------------------------------- Listes */

.plain { list-style: none; margin: 0 0 1.15em; padding: 0; }
.plain li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.5rem;
}
.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.55rem;
  height: 1px;
  background: var(--accent);
}

/* Index des soins : lignes, pas cartes */
.index { list-style: none; margin: 0; padding: 0; }
.index li { border-top: 1px solid var(--line); max-width: none; }
.index li:last-child { border-bottom: 1px solid var(--line); }
.index a {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: var(--gap-lg);
  align-items: baseline;
  padding: 1.5rem 0;
  text-decoration: none;
  color: var(--ink);
}
.index a:hover { background: var(--surface-alt); }
.index a:hover .index__name { color: var(--accent-deep); }
.index__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-md);
}
.index__note { color: var(--ink-soft); font-size: var(--t-sm); margin: 0; }

@media (max-width: 48rem) {
  .index a { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* --------------------------------------------------------------- Encadré pratique */

.note {
  background: var(--surface-alt);
  border-left: 3px solid var(--accent);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  font-size: var(--t-sm);
}
.note > :last-child { margin-bottom: 0; }
.note h3 { font-size: var(--t-md); margin-bottom: 0.5em; }

/* Zone réservation (widget externe) */
.booking {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  margin-top: 2rem;
}

/* --------------------------------------------------------------- Pied de page */

.footer {
  background: var(--bleuvert);
  color: var(--ivoire);
  padding-block: 3.5rem 2rem;
  margin-top: var(--section);
}
.footer a { color: var(--ivoire); text-decoration: none; }
.footer a:hover { color: var(--brand); text-decoration: underline; }

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(225, 218, 204, 0.22);
}
.footer h2 {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 1rem;
  letter-spacing: 0;
}
.footer ul { list-style: none; margin: 0; padding: 0; font-size: var(--t-sm); }
.footer li { margin-bottom: 0.55rem; max-width: none; }
.footer address { font-style: normal; font-size: var(--t-sm); line-height: 1.7; }

.legal {
  padding-top: 1.75rem;
  font-size: var(--t-xs);
  color: rgba(225, 218, 204, 0.72);
  line-height: 1.8;
}
.legal a { color: var(--ivoire); }

/* --------------------------------------------------------------- Mobile */

/* Héros : une colonne sous 60rem */
@media (max-width: 60rem) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__aside { border-left: 0; border-top: 2px solid var(--accent); padding-left: 0; padding-top: 1.25rem; }
}

/* Largeurs intermédiaires : on resserre avant de basculer en menu déroulant */
@media (max-width: 86rem) {
  .nav__list { gap: 1.15rem; }
  .nav__list a, .nav__trigger { font-size: 0.875rem; }
  .nav__cta { padding: 0.5rem 0.85rem !important; }
}

/* Navigation repliée : 7 entrées ne tiennent plus en ligne sous ~78rem */
@media (max-width: 78rem) {
  .nav__toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 1rem clamp(1.25rem, 5vw, 3rem) 1.5rem;
    max-height: calc(100vh - 4.5rem);
    overflow-y: auto;
  }
  .nav[data-open="true"] { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list > li { border-bottom: 1px solid var(--line); }
  .nav__list a { display: block; padding: 0.85rem 0; border-bottom: 0; font-size: var(--t-base); }

  /* le sous-menu est déplié d'office : pas de survol sur écran tactile */
  .nav__sub { position: static; border: 0; min-width: 0; display: block; padding: 0 0 0.75rem 1rem; }
  .nav__sub a { padding: 0.4rem 0; font-size: var(--t-sm); color: var(--ink-soft); }

  .nav__trigger {
    width: 100%;
    text-align: left;
    padding: 0.85rem 0 !important;
    background: none;
    border: 0;
    color: var(--ink) !important;
    font-size: var(--t-base);
    pointer-events: none;      /* il ne sert plus à rien : tout est déplié */
  }
  .masthead__inner { position: relative; }
}

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

@media print {
  .masthead, .footer, .btn { display: none; }
  body { background: #fff; }
}

/* --------------------------------------------------------------- Portrait */

.portrait {
  display: grid;
  grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
  margin-bottom: 3.5rem;
}
.portrait__fig { margin: 0; }
.portrait__fig img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 3px solid var(--accent);
}
.portrait__body > :first-child { margin-top: 0; }
.portrait__body > :last-child { margin-bottom: 0; }

@media (max-width: 56rem) {
  .portrait { grid-template-columns: 1fr; }
  .portrait__fig { max-width: 20rem; }
}

/* h3 en tête de colonne gauche dans .split */
.split > h3 {
  margin: 0;
  font-size: var(--t-lg);
  position: sticky;
  top: 6rem;
  align-self: start;
}
@media (max-width: 62rem) { .split > h3 { position: static; } }

.split__body h4 {
  margin-top: 1.75rem;
  font-size: var(--t-base);
  color: var(--ink-soft);
}


/* --------------------------------------------------------------- Réservation */

.booking { min-height: 32rem; }
#smart-container { width: 100%; }
#smart-container iframe { width: 100% !important; border: 0; display: block; }

/* --------------------------------------------------------------- Lieux */

.places {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
}
.place { border-top: 2px solid var(--brand); padding-top: 1.25rem; }
.place h3 { font-size: var(--t-md); margin-bottom: 0.5rem; }
.place address { font-style: normal; color: var(--ink-soft); margin-bottom: 0.5rem; }
.place__when { font-size: var(--t-sm); color: var(--ink-soft); }
.place > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------- Publications */

.posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  max-width: 34rem;
}
.posts li { max-width: none; margin: 0; }
.posts img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 2px solid var(--brand);
}
.posts a { display: block; }
.posts a:hover img { opacity: 0.88; }

/* --------------------------------------------------------------- Illustrations */

.shot { margin: 0 0 1.5rem; max-width: 28rem; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 2px solid var(--brand);
}

/* --------------------------------------------------------------- Page agenda */

.band--flush { padding-top: clamp(2rem, 4vw, 3rem); }
.booking--full {
  border: 0;
  padding: 0;
  margin-top: 0;
  min-height: 40rem;
}

/* Bouton d'appel dans la navigation */
.nav__cta {
  background: var(--brand);
  color: var(--brand-ink) !important;
  padding: 0.55rem 1.1rem !important;
  border: 1px solid var(--brand);
  border-bottom: 1px solid var(--brand) !important;
  font-weight: 600;
}
.nav__cta:hover {
  background: var(--bleuvert);
  border-color: var(--bleuvert);
  color: var(--ivoire) !important;
}
@media (max-width: 60rem) {
  .nav__cta { text-align: center; margin: 0.75rem 0; }
}

/* Titre accessible mais non affiché */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------- Réseaux sociaux */

.social {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  max-width: 37rem;          /* 80 % de la largeur précédente */
}
.social__item { max-width: none; margin: 0; }
.social__item a {
  display: block;
  position: relative;
  text-decoration: none;
  color: var(--ink);
}
.social__item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;      /* format d'origine des publications */
  object-fit: cover;
  border-bottom: 2px solid var(--brand);
}
.social__badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  background: var(--bleuvert);
  color: var(--ivoire);
  border-radius: 50%;
}
.social__badge svg { width: 0.95rem; height: 0.95rem; }
.social__name {
  display: block;
  margin-top: 0.45rem;
  font-size: var(--t-sm);
  font-weight: 600;
  font-family: var(--display);
}
.social__item a:hover img { opacity: 0.88; }
.social__item a:hover .social__name { color: var(--accent-deep); }

/* Tablette : deux colonnes */
@media (max-width: 48rem) {
  .social {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 22rem;
  }
}

/* Petit mobile : deux colonnes resserrées, la vignette reste lisible */
@media (max-width: 26rem) {
  .social {
    gap: 0.75rem;
    max-width: 100%;
  }
  .social__name { font-size: var(--t-xs); }
  .social__badge { width: 1.5rem; height: 1.5rem; }
  .social__badge svg { width: 0.8rem; height: 0.8rem; }
}

/* --------------------------------------------------------------- Mentions légales */

.legalese .split__body h3 {
  font-size: var(--t-md);
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.legalese .split__body h3:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.adresse { font-style: normal; line-height: 1.8; margin-bottom: 1.15em; }

.duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.25rem;
  max-width: 34rem;
}
.duo .shot { margin: 0; max-width: none; }

/* --------------------------------------------------------------- Agenda pleine largeur */

.agenda {
  width: 100%;
  max-width: 72rem;
  margin: 2.5rem auto 3rem;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
  min-height: 38rem;
}

/* L'agenda est servi dans une iframe : son fond blanc n'est pas modifiable
   depuis cette feuille. On l'assume donc comme un panneau à part entière,
   cadré et posé sur le fond crème. */
.agenda #smart-container {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  box-shadow: 0 1px 0 rgba(43, 43, 40, 0.04);
}
.agenda iframe { width: 100% !important; border: 0; display: block; }

/* titre vide utilisé pour reprendre la colonne après l'agenda */
.split > h2:empty { display: none; }

/* --------------------------------------------------------------- Tarifs */

.tarifs {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.15em;
  font-size: var(--t-sm);
}
.tarifs th, .tarifs td {
  text-align: left;
  padding: 0.85rem 0.75rem 0.85rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tarifs thead th {
  font-family: var(--body);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--ink-mute);
  border-bottom: 2px solid var(--brand);
}
.tarifs tbody th {
  font-family: var(--display);
  font-size: var(--t-base);
  font-weight: 600;
}
.tarifs__note {
  display: block;
  font-family: var(--body);
  font-size: var(--t-xs);
  font-weight: 400;
  color: var(--ink-soft);
  margin-top: 0.25rem;
  max-width: 24rem;
}
.tarifs__prix {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-md);
  white-space: nowrap;
  text-align: right !important;
  padding-right: 0 !important;
}
@media (max-width: 34rem) {
  .tarifs thead { display: none; }
  .tarifs tbody th, .tarifs td { display: block; border-bottom: 0; padding: 0.15rem 0; }
  .tarifs tbody tr { display: block; padding: 1rem 0; border-bottom: 1px solid var(--line); }
  .tarifs__prix { text-align: left !important; }
}


/* --------------------------------------------------------------- Déclencheur du menu rendez-vous */

.nav__trigger {
  font: inherit;
  font-size: var(--t-sm);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Survol, focus clavier et ouverture au tap */
.nav__item--rdv:hover > .nav__sub,
.nav__item--rdv:focus-within > .nav__sub,
.nav__item--rdv[data-open] > .nav__sub { display: block; }

/* Le sous-menu démarre au ras du bouton : pas de trou où le survol se perd. */
.nav__item--rdv > .nav__sub { left: 0; min-width: 16rem; }

/* Page sans bandeau de titre : la première section n'a rien à séparer
   au-dessus d'elle, son filet est donc supprimé. */
.band--flush .shell > .split:first-child {
  border-top: 0;
  padding-top: 0;
}
