/* ===================================================
   G.D NETTOYAGE - home.css (page d'accueil uniquement)
   Les styles communs sont dans ui.css.
   =================================================== */

/* ===================================================
   HERO
   =================================================== */
.h-hero {
  padding: calc(var(--header-h) + clamp(32px, 6vw, 72px)) 0 clamp(64px, 8vw, 104px);
}

.h-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

.h-hero-title {
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 28px;
}

.h-hero-lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 44ch;
  margin-bottom: 36px;
}

.h-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Photo du hero : une vitre embuée essuyée par la raclette */
.h-hero-photo { margin: 0; }
.h-hero-photo figcaption {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.h-glass {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--mist);
}
.h-glass img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transform: scale(1.08);
  transition: transform 2.4s var(--ease-out);
}
.h-fog {
  position: absolute; inset: 0;
  background: rgba(238, 244, 245, 0.55);
  backdrop-filter: blur(18px) saturate(80%);
  -webkit-backdrop-filter: blur(18px) saturate(80%);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.5s var(--ease-wipe) 0.25s;
}
.h-blade-x {
  left: -2%; right: -2%;
  top: 0;
  height: 5px;
  transform: translateY(-10px);
  transition: transform 1.5s var(--ease-wipe) 0.25s, opacity 0.4s 1.7s;
}
.h-blade-x::after { left: 0; right: 0; bottom: -3px; height: 3px; }

.is-loaded .h-glass img { transform: scale(1); }
.is-loaded .h-fog { clip-path: inset(100% 0 0 0); }
.is-loaded .h-blade-x { transform: translateY(var(--glass-h, 600px)); opacity: 0; }

/* Comparateur de l'accueil */
.h-compare-section { padding-top: 0; }
.h-compare-section .h-compare { max-height: 78vh; }

/* ===================================================
   PRESTATIONS
   =================================================== */
.h-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: start;
}
.h-split-aside { position: sticky; top: calc(var(--header-h) + 32px); }
.h-split-aside .h-sub { margin-bottom: 24px; }

.h-services { border-top: 1px solid var(--line); }
.h-services li {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.h-services h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.h-services p { color: var(--ink-soft); line-height: 1.6; }

/* ===================================================
   À PROPOS
   =================================================== */
.h-about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: center;
}
.h-about-photo {
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--mist);
}
.h-about-photo img {
  width: 100%; height: 115%;
  object-fit: cover;
  will-change: transform;
}
.h-about-text p {
  color: var(--ink-soft);
  line-height: 1.7;
  max-width: 52ch;
  margin-bottom: 36px;
}

.h-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.h-facts dt { font-size: 0.875rem; color: var(--ink-soft); margin-bottom: 4px; }
.h-facts dd { font-weight: 700; font-size: 1.05rem; line-height: 1.35; }

/* ===================================================
   FACEBOOK
   =================================================== */
.fb-page {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  background: #fff;
  border-radius: 16px;
}
.fb-page[hidden] { display: none; }

.fb-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--mist);
  border: 1px solid var(--line);
}
/* Goutte du logo (logo.jpg recadré) quand la page n'a pas de photo */
.fb-avatar-logo {
  display: block;
  background: #fff url(images/logo.jpg) no-repeat -18px -113px / 280px;
}
.fb-post-head .fb-avatar-logo { background-position: -21px -116px; }

.fb-page-name { font-weight: 700; line-height: 1.3; }
.fb-page-meta { font-size: 0.9rem; color: var(--ink-soft); }
.fb-page .h-btn { margin-left: auto; min-height: 44px; padding: 0 20px; font-size: 0.95rem; }

.fb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.fb-post {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.fb-post.is-shown { opacity: 1; transform: none; }
.fb-post:hover { box-shadow: 0 18px 40px rgba(30, 41, 71, 0.1); }

.fb-post-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
}
.fb-post-head .fb-avatar { width: 38px; height: 38px; }
.fb-post-author { font-weight: 700; font-size: 0.95rem; line-height: 1.3; }
.fb-post-date { display: block; font-size: 0.85rem; color: var(--ink-soft); font-weight: 400; }

.fb-rank {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--aqua-deep);
  background: var(--mist);
  white-space: nowrap;
}

.fb-post-text {
  margin: 0 18px 14px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fb-post-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--mist);
}
.fb-post-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
}
.fb-post:hover .fb-post-media img { transform: scale(1.03); }
.fb-post-count {
  position: absolute;
  right: 12px; bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: rgba(30, 41, 71, 0.72);
}

.fb-post-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding: 12px 18px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--mist);
}
.fb-likes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--ink);
}
.fb-likes svg {
  width: 20px; height: 20px;
  padding: 4px;
  border-radius: 50%;
  background: var(--aqua-deep);
  color: #fff;
}
.fb-post-stats .fb-more { margin-left: auto; }

/* Toute la carte est cliquable via ce bouton */
.fb-open {
  position: absolute; inset: 0;
  z-index: 1;
  background: none;
  border: 0;
  cursor: pointer;
  border-radius: 16px;
}

/* La publication la plus aimée prend deux colonnes et deux lignes */
.fb-post.is-top { grid-column: span 2; grid-row: span 2; }
.fb-post.is-top .fb-post-media { aspect-ratio: auto; flex: 1; min-height: 320px; }
/* La photo remplit le cadre sans l'agrandir : ce sont les cartes de droite qui donnent la hauteur */
.fb-post.is-top .fb-post-media img { position: absolute; inset: 0; }
.fb-post.is-top .fb-post-text { -webkit-line-clamp: 3; font-size: 1.05rem; }

/* Chargement */
.fb-skeleton {
  min-height: 300px;
  border-radius: 16px;
  background: linear-gradient(100deg, #fff 30%, #f6f9fa 50%, #fff 70%) 0 0 / 250% 100%;
  animation: fb-shine 1.6s linear infinite;
}
.fb-skeleton:first-child { grid-column: span 2; grid-row: span 2; }
@keyframes fb-shine { to { background-position: -250% 0; } }

/* Publication vidéo (reel) */
.fb-play {
  position: absolute;
  left: 12px; bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: rgba(30, 41, 71, 0.72);
}
.fb-play::before {
  content: '';
  border: 5px solid transparent;
  border-left: 8px solid #fff;
  border-right: 0;
}

/* Peu de publications : mise en page adaptée */
.fb-grid[data-count="1"] .fb-post.is-top {
  grid-column: 1 / -1;
  grid-row: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "media head" "media text" "media stats";
}
.fb-grid[data-count="1"] .fb-post.is-top .fb-post-media { grid-area: media; aspect-ratio: 4 / 3; min-height: 0; }
.fb-grid[data-count="1"] .fb-post.is-top .fb-post-head { grid-area: head; padding: 28px 28px 14px; }
.fb-grid[data-count="1"] .fb-post.is-top .fb-post-text { grid-area: text; margin: 0 28px; -webkit-line-clamp: 8; white-space: pre-line; font-size: 1.1rem; }
.fb-grid[data-count="1"] .fb-post.is-top .fb-post-stats { grid-area: stats; align-self: end; padding: 16px 28px; }
.fb-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fb-grid[data-count="2"] .fb-post.is-top { grid-column: auto; grid-row: auto; }
.fb-more-static { color: var(--aqua-deep); font-weight: 600; }

/* ---------- Fenêtre de lecture ---------- */
.fb-modal {
  width: min(1080px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-out),
              overlay 0.4s allow-discrete, display 0.4s allow-discrete;
}
.fb-modal[open] { opacity: 1; transform: none; }
@starting-style { .fb-modal[open] { opacity: 0; transform: translateY(24px) scale(0.98); } }
.fb-modal::backdrop {
  background: rgba(20, 27, 48, 0);
  backdrop-filter: blur(0);
  transition: background 0.4s, backdrop-filter 0.4s, overlay 0.4s allow-discrete, display 0.4s allow-discrete;
}
.fb-modal[open]::backdrop { background: rgba(20, 27, 48, 0.6); backdrop-filter: blur(4px); }
@starting-style { .fb-modal[open]::backdrop { background: rgba(20, 27, 48, 0); backdrop-filter: blur(0); } }

.fb-modal-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  height: min(680px, calc(100dvh - 48px));
}

.fb-gallery { position: relative; background: #0f1525; min-height: 0; }
.fb-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.fb-track::-webkit-scrollbar { display: none; }
.fb-track img {
  flex: 0 0 100%;
  width: 100%; height: 100%;
  object-fit: contain;
  scroll-snap-align: center;
}
.fb-nav {
  position: absolute;
  top: 50%;
  width: 44px; height: 44px;
  margin-top: -22px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: opacity 0.2s, transform 0.3s var(--ease-out);
}
.fb-nav:hover { transform: scale(1.06); }
.fb-nav:disabled { opacity: 0; pointer-events: none; }
.fb-nav svg { width: 20px; height: 20px; }
.fb-prev { left: 14px; }
.fb-next { right: 14px; }
.fb-index {
  position: absolute;
  left: 50%; bottom: 14px;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: rgba(30, 41, 71, 0.72);
}

.fb-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.fb-side .fb-post-head { padding: 22px 24px 14px; padding-right: 64px; }
.fb-side-text {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 20px;
  line-height: 1.65;
  white-space: pre-line;
  overscroll-behavior: contain;
}
.fb-side .fb-post-stats { padding: 14px 24px; border-top: 1px solid var(--line); }
.fb-side-actions { padding: 0 24px 24px; }
.fb-side-actions .h-btn { width: 100%; }

.fb-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--mist);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}
.fb-close:hover { background: var(--line); }
.fb-close svg { width: 18px; height: 18px; }

/* ===================================================
   AVIS
   =================================================== */
.h-quote-wrap { max-width: 900px; }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 968px) {
  .h-hero-grid,
  .h-split,
  .h-about { grid-template-columns: 1fr; }
  .h-hero-photo { max-width: 460px; }
  .h-split-aside { position: static; }
  .fb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fb-post.is-top { grid-row: auto; }
  .fb-post.is-top .fb-post-media { aspect-ratio: 16 / 10; flex: none; min-height: 0; }
  .fb-grid[data-count="1"] .fb-post.is-top { display: flex; }
  .fb-modal-inner { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.1fr) minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .h-services li { grid-template-columns: 1fr; gap: 6px; padding: 22px 0; }
  .h-facts { grid-template-columns: 1fr; gap: 14px; }
  .h-facts div { display: flex; justify-content: space-between; gap: 16px; }
  .h-compare-section .h-compare { aspect-ratio: 4 / 5; }
  .h-hero-actions .h-btn { flex: 1 1 100%; }

  .fb-page { flex-wrap: wrap; }
  .fb-page .h-btn { margin-left: 0; width: 100%; }
  .fb-grid[data-count="1"] > * { flex-basis: 100%; }
  .fb-post.is-top .fb-post-text { font-size: 1rem; }
  .fb-rank { display: none; }
  .fb-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 -24px;
    padding: 0 24px 8px;
    scrollbar-width: none;
  }
  .fb-grid > * { flex: 0 0 84%; scroll-snap-align: start; }
  .fb-modal { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .fb-modal-inner { height: 100dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .h-glass img, .fb-post { transform: none !important; opacity: 1 !important; transition: none !important; }
  .h-fog, .h-blade-x { display: none; }
  .fb-skeleton { animation: none; }
  .fb-modal, .fb-modal::backdrop { transition: none; }
}
