/* ==========================================================================
   Antoine Bertrand — Conseil Conjugal et Familial
   Reconstruction fidèle du microsite Google Sites
   ========================================================================== */

:root {
  --color-sage: #d3d8ca;      /* fond unique de la page, utilisé partout (body, contenu, mentions légales) pour une navigation visuellement cohérente */
  --color-overlay: rgba(31, 32, 32, 0.55); /* voile sombre sur le hero */
  --color-white: #ffffff;
  --color-text: #1a1a1a;
  --color-content-text: #476357;
  --color-link: #000000;
  --font-main: 'Montserrat', Arial, Helvetica, sans-serif;
  --max-width: 900px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-sage);
  line-height: 1.6;
}

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

a {
  color: var(--color-link);
  text-decoration: underline;
}

a:hover {
  opacity: 0.7;
}

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

.hero {
  position: relative;
  min-height: 100vh;
  /* Fallback pour les navigateurs sans support WebP */
  background-image: url("images/hero-tree.png");
  /* Navigateurs avec support WebP : variante principale compressée (T1) */
  background-image: image-set(
    url("images/hero-tree.webp") 1x,
    url("images/hero-tree.png") 1x
  );
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* Variantes WebP responsives alignées sur les breakpoints existants (T1) */
@media (max-width: 768px) {
  .hero {
    background-image: url("images/hero-tree.png");
    background-image: image-set(
      url("images/hero-tree-768.webp") 1x,
      url("images/hero-tree.png") 1x
    );
  }
}

@media (max-width: 420px) {
  .hero {
    background-image: url("images/hero-tree.png");
    background-image: image-set(
      url("images/hero-tree-420.webp") 1x,
      url("images/hero-tree.png") 1x
    );
  }
}

.hero__overlay {
  padding: 48px 56px;
  text-align: center;
  max-width: 900px;
  width: 100%;
}

.hero__overlay h1,
.hero__overlay h2 {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.hero__title {
  margin: 0 0 24px;
  color: var(--color-white);
  font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 5.3rem);
  line-height: 1.15;
  letter-spacing: 1px;
}

.hero__title-accent {
  font-weight: 600;
  letter-spacing: 2px;
}

.hero__name {
  margin: 0 0 8px;
  color: var(--color-white);
  font-weight: 400;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.hero__role {
  margin: 0;
  color: var(--color-white);
  font-weight: 700;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
}

/* ---------- Contenu ---------- */

.content {
  background: var(--color-sage);
  color: var(--color-content-text);
  padding: 60px 20px;
  text-align: justify;
}

.content a {
  color: var(--color-link);
}

.content__wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.content__photo {
  flex: 0 0 280px;
  margin: 0;
}

.content__photo img {
  width: 100%;
  height: auto;
}

.content__text {
  flex: 1 1 400px;
  min-width: 280px;
}

.content__text p {
  margin: 0 0 20px;
  font-size: 1rem;
}

.content__subheading {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 32px 0 20px;
}

.content__text strong {
  font-weight: 700;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .hero {
    min-height: 70vh;
  }

  .hero__overlay {
    padding: 32px 24px;
  }

  .content {
    padding: 40px 16px;
  }

  .content__wrapper {
    flex-direction: column;
  }

  .content__photo {
    flex: 0 0 auto;
    max-width: 320px;
    margin: 0 auto;
  }
}

@media (max-width: 420px) {
  .hero__overlay {
    padding: 24px 16px;
  }
}

/* ---------- Navigation ----------
   Un simple bouton, systématiquement en haut à GAUCHE de chaque page
   (position fixe, identique sur toutes les pages), qui déroule
   l'arborescence du menu au survol de la souris (desktop) ou au tap
   (mobile/tactile, géré par menu.js). L'image du bouton vient de
   images/bouton-de-menu.png (mock en attendant le graphisme définitif
   d'Antoine/Guillaume — même emplacement, même nom de fichier pour le
   remplacer) ; à défaut, une icône de secours à trois barres s'affiche.
   Le nom du site ne s'affiche jamais dans ce menu (uniquement dans
   l'onglet du navigateur, via <title>). Le bouton n'apparaît que s'il y a
   plus d'une page dans le menu (sauf sur la page des mentions légales, où
   il reste toujours visible pour revenir à l'accueil). */

.site-menu {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  padding: 16px 20px;
}

.site-menu--solid {
  /* "relative" (et non "static") : le panneau déroulant, positionné en
     absolu, doit rester ancré à CE bouton — pas se retrouver plaqué en
     bas de la page après tout le contenu. */
  position: relative;
  display: flex;
  justify-content: flex-start;
  background: var(--color-sage);
  padding: 12px 24px;
}

.site-menu__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.site-menu__toggle-img {
  width: 44px;
  height: 44px;
  display: block;
}

.site-menu__toggle-icon span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-menu--solid .site-menu__toggle-icon span {
  background: var(--color-text);
}

.site-menu__panel {
  position: absolute;
  top: 100%;
  left: 20px;
  min-width: 220px;
  background: var(--color-sage);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.site-menu--solid .site-menu__panel {
  left: 24px;
}

.site-menu:hover .site-menu__panel,
.site-menu:focus-within .site-menu__panel,
.site-menu--open .site-menu__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

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

.site-menu__list .site-menu__list {
  /* Les pages filles restent masquées tant que la page mère n'est pas
     survolée/cliquée (ou n'est pas — elle-même ou une de ses descendantes
     — la page actuellement affichée, voir .site-menu__item--active-parent
     plus bas). */
  display: none;
  padding-left: 16px;
}

.site-menu__item {
  position: relative;
}

.site-menu__item--parent:hover > .site-menu__list,
.site-menu__item--parent:focus-within > .site-menu__list,
.site-menu__item--parent.site-menu__item--open > .site-menu__list,
.site-menu__item--parent.site-menu__item--active-parent > .site-menu__list {
  display: block;
}

.site-menu__item a {
  display: block;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 10px 20px;
  white-space: nowrap;
}

.site-menu__item a:hover,
.site-menu__item a[aria-current="page"] {
  background: rgba(0, 0, 0, 0.06);
}

.site-menu__item--parent > a {
  font-weight: 700;
  padding-right: 36px;
}

/* Petite flèche cliquable/tapotable à côté d'une page mère : elle bascule
   l'affichage de ses pages filles sans naviguer (utile au tactile, où le
   survol n'existe pas — au survol souris, les filles s'affichent déjà
   automatiquement, cette flèche n'est alors qu'un indicateur visuel). */
.site-menu__caret {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-menu__caret::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--color-text);
  transition: transform 0.18s ease;
}

.site-menu__item--parent:hover > .site-menu__caret::before,
.site-menu__item--parent:focus-within > .site-menu__caret::before,
.site-menu__item--open > .site-menu__caret::before,
.site-menu__item--active-parent > .site-menu__caret::before {
  transform: rotate(180deg);
}

@media (max-width: 480px) {
  .site-menu__panel {
    left: 0;
    right: 0;
    min-width: 0;
    margin: 0 12px;
  }

  .site-menu--solid .site-menu__panel {
    left: 0;
  }
}

/* ---------- Pages standard (contenu en blocs) ---------- */

.page-content {
  background: var(--color-sage);
  color: var(--color-content-text);
  padding: 60px 20px;
  min-height: 60vh;
  text-align: justify;
}

.page-content__wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0 0 40px;
  text-align: center;
  color: var(--color-text);
}

.page-content a {
  color: var(--color-link);
}

/* ---------- Blocs de contenu réutilisables ---------- */

.block {
  margin: 0 0 32px;
}

.block__heading {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 32px 0 20px;
  color: var(--color-text);
}

.block__subheading {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.block__quote {
  border-left: 3px solid var(--color-content-text);
  padding-left: 20px;
  margin: 0 0 32px;
  font-style: italic;
}

.block__cta {
  margin-top: 8px;
}

.block p {
  margin: 0 0 20px;
  font-size: 1rem;
}

/* Mise en forme du texte (taille de police) depuis l'éditeur — classes
   générées par Quill (voir admin/assets/editor.js et sanitize_rich_text()
   dans admin/includes/helpers.php). Mêmes proportions que dans l'éditeur
   admin (quill.bubble.css), pour que le rendu public corresponde à ce
   qu'Antoine voit en modifiant le texte. */
.ql-size-small {
  font-size: 0.75em;
}

.ql-size-large {
  font-size: 1.5em;
}

.ql-size-huge {
  font-size: 2.5em;
}

.block--image-text {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.block--image-left {
  flex-direction: row;
}

.block--image-right {
  flex-direction: row-reverse;
}

.block__image {
  flex: 0 0 300px;
  margin: 0;
}

.block__image img,
.block__image picture img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.block--image-full .block__image {
  flex: 1 1 100%;
}

.block--image-text .block__text {
  flex: 1 1 320px;
  min-width: 280px;
}

@media (max-width: 768px) {
  .block--image-text {
    flex-direction: column;
  }

  .block__image {
    flex: 0 0 auto;
    max-width: 340px;
    margin: 0 auto;
  }
}

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

.site-footer {
  background: var(--color-sage);
  text-align: center;
  padding: 20px 20px 32px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--color-link);
  font-size: 0.7rem;
}

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

.legal {
  background: var(--color-sage);
  color: var(--color-content-text);
  padding: 60px 20px;
  font-size: 1rem;
}

.legal a {
  color: var(--color-link);
}

.legal__wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
}

.legal__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--color-text);
}

.legal__heading {
  font-size: 1rem;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--color-text);
}

.legal p {
  margin: 0 0 12px;
  line-height: 1.6;
}

.legal p strong {
  font-weight: 700;
}

/* ---------- Page mentions légales dédiée ---------- */

.legal--page {
  min-height: 100vh;
  padding-top: 60px;
}

.legal--page .legal__title {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 700;
}

.legal__back {
  margin: 0 0 24px;
  font-size: 0.9rem;
}
