/* ============================================
   organic.css — Surcharge design organique
   Chargé après style.css
   ============================================ */

/* --- 1. TYPOGRAPHIE — Plus grande, plus claire --- */

:root {
  --fs-base: clamp(1.05rem, 1rem + 0.35vw, 1.25rem);
  --lh-base: 1.7;
}

h1 {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 4rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.65rem, 1.3rem + 1.75vw, 2.75rem);
  letter-spacing: -0.015em;
}

h3 {
  font-size: clamp(1.2rem, 1.05rem + 0.65vw, 1.625rem);
}

.stat__number {
  font-size: clamp(2.5rem, 2rem + 2.5vw, 3.75rem);
}

/* --- 2. VAGUES SVG ENTRE SECTIONS --- */

.wave-divider {
  display: block;
  width: 100%;
  line-height: 0;
  font-size: 0;
  position: relative;
  z-index: 2;
  margin-top: -1px;
  margin-bottom: -1px;
  overflow: hidden;
  backface-visibility: hidden;
}

.wave-divider svg {
  display: block;
  width: calc(100% + 1.3px);
  height: auto;
  position: relative;
  left: -0.65px;
}

/* Couleurs de remplissage SVG = couleur de la section SUIVANTE */
.wave-divider--bg svg path    { fill: var(--color-bg); }
.wave-divider--white svg path { fill: var(--color-white); }
.wave-divider--forest svg path{ fill: var(--color-forest); }
.wave-divider--river svg path { fill: var(--color-river); }
.wave-divider--dark svg path  { fill: var(--color-charcoal); }

/* Anti-seam : bande interne couvrant le bord bas (même couleur que section suivante) */
/* Positionné DANS le conteneur → pas clippé par overflow:hidden */
.wave-divider::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  z-index: 3;
}
.wave-divider--bg::after     { background: var(--color-bg); }
.wave-divider--white::after  { background: var(--color-white); }
.wave-divider--forest::after { background: var(--color-forest); }
.wave-divider--river::after  { background: var(--color-river); }
.wave-divider--dark::after   { background: var(--color-charcoal); }


/* --- 3. BACKGROUND AUTO-MATCH — couleur de la section PRECEDENTE --- */
/* Remplit la zone transparente au-dessus de la vague avec la bonne couleur */
/* Ordre par specificity croissante : generic d'abord, overrides ensuite */

.section + .wave-divider                { background-color: var(--color-bg); }
.section--alt + .wave-divider           { background-color: var(--color-white); }
.section--forest + .wave-divider        { background-color: var(--color-forest); }
.filiation + .wave-divider              { background-color: var(--color-forest); }
.cta-banner + .wave-divider             { background-color: var(--color-river); }
.page-header + .wave-divider            { background-color: var(--color-forest); }
.hero + .wave-divider                   { background: linear-gradient(135deg, var(--color-forest), var(--color-forest-dark)); }

/* --- 4. IMAGES ORGANIQUES --- */

/* A. Blob border-radius (cartes) */
.img-organic {
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  transition: border-radius 0.6s ease;
  overflow: hidden;
}
.img-organic:hover {
  border-radius: 50%;
}

/* B. Clip-path formes organiques (images standalone) */
.img-clip-leaf {
  clip-path: ellipse(48% 45% at 50% 50%);
}
.img-clip-drop {
  clip-path: polygon(50% 0%, 80% 30%, 100% 60%, 85% 85%, 50% 100%, 15% 85%, 0% 60%, 20% 30%);
}
.img-clip-pebble {
  clip-path: polygon(25% 5%, 75% 0%, 95% 25%, 100% 65%, 80% 95%, 30% 100%, 5% 75%, 0% 30%);
}

/* C. Card-case organique */
.card-case--organic .card-case__image {
  border-radius: 20px 60px 20px 60px;
  overflow: hidden;
}
.card-case--organic:hover .card-case__image {
  border-radius: 30px 50px 30px 50px;
}

/* Overlay vert nature au hover sur les images de cartes */
.card-case--organic .card-case__image {
  position: relative;
}
.card-case--organic .card-case__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.12);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.card-case--organic:hover .card-case__image::after {
  opacity: 1;
}

/* --- 5. ELEMENTS DECORATIFS FLOTTANTS --- */

.organic-deco {
  position: absolute;
  pointer-events: none;
  opacity: 0.06;
  z-index: 0;
}

.organic-deco--float {
  animation: organic-float 8s ease-in-out infinite;
}

@keyframes organic-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}

@media (prefers-reduced-motion: reduce) {
  .organic-deco--float {
    animation: none;
  }
}

/* --- 6. BANDEAUX IMAGES UNSPLASH --- */

/* Base : position relative + overflow hidden pour contenir le pseudo-élément flouté */
.hero--bg-torrent,
.ph-brume,
.ph-canopee,
.ph-sinueuse,
.ph-mousse {
  position: relative;
  overflow: hidden;
  background: #111;
}

/* Fade-in progressif des images de bandeau */
@keyframes banner-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ::before = image de fond floutée */
.hero--bg-torrent::before,
.ph-brume::before,
.ph-canopee::before,
.ph-sinueuse::before,
.ph-mousse::before {
  content: '';
  position: absolute;
  inset: -8px; /* déborde pour éviter les bords nets du blur */
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(5px);
  transition: filter 0.6s ease;
  animation: banner-fadein 1.2s ease-out both;
}

/* Hover : le flou disparaît, l'image devient nette */
.ph-brume:hover::before,
.ph-sinueuse:hover::before,
.ph-mousse:hover::before {
  filter: blur(0);
}

/* ::after = overlay noir */
.hero--bg-torrent::after,
.ph-brume::after,
.ph-canopee::after,
.ph-sinueuse::after,
.ph-mousse::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: background 0.6s ease;
}

/* Hover : overlay noir 40% quand le flou disparaît */
.ph-brume:hover::after,
.ph-sinueuse:hover::after,
.ph-mousse:hover::after {
  background: rgba(0,0,0,.50) !important;
}

/* Contenu au-dessus des pseudo-éléments */
.hero--bg-torrent > *,
.ph-brume > *,
.ph-canopee > *,
.ph-sinueuse > *,
.ph-mousse > * {
  position: relative;
  z-index: 2;
}

/* Images individuelles */
.hero--bg-torrent::before { background-image: url("../img/accueil-hero.jpg"); filter: blur(3px); opacity: 1; }
.hero--bg-torrent::after  { background: rgba(0,0,0,.35); background-image: none; opacity: 1; z-index: 1; }

.ph-brume::before { background-image: url("https://images.unsplash.com/photo-1448375240586-882707db888b?w=1400&q=80"); filter: blur(3px); }
.ph-brume::after  { background: rgba(0,0,0,.10); }

.ph-canopee::before { background-image: url("../img/equipe-hero.jpg"); filter: blur(3px); }
.ph-canopee::after  { background: rgba(0,0,0,.35); }

.ph-sinueuse::before { background-image: url("../img/references-hero.jpg"); filter: blur(3px); }
.ph-sinueuse::after  { background: rgba(0,0,0,.10); }

.ph-mousse::before { background-image: url("../img/contact-hero.jpg"); filter: blur(3px); }
.ph-mousse::after  { background: rgba(0,0,0,.10); }

/* Extend image backgrounds into the wave transition area */
.hero--bg-torrent {
  padding-bottom: calc(var(--space-xl) + 4vw);
}
.ph-brume,
.ph-canopee,
.ph-sinueuse,
.ph-mousse {
  position: relative;
  padding-bottom: calc(var(--space-lg) + 4vw);
}

/* Sibling wave approach (index.html hero, equipe.html) */
.hero--bg-torrent + .wave-divider,
.ph-canopee + .wave-divider {
  background: transparent;
  margin-top: calc(-4vw - 2px);
}

/* Dégradé vers noir en bas pour transition douce vers la vague */
.hero--bg-torrent::after,
.ph-canopee::after {
  background: linear-gradient(to bottom, rgba(0,0,0,.50) 0%, rgba(0,0,0,.35) 80%, rgba(0,0,0,0) 88%, rgba(255,255,255,1) 100%) !important;
}

/* --- Citation Brice (page équipe) --- */

.brice-quote {
  max-width: 58ch;
  padding-left: var(--space-md);
  border-left: 3px solid var(--color-ochre);
  margin-top: var(--space-lg);
}
.brice-quote__text {
  font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem);
  line-height: 1.85;
  opacity: .93;
}
.brice-quote__text p + p {
  margin-top: var(--space-sm);
}
.brice-quote__text em {
  font-style: normal;
  color: var(--color-ochre);
}
.brice-quote__author {
  margin-top: var(--space-md);
  font-size: .9rem;
  opacity: .65;
  font-style: italic;
}
.brice-quote__author strong {
  opacity: 1;
  color: var(--color-ochre);
  font-style: normal;
}

/* Inner wave: SVG inside the page-header (approche, references, contact) */
.page-header > .wave-divider--inner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  background: transparent;
  transform: translateY(1px);
}

/* --- Blob image Savasse --- */

@keyframes blob-morph {
  0%, 100% { border-radius: 60% 40% 55% 45% / 55% 60% 40% 45%; }
  25%      { border-radius: 45% 55% 40% 60% / 60% 45% 55% 40%; }
  50%      { border-radius: 55% 45% 60% 40% / 40% 55% 45% 60%; }
  75%      { border-radius: 40% 60% 45% 55% / 45% 40% 60% 55%; }
}

.savasse-showcase {
  align-items: center;
}

.blob-frame {
  display: flex;
  justify-content: center;
  align-items: center;
}

.blob-frame__img {
  width: 420px;
  height: 480px;
  overflow: hidden;
  animation: blob-morph 12s ease-in-out infinite;
  box-shadow: 0 12px 40px rgba(45,80,22,.2), 0 0 0 6px rgba(45,80,22,.08);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.blob-frame__img:hover {
  transform: scale(1.03);
  box-shadow: 0 16px 50px rgba(45,80,22,.3), 0 0 0 8px rgba(45,80,22,.12);
}

.blob-frame__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .blob-frame__img {
    width: 260px;
    height: 310px;
  }
}
