/* Nos réalisations (/realisations/) and Our Projects (/projects/).
 * A showcase page: clips you tap to play, three sliders, a photo grid that
 * opens in a lightbox. The section headings, the reviews and the closing call
 * are the cleaning page's own (build-projects.mjs copies them), so nothing
 * here styles them. Written by
 * scripts/build-projects.mjs from content/projects-media.json; the script is
 * public/js/projects.js. Nothing here loads a video: a clip is a poster and
 * a button until it is tapped. */


/* ----- Clips ----- */
.pj-clips { list-style: none; display: grid; grid-template-columns: repeat(var(--pj-n, 5), minmax(0, 1fr)); gap: 18px; }
.pj-clips li { min-width: 0; }
.pj-clip { position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; padding: 0; border: 0; border-radius: 22px; overflow: hidden; background: #14251a; cursor: pointer; font: inherit; color: #fff; box-shadow: 0 14px 40px rgba(20, 37, 26, 0.18); -webkit-tap-highlight-color: transparent; }
.pj-clip img, .pj-clip video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pj-clip::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8, 20, 12, 0.72), rgba(8, 20, 12, 0.04) 55%); pointer-events: none; transition: opacity 0.2s; }
.pj-clip.is-playing::after, .pj-clip.is-playing .pj-play { opacity: 0; }
.pj-play { position: absolute; z-index: 2; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(255, 255, 255, 0.94); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3); transition: transform 0.2s var(--ease), opacity 0.2s; }
.pj-play svg { width: 22px; height: 22px; margin-left: 3px; fill: var(--g-deep, #14251a); }
.pj-clip:hover .pj-play { transform: scale(1.08); }
.pj-clip:focus-visible { outline: 3px solid #f2c14e; outline-offset: 3px; }
.pj-clip-title { position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 12px; font: 800 1.15rem/1.15 'Outfit', sans-serif; text-align: left; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45); transition: opacity 0.2s; }
.pj-clip.is-playing .pj-clip-title { opacity: 0; }
/* Between the tap and the first frame: a small ring on the tile. */
.pj-clip.is-loading::before { content: ""; position: absolute; z-index: 3; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.35); border-top-color: #ffffff; animation: pj-spin 0.8s linear infinite; pointer-events: none; }
@keyframes pj-spin { to { transform: rotate(360deg); } }

/* ----- Sliders ----- */
.pj-ba-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: 1100px; margin: 0 auto; }
.pj-ba-item { margin: 0; min-width: 0; }
.pj-ba { position: relative; height: 520px; overflow: hidden; border-radius: 20px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15); user-select: none; -webkit-user-select: none; touch-action: pan-y; cursor: ew-resize; background: #14251a; transform: translate3d(0, 0, 0); }
.pj-ba:focus-visible { outline: 3px solid #f2c14e; outline-offset: 3px; }
.pj-ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; pointer-events: none; }
/* The slider moves with transform only, as on the homepage (home-b.css): the
 * "before" layer slides left inside the box while its picture slides right by
 * the same amount, so the picture stays put and only the edge moves. */
.pj-ba-over { position: absolute; inset: 0; overflow: hidden; transform: translate3d(-50%, 0, 0); will-change: transform; }
.pj-ba-over img { border-radius: 0; transform: translate3d(50%, 0, 0); will-change: transform; }
.pj-ba-tag { position: absolute; bottom: 14px; z-index: 4; background: rgba(0, 0, 0, 0.72); color: #f7f3ea; font-size: 0.875rem; font-weight: 700; padding: 5px 14px; border-radius: 30px; letter-spacing: 1.5px; text-transform: uppercase; pointer-events: none; }
.pj-ba-tag.is-before { left: 14px; }
.pj-ba-tag.is-after { right: 14px; background: var(--g); }
.pj-ba-line { position: absolute; inset: 0; z-index: 3; pointer-events: none; will-change: transform; }
.pj-ba-line::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: #fff; }
.pj-ba-knob { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4); transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
@media (hover: hover) and (pointer: fine) { .pj-ba:hover .pj-ba-knob { transform: scale(1.1); } }
.pj-ba.pj-drag .pj-ba-knob { transform: scale(0.94); }
.pj-ba-knob svg { width: 20px; height: 20px; }
.pj-ba-cap { text-align: center; color: var(--body); font-weight: 600; font-size: 1rem; margin-top: 12px; }

/* ----- Photo grid ----- */
.pj-grid { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pj-grid li { min-width: 0; }
.pj-photo { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: #e2ede4; cursor: zoom-in; font: inherit; color: #fff; box-shadow: 0 8px 24px rgba(20, 37, 26, 0.12); -webkit-tap-highlight-color: transparent; }
.pj-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s var(--ease); }
.pj-photo:hover img { transform: scale(1.04); }
.pj-photo:focus-visible { outline: 3px solid #f2c14e; outline-offset: 3px; }
.pj-photo-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 12px 10px; background: linear-gradient(to top, rgba(8, 20, 12, 0.78), rgba(8, 20, 12, 0)); font: 700 0.95rem/1.2 'Outfit', sans-serif; text-align: left; }

.pj-more { text-align: center; margin-top: 24px; }

/* ----- Closing call ----- */

/* ----- Lightbox ----- */
.pj-lb { position: fixed; inset: 0; z-index: 10000; background: rgba(6, 14, 9, 0.94); display: none; align-items: center; justify-content: center; touch-action: pan-y; }
.pj-lb.is-open { display: flex; }
.pj-lb-fig { margin: 0; max-width: min(92vw, 900px); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 0 20px; }
.pj-lb-fig img { max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); width: auto; height: auto; border-radius: 12px; object-fit: contain; }
.pj-lb-cap { color: #f7f3ea; font: 700 1.05rem/1.3 'Outfit', sans-serif; text-align: center; }
.pj-lb-count { color: rgba(247, 243, 234, 0.7); font-size: 0.9rem; }
.pj-lb-btn { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.16); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pj-lb-btn:hover { background: rgba(255, 255, 255, 0.28); }
.pj-lb-btn:focus-visible { outline: 3px solid #f2c14e; outline-offset: 2px; }
.pj-lb-btn svg { width: 24px; height: 24px; }
.pj-lb-close { top: 12px; right: 12px; }
.pj-lb-prev { left: 12px; top: 50%; margin-top: -24px; }
.pj-lb-next { right: 12px; top: 50%; margin-top: -24px; }
html.pj-lb-lock, html.pj-lb-lock body { overflow: hidden; }

/* ----- Soft band edges, as on the service pages -----
 * On the cleaning page the band after the reviews fades in from the reviews'
 * dark green (.sv-wait, --pv-above #15311d) and the closing photo fades in from
 * the band above it. Here the band after the reviews is the photo grid, and the
 * band above the closing photo is the same stone. Same six-stop ramp. */
html body.place-v2 #photos:not(#dv) {
  background-image: linear-gradient(to bottom,
    #15311d 0%,
    color-mix(in srgb, #15311d 90%, transparent) 20%,
    color-mix(in srgb, #15311d 65%, transparent) 40%,
    color-mix(in srgb, #15311d 35%, transparent) 60%,
    color-mix(in srgb, #15311d 10%, transparent) 80%,
    transparent 100%) !important;
  background-size: 100% 64px !important;
  background-repeat: no-repeat !important;
}
html body.place-v2 #cta-final::before { --pv-a: #eaf0eb; --pv-b: rgba(234, 240, 235, 0); }

/* ----- Compact hero (Emile 2026-11-09: show the work on the first screen) -----
 * Same hero, same H1 class and size as the service pages; only its height is
 * the height of its own content instead of the whole screen, so the live clips
 * start inside the first screen. */
@media (min-width: 769px) {
  html body.pj-page.place-v2 section#hero { min-height: 0 !important; padding: 108px 0 40px !important; }
  html body.pj-page.place-v2 #hero .dv-assure { display: none; } /* the closing card carries the same line */
}

/* ----- Phone ----- */
@media (max-width: 768px) {
  /* Compact hero card: the photo shows a little sky above the words and stops there, so
     the clip row starts inside the first screen. */
  html body.pj-page.place-v2:not(#pp) #hero .hero-bg-container { min-height: 340px; }
  html body.pj-page.place-v2:not(#pp) #hero .hero-subtitle { margin-bottom: 18px !important; }
  /* The closing photo's soft top (the phone look turns the shared one off). */
  html body.place-v2:not(#pp) #cta-final::before {
    display: block !important;
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    z-index: 6;
    pointer-events: none;
    background: linear-gradient(to bottom,
      #eaf0eb 0%,
      rgba(234, 240, 235, 0.9) 20%,
      rgba(234, 240, 235, 0.65) 40%,
      rgba(234, 240, 235, 0.35) 60%,
      rgba(234, 240, 235, 0.1) 80%,
      rgba(234, 240, 235, 0) 100%);
  }
  /* The section rhythm and titles of the service pages' bands (#etapes,
     #quand in site.css "Service page template"), for this page's three bands. */
  html body.place-v2:not(#pp) #direct,
  html body.place-v2:not(#pp) #avant-apres,
  /* 20 px at the sides, the gutter of the cleaning page's bands (the shared phone
     rule zeroes the .container padding; until 2026-11-15 these three ran edge to edge). */
  html body.place-v2:not(#pp) #photos { position: relative !important; margin: 0 !important; padding: 72px 20px 64px !important; border: 0 !important; }
  /* A clearly different tint under the hero card (the shared stone sat 0.021 OKLab from it). */
  html body.place-v2:not(#pp) #direct:not(#dv) { background-color: #dbe8df !important; }
  html body.place-v2:not(#pp) #direct h2,
  html body.place-v2:not(#pp) #avant-apres h2,
  html body.place-v2:not(#pp) #photos h2 {
    margin: 0 !important; font-family: 'Outfit', sans-serif !important; font-size: 32px !important; line-height: 1.06 !important;
    font-weight: 800 !important; letter-spacing: -0.035em !important; color: var(--pp-forest) !important; text-align: center !important;
  }
  html body.place-v2:not(#pp) #direct .section-title-wrap,
  html body.place-v2:not(#pp) #avant-apres .section-title-wrap,
  html body.place-v2:not(#pp) #photos .section-title-wrap { margin: 0 0 24px !important; text-align: center !important; }
  html body.place-v2:not(#pp) #avant-apres .section-subtitle { margin: 10px 0 0 !important; text-align: center !important; }

  /* A swipe row showing about two clips at once. */
  /* Runs to both screen edges; the first tile sits on the 20 px gutter and snaps back to it
     (scroll-padding), so it is never cut at the left edge. */
  .pj-clips { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; -webkit-overflow-scrolling: touch; margin: 0 -20px; padding: 4px 20px 14px; scrollbar-width: none; }
  .pj-clips::-webkit-scrollbar { display: none; }
  .pj-clips li { flex: 0 0 calc((100% - 12px) / 2.25); scroll-snap-align: start; }
  .pj-clip { border-radius: 18px; }
  .pj-clip-title { font-size: 1rem; left: 10px; right: 10px; bottom: 10px; }

  /* Pair B across the width, the two others side by side below it. */
  .pj-ba-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .pj-ba-item:first-child { grid-column: 1 / -1; }
  .pj-ba { height: 300px; border-radius: 16px; }
  .pj-ba-item:not(:first-child) .pj-ba { height: 230px; border-radius: 14px; }
  .pj-ba-item:not(:first-child) .pj-ba-tag { bottom: 8px; font-size: 0.875rem; padding: 3px 9px; letter-spacing: 0; text-transform: none; }
  .pj-ba-item:not(:first-child) .pj-ba-tag.is-before { left: 8px; }
  .pj-ba-item:not(:first-child) .pj-ba-tag.is-after { right: 8px; }
  .pj-ba-item:not(:first-child) .pj-ba-knob { width: 32px; height: 32px; margin: -16px 0 0 -16px; }
  .pj-ba-item:not(:first-child) .pj-ba-knob svg { width: 14px; height: 14px; }
  .pj-ba-cap { font-size: 0.9rem; margin-top: 8px; }

  .pj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pj-photo { aspect-ratio: 1 / 1.05; border-radius: 14px; }
  .pj-photo-cap { font-size: 0.875rem; padding: 22px 10px 8px; }


  .pj-lb-fig { max-width: 100vw; padding: 60px 0 16px; }
  .pj-lb-fig img { border-radius: 0; max-height: calc(100dvh - 160px); }
  .pj-lb-prev { left: 6px; }
  .pj-lb-next { right: 6px; }
}

/* ----- Arrivals, as on the homepage (home-b.css "reveals") -----
 * Section titles, clip tiles, slider cards and photo tiles (.pj-r) rise 30 px and
 * fade in when they reach the screen; projects.js staggers the ones that arrive
 * together, 90 ms apart. Only html.pj-js hides them, set inline just before
 * <main>, and it is taken off again if projects.js never starts, so the page is
 * complete without scripts. Off under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .pj-js .pj-r { opacity: 0; transform: translate3d(0, 30px, 0); }
  .pj-js .pj-r.pj-in {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--pj-d, 0) * 90ms);
  }
  .pj-js .pj-r.pj-done { transition-delay: 0s; }
}

@media (prefers-reduced-motion: reduce) {
  .pj-photo img, .pj-play, .pj-clip::after { transition: none; }
  .pj-ba-knob { transition: none; }
  .pj-clip.is-loading::before { animation: none; }
}
