/* ============================================================
   Felix's image slider (behaviour in js/slider.js)
   ------------------------------------------------------------
   Images shown one at a time: arrows on the image, a caption
   under it, then "← Prev  01 / 13  Next →" and numbered buttons
   in windows of ten ("1 2 ... 10 …").
   Plain CSS and JavaScript. No Semplice classes, jQuery or
   Flickity, so it can take over the theme's gallery sliders when
   the Semplice code is removed.

   Markup (the nav buttons are written in the page so each page
   chooses its own labels and languages; the count and the numbers
   are filled in by the script):

   <div class="fc-slider" data-slider aria-label="...">
     <div class="fc-slider-stage">
       <div class="fc-slider-track">
         <div class="fc-slider-slide" title="Next →"><img src alt></div>  ...one per image
       </div>
       <button type="button" class="fc-slider-arrow fc-slider-arrow-prev" data-slider-go="prev" aria-label="Previous image">svg</button>
       <button type="button" class="fc-slider-arrow fc-slider-arrow-next" data-slider-go="next" aria-label="Next image">svg</button>
     </div>
     <div class="fc-slider-caps">                       (optional)
       <div class="fc-slider-cap"><b>title</b><span>text</span></div>  ...one per image
     </div>
     <div class="fc-slider-nav">
       <div class="fc-slider-ctl">
         <button type="button" class="fc-slider-btn fc-slider-prev" data-slider-go="prev"><span class="fc-slider-ar" aria-hidden="true">←</span> Prev</button>
         <span class="fc-slider-count"></span>
         <button type="button" class="fc-slider-btn fc-slider-next" data-slider-go="next">Next <span class="fc-slider-ar" aria-hidden="true">→</span></button>
       </div>
       <div class="fc-slider-pager" role="group" aria-label="Images"></div>
     </div>
   </div>

   Per-instance settings (set on .fc-slider):
     --fc-stage-bg   colour behind the images while they load (default #1B1B1B)
     --fc-ratio      image shape (default 16 / 9)

   Variants (classes on .fc-slider, added 12/3):
     is-adaptive     images of different shapes: put --fc-ratio on each
                     .fc-slider-slide; the box follows the image shown
     is-fade         images cross-fade in place instead of sliding
     is-plain        no frame around the images (no border, no corners)
   Without .fc-slider-caps there is no caption bar; without
   .fc-slider-nav there is no Prev / Next row (arrows only).
   Type follows the page: --fh (heading font) and --k (Korean
   optical scale) are used when the page defines them.
   ============================================================ */

.fc-slider {
  --fc-acc: #FFD300;                 /* the site's theme yellow */
  --fc-line: #2A2A2A;
  --fc-card: #1B1B1B;
  --fc-head: #F2F2F2;
  --fc-text: #C8C8C8;
  --fc-gray: #8A8A8A;
  --fc-mono: "Cousine", monospace;   /* same as the Landing filter */
  position: relative;
}
.fc-slider *, .fc-slider *::before, .fc-slider *::after { box-sizing: border-box; }

/* ---------- images ---------- */
.fc-slider-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--fc-line);
  border-radius: 6px;
  background: var(--fc-stage-bg, #1B1B1B);
  touch-action: pan-y;               /* a sideways swipe changes the image; up and down still scrolls the page */
}
.fc-slider.has-caps .fc-slider-stage { border-bottom: 0; border-radius: 6px 6px 0 0; }
.fc-slider-track { display: flex; transition: transform .35s ease; }
.fc-slider .fc-slider-slide { flex: 0 0 100%; margin: 0; display: block; cursor: pointer; -webkit-user-select: none; user-select: none; }
.fc-slider .fc-slider-slide img {
  display: block; width: 100%; height: auto;
  aspect-ratio: var(--fc-ratio, 16 / 9); object-fit: cover;
  border: 0; border-radius: 0;
  -webkit-user-drag: none;
}

/* is-adaptive: each slide keeps its own shape; the script sets the row's height to the image shown */
.fc-slider.is-adaptive .fc-slider-track { align-items: flex-start; transition: transform .35s ease, height .35s ease; }

/* is-fade: all images in one place, the current one fades in over the others */
.fc-slider.is-fade .fc-slider-track { display: grid; transition: none; }
.fc-slider.is-fade .fc-slider-slide { grid-area: 1 / 1; opacity: 0; pointer-events: none; transition: opacity .45s ease; }
.fc-slider.is-fade .fc-slider-slide.is-current { opacity: 1; pointer-events: auto; z-index: 1; }

/* is-plain: the images sit on the page with no frame */
.fc-slider.is-plain .fc-slider-stage { border: 0; border-radius: 0; background: transparent; }

/* round arrows on the image: they stay put while the images slide */
.fc-slider .fc-slider-arrow {
  -webkit-appearance: none; appearance: none; margin: 0; padding: 0; border: 0;
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11, 15, 20, .5); color: #fff; opacity: .425; cursor: pointer;
  transition: opacity .15s, transform .1s;
}
/* Felix, 12/3: half as visible at rest; on hover they look as they used to at rest; pressed, they shrink a little
   like PREV / NEXT (a bit more than the buttons' .97, as the circle is smaller) */
.fc-slider .fc-slider-arrow:hover { opacity: .85; }
.fc-slider .fc-slider-arrow:active { transform: translateY(-50%) scale(.94); }
.fc-slider .fc-slider-arrow:focus-visible { outline: 2px solid var(--fc-acc); outline-offset: 3px; opacity: .85; }
.fc-slider .fc-slider-arrow-prev { left: 16px; }
.fc-slider .fc-slider-arrow-next { right: 16px; }
.fc-slider .fc-slider-arrow svg { display: block; }

/* ---------- caption under the image ---------- */
.fc-slider-caps { background: var(--fc-card); border: 1px solid var(--fc-line); border-radius: 0 0 6px 6px; }
/* Spacing and line height as the SAM3 storyboard showed them (its captions also took the page's
   figure-caption rule: 14px, 22px lines, 12px more room above), so every slider matches it. */
.fc-slider .fc-slider-cap {
  display: none; gap: 18px; align-items: baseline;
  padding: 26px 18px 15px; font-size: 14px; line-height: 22px; color: var(--fc-gray);
}
.fc-slider .fc-slider-cap.is-current { display: flex; }
.fc-slider .fc-slider-cap b {
  font-family: var(--fh, "Montserrat Bold", "Montserrat", Helvetica, Arial, sans-serif) !important;
  font-weight: 700 !important; font-synthesis: none !important; font-style: normal !important;
  color: var(--fc-head); font-size: calc(16px * var(--k, 1)); white-space: nowrap;
}
/* put the title text in a <span> inside <b>: it then shows at 14.5px in light gray, as on SAM3 */
.fc-slider .fc-slider-cap span { font-size: calc(14.5px * var(--k, 1)); color: var(--fc-text); line-height: 22px; }
/* a caption with a title only: the title may wrap (it keeps to one line only when a description sits beside it) */
.fc-slider .fc-slider-cap b:only-child { white-space: normal; }
@media (max-width: 820px) {
  .fc-slider .fc-slider-cap { flex-direction: column; gap: 4px; }
  .fc-slider .fc-slider-cap b { white-space: normal; }   /* long titles wrap on a phone instead of running out of the box */
}

/* ---------- Prev · count · Next, and the numbers ---------- */
.fc-slider-nav {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px 16px;        /* on a narrow screen the numbers go to their own line */
  margin-top: 14px; min-height: 36px;
}
.fc-slider-ctl { display: flex; align-items: center; gap: 12px; }

/* Same type as the Landing filter: Cousine 13px bold. The shape stays a 6px-corner box.
   Next is the main way forward, so it carries the theme yellow; Prev reads like a filter pill. */
.fc-slider .fc-slider-btn {
  -webkit-appearance: none; appearance: none; margin: 0;
  display: inline-block; padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, .7); border-radius: 6px;
  background: transparent; color: #fff; opacity: .85; cursor: pointer;
  font-family: var(--fc-mono) !important; font-size: 13px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; line-height: 1; white-space: nowrap; -webkit-user-select: none; user-select: none;
  transition: opacity .15s, color .15s, background-color .15s, border-color .15s, transform .1s;
}
.fc-slider .fc-slider-btn:hover { opacity: 1; border-color: #fff; }
.fc-slider .fc-slider-next { color: var(--fc-acc); border-color: var(--fc-acc); background: rgba(255, 211, 0, .1); opacity: 1; }
/* on the last image Next goes back to the first one, so it steps down to the Prev look until hovered */
.fc-slider.is-last .fc-slider-next { color: #fff; border-color: rgba(255, 255, 255, .7); background: transparent; opacity: .85; }
.fc-slider .fc-slider-next:hover,
.fc-slider.is-last .fc-slider-next:hover { background: var(--fc-acc); border-color: var(--fc-acc); color: #151515; opacity: 1; }
.fc-slider .fc-slider-btn:active { transform: scale(.97); }
.fc-slider .fc-slider-btn:focus-visible { outline: 2px solid var(--fc-acc); outline-offset: 3px; opacity: 1; }
.fc-slider .fc-slider-ar { display: inline-block; transition: transform .15s; }
.fc-slider .fc-slider-prev:hover .fc-slider-ar { transform: translateX(-3px); }
.fc-slider .fc-slider-next:hover .fc-slider-ar { transform: translateX(3px); }

/* information, not a button: same face, gray; bold and 14px like the numbers so it reads on the dark page */
.fc-slider .fc-slider-count {
  font-family: var(--fc-mono) !important; font-size: 14px; font-weight: 700; letter-spacing: 0;
  color: var(--fc-gray); white-space: nowrap;
}

.fc-slider-pager { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.fc-slider .fc-slider-num,
.fc-slider .fc-slider-more {
  -webkit-appearance: none; appearance: none; margin: 0; border: 0; background: transparent;
  min-width: 24px; height: 28px; padding: 0 4px; border-radius: 4px; cursor: pointer;
  font-family: var(--fc-mono) !important; font-size: 14px; font-weight: 700; letter-spacing: 0;
  line-height: 28px; text-align: center; color: var(--fc-gray);
  transition: color .15s;
}
.fc-slider .fc-slider-num:hover,
.fc-slider .fc-slider-more:hover { color: #fff; }
.fc-slider .fc-slider-num[aria-current="true"] { color: var(--fc-acc); cursor: default; }
.fc-slider .fc-slider-num:focus-visible,
.fc-slider .fc-slider-more:focus-visible { outline: 2px solid var(--fc-acc); outline-offset: 1px; }
@media (max-width: 400px) {
  .fc-slider-pager { gap: 0; }
  .fc-slider .fc-slider-num, .fc-slider .fc-slider-more { min-width: 22px; padding: 0 3px; }
}

/* spoken to screen readers when the image changes; not shown */
.fc-slider-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .fc-slider-track,
  .fc-slider.is-adaptive .fc-slider-track,
  .fc-slider.is-fade .fc-slider-slide { transition: none; }
  .fc-slider .fc-slider-ar { transition: none; transform: none !important; }
  .fc-slider .fc-slider-btn:active { transform: none; }
  .fc-slider .fc-slider-arrow:active { transform: translateY(-50%); }
}
