/* SJC Finale — ready-to-wear line-up on an evening stage, and the fitting room.
   Needs rail.css for the shared tokens (.sjc-sr) and the close-up sheet (.sjc-rail-sheet). */

.sjc-finale {
  /* House lights up: every look is visible in its true colours; the chosen one gets the key light. */
  --sf-stage-top: #4b4ea6;
  --sf-stage: #34378a;
  --sf-stage-deep: #25276a;
  --sf-text: #f8f4ee;
  --sf-dim: rgba(248, 244, 238, 0.74);
  --sf-rest: brightness(0.84) saturate(0.9);
  --sf-haze: 37, 39, 106;
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: clamp(56px, 8vw, 104px) 0 clamp(40px, 6vw, 72px);
  background: radial-gradient(120% 75% at 50% 0%, var(--sf-stage-top) 0%, var(--sf-stage) 50%, var(--sf-stage-deep) 100%);
  color: var(--sf-text);
  font-family: var(--sr-sans);
}

.sjc-finale .sf-head {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 16px;
  text-align: center;
}
.sjc-finale .sf-eyebrow {
  margin: 0 0 14px;
  font: 600 11px/1.4 var(--sr-sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sf-dim);
}
.sjc-finale .sf-title {
  margin: 0 0 14px;
  font: 600 clamp(28px, 3.6vw, 40px)/1.15 var(--sr-head);
  letter-spacing: -0.01em;
  color: #fff;
}
.sjc-finale .sf-lede {
  max-width: 52ch;
  margin: 0 auto;
  font: 400 16px/1.6 var(--sr-sans);
  color: var(--sf-dim);
}
.sjc-finale .sf-hint {
  margin: 18px 0 0;
  font: 700 12px/1.4 var(--sr-sans);
  letter-spacing: 0.06em;
  color: #f3c98b;
}
.sjc-finale .sf-hint-touch { display: none; }
@media (hover: none) {
  .sjc-finale .sf-hint-hover { display: none; }
  .sjc-finale .sf-hint-touch { display: inline; }
}

.sjc-finale .sf-stages {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  margin-top: clamp(28px, 4vw, 48px);
}
.sjc-finale .sf-fallback {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
  list-style: none;
}
.sjc-finale .sf-fallback a { color: var(--sf-text); }

/* ---------- Stage ---------- */

.sjc-finale .sf-stage {
  --fh: 380px;
  --pitch: 100px;
  --shift: 80px;
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 1180px;
  margin: 0 auto;
  contain: inline-size;
}

.sjc-finale .sf-stage-label {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin: 0 0 6px;
  font: 400 15px/1.3 var(--sr-serif);
  color: #fff;
}
.sjc-finale .sf-stage-label span {
  font: 700 10.5px/1 var(--sr-sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sf-dim);
}

.sjc-finale .sf-view { position: relative; }
.sjc-finale .is-scroll .sf-view {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.sjc-finale .is-scroll .sf-view::-webkit-scrollbar { display: none; }

/* Stage haze: every figure fades into the floor at the same line. */
.sjc-finale .sf-view::after {
  content: "";
  position: absolute;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  bottom: 0;
  height: calc(var(--fh) * 0.2);
  background: linear-gradient(180deg, rgba(var(--sf-haze), 0) 0%, rgba(var(--sf-haze), 0.85) 80%, rgb(var(--sf-haze)) 100%);
  pointer-events: none;
}
.sjc-finale .sf-stage--tops .sf-view::after { height: calc(var(--fh) * 0.34); }

.sjc-finale .sf-track {
  position: relative;
  display: flex;
  box-sizing: border-box;
  margin: 0;
  padding: 26px 0 0;
  list-style: none;
}
.sjc-finale .is-scroll .sf-track {
  width: max-content;
  min-width: 100%;
}

/* The runway floor line */
.sjc-finale .sf-track::before {
  content: "";
  position: absolute;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(243, 201, 139, 0), rgba(243, 201, 139, 0.35) 30%, rgba(243, 201, 139, 0.35) 70%, rgba(243, 201, 139, 0));
}
.sjc-finale .is-scroll .sf-track::before { left: 0; right: 0; }

.sjc-finale .sf-look {
  position: relative;
  flex: 0 0 var(--pitch);
  width: var(--pitch);
  height: var(--fh);
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}
.sjc-finale .sf-look::before,
.sjc-finale .sf-look::marker { content: none; }
.sjc-finale .is-scroll .sf-look { scroll-snap-align: center; }

.sjc-finale .sf-link {
  position: absolute;
  inset: 0;
  display: block;
  color: inherit;
  text-decoration: none;
  outline: none;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.6s var(--sr-glide);
  -webkit-tap-highlight-color: transparent;
}
.sjc-finale .sf-look.is-before .sf-link { transform: translateX(calc(var(--shift) * -1)); }
.sjc-finale .sf-look.is-after .sf-link { transform: translateX(var(--shift)); }
.sjc-finale .sf-look.is-active .sf-link::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - var(--fw) / 2);
  width: var(--fw);
}

.sjc-finale .sf-fig {
  position: absolute;
  bottom: 0;
  left: calc(50% - var(--fw) / 2);
  display: block;
  width: var(--fw);
  height: var(--fhi, var(--fh));
  pointer-events: none;
}

/* Spotlight: a warm cone behind, a pool of light on the floor. */
.sjc-finale .sf-fig::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: -2%;
  width: calc(var(--fw) * 1.9);
  height: 108%;
  transform: translateX(-50%);
  background:
    radial-gradient(50% 12% at 50% 96%, rgba(255, 232, 190, 0.55), rgba(255, 232, 190, 0) 100%),
    radial-gradient(44% 62% at 50% 50%, rgba(255, 240, 214, 0.28), rgba(255, 240, 214, 0) 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.sjc-finale .sf-look.is-active .sf-fig::before { opacity: 1; }

.sjc-finale .sf-img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  object-fit: contain;
  object-position: 50% 100%;
  transform: scale(0.94);
  transform-origin: 50% 100%;
  filter: var(--sf-rest);
  transition: transform 0.6s var(--sr-settle), filter 0.5s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.sjc-finale .sf-look.is-active .sf-img {
  transform: scale(1.05) translateY(-4px);
  filter: brightness(1.03) drop-shadow(0 18px 26px rgba(10, 10, 40, 0.4));
}
/* While one look is in the light, the rest of the line-up steps back a touch. */
.sjc-finale .sf-track.has-active .sf-look:not(.is-active) .sf-img { filter: brightness(0.7) saturate(0.8); }
.sjc-finale .sf-look.is-lifted .sf-img { visibility: hidden; }

.sjc-finale .sf-link:focus-visible .sf-fig {
  outline: 2px solid #f3c98b;
  outline-offset: 4px;
}

.sjc-finale .sf-caption {
  min-height: 58px;
  margin: 14px 0 0;
  padding: 0 16px;
  text-align: center;
}
.sjc-finale .sf-cap-name {
  display: block;
  font: 400 clamp(19px, 2vw, 23px)/1.25 var(--sr-serif);
  color: #fff;
}
.sjc-finale .sf-cap-meta {
  display: block;
  margin-top: 5px;
  font: 700 11px/1.4 var(--sr-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sf-dim);
}
.sjc-finale .sf-caption.is-swap span { animation: sr-cap 0.32s ease both; }

/* ---------- Fitting room (inside the shared close-up sheet) ---------- */

.sjc-finale-sheet .sff-room {
  --rh: min(560px, 58vh);
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
}
.sjc-finale-sheet .sff-frame {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: min(420px, 34vw);
  height: var(--rh);
  touch-action: pan-y;
  cursor: grab;
}
.sjc-finale-sheet .sff-frame:active { cursor: grabbing; }
.sjc-finale-sheet .sff-frame::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -10px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(60, 40, 20, 0.22), rgba(60, 40, 20, 0));
}
.sjc-finale-sheet .sff-img {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 0;
  max-height: 100%;
  margin: 0;
  transform-origin: 50% 100%;
  transition: transform 0.55s var(--sr-glide), opacity 0.25s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.sjc-finale-sheet .sff-img.is-fading { opacity: 0; }

/* The real studio photo, framed */
.sjc-finale-sheet .sff-frame.is-photo { overflow: hidden; border-radius: 20px; background: #ececec; box-shadow: 0 20px 44px rgba(40, 30, 20, 0.16); }
.sjc-finale-sheet .sff-frame.is-photo::before { display: none; }
.sjc-finale-sheet .sff-frame.is-photo .sff-img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.sjc-finale-sheet .sff-angle--photo { padding: 0; }
.sjc-finale-sheet .sff-angle--photo img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.sjc-finale-sheet .sff-img.is-cropped {
  -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
}

.sjc-finale-sheet .sff-angles {
  display: flex;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s ease 0.15s;
}
.sjc-finale-sheet.is-open .sff-angles { opacity: 1; }
.sjc-finale-sheet .sff-angle {
  display: grid;
  place-items: end center;
  width: 44px;
  height: 56px;
  margin: 0;
  padding: 3px;
  overflow: hidden;
  border: 1px solid var(--sr-line);
  border-radius: 8px;
  background: var(--sr-paper);
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.sjc-finale-sheet .sff-angle img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
}
.sjc-finale-sheet .sff-angle:hover { border-color: var(--sr-ink); background: var(--sr-paper); }
.sjc-finale-sheet .sff-angle[aria-pressed="true"] { border: 1.5px solid var(--sr-indigo); transform: translateY(-2px); }
.sjc-finale-sheet .sff-angle:focus-visible { outline: 2px solid var(--sr-indigo); outline-offset: 2px; }

.sjc-finale-sheet .srs-count { display: none; } /* the angle thumbnails and arrows already orient you */

/* Sizes */
.sjc-finale-sheet .sff-size-head {
  display: flex;
  justify-content: space-between;
  margin: 0 0 8px;
  font: 700 11px/1.4 var(--sr-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sr-muted);
}
.sjc-finale-sheet .sff-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.sjc-finale-sheet .sff-size {
  min-width: 48px;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1.5px solid var(--sr-line);
  border-radius: 10px;
  background: var(--sr-paper);
  color: var(--sr-ink);
  font: 700 14px/1 var(--sr-sans);
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.sjc-finale-sheet .sff-size:hover { border-color: var(--sr-ink); background: var(--sr-paper); color: var(--sr-ink); }
.sjc-finale-sheet .sff-size[aria-checked="true"] { border-color: var(--sr-indigo); background: var(--sr-indigo); color: #fff; }
.sjc-finale-sheet .sff-size:disabled {
  border-style: dashed;
  color: rgba(30, 28, 42, 0.35);
  text-decoration: line-through;
  cursor: not-allowed;
}
.sjc-finale-sheet .sff-size:focus-visible { outline: 2px solid var(--sr-indigo); outline-offset: 2px; }
.sjc-finale-sheet .sff-sizes.is-nudged { animation: sff-nudge 0.4s ease; }
@keyframes sff-nudge {
  25% { transform: translateX(-5px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

.sjc-finale-sheet .srs-add[aria-disabled="true"] {
  background: rgba(235, 49, 55, 0.5);
}
.sjc-finale-sheet .srs-make {
  width: 100%;
  margin: 0;
  font-family: var(--sr-sans);
  text-transform: none;
  cursor: pointer;
}

/* Style x Fabric picker */
.sjc-finale-sheet .sff-fabrics {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--sr-line);
  border-radius: 14px;
  background: var(--sr-paper);
}
.sjc-finale-sheet .sff-fabrics[hidden] { display: none; }
.sjc-finale-sheet .sff-fabrics-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  font: 700 13px/1.4 var(--sr-sans);
  color: var(--sr-ink);
}
.sjc-finale-sheet .sff-fabrics-head a {
  font-weight: 600;
  color: var(--sr-indigo);
  text-underline-offset: 3px;
}
.sjc-finale-sheet .sff-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  max-height: 152px;
  overflow-y: auto;
  padding: 2px;
}
.sjc-finale-sheet .sff-swatch {
  aspect-ratio: 2 / 3;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: #ddd center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sjc-finale-sheet .sff-swatch:hover { transform: translateY(-2px); }
.sjc-finale-sheet .sff-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--sr-paper), 0 0 0 4px var(--sr-indigo); }
.sjc-finale-sheet .sff-swatch:focus-visible { outline: 2px solid var(--sr-indigo); outline-offset: 2px; }
.sjc-finale-sheet .sff-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  font: 400 13px/1.4 var(--sr-sans);
  color: var(--sr-muted);
}
.sjc-finale-sheet .sff-pick b { color: var(--sr-ink); font-weight: 700; }
/* AI preview */
.sjc-finale-sheet .sff-ai {
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin-top: 10px;
  border-color: var(--sr-indigo);
  background: var(--sr-indigo);
  color: #fff;
  font-family: var(--sr-sans);
  text-transform: none;
  cursor: pointer;
}
.sjc-finale-sheet .sff-ai small { font-weight: 600; font-size: 11px; letter-spacing: 0.08em; opacity: 0.8; }
.sjc-finale-sheet .sff-ai:hover { background: #2f3180; color: #fff; }
.sjc-finale-sheet .sff-ai:disabled { opacity: 0.7; cursor: progress; }
.sjc-finale-sheet .sff-ai[hidden] { display: none; }
.sjc-finale-sheet .sff-ai-note { margin: 8px 0 0; font: 400 12.5px/1.45 var(--sr-sans); color: var(--sr-muted); }
.sjc-finale-sheet .sff-ai-note[hidden] { display: none; }

.sjc-finale-sheet .sff-frame.is-preview { align-items: center; }
.sjc-finale-sheet .sff-frame.is-preview .sff-img {
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(40, 30, 20, 0.18);
}
.sjc-finale-sheet .sff-frame.is-preview::before { display: none; }

.sjc-finale-sheet .sff-making {
  position: absolute;
  left: 50%;
  bottom: 18%;
  z-index: 2;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(30, 28, 42, 0.82);
  color: #fff;
  font: 700 12px/1.2 var(--sr-sans);
  letter-spacing: 0.04em;
  white-space: nowrap;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sjc-finale-sheet .sff-frame.is-making .sff-making { opacity: 1; }
.sjc-finale-sheet .sff-frame.is-making .sff-img { animation: sff-breathe 1.6s ease-in-out infinite; }
@keyframes sff-breathe {
  50% { opacity: 0.55; filter: saturate(0.4); }
}

.sjc-finale-sheet .sff-angle--ai { position: relative; border-color: var(--sr-indigo); }
.sjc-finale-sheet .sff-angle--ai img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.sjc-finale-sheet .sff-angle--ai i {
  position: absolute;
  right: 2px;
  bottom: 2px;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--sr-indigo);
  color: #fff;
  font: 800 8px/1.3 var(--sr-sans);
  font-style: normal;
  letter-spacing: 0.06em;
}

.sjc-finale-sheet .sff-send { margin-top: 10px; background: #1f8f4e; color: #fff; }
.sjc-finale-sheet .sff-send:hover { background: #18773f; color: #fff; }
.sjc-finale-sheet .sff-send[hidden] { display: none; }

@media (max-width: 760px) {
  .sjc-finale-sheet .sff-room { --rh: min(46vh, 420px); }
  .sjc-finale-sheet .sff-frame { width: min(64vw, 300px); }
  .sjc-finale-sheet .sff-sizes { justify-content: center; }
  .sjc-finale-sheet .sff-size-head { justify-content: center; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .sjc-finale .sf-link,
  .sjc-finale .sf-img,
  .sjc-finale-sheet .sff-img {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}

/* Bright runway (the default; [sjc_finale stage="evening"] drops this class for the indigo stage). */
.sjc-finale--light {
  --sf-stage-top: #fbf8f3;
  --sf-stage: #f1ece4;
  --sf-stage-deep: #e4ddd2;
  --sf-text: #1e1c2a;
  --sf-dim: #6f675c;
  --sf-rest: brightness(0.97) saturate(0.88);
  --sf-haze: 228, 221, 210;
}
.sjc-finale--light .sf-title,
.sjc-finale--light .sf-stage-label,
.sjc-finale--light .sf-cap-name { color: var(--sr-ink); }
.sjc-finale--light .sf-hint { color: var(--sr-indigo); }
.sjc-finale--light .sf-track::before { background: linear-gradient(90deg, rgba(62, 64, 149, 0), rgba(62, 64, 149, 0.25) 30%, rgba(62, 64, 149, 0.25) 70%, rgba(62, 64, 149, 0)); }
.sjc-finale--light .sf-fig::before {
  background:
    radial-gradient(50% 10% at 50% 97%, rgba(60, 40, 20, 0.22), rgba(60, 40, 20, 0) 100%),
    radial-gradient(44% 62% at 50% 50%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 100%);
}
.sjc-finale--light .sf-look.is-active .sf-img { filter: drop-shadow(0 18px 22px rgba(60, 40, 20, 0.22)); }
.sjc-finale--light .sf-track.has-active .sf-look:not(.is-active) .sf-img { filter: brightness(0.92) saturate(0.7) opacity(0.85); }
