/* ==========================================================================
   ESSPERT COOP — Styles principaux (version nettoyée)
   ========================================================================== */

/* ------------------------------
   Variables & base
   ------------------------------ */
:root {
  --pine:      #157A6E;
  --cornsilk:  #FEFAE0;
  --pistachio: #C1D37F;
  --vanilla:   #F0E2A3;
  --apricot:   #F9D4BB;
  --ink:       #0C3B34;
  --muted:     #476660;
  --shadow:    2px 3px 2px 2px rgba(12,59,52,.12);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--cornsilk);
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 { color: var(--pine); }
.lead { color: var(--muted); }
.center { text-align: center; }

:focus-visible {
  outline: 3px solid rgba(21,122,110,.35);
  outline-offset: 2px;
}

p { text-align: justify; }

/* Ancrages locaux: marge pour header sticky */
section[id^="sec-"] { scroll-margin-top: 110px; }

/* ------------------------------
   Boutons
   ------------------------------ */
.cta,
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--pine);
  color: #fff;
  padding: 10px 16px;
  border-radius: 9999px;
  font-weight: 900;
  box-shadow: 2px 3px 2px 2px rgba(21,122,110,.20);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.cta:hover, .cta:focus,
.btn:hover, .btn:focus {
  transform: translateY(-1px);
  background: var(--apricot);
  color: var(--pine);
}

/* ==========================================================================
   ENTÊTE / NAVIGATION
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  position: relative;
}

.brand img {
  height: auto;
  max-height: 90px;  /* ajuste si besoin */
  width: auto;
  object-fit: contain;
  transition: transform .2s ease;
}
.brand img:hover { transform: scale(1.03); }

/* Liens principaux (desktop) */
.nav .nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav .nav-links > li { position: relative; }

.nav .nav-links > li > a {
  display: block;
  padding: 8px 6px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  border-radius: 10px;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

/* Bouton de contact dans la nav */
.nav .nav-links > li.cta a {
  color: #fff; /* texte blanc par défaut */
}

/* Effet au survol / focus */
.nav .nav-links > li.cta a:hover,
.nav .nav-links > li.cta a:focus {
  color: var(--pine);     /* texte vert */
}


.nav .nav-links > li > a:hover,
.nav .nav-links > li > a:focus {
  background: var(--apricot);
  color:var(--pine);
}

/* Bouton CTA dans la nav */
.nav .nav-links > li.cta .btn { padding: .6rem 1rem; }

/* Méga-menu (hover / focus / .open) */
.nav .nav-links > li > .mega {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid rgba(21,122,110,.12);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 280px;
  z-index: 1300;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .12s ease, transform .12s ease;
}
.nav .nav-links > li:hover > .mega,
.nav .nav-links > li:focus-within > .mega,
.nav .nav-links > li.open > .mega {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.nav .nav-links > li > .mega a.item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px;
  border-radius: 10px;
  color: inherit;
  white-space: nowrap;
  transition: background .15s ease;
}
.nav .nav-links > li > .mega a.item:hover,
.nav .nav-links > li > .mega a.item:focus {
  background: rgba(21,122,110,.08);
}


/* ------------------------------
   Navigation mobile
   ------------------------------ */
.mobile-wrap {
    position: relative;
    padding-right: 30px;
}

/* --- Bouton hamburger (style carré arrondi) --- */
.hamburger {
  display: none; /* caché par défaut (desktop) */
  width: 42px;
  height: 38px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(12, 59, 52, 0.15);
  box-shadow: 0 4px 10px rgba(12, 59, 52, 0.08);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  transition: all 0.25s ease;
  z-index: 1400;
}

.hamburger:hover {
  background: rgba(21, 122, 110, 0.06);
  transform: translateY(-1px);
}

/* Les barres internes */
.hamburger span {
  display: block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Animation croix quand ouvert */
.hamburger.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.hamburger.is-open span:nth-child(2) {
  opacity: 0;
}
.hamburger.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}


/* Panneau mobile (slide + fade) */
.mobile-menu {
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  background: #fff;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: transform .35s ease, opacity .35s ease;
  z-index: 1200;
}
.mobile-menu.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu a {
  display: block;
  padding: 14px 20px;
  border-bottom: 1px solid #eee;
  text-align: center;
  font-weight: 600;
  transition: background .2s ease, color .2s ease;
}
.mobile-menu a:hover {
  background: rgba(21,122,110,.06);
  color: var(--pine);
}

/* Overlay & lock scroll quand le menu est ouvert */
body.nav-open { overflow: hidden; }
body.nav-open::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.2);
  backdrop-filter: blur(2px);
  z-index: 1100;
  animation: fadeIn .35s ease forwards;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Responsive : mobile / tablette --- */
@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }

  .nav .nav-links {
    display: none;
  }
}

/* --- Desktop : cacher le hamburger --- */
@media (min-width: 901px) {
  .hamburger {
    display: none !important;
  }

  .nav .nav-links {
    display: flex !important;
  }
}

/* ==========================================================================
   HERO (section d’intro)
   ========================================================================== */
.hero { padding: 20px 0 56px; background: transparent; }

.premier { padding-top: 80px; }
.titre { font-size: 60px; }

@media (max-width: 900px) {
  .premier { text-align: center; }
  .titre { font-size: 50px; }
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
  background: #fff;
  border-radius: 28px;
  padding: 42px 48px;
  box-shadow: 8px 14px 5px 2px rgba(12,59,52,.12);
  overflow: hidden;
}
.hero h1 { margin: 0 0 14px; font-size: 42px; line-height: 1.08; }
.hero p  { margin: 0 0 16px; }
.hero img {
  border-radius: 18px;
  box-shadow: 2px 7px 10px 2px rgba(12,59,52,.10);
}

@media (max-width: 900px) {
  .hero { padding: 14px 0 40px; }
  .hero .wrap {
    grid-template-columns: 1fr;
    padding: 28px 22px;
    gap: 22px;
    border-radius: 22px;
  }
  .hero img { max-height: 260px; object-fit: cover; }
}

/* ==========================================================================
   Tuiles (accueil)
   ========================================================================== */
.tiles { padding: 36px 0; }

.tiles .grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 20px;
  text-align: center;
}

.tile {
  background: rgba(249,212,187,.60);
  border: 1px solid rgba(21,122,110,.12);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

/* --- Hover des tuiles (même esprit que le bouton CTA) --- */
.tile{
  background: rgba(249,212,187,.60);                /* état normal (ton actuel) */
  border: 1px solid rgba(21,122,110,.12);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: 
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    color .18s ease,
    border-color .18s ease;
}

/* Survol + focus clavier */
.tile:hover,
.tile:focus-within{
  transform: translateY(-2px);                      /* petit “lift” */
  box-shadow: 0 14px 40px rgba(21,122,110,.20);     /* ombre plus marquée */
  background: var(--pine);                          /* teinte bouton CTA */
  border-color: rgba(21,122,110,.35);
  color: var(--apricot);                         /* texte lisible sur vert */
}

/* Inversion des couleurs internes si besoin */
.tile:hover h3,
.tile:hover p,
.tile:hover a,
.tile:focus-within h3,
.tile:focus-within p,
.tile:focus-within a{
  color: var(--apricot);
}

/* Si la tuile contient une image, on la garde nette */
.tile img{
  transition: transform .18s ease, box-shadow .18s ease;
}
.tile:hover img,
.tile:focus-within img{
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

/* Accessibilité : réduire le mouvement si l'utilisateur préfère */
@media (prefers-reduced-motion: reduce){
  .tile,
  .tile img{
    transition: none;
  }
}

.tile img { border-radius: 12px; height: 140px; object-fit: cover; }

.super-titre { text-align: center; font-size: 50px; }

@media (max-width: 900px) {
  .tiles .grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Sections génériques
   ========================================================================== */
.section { padding-top: 40px; }
@media (max-width: 900px) { .section { padding-top: 15px; } }

/* Sommaire local (liens d’ancrage) */
.local-toc {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1.5rem 0 2rem;
}
.local-toc a {
  padding: .5rem .75rem;
  border: 1px solid var(--pine);
  border-radius: .5rem;
  color: var(--pine);
  transition: background .2s ease, color .2s ease;
}
.local-toc a:hover { background: var(--pine); color: #fff; }

/* ==========================================================================
   Cartes “produit” (prestations)
   ========================================================================== */
.product {
  background: #fff;
  border: 1px solid rgba(21,122,110,.12);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.product.alt .product-grid { grid-template-columns: .9fr 1.1fr; }
.product h3 { margin-top: 0; }
.product ul { padding-left: 18px; margin: 10px 0; }
.product img { border-radius: 12px; box-shadow: var(--shadow); }

@media (max-width: 900px) {
  .product-grid { grid-template-columns: 1fr; }
  .product img { max-height: 220px; object-fit: cover; }
}

/* ==========================================================================
   Cartes d'articles (Ressources / Actualités)
   ========================================================================== */

.article-card {
  background: #fff;
  border: 1px solid rgba(21,122,110,.12);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: 
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

/* Titre et texte */
.article-card h3 {
  margin-top: 0;
  color: var(--pine);
  font-size: 1.25rem;
  line-height: 1.3;
  transition: color .18s ease;
}

.article-card p {
  flex-grow: 1;
  margin: 0.75rem 0 1rem;
  color: var(--ink);
  text-align: justify;
  transition: color .18s ease;
}

/* Bouton interne éventuel */
.article-card a.cta {
  align-self: flex-start;
}

/* Effet hover/focus (même esprit que les tuiles et boutons CTA) */
.article-card:hover,
.article-card:focus-within {
  transform: translateY(-2px);
  background: var(--pine);
  color: #fff;
  box-shadow: 0 14px 40px rgba(21,122,110,.25);
}

/* Harmoniser la couleur des sous-éléments au survol */
.article-card:hover h3,
.article-card:hover p,
.article-card:hover a,
.article-card:focus-within h3,
.article-card:focus-within p,
.article-card:focus-within a {
  color: #fff;
}

/* Image éventuelle dans la carte */
.article-card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 1rem;
  box-shadow: 0 6px 16px rgba(12,59,52,.08);
  transition: transform .18s ease, box-shadow .18s ease;
}

.article-card:hover img,
.article-card:focus-within img {
  transform: scale(1.02);
  box-shadow: 0 10px 26px rgba(0,0,0,.15);
}

/* Responsive : grille fluide */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 1.5rem;
}

/* Réduction du mouvement pour accessibilité */
@media (prefers-reduced-motion: reduce) {
  .article-card,
  .article-card img {
    transition: none;
  }
}


/* ==========================================================================
   Grilles & cartes Équipe (accordéon)
   ========================================================================== */
.team-grid {
  display: grid;
  gap: 24px;
  margin-top: 20px;
  grid-template-columns: repeat(3, 1fr);      /* max 3 par ligne */
}
@media (max-width: 999px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .team-grid { grid-template-columns: 1fr; } }

.team-member {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(21,122,110,.12);
  overflow: hidden;
}

/* Accordéon details/summary */
.team-member summary { list-style: none; cursor: pointer; }
.team-member summary::-webkit-details-marker { display: none; }

.team-member > summary {
  display: grid;
  grid-template-columns: 72px 1fr 24px;       /* photo | texte | chevron */
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  user-select: none;
  transition: background .15s ease;
}
.team-member > summary:hover,
.team-member > summary:focus-visible {
  background: rgba(21,122,110,.06);
  outline: none;
}
.team-member summary img {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(12,59,52,.10);
  pointer-events: none;
}
.team-member summary .id h3 { margin: 0; color: var(--ink); line-height: 1.2; }
.team-member summary .id .role { margin: 2px 0 0; color: var(--muted); font-weight: 600; }

/* Chevron indicateur via CSS */
.team-member summary .chevron {
  width: 24px; height: 24px; position: relative;
}
.team-member summary .chevron::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 10px; height: 10px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.team-member[open] summary .chevron::before { transform: rotate(-135deg); }

.team-member .content {
  padding: 0 16px 16px 16px;
  border-top: 1px solid rgba(21,122,110,.12);
  animation: accordionFade .2s ease;
}
.team-member .content h4 { margin: 14px 0 8px; color: var(--pine); }
.team-member .content p { margin: 8px 0; }
.team-member .content ul { margin: 6px 0 10px 18px; }

@keyframes accordionFade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 480px) {
  .team-member > summary { grid-template-columns: 56px 1fr 24px; padding: 12px 14px; }
  .team-member summary img { width: 56px; height: 56px; }
}

/* ==========================================================================
   Pied de page
   ========================================================================== */
.footer {
  background: #0a2e29;
  color: #e6f3f1;
  margin-top: 40px;
  padding: 40px 0;
}
.footer a { color: #e6f3f1; }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer { text-align: center; }
  .footer-grid > div { margin: 0 auto; }
  .footer a { display: inline-block; }
}
