/* Photos (2026-10-28): endless home carousel + full-screen viewer. Script: photos.js. */

/* carousel: 3 photos across on computers, about 1.2 on phones (the next one peeks in) */
.loop { position: relative; margin-top: 36px; --per: 3; --gap: 16px; }
.loop-window { overflow: hidden; }
.loop-track { display: flex; column-gap: var(--gap); will-change: transform; }
.loop-slide { flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per)); margin: 0; position: relative; overflow: hidden; background: #ddd; }
.loop-slide img { width: 100%; height: 330px; object-fit: cover; transition: transform .7s; cursor: zoom-in; }
.loop-slide:hover img { transform: scale(1.05); }
.loop-slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 14px; color: #fff; font-weight: 600; font-size: 15px;
  background: linear-gradient(0deg, rgba(5,15,25,.85), rgba(5,15,25,0)); pointer-events: none; }
.loop-btn { position: absolute; top: 165px; transform: translateY(-50%); z-index: 3; width: 54px; height: 54px; border-radius: 50%; border: 0;
  background: var(--orange); color: #111; font: 400 38px/1 var(--body); cursor: pointer; box-shadow: 0 8px 22px rgba(0,0,0,.25);
  display: grid; place-items: center; padding-bottom: 4px; transition: transform .2s, background .2s; }
.loop-btn:hover { transform: translateY(-50%) scale(1.1); background: #ffb933; }
.loop-prev { left: -22px; }
.loop-next { right: -22px; }
.loop-dots { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.loop-dots button { width: 11px; height: 11px; padding: 0; border-radius: 6px; border: 0; background: #c9c9c9; cursor: pointer; transition: width .3s, background .3s; }
.loop-dots button.on { width: 32px; background: var(--orange); }
/* a thin orange line under the strip shows the time to the next turn; stops while paused */
.loop-window { position: relative; }
.loop::after { content: ""; position: absolute; left: 0; height: 3px; top: 330px; width: 100%; background: var(--orange); transform-origin: left; transform: scaleX(0); animation: loopbar 4s linear infinite; opacity: .9; }
.loop.paused::after { animation-play-state: paused; }
@keyframes loopbar { to { transform: scaleX(1); } }

/* zoomable photos elsewhere */
img.zoomable { cursor: zoom-in; }
img.zoomable:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* full-screen viewer */
/* ".lb .lb-x" not ".lb-x": the old gallery style ".lb button { background: none }" in
   v2-pages.css is more specific and hid the orange circles */
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(5,12,20,.94); display: flex; align-items: center; justify-content: center; padding: 50px 80px; animation: lbIn .25s ease both; cursor: zoom-out; }
.lb[hidden] { display: none; }
.lb figure { margin: 0; max-width: 100%; max-height: 100%; text-align: center; cursor: default; }
.lb img { max-width: 100%; max-height: calc(100vh - 150px); margin: 0 auto; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: lbZoom .35s cubic-bezier(.2,.8,.2,1) both; }
.lb figcaption { color: #fff; margin-top: 14px; font-size: 16px; }
.lb button { position: absolute; border: 0; cursor: pointer; display: grid; place-items: center; }
.lb .lb-x { top: 18px; right: 22px; width: 50px; height: 50px; border-radius: 50%; background: var(--orange); color: #111; font-size: 34px; line-height: 1; padding-bottom: 4px; }
.lb .lb-x:hover { background: #ffb933; transform: rotate(90deg); transition: transform .25s; }
.lb .lb-p, .lb .lb-n { top: 50%; transform: translateY(-50%); width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 40px; padding-bottom: 5px; }
.lb .lb-p:hover, .lb .lb-n:hover { background: var(--orange); color: #111; }
.lb .lb-p { left: 18px; }
.lb .lb-n { right: 18px; }
.lb.single .lb-p, .lb.single .lb-n { display: none; }
.lb-count { position: absolute; left: 24px; top: 30px; color: #c7d2dd; font-size: 15px; letter-spacing: 1px; }
body.lb-open { overflow: hidden; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lbZoom { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

@media (max-width: 1200px) { .loop { --per: 2; } }
@media (max-width: 860px) {
  .loop { --per: 1.15; --gap: 12px; }
  .loop-slide img { height: 240px; }
  .loop-btn { top: 120px; width: 44px; height: 44px; font-size: 30px; }
  .loop-prev { left: 4px; } .loop-next { right: 4px; }
  .loop::after { top: 240px; }
  .lb { padding: 70px 8px 60px; }
  .lb .lb-p, .lb .lb-n { top: auto; bottom: 10px; transform: none; width: 48px; height: 48px; }
  .lb .lb-p { left: calc(50% - 60px); } .lb .lb-n { right: calc(50% - 60px); }
}
@media (prefers-reduced-motion: reduce) {
  .loop-track { transition: none !important; }
  .loop::after, .lb, .lb img { animation: none; }
  .loop::after { display: none; }
}

/* pause / play button next to the dots (WCAG 2.2.2: moving content can be stopped) */
.loop-bar { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 22px; }
.loop-bar .loop-dots { margin-top: 0; }
.loop-toggle { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #111; background: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
.loop-toggle:hover { background: var(--orange); border-color: var(--orange); }
.i-pause { width: 10px; height: 12px; border-left: 3px solid #111; border-right: 3px solid #111; }
.i-play { display: none; width: 0; height: 0; border-left: 11px solid #111; border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }
.loop.stopped .i-pause { display: none; }
.loop.stopped .i-play { display: block; }
.loop.stopped::after { animation: none; transform: scaleX(0); }
/* the countdown line restarts with the timer after an arrow press */
.loop.restart::after { animation: loopbar 4s linear infinite; }
/* reduce-motion visitors: the photos still turn (owner's request) but snap quickly, and the countdown line is shown still */
@media (prefers-reduced-motion: reduce) {
  .loop::after { display: block; animation: none; transform: scaleX(1); opacity: .35; }
}
