/* ===========================================
   folalier.com — homepage slideshow (assets/slideshow.js)
   Full-screen, swipeable in every direction, auto-advancing.
   =========================================== */

/* Black cover from first paint until a slide link (/#031009, /#slideshow) opens
   the slideshow, so the homepage never flashes. Set by the inline script in
   index.html's <head>. */
html.ss-boot::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
}

html.ss-open,
html.ss-open body {
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
}

/* "Start the journey" button in the homepage hero: opens the slideshow. */
.hero-slideshow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 2rem 0.85rem 1.6rem;
  border: 0;
  border-radius: 2rem;
  background: #111;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}
.hero-slideshow:hover {
  background: #000;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.38);
}
.hero-slideshow:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
.hero-slideshow[aria-busy="true"] { cursor: progress; opacity: 0.8; }
.hero-slideshow svg { flex: none; }

.ss {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1001;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: var(--font-ui);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
html.ss-open .ss,
.ss.ss-wait { display: block; }   /* ss-wait: gone full screen, data still loading */

/* ── Slides ── */
.ss-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.ss-slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
  will-change: transform;
  backface-visibility: hidden;
}
.ss-stage.ss-anim .ss-slide {
  transition: transform var(--ss-dur, 300ms) cubic-bezier(0.22, 0.8, 0.24, 1);
}

.ss-bg,
.ss-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  pointer-events: none;
}
.ss-bg {
  object-fit: cover;
  transform: scale(1.15);
  filter: blur(26px) brightness(0.5) saturate(1.15);
}
.ss-media {
  object-fit: contain;
  background: transparent;
}
/* Close to the screen's shape: fill it (slideshow.js, fit) */
.ss-fill .ss-media { object-fit: cover; }
/* Phones in portrait: lift the photo a little so it sits with its caption */
@media (orientation: portrait) {
  .ss-media { object-position: 50% 42%; }
}

/* Video whose autoplay was refused (e.g. iPhone Low Power Mode): tap to play */
.ss-slide.ss-blocked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='white'/%3E%3C/svg%3E") center / 38px no-repeat;
  pointer-events: none;
}

/* ── Caption: date + "Read more"; the full text in reading mode (.ss-read) ──
   Reading mode: the date, the text (.ss-body, scrolls when long), then the foot
   (.ss-foot) — A− A+ over "Show less", at the bottom where "Read more" was.
   Text size: --ss-fs, set from A− / A+ and saved by slideshow.js. */
.ss-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 4rem 1.25rem calc(1.2rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.4) 55%, transparent);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.ss-cap.ss-txt { cursor: pointer; }
.ss-cap-in {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 46rem;
  min-height: 0;
  margin: 0 auto;
  font-size: calc(1rem * var(--ss-fs, 1));
}
.ss-head,
.ss-foot { flex: none; }
.ss-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ss-body.ss-scroll { touch-action: pan-y; }   /* long text: vertical swipes scroll it */
.ss-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.ss-date {
  margin-right: auto;
  font-size: 0.95em;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.ss-date .ss-tag {   /* Film, Early logs, Final logs */
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.05rem 0.5rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 0.1em;
}
.ss-more,
.ss-less,
.ss-size {
  flex: none;
  height: 2rem;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font: 600 0.8rem/1 var(--font-ui);
  letter-spacing: 0.01em;
  text-shadow: none;
  cursor: pointer;
}
.ss-size { width: 2.4rem; padding: 0; }
.ss-size[aria-disabled="true"] { opacity: 0.35; cursor: default; }
.ss-more:focus-visible,
.ss-less:focus-visible,
.ss-size:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (hover: hover) {
  .ss-more:hover,
  .ss-less:hover,
  .ss-size:not([aria-disabled="true"]):hover { background: rgba(255, 255, 255, 0.34); }
}
.ss-foot {
  display: none;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin-top: 0.6em;
}
.ss-sizes {
  grid-column: 2;
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}
.ss-foot .ss-meta { grid-row: 2; grid-column: 1; margin: 0; }
.ss-less { grid-row: 2; grid-column: 2; place-self: end; }   /* at the bottom even beside long details */
.ss-text,
.ss-meta { display: none; }
.ss-text {
  margin-top: 0.55em;
  font-family: var(--font-body);
  font-size: clamp(1em, 0.95em + 0.3vw, 1.2em);
  line-height: 1.45;
  white-space: pre-line;
}
.ss-meta {
  margin-top: 0.5em;
  font-size: 0.72em;
  letter-spacing: 0.02em;
  opacity: 0.7;
}

.ss-read .ss-more { display: none; }
.ss-read .ss-foot { display: grid; }
.ss-read .ss-text,
.ss-read .ss-meta { display: block; }
.ss-read .ss-cap.ss-txt {
  max-height: calc(100% - 4.5rem - env(safe-area-inset-top));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.75) 70%, transparent);
}

/* ── Top bar ── */
.ss-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: calc(0.5rem + env(safe-area-inset-top)) 0.75rem 1.75rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
}
.ss-bar {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.ss-bar > * { pointer-events: auto; }
/* The logo: a link home (slideshow.js), as tall as the buttons to be easy to tap */
.ss-logo {
  display: block;
  margin: 0 auto 0 0.25rem;
  padding: 9px 0;
  border-radius: 4px;
}
.ss-logo img {
  display: block;
  height: 22px;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
.ss-logo:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* Full screen on an iPad: the system's ✕ (60 × 47 pt, at the 20 pt left margin)
   covers the logo's place, so the logo starts after it (slideshow.js, SYSTEM_CLOSE). */
.ss.ss-sysclose .ss-logo { margin-left: 88px; }
.ss-count {
  margin-right: 0.35rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
  pointer-events: none;
}

.ss-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #fff;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
.ss-btn svg { width: 22px; height: 22px; }
.ss-btn[hidden] { display: none; }
.ss-btn:focus-visible,
.ss .lang-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (hover: hover) {
  .ss-btn:hover { background: rgba(255, 255, 255, 0.16); }
}
.ss .lang-toggle {
  margin: 0 0.3rem;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}
.ss .lang-toggle:hover { background: rgba(255, 255, 255, 0.16); color: #fff; border-color: #fff; }

/* Previous / next arrows: mouse users only */
.ss-nav {
  display: none;
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0.55;
}
.ss-nav:hover { opacity: 1; background: rgba(0, 0, 0, 0.55); }
.ss-nav svg { width: 28px; height: 28px; }
.ss-prev { left: 1rem; }
.ss-next { right: 1rem; }
@media (hover: hover) and (pointer: fine) {
  .ss-nav { display: grid; }
  .ss-nav[hidden] { display: none; }
}

/* While the show plays (.ss-auto) the arrows fade out, and in full screen the
   top-bar controls too — the logo stays. Pausing (a tap, Space) brings them back. */
.ss-nav,
.ss-bar > :not(.ss-logo) {
  transition: opacity 0.3s, visibility 0s, background 0.2s, color 0.2s, border-color 0.2s;
}
.ss.ss-auto .ss-nav,
.ss.ss-auto.ss-fullscreen .ss-bar > :not(.ss-logo) {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0s 0.3s;
}

/* ── Feedback: play/pause flash, first-visit hint ── */
.ss-flash {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
}
.ss-flash svg { width: 36px; height: 36px; }
.ss-flash.show { animation: ss-flash 0.7s ease-out; }
@keyframes ss-flash {
  0%   { opacity: 1; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.25); }
}

.ss-hint {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 2;
  max-width: calc(100% - 2rem);
  padding: 0.75rem 1.2rem;
  border-radius: 1.5rem;
  background: rgba(0, 0, 0, 0.6);
  font-size: 0.9rem;
  text-align: center;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.ss-hint.show { opacity: 1; }
.ss-hint .mouse { display: none; }
@media (hover: hover) and (pointer: fine) {
  .ss-hint .touch { display: none; }
  .ss-hint .mouse { display: inline; }
}

@media (max-width: 359px) {
  .ss-count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ss-flash.show { animation: none; }
}
