/* ==========================================================================
   Ishwar Jewellers — SECTION · Men's Rings
   --------------------------------------------------------------------------
   Same interaction language as the Earrings section (css/earrings.css): no
   pinning; five glass display panels hang from wires and sway gently; the
   panels themselves ARE the collection rail, autoplaying; the Featured Piece
   column crossfades to the active panel; dragging the group rotates the
   whole hanging arrangement a few degrees and springs back. Reuses the same
   showroom background as Earrings. Adds one thing Earrings doesn't need: a
   Gold / Silver tab toggle that swaps which five-panel set is hanging —
   both rails/hang-groups live in the DOM at once, gated by `.is-out` (the
   same phase-gate class the rail/drag controllers in js/sections.js already
   understand from the bangles gold→silver transformation).
   ========================================================================== */

.gjmr {
  --gjmr-gold: #a9853c;
  --gjmr-brown: #6b4d1e;
  --gjmr-ink: #4a3a22;
  --gjmr-silver: #8b9198;
  --gjmr-silver-dark: #5b6167;
  --gjmr-body: #7a6a52;
  --gjmr-ivory: #f6f0e4;
  position: relative;
  background: var(--gjmr-ivory);
  font-family: "Jost", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}

.gjmr__stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
}

.gjmr::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 64px;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(to bottom, #f5efe2, rgba(245, 239, 226, 0));
}

/* ------------------------------------------------- fixed-aspect scene layer */
.gjmr__scene {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: max(100vw, 177.78svh);
  aspect-ratio: 1536 / 864;
  container-type: size;
}

.gjmr__scene > picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* two backgrounds (gold showroom / silver-bg-new.png showroom) stacked and
   crossfaded by the same `.is-out` toggle the metal tabs already drive */
.gjmr__bg {
  position: absolute;
  inset: 0;
  transition: opacity 0.6s ease;
}

.gjmr__bg.is-out { opacity: 0; }

.gjmr__bg picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ------------------------------------------------------- hanging panels */
.gjmr__hangwrap {
  position: absolute;
  inset: 0;
  transform-origin: 50% -4%;
  will-change: transform;
}

.gjmr__hangwrap.is-springing { transition: transform 0.9s cubic-bezier(0.2, 1.2, 0.3, 1); }

/* one hang-group per metal, absolutely stacked; the toggle crossfades them */
.gjmr__group {
  position: absolute;
  inset: 0;
  transition: opacity 0.5s ease;
}

.gjmr__group.is-out {
  opacity: 0;
  pointer-events: none;
}

.gjmr__rail { position: absolute; inset: 0; }

.gjmr__panel {
  position: absolute;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: var(--gjmr-ink);
}

.gjmr__hang {
  position: relative;
  display: block;
  transform-origin: 50% 0;
  animation: gjmr-sway var(--swayd, 7.5s) ease-in-out var(--swayo, 0s) infinite alternate;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

@keyframes gjmr-sway {
  from { rotate: calc(var(--swayr, 1.2deg) * -1); }
  to   { rotate: var(--swayr, 1.2deg); }
}

.gjmr__hang img {
  width: 100%;
  height: auto;
  display: block;
  -webkit-user-drag: none;
  transition: filter 0.5s ease;
}

/* hover: refined lift + glow, label brightens (autoplay pauses via the rail) */
.gjmr__panel:hover .gjmr__hang,
.gjmr__panel:focus-visible .gjmr__hang { transform: translateY(-8px); }

.gjmr__panel:hover .gjmr__hang img { filter: brightness(1.045); }

/* active panel: the featured one */
.gjmr__panel.is-active .gjmr__hang img {
  filter: brightness(1.055) drop-shadow(0 20px 34px rgba(160, 118, 48, 0.26));
}

.gjmr__panel.is-active .gjmr__panel-label { color: var(--gjmr-brown); }

/* labels sit below the glass case (not overlaid on it - on smaller panels
   the glass artwork leaves too little of its own transparent margin for an
   in-image label to read cleanly, so it's set just under the case instead) */
.gjmr__panel-label {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  text-align: center;
  font-size: clamp(8px, 0.72cqw, 12px);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6d5a3c;
  transition: color 0.4s ease;
  pointer-events: none;
}

.gjmr__panel--side .gjmr__panel-label { line-height: 1.5; }

.gjmr__panel--hero .gjmr__panel-label {
  top: calc(100% + 12px);
  font-size: clamp(9px, 0.8cqw, 13.5px);
  letter-spacing: 0.22em;
}

.gjmr__panel--hero .gjmr__panel-label::after {
  content: "";
  display: block;
  width: 44px;
  height: 1px;
  margin: 7px auto 0;
  background: linear-gradient(to right, rgba(169, 133, 60, 0), rgba(169, 133, 60, 0.8), rgba(169, 133, 60, 0));
  transition: background 0.4s ease;
}

/* the silver hang-group carries `data-metal-panel="silver"` regardless of
   which tab is active, so these can key off it directly rather than the
   root's `data-active-metal` — the ring labels, active-panel glow and hero
   underline all switch from warm gold to cool silver for that group. */
[data-metal-panel="silver"] .gjmr__panel-label { color: var(--gjmr-silver-dark); }

[data-metal-panel="silver"] .gjmr__panel.is-active .gjmr__panel-label { color: #40454a; }

[data-metal-panel="silver"] .gjmr__panel.is-active .gjmr__hang img {
  filter: brightness(1.055) drop-shadow(0 20px 34px rgba(91, 97, 103, 0.3));
}

[data-metal-panel="silver"] .gjmr__panel--hero .gjmr__panel-label::after {
  background: linear-gradient(to right, rgba(91, 97, 103, 0), rgba(91, 97, 103, 0.85), rgba(91, 97, 103, 0));
}

/* ------------------------------------------------- scene furniture (HTML) */
.gjmr__badge {
  position: absolute;
  left: 84.9%;
  top: 70.5%;
  width: 5.9cqw;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #e8c87c, #b3893a 68%, #936d26);
  box-shadow: 0 10px 24px rgba(140, 100, 40, 0.35), inset 0 1px 6px rgba(255, 240, 200, 0.8);
  color: #fffaf0;
  font-size: clamp(10px, 1.05cqw, 17px);
  font-weight: 500;
  letter-spacing: 0.06em;
  pointer-events: none;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.gjmr__badge::before {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px dashed rgba(255, 250, 235, 0.65);
  border-radius: 50%;
}

.gjmr__drag {
  position: absolute;
  left: 91.3%;
  top: 72.8%;
  margin: 0;
  color: #8a6f3a;
  font-size: clamp(8px, 0.72cqw, 12px);
  font-weight: 500;
  letter-spacing: 0.24em;
  line-height: 2;
  text-transform: uppercase;
  pointer-events: none;
  transition: color 0.4s ease;
}

.gjmr__drag span { display: block; letter-spacing: 0.5em; color: rgba(138, 111, 58, 0.8); transition: color 0.4s ease; }

/* --------------------------------------------------------- left editorial */
.gjmr__copy {
  position: absolute;
  left: clamp(20px, 7vw, 112px);
  top: 6.5svh;
  width: clamp(220px, 16.5vw, 280px);
  z-index: 3;
}

.gjmr__eyebrow {
  margin: 0 0 1vw;
  color: var(--gjmr-gold);
  font-size: clamp(10px, 0.82vw, 13.5px);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.4s ease;
}

.gjmr__title {
  margin: 0 0 1vw;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(30px, 3.1vw, 52px);
  line-height: 1.08;
  color: #6d5124;
  transition: color 0.4s ease;
}

.gjmr__orn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 1.1vw;
}

.gjmr__orn i { width: clamp(46px, 5vw, 80px); height: 1px; background: rgba(169, 133, 60, 0.7); transition: background 0.4s ease; }

.gjmr__orn::after {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid var(--gjmr-gold);
  transform: rotate(45deg);
  transition: border-color 0.4s ease;
}

.gjmr__desc {
  margin: 0 0 1.4vw;
  font-size: clamp(12.5px, 0.98vw, 16.5px);
  line-height: 1.6;
  color: var(--gjmr-body);
}

.gjmr__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.8vw;
  padding: clamp(10px, 0.9vw, 15px) clamp(18px, 1.7vw, 28px);
  border: 1px solid rgba(169, 133, 60, 0.75);
  color: var(--gjmr-brown);
  background: rgba(255, 252, 244, 0.4);
  text-decoration: none;
  font-size: clamp(10px, 0.8vw, 13px);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

.gjmr__cta span { font-size: 1.3em; transition: transform 0.35s ease; }
.gjmr__cta:hover, .gjmr__cta:focus-visible { background: var(--gjmr-gold); color: #fffcf4; }
.gjmr__cta:hover span { transform: translateX(5px); }

/* -------------------------------------------------------- metal tab toggle */
.gjmr__tabs {
  display: inline-flex;
  gap: 6px;
  margin: 0 0 1.4vw;
  padding: 4px;
  border: 1px solid rgba(169, 133, 60, 0.4);
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.55);
}

.gjmr__tabs button {
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  padding: clamp(6px, 0.6vw, 9px) clamp(14px, 1.3vw, 20px);
  border-radius: 999px;
  font-size: clamp(10px, 0.78vw, 12.5px);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gjmr-body);
  transition: background 0.3s ease, color 0.3s ease;
}

.gjmr__tabs button[data-metal="gold"].is-active {
  background: linear-gradient(135deg, #d4b06a, var(--gjmr-gold) 60%, #8a6a2c);
  color: #fffcf4;
}

.gjmr__tabs button[data-metal="silver"].is-active {
  background: linear-gradient(135deg, #d6dadd, var(--gjmr-silver) 60%, var(--gjmr-silver-dark));
  color: #fffcf4;
}

.gjmr__tabs button:not(.is-active):hover { color: var(--gjmr-brown); }

/* cue --------------------------------------------------------------------- */
.gjmr__cue {
  position: absolute;
  left: clamp(16px, 2.4vw, 40px);
  bottom: 7svh;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  color: #8a6f3a;
}

.gjmr__cue i {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(169, 133, 60, 0.7);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 13px;
  animation: gjmr-nudge 2.3s ease-in-out infinite;
}

@keyframes gjmr-nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}

.gjmr__cue span {
  font-size: clamp(9px, 0.76vw, 12px);
  font-weight: 500;
  letter-spacing: 0.26em;
  line-height: 1.8;
  text-transform: uppercase;
}

/* ------------------------------------------------- featured piece (right) */
.gjmr__featured {
  position: absolute;
  right: clamp(18px, 2.4vw, 40px);
  top: 6.5svh;
  width: clamp(230px, 17vw, 280px);
  z-index: 3;
}

.gjmr__featured-eyebrow {
  margin: 0 0 0.9vw;
  color: var(--gjmr-gold);
  font-size: clamp(10px, 0.82vw, 13.5px);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  transition: color 0.4s ease;
}

.gjmr__featured-name {
  margin: 0 0 0.9vw;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(24px, 2.2vw, 38px);
  line-height: 1.1;
  color: #6d5124;
  transition: color 0.4s ease;
}

.gjmr__featured-orn { width: 54px; height: 1px; background: rgba(169, 133, 60, 0.7); margin: 0 0 1vw; position: relative; transition: background 0.4s ease; }

.gjmr__featured-orn::after {
  content: "";
  position: absolute;
  right: -8px;
  top: -2.5px;
  width: 5px;
  height: 5px;
  border: 1px solid var(--gjmr-gold);
  transform: rotate(45deg);
  transition: border-color 0.4s ease;
}

.gjmr__featured-desc {
  margin: 0 0 1.4vw;
  font-size: clamp(11.5px, 0.92vw, 15px);
  line-height: 1.55;
  color: var(--gjmr-body);
}

.gjmr__specs { display: grid; gap: clamp(9px, 1.3svh, 15px); margin: 0; padding: 0; list-style: none; }

.gjmr__specs li { display: flex; align-items: flex-start; gap: clamp(10px, 0.85vw, 15px); }

.gjmr__tile {
  flex: 0 0 clamp(36px, 3vw, 50px);
  height: clamp(36px, 3vw, 50px);
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(to bottom, #fbf6ea, #f3ebd8);
  border: 1px solid rgba(190, 154, 78, 0.45);
  box-shadow: 0 6px 14px rgba(150, 110, 50, 0.1);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.gjmr__tile svg {
  width: 55%;
  height: 55%;
  stroke: #a8823f;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.4s ease;
}

.gjmr__specs h4 {
  margin: 0 0 2px;
  font-size: clamp(12px, 0.95vw, 15.5px);
  font-weight: 500;
  color: var(--gjmr-ink);
  transition: color 0.4s ease;
}

.gjmr__specs p {
  margin: 0;
  font-size: clamp(10.5px, 0.84vw, 13.5px);
  line-height: 1.4;
  color: #8a7758;
}

/* --------------------------------------------------- silver-mode retheme
   `data-active-metal` is set on the section root by the metal-tab handler
   in js/sections.js; when silver is selected, every gold-tinted accent in
   the section (copy, dividers, CTA, drag hint, featured column, spec icons,
   the 360° badge) switches from the warm gold palette to cool silver. */
.gjmr[data-active-metal="silver"] .gjmr__eyebrow,
.gjmr[data-active-metal="silver"] .gjmr__featured-eyebrow {
  color: var(--gjmr-silver-dark);
}

.gjmr[data-active-metal="silver"] .gjmr__title,
.gjmr[data-active-metal="silver"] .gjmr__featured-name {
  color: var(--gjmr-silver-dark);
}

.gjmr[data-active-metal="silver"] .gjmr__orn i,
.gjmr[data-active-metal="silver"] .gjmr__featured-orn {
  background: rgba(91, 97, 103, 0.55);
}

.gjmr[data-active-metal="silver"] .gjmr__orn::after,
.gjmr[data-active-metal="silver"] .gjmr__featured-orn::after {
  border-color: var(--gjmr-silver-dark);
}

.gjmr[data-active-metal="silver"] .gjmr__cta {
  border-color: rgba(91, 97, 103, 0.6);
  color: var(--gjmr-silver-dark);
}

.gjmr[data-active-metal="silver"] .gjmr__cta:hover,
.gjmr[data-active-metal="silver"] .gjmr__cta:focus-visible {
  background: var(--gjmr-silver-dark);
  color: #fffcf4;
}

.gjmr[data-active-metal="silver"] .gjmr__drag { color: var(--gjmr-silver-dark); }
.gjmr[data-active-metal="silver"] .gjmr__drag span { color: rgba(91, 97, 103, 0.8); }

.gjmr[data-active-metal="silver"] .gjmr__specs h4 { color: #33373b; }

.gjmr[data-active-metal="silver"] .gjmr__tile {
  background: linear-gradient(to bottom, #f2f4f5, #e2e6e9);
  border-color: rgba(139, 145, 152, 0.5);
  box-shadow: 0 6px 14px rgba(91, 97, 103, 0.14);
}

.gjmr[data-active-metal="silver"] .gjmr__tile svg { stroke: var(--gjmr-silver-dark); }

.gjmr[data-active-metal="silver"] .gjmr__badge {
  background: radial-gradient(circle at 35% 30%, #eef1f3, var(--gjmr-silver) 68%, var(--gjmr-silver-dark));
  box-shadow: 0 10px 24px rgba(91, 97, 103, 0.35), inset 0 1px 6px rgba(255, 255, 255, 0.75);
}

/* clean crossfade when the active ring changes */
.gjmr__featured [data-f] { transition: opacity 0.22s ease, transform 0.22s ease; }

.gjmr__featured.is-swapping [data-f] { opacity: 0; transform: translateY(5px) scale(0.99); }

.gjmr__view-m { position: absolute; inset: 0; }

/* --------------------------------------------------------- soft reveal */
.js .gjmr [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.85s ease, transform 1s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0s);
}

.js .gjmr [data-reveal="drop"] { transform: translateY(-22px); }
.js .gjmr.is-in [data-reveal] { opacity: 1; transform: none; }

/* --------------------------------------------------------------- compact */
@media (max-width: 1023px) {
  .gjmr__stage { height: auto; min-height: 0; }

  .gjmr__copy {
    position: relative;
    inset: auto;
    width: auto;
    padding: 46px clamp(20px, 6vw, 56px) 22px;
  }

  .gjmr__eyebrow { font-size: 11px; margin-bottom: 10px; }
  .gjmr__title { font-size: clamp(30px, 7.8vw, 44px); margin-bottom: 10px; }
  .gjmr__desc { font-size: clamp(14px, 3.8vw, 16px); margin-bottom: 18px; }
  .gjmr__cta { padding: 12px 22px; font-size: 11px; gap: 8px; }

  .gjmr__view-m {
    position: relative;
    height: clamp(320px, 52svh, 500px);
    overflow: hidden;
  }

  .gjmr__scene {
    width: max(100%, calc(clamp(320px, 52svh, 500px) * 1.7778));
    top: 50%;
  }

  .gjmr__badge, .gjmr__drag { display: none; }
  .gjmr__cue { display: none; }

  /* the silver corner pieces are sized up for desktop's wider stage; on the
     narrower mobile scene (already cropped at the sides) that extra size
     pushes their labels past the visible edge, so trim back toward their
     original footprint here */
  [data-metal-panel="silver"] .gjmr__panel--corner { width: 9% !important; }

  .gjmr__featured {
    position: relative;
    inset: auto;
    width: auto;
    padding: 28px clamp(20px, 6vw, 56px) 42px;
  }

  .gjmr__featured-name { font-size: 26px; }
  .gjmr__featured-desc { font-size: 14px; margin-bottom: 16px; }
  .gjmr__specs { gap: 12px; }
  .gjmr__tile { flex-basis: 44px; height: 44px; }
}

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .gjmr__hang { animation: none; transition: none; }
  .gjmr__panel:hover .gjmr__hang { transform: none; }
  .gjmr__cue i { animation: none; }
  .gjmr__hangwrap, .gjmr__hangwrap.is-springing { transition: none; }
  .gjmr__group { transition: none; }
  .js .gjmr [data-reveal] { transform: none !important; transition: opacity 0.6s ease; }
}
