/* ===================================================================
   Horizon Peinture — page Réalisations (hérite de style.css)
   =================================================================== */

/* --- Hero (comme les pages prestations) --- */
.service-hero .eyebrow {
  color: var(--horizon-glow);
}

/* --- Filtres --- */
.filters-section {
  background: var(--horizon-day);
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.filter-btn {
  font: inherit;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--stone);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--horizon-dusk);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.filter-btn:hover {
  border-color: var(--horizon-dusk);
  transform: translateY(-1px);
}
.filter-btn[aria-pressed="true"] {
  background: var(--horizon-dusk);
  border-color: var(--horizon-dusk);
  color: var(--horizon-day);
}
.filter-btn:focus-visible {
  outline: 2px solid var(--horizon-glow);
  outline-offset: 2px;
}

/* --- Grille de réalisations (avant/après) --- */
.realisations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 40px;
}
.realisation-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--stone);
  box-shadow: 0 16px 34px rgba(16, 24, 32, 0.08);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.realisation-card.is-hidden {
  display: none;
}
.realisation-meta {
  padding: 18px 22px 22px;
}
.realisation-meta h3 {
  font-size: 1.15rem;
  margin: 0 0 4px;
}
.realisation-meta .realisation-sub {
  margin: 0;
  color: #5b6570;
  font-size: 0.88rem;
}
.realisation-category-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--horizon-day);
  border: 1px solid var(--stone);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--horizon-dusk);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* --- Composant avant / après --- */
.before-after {
  position: relative;
}
.ba-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--stone);
  user-select: none;
  -webkit-user-select: none;
}
.ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.ba-img-after {
  clip-path: inset(0 0 0 50%);
}
.ba-frame.is-animated .ba-img-after,
.ba-frame.is-animated .ba-divider-line,
.ba-frame.is-animated .ba-range {
  transition: clip-path 0.5s cubic-bezier(0.4, 0, 0.2, 1), left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ba-divider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  background: rgba(246, 243, 236, 0.9);
  box-shadow: 0 0 0 1px rgba(16, 24, 32, 0.15);
  pointer-events: none;
  z-index: 2;
}

.ba-label {
  position: absolute;
  top: 14px;
  z-index: 3;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(16, 24, 32, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--horizon-day);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.ba-label-before {
  left: 14px;
}
.ba-label-after {
  right: 14px;
}

/* Curseur natif <input type="range"> : pilote le clip-path en JS, stylé
   pour ressembler à une poignée de comparaison avant/après. */
.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: ew-resize;
  z-index: 4;
}
.ba-range:focus-visible {
  outline: none;
}
.ba-range::-webkit-slider-runnable-track {
  background: transparent;
  height: 100%;
}
.ba-range::-moz-range-track {
  background: transparent;
  height: 100%;
  border: none;
}
.ba-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 46px;
  height: 46px;
  margin-top: 0;
  border-radius: 50%;
  background-color: var(--horizon-day);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232B4C6F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7l-5 5 5 5M16 7l5 5-5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px;
  border: 3px solid var(--horizon-glow);
  box-shadow: 0 8px 18px rgba(16, 24, 32, 0.35);
  cursor: ew-resize;
}
.ba-range::-moz-range-thumb {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: var(--horizon-day);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232B4C6F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7l-5 5 5 5M16 7l5 5-5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px;
  border: 3px solid var(--horizon-glow);
  box-shadow: 0 8px 18px rgba(16, 24, 32, 0.35);
  cursor: ew-resize;
}
.ba-range:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--horizon-glow);
  outline-offset: 3px;
}
.ba-range:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--horizon-glow);
  outline-offset: 3px;
}

.realisation-demo-badge {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 3;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(225, 154, 92, 0.92);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

@media (prefers-reduced-motion: reduce) {
  .ba-frame.is-animated .ba-img-after,
  .ba-frame.is-animated .ba-divider-line,
  .ba-frame.is-animated .ba-range {
    transition: none;
  }
}

/* --- Note sur le contenu de démonstration --- */
.demo-notice {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: rgba(225, 154, 92, 0.12);
  border: 1px solid rgba(225, 154, 92, 0.4);
  color: #6b4a2a;
  font-size: 0.9rem;
}

/* --- Galerie générale --- */
.gallery-section {
  background: #fff;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.gallery-photo {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: none;
  padding: 0;
  background: none;
  aspect-ratio: 4 / 3;
}
.gallery-photo.is-hidden {
  display: none;
}
.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-photo:hover img {
  transform: scale(1.06);
}
.gallery-photo:focus-visible {
  outline: 2px solid var(--horizon-glow);
  outline-offset: 3px;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 32, 0.85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.lightbox-figure {
  position: relative;
  z-index: 1;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
}
.lightbox-figure img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}
.lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--horizon-day);
  border: none;
  color: var(--ink);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 560px) {
  .lightbox-close {
    top: 8px;
    right: 8px;
  }
}
