/* SJC Fabric Rail — prints hang side-on on a studio rail, turn to face you, come off the rail to buy. */

.sjc-sr {
  --sr-calico: #f5f0e8;
  --sr-paper: #fffdf9;
  --sr-ink: #1e1c2a;
  --sr-muted: #6f675c;
  --sr-indigo: #3e4095;
  --sr-red: #eb3137;
  --sr-line: rgba(30, 28, 42, 0.14);
  --sr-settle: cubic-bezier(0.34, 1.28, 0.64, 1);
  --sr-glide: cubic-bezier(0.22, 1, 0.36, 1);
  --sr-sans: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sr-head: "Poppins", var(--sr-sans);
  --sr-serif: "Prata", Georgia, "Times New Roman", serif;
}

/* ---------- Section ---------- */

.sjc-rail {
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: clamp(56px, 8vw, 104px) 0 clamp(36px, 5vw, 64px);
  background: var(--sr-calico);
  color: var(--sr-ink);
  font-family: var(--sr-sans);
}

.sjc-rail .sr-head {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
  text-align: center;
}

.sjc-rail .sr-eyebrow {
  margin: 0 0 14px;
  font: 600 11px/1.4 var(--sr-sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sr-muted);
}

.sjc-rail .sr-title {
  margin: 0 0 14px;
  font: 600 clamp(28px, 3.6vw, 40px)/1.15 var(--sr-head);
  letter-spacing: -0.01em;
  color: var(--sr-ink);
}

.sjc-rail .sr-lede {
  max-width: 50ch;
  margin: 0 auto;
  font: 400 16px/1.6 var(--sr-sans);
  color: var(--sr-muted);
}

.sjc-rail .sr-hint {
  margin: 18px 0 0;
  font: 700 12px/1.4 var(--sr-sans);
  letter-spacing: 0.06em;
  color: var(--sr-indigo);
}

.sjc-rail .sr-hint-touch { display: none; }
@media (hover: none) {
  .sjc-rail .sr-hint-hover { display: none; }
  .sjc-rail .sr-hint-touch { display: inline; }
}

.sjc-rail .sr-rails {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(4px, 1.6vw, 20px);
  margin-top: clamp(24px, 4vw, 44px);
}

/* No-JS / pre-mount list */
.sjc-rail .sr-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-rail .sr-fallback a { color: var(--sr-indigo); }

/* ---------- Rail ---------- */

.sjc-rail .sr-rail {
  --w: 180px;
  --pitch: 50px;
  --shift: 80px;
  --turn: 72deg;
  --pad-top: 20px;
  --bar-h: max(6px, calc(var(--w) * 0.042));
  --bar-y: calc(var(--pad-top) + var(--w) * 0.0575 - var(--bar-h) / 2);
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 1180px;
  margin: 0 auto;
  contain: inline-size; /* the rail sizes to the page, never to its own row of prints */
}

.sjc-rail .sr-view { position: relative; }

.sjc-rail .is-scroll .sr-view {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.sjc-rail .is-scroll .sr-view::-webkit-scrollbar { display: none; }

.sjc-rail .sr-track {
  position: relative;
  z-index: 0;
  display: flex;
  box-sizing: border-box;
  margin: 0;
  padding: var(--pad-top) 0 30px;
  list-style: none;
  perspective: 1800px;
  perspective-origin: 50% 20%;
}
.sjc-rail .is-scroll .sr-track {
  width: max-content;
  min-width: 100%;
}

/* The wooden rail runs wall to wall. */
.sjc-rail .sr-track::before {
  content: "";
  position: absolute;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  top: var(--bar-y);
  height: var(--bar-h);
  background: linear-gradient(180deg, #b78559 0%, #7d4f2c 46%, #4b2e18 100%);
  box-shadow: 0 3px 4px -1px rgba(50, 28, 12, 0.32);
}
.sjc-rail .is-scroll .sr-track::before {
  left: 0;
  right: 0;
}

.sjc-rail .sr-item {
  position: relative;
  flex: 0 0 var(--pitch);
  width: var(--pitch);
  height: calc(var(--w) * 1.7);
  margin: 0;
  padding: 0;
  list-style: none;
  transform-style: preserve-3d;
  pointer-events: none;
}
.sjc-rail .sr-item::before,
.sjc-rail .sr-item::marker { content: none; }

.sjc-rail .is-scroll .sr-item { scroll-snap-align: center; }

/* Neighbours slide apart. The slide lives on the link, not the <li>, so swipe snap points never move. */
.sjc-rail .sr-item.is-active { z-index: 3; }
.sjc-rail .sr-item.is-before :is(.sr-link, .sr-disc) { transform: translateX(calc(var(--shift) * -1)); }
.sjc-rail .sr-item.is-after .sr-link { transform: translateX(var(--shift)); }

/* Size-divider disc hooked on the rail */
.sjc-rail .sr-divider {
  z-index: -1;
  flex-basis: var(--div, 96px);
  width: var(--div, 96px);
  scroll-snap-align: none;
}
.sjc-rail .sr-disc {
  position: absolute;
  top: calc(var(--w) * 0.0575 - 16px);
  left: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 64px;
  height: 64px;
  padding-top: 15px;
  border-radius: 50%;
  background: var(--sr-indigo);
  color: #fff;
  box-shadow: 0 6px 14px rgba(30, 25, 60, 0.18);
  transition: transform 0.62s var(--sr-glide);
}
.sjc-rail .sr-disc b {
  font: 800 8.5px/1 var(--sr-sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.85;
}
.sjc-rail .sr-disc i {
  margin-top: 3px;
  font: 400 15px/1.2 var(--sr-serif);
  font-style: normal;
}
.sjc-rail .sr-rail--b .sr-disc {
  background: var(--sr-paper);
  color: var(--sr-indigo);
  box-shadow: 0 6px 14px rgba(30, 25, 60, 0.12), inset 0 0 0 1.5px var(--sr-indigo);
}

.sjc-rail .sr-link {
  position: absolute;
  inset: 0;
  display: block;
  color: inherit;
  text-decoration: none;
  outline: none;
  cursor: pointer;
  pointer-events: auto;
  transform-style: preserve-3d;
  transition: transform 0.62s var(--sr-glide);
  -webkit-tap-highlight-color: transparent;
}
/* The facing print keeps the pointer while it is turned toward you. */
.sjc-rail .sr-item.is-active .sr-link::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - var(--w) / 2);
  width: var(--w);
}

.sjc-rail .sr-link .sr-turn {
  transform: rotateY(var(--turn));
  transition: transform 0.75s var(--sr-settle);
}
.sjc-rail .sr-item.is-right .sr-turn { transform: rotateY(calc(var(--turn) * -1)); }
.sjc-rail .sr-item.is-active .sr-turn { transform: rotateY(0deg); }
.sjc-rail .sr-item.is-lifted .sr-turn { visibility: hidden; }

.sjc-rail .sr-link:focus-visible .sr-cloth {
  outline: 2px solid var(--sr-indigo);
  outline-offset: 6px;
}

/* Caption under each rail */
.sjc-rail .sr-caption {
  min-height: 58px;
  margin-top: -6px;
  padding: 0 16px;
  text-align: center;
}
.sjc-rail .sr-cap-name {
  display: block;
  font: 400 clamp(19px, 2vw, 23px)/1.25 var(--sr-serif);
  color: var(--sr-ink);
}
.sjc-rail .sr-cap-meta {
  display: block;
  margin-top: 5px;
  font: 700 11px/1.4 var(--sr-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sr-muted);
}
.sjc-rail .sr-caption.is-swap span { animation: sr-cap 0.32s ease both; }
@keyframes sr-cap {
  from { opacity: 0; transform: translateY(4px); }
}

/* ---------- Hanging print (rail + close-up) ---------- */

.sjc-sr .sr-turn {
  position: absolute;
  top: 0;
  left: calc(50% - var(--w) / 2);
  width: var(--w);
  height: calc(var(--w) * 1.7);
  transform-style: preserve-3d;
  pointer-events: none;
}

.sjc-sr .sr-fig {
  position: absolute;
  inset: 0;
  display: block;
  transform-origin: 55% 1%; /* the hook */
}
.sjc-sr .sr-fig.is-swaying { animation: sr-sway 1.6s cubic-bezier(0.3, 0.7, 0.4, 1); }
@keyframes sr-sway {
  0% { rotate: 0deg; }
  22% { rotate: 2.4deg; }
  50% { rotate: -1.5deg; }
  76% { rotate: 0.6deg; }
  100% { rotate: 0deg; }
}

.sjc-sr .sr-hanger {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 200 / 64;
  overflow: visible;
}

.sjc-sr .sr-cloth {
  position: absolute;
  top: calc(var(--w) * 0.25);
  left: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: calc(var(--w) * 1.45);
}

.sjc-sr .sr-layer {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  overflow: hidden;
  background: #e6dac6; /* unprinted calico until the print arrives */
}
/* Fabric folded over the bar: the far half hangs longer behind the near half. */
.sjc-sr .sr-back {
  height: 100%;
  clip-path: polygon(13% 0, 87% 0, 90.5% 98%, 80% 100%, 68% 98.4%, 55% 100%, 42% 98.6%, 30% 100%, 18% 98.3%, 9.5% 98%);
}
.sjc-sr .sr-front {
  height: 87%;
  clip-path: polygon(11% 0, 89% 0, 93% 97%, 86% 99.4%, 78% 97.6%, 65% 100%, 52% 98.2%, 38% 100%, 26% 97.8%, 14% 99.6%, 7% 97%);
}

.sjc-sr .sr-tex {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  object-fit: cover;
}
.sjc-sr .sr-back .sr-tex { transform: scaleX(-1); }
.sjc-sr .is-fallback .sr-tex { transform: scale(1.9); }
.sjc-sr .is-fallback .sr-back .sr-tex { transform: scale(-1.9, 1.9); }

/* Folds: soft vertical light and shade, plus the roll over the bar. */
.sjc-sr .sr-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.sjc-sr .sr-front::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0, rgba(255, 255, 255, 0.22) 2.2%, rgba(255, 255, 255, 0) 6%, rgba(0, 0, 0, 0.1) 7.5%, rgba(0, 0, 0, 0) 12%),
    linear-gradient(90deg,
      rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0) 9%,
      rgba(255, 255, 255, 0.1) 17%, rgba(255, 255, 255, 0) 26%,
      rgba(0, 0, 0, 0.16) 38%, rgba(0, 0, 0, 0) 48%,
      rgba(255, 255, 255, 0.12) 58%, rgba(255, 255, 255, 0) 67%,
      rgba(0, 0, 0, 0.14) 78%, rgba(0, 0, 0, 0) 86%,
      rgba(0, 0, 0, 0.3) 100%);
}
.sjc-sr .sr-back::after {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.1) 30%, rgba(0, 0, 0, 0.2) 70%, rgba(0, 0, 0, 0.38)),
    rgba(0, 0, 0, 0.2);
}

/* Turned-away prints sit in shadow; the facing one is in the light. */
.sjc-sr .sr-dim {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  background: linear-gradient(90deg, rgba(24, 16, 8, 0.12), rgba(24, 16, 8, 0.48));
  transition: opacity 0.6s ease;
}
.sjc-rail .sr-item.is-right .sr-dim { background: linear-gradient(270deg, rgba(24, 16, 8, 0.12), rgba(24, 16, 8, 0.48)); }
.sjc-rail .sr-item.is-active .sr-dim,
.sjc-rail-sheet .sr-dim { opacity: 0; }

.sjc-rail .sr-item.is-active .sr-cloth,
.sjc-rail-sheet .sr-cloth { filter: drop-shadow(0 18px 22px rgba(60, 38, 18, 0.2)); }

/* ---------- Close-up sheet ---------- */

.sjc-rail-sheet {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  color: var(--sr-ink);
  font-family: var(--sr-sans);
}
.sjc-rail-sheet[hidden] { display: none !important; }

.sjc-rail-sheet .srs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(245, 240, 232, 0.97);
  opacity: 0;
  transition: opacity 0.35s ease;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .sjc-rail-sheet .srs-backdrop {
    background: rgba(245, 240, 232, 0.88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}
.sjc-rail-sheet.is-open .srs-backdrop { opacity: 1; }

.sjc-rail-sheet .srs-close {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin: 0;
  padding: 0 14px 0 16px;
  border: 1px solid var(--sr-line);
  border-radius: 999px;
  background: var(--sr-paper);
  color: var(--sr-ink);
  font: 700 13px/1 var(--sr-sans);
  letter-spacing: 0.02em;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease 0.1s, border-color 0.2s ease;
}
.sjc-rail-sheet.is-open .srs-close { opacity: 1; }
.sjc-rail-sheet .srs-close:hover { border-color: var(--sr-ink); background: var(--sr-paper); color: var(--sr-ink); }
.sjc-rail-sheet .srs-close svg { width: 14px; height: 14px; }

.sjc-rail-sheet .srs-body {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(280px, 360px);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
  box-sizing: border-box;
  width: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  padding: 72px 24px 40px;
  overflow-y: auto;
  justify-content: center;
}

.sjc-rail-sheet .srs-stage {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

.sjc-rail-sheet .srs-hero {
  --w: min(340px, 30vw, 46vh);
  position: relative;
  flex: 0 0 auto;
  width: var(--w);
  height: calc(var(--w) * 1.7);
  perspective: 1400px;
  transform-origin: 0 0;
  transition: transform 0.55s var(--sr-glide);
}
.sjc-rail-sheet .srs-hero .sr-turn {
  left: 0;
  transition: transform 0.55s var(--sr-settle);
}
.sjc-rail-sheet .srs-hero .sr-tex { transition: opacity 0.4s ease; }
.sjc-rail-sheet .srs-hero.is-loading .sr-tex { opacity: 0; }
.sjc-rail-sheet .srs-hero.is-loading .sr-front::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 70%) 120% 0 / 250% 100% no-repeat;
  animation: sr-sheen 1.6s ease-in-out infinite;
}
@keyframes sr-sheen {
  to { background-position: -120% 0; }
}

.sjc-rail-sheet .srs-nav {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--sr-line);
  border-radius: 50%;
  background: transparent;
  color: var(--sr-ink);
  box-shadow: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease 0.15s, background-color 0.2s ease, border-color 0.2s ease;
}
.sjc-rail-sheet.is-open .srs-nav { opacity: 1; }
.sjc-rail-sheet .srs-nav:hover { background: var(--sr-paper); border-color: var(--sr-ink); color: var(--sr-ink); }
.sjc-rail-sheet .srs-nav svg { width: 18px; height: 18px; }

.sjc-rail-sheet .srs-count {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -30px;
  margin: 0;
  font: 600 11px/1 var(--sr-head);
  letter-spacing: 0.24em;
  text-align: center;
  color: var(--sr-muted);
  font-variant-numeric: tabular-nums;
}

.sjc-rail-sheet .srs-info {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease 0.12s, transform 0.45s var(--sr-glide) 0.12s;
}
.sjc-rail-sheet.is-open .srs-info { opacity: 1; transform: none; }

.sjc-rail-sheet .srs-eyebrow {
  margin: 0 0 12px;
  font: 700 11px/1.4 var(--sr-sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sr-muted);
}
.sjc-rail-sheet .srs-name {
  margin: 0 0 10px;
  font: 400 clamp(28px, 3.4vw, 40px)/1.12 var(--sr-serif);
  letter-spacing: 0;
  text-transform: none;
  color: var(--sr-ink);
}
.sjc-rail-sheet .srs-price {
  margin: 0 0 26px;
  font: 600 22px/1.2 var(--sr-head);
  color: var(--sr-indigo);
}

.sjc-rail-sheet .srs-actions {
  display: grid;
  gap: 10px;
}
.sjc-rail-sheet .srs-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-sizing: border-box;
  min-height: 52px;
  padding: 0 22px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: 700 14px/1.2 var(--sr-sans);
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.sjc-rail-sheet .srs-btn:active { transform: scale(0.98); }
.sjc-rail-sheet .srs-btn:focus-visible { outline: 2px solid var(--sr-indigo); outline-offset: 3px; }
.sjc-rail-sheet .srs-add { background: var(--sr-red); color: #fff; }
.sjc-rail-sheet .srs-add:hover { background: #d2252b; color: #fff; }
.sjc-rail-sheet .srs-add.is-busy { opacity: 0.75; cursor: progress; }
.sjc-rail-sheet .srs-add.is-done { background: var(--sr-ink); }
.sjc-rail-sheet .srs-make { border-color: var(--sr-indigo); color: var(--sr-indigo); background: transparent; }
.sjc-rail-sheet .srs-make:hover { background: var(--sr-indigo); color: #fff; }
.sjc-rail-sheet .srs-make svg { width: 18px; height: 18px; flex: 0 0 auto; }

.sjc-rail-sheet .srs-trust {
  margin: 14px 0 0;
  font: 400 13px/1.5 var(--sr-sans);
  color: var(--sr-muted);
}

/* The way to the full product page: secondary to the two buttons above, but a real, thumb-sized target. */
.sjc-rail-sheet .srs-arrives {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  margin-top: 18px;
  padding: 10px 16px 10px 10px;
  border: 1.5px solid var(--sr-line);
  border-radius: 14px;
  background: var(--sr-paper);
  color: var(--sr-ink);
  text-align: left;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sjc-rail-sheet .srs-arrives:hover { border-color: var(--sr-ink); box-shadow: 0 6px 16px rgba(40, 30, 20, 0.08); color: var(--sr-ink); }
.sjc-rail-sheet .srs-arrives:focus-visible { outline: 2px solid var(--sr-indigo); outline-offset: 3px; }
.sjc-rail-sheet .srs-arrives img {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  margin: 0;
  border-radius: 9px;
  background: var(--sr-calico);
  object-fit: cover;
}
.sjc-finale-sheet .srs-arrives img { object-fit: contain; object-position: 50% 100%; padding: 3px 0 0; box-sizing: border-box; }
.sjc-rail-sheet .srs-arrives-text { display: grid; flex: 1 1 auto; gap: 2px; min-width: 0; }
.sjc-rail-sheet .srs-arrives-text b { font: 700 14.5px/1.3 var(--sr-sans); color: var(--sr-ink); }
.sjc-rail-sheet .srs-note { font: 400 12.5px/1.4 var(--sr-sans); color: var(--sr-muted); }
.sjc-rail-sheet .srs-arrives svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--sr-indigo); transition: transform 0.2s ease; }
.sjc-rail-sheet .srs-arrives:hover svg { transform: translateX(3px); }

html.sr-locked { overflow: hidden; }

@media (max-width: 760px) {
  .sjc-rail-sheet .srs-body {
    grid-template-columns: 1fr;
    align-content: start;
    justify-items: center;
    gap: 44px;
    height: 100vh;
    height: 100dvh;
    padding: 66px 16px 28px;
  }
  .sjc-rail-sheet .srs-hero { --w: min(56vw, 30vh); }
  .sjc-rail-sheet .srs-info { width: 100%; max-width: 380px; text-align: center; }
  .sjc-rail-sheet .srs-price { margin-bottom: 18px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .sjc-sr .sr-link,
  .sjc-sr .sr-disc,
  .sjc-sr .sr-turn,
  .sjc-sr .sr-dim,
  .sjc-rail-sheet .srs-hero,
  .sjc-rail-sheet .srs-info {
    transition-duration: 0.01ms !important;
  }
  .sjc-sr .sr-fig.is-swaying,
  .sjc-rail-sheet .srs-hero.is-loading .sr-front::before { animation: none; }
}

/* On a category page the page heading already names the collection. */
.sjc-rail.sjc-rail--headless { padding-top: clamp(8px, 2vw, 20px); }
.sjc-rail.sjc-rail--headless .sr-hint { margin-top: 0; }

/* Pages that open with a full-width section: no theme gap above or below the content (body class from SJC_Rail). */
.sjc-full-bleed .site-content { margin-top: 0; margin-bottom: 0; }
