/* About page: a calm timed carousel left of the intro text
   (assets/about-carousel.js). One photo in focus, the previous and next
   peeking in at the stage edges, a thin progress bar under the focused photo
   that doubles as the pause button. */
/* the carousel floats left; the text wraps beside it and runs on full width below */
.about-intro {
  display: flow-root;
  margin-top: var(--space-m);
}
.about-intro .about-text p { max-width: none; }

.ac {
  --ac-h: 330px;          /* photo zone height: constant, so nothing shifts */
  --ac-peek: .13;         /* share of a peek's width left visible */
  position: relative;
  outline: none;
  float: left;
  width: min(48%, 560px);
  margin: 0 clamp(24px, 3.5vw, 52px) var(--space-s) 0;
}
.ac:focus-visible .ac-stage { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); border-radius: var(--radius-l); }

.ac-stage {
  position: relative;
  height: var(--ac-h);
  overflow: hidden;
  touch-action: pan-y;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
}

.ac-img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  object-fit: cover;
  border-radius: var(--radius-l);
  background: var(--bg-raised);
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 450ms var(--ease-out), opacity 450ms var(--ease-out), box-shadow 450ms var(--ease-out);
}
.ac-img.is-peek { cursor: pointer; }
.ac-img.is-focus { box-shadow: var(--shadow-1); }
.ac.no-anim .ac-img { transition: none; }

/* the progress bar (also a pause toggle) and a small pause / play button */
.ac-row { display: flex; align-items: center; gap: 10px; margin: -4px auto 0; }
.ac-bar {
  display: block;
  position: relative;
  flex: 1;
  height: 14px;               /* hit area; the line itself is 3px */
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.ac-bar::before, .ac-fill {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
}
.ac-bar::before { background: var(--line-strong); }
.ac-fill { background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.ac-bar[aria-pressed="true"] .ac-fill { opacity: .55; }
.ac-bar:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.ac-pause {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: var(--hairline) solid var(--line-strong);
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.ac-pause:hover, .ac-pause:focus-visible { color: var(--control); border-color: var(--control); }
.ac-pause:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 2px; }
.ac-pause svg { width: 12px; height: 12px; }
.ac-pause path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ac-pause .i-play { display: none; fill: currentColor; stroke: none; }
.ac-pause[aria-pressed="true"] .i-pause { display: none; }
.ac-pause[aria-pressed="true"] .i-play { display: block; }

/* the description, on the focused photo, only while it is hovered */
.ac-tip {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  margin: 0;
  padding: var(--space-s) var(--space-s) 14px;
  border-radius: var(--radius-l);
  background: linear-gradient(to top, rgb(0 0 0 / .62), rgb(0 0 0 / .18) 42%, transparent 60%);
  color: #fff;
  font-size: var(--text-md);
  font-weight: var(--weight-strong);
  line-height: 1.3;
  text-shadow: 0 1px 6px rgb(0 0 0 / .5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms var(--ease-out);
}
.ac-tip:empty { display: none; }
.ac-stage:has(.ac-img.is-focus:hover) .ac-tip,
.ac:focus-visible .ac-tip { opacity: 1; }

/* without the script: the first photo, still */
.ac:not(.ac-on) .ac-img { position: static; width: 100%; height: 100%; }
.ac:not(.ac-on) .ac-img ~ .ac-img { display: none; }
.ac:not(.ac-on) .ac-row { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ac-img { transition: opacity 150ms linear; }
  .ac-row { display: none; }
}

@media (max-width: 700px) {
  .ac { --ac-h: clamp(200px, 56vw, 300px); --ac-peek: .08; float: none; width: auto; margin: 0 0 var(--space-m); }
  .ac-stage {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
  }
}
