/* =========================================================
   RING FINDER  sentence variant
   A sentence with four tappable blanks that open a tray of options. Uses the
   theme's own tokens and the same dark / light palette as Shop by Category
   and the stepper Ring Finder. Every rule is anchored to .rs-section or uses
   an rs- prefixed class.
   ========================================================= */
.rs-section {
  --rs-bg: var(--fm-black);
  --rs-ink: var(--fm-cream);
  --rs-muted: var(--fm-cream-dim);
  --rs-accent: var(--fm-gold);
  --rs-on-accent: var(--fm-black);
  --rs-card-bg: rgba(255, 255, 255, 0.03);
  --rs-line: rgba(var(--fm-rgb-gold), 0.25);
  --rs-tile-bg: rgba(255, 255, 255, 0.04);
  --rs-tile-line: rgba(var(--fm-rgb-gold), 0.3);

  position: relative;
  background: var(--rs-bg);
  padding: 8px 24px 76px;
}
.rs-section *,
.rs-section *::before,
.rs-section *::after { box-sizing: border-box; }
:where(.rs-section) button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.rs-wrap { max-width: 900px; margin: 0 auto; }
.rs-lede {
  margin: 0 0 30px;
  text-align: center;
  font-family: var(--fm-font-serif);
  font-size: clamp(15px, 1.4vw, 19px);
  color: var(--rs-muted);
}

/* ---------------- card + sentence ---------------- */
.rs-card {
  overflow: hidden;
  background: var(--rs-card-bg);
  border: 1px solid var(--rs-line);
  border-radius: var(--fm-radius-md);
  box-shadow: 0 1px 2px rgba(60, 40, 15, 0.04), 0 8px 24px rgba(60, 40, 15, 0.05);
}
.rs-sentence {
  margin: 0;
  padding: 40px clamp(18px, 5vw, 56px) 28px;
  text-align: center;
  font-family: var(--fm-font-serif);
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 2;
  color: var(--rs-ink);
}
.rs-slot {
  display: inline-block;
  padding: 0 4px 1px;
  font-family: var(--fm-font-serif);
  font-size: inherit;
  line-height: 1.35;
  color: var(--rs-accent);
  border-bottom: 2px solid var(--rs-accent);
  transition: background var(--fm-duration-base) var(--fm-ease), color var(--fm-duration-base) var(--fm-ease);
}
.rs-slot.is-empty { border-bottom-style: dashed; }
.rs-slot:hover,
.rs-slot[aria-expanded="true"] {
  background: var(--rs-accent);
  color: var(--rs-on-accent);
  border-radius: var(--fm-radius-sm) var(--fm-radius-sm) 0 0;
}

/* ---------------- option tray (height animates 0 -> auto) ---------------- */
.rs-tray {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--fm-duration-med) var(--fm-ease);
}
.rs-tray.is-open { grid-template-rows: 1fr; }
.rs-tray-inner { min-height: 0; overflow: hidden; }
.rs-tray.is-open .rs-tray-inner { padding: 6px clamp(18px, 5vw, 56px) 8px; }
.rs-hint {
  margin: 0 0 20px;
  text-align: center;
  font-family: var(--fm-font-serif);
  font-size: 16px;
  color: var(--rs-muted);
}
.rs-opts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding-bottom: 16px;
}
.rs-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 0 0 auto;
  width: 112px;
  min-height: 128px;
  padding: 14px 8px;
  text-align: center;
  font-family: var(--fm-font-serif);
  font-size: 15px;
  line-height: 1.25;
  color: var(--rs-ink);
  background: var(--rs-tile-bg);
  border: 1px solid var(--rs-tile-line);
  border-radius: var(--fm-radius-lg);
  transition: background var(--fm-duration-base) var(--fm-ease), color var(--fm-duration-base) var(--fm-ease), border-color var(--fm-duration-base) var(--fm-ease), transform var(--fm-duration-med) var(--fm-ease), box-shadow var(--fm-duration-med) var(--fm-ease);
}
.rs-opt:hover {
  border-color: var(--rs-accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(168, 117, 42, 0.16);
}
.rs-opt[aria-pressed="true"] {
  background: var(--rs-accent);
  border-color: var(--rs-accent);
  color: var(--rs-on-accent);
}
.rs-opt--price { width: 190px; min-height: 84px; font-size: 20px; }
.rs-opt .rf-ico { width: 48px; height: 48px; color: var(--rs-accent); }
.rs-opt .rf-ico--style { width: 62px; height: 62px; }
.rs-opt[aria-pressed="true"] .rf-ico { color: var(--rs-on-accent); }
.rs-opt .rf-sw {
  width: 52px;
  height: 52px;
  border-radius: var(--fm-radius-circle);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 8px 14px -8px rgba(0, 0, 0, 0.4);
}

/* ---------------- footer ---------------- */
.rs-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 8px 24px 34px;
}
.rs-btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--fm-radius-pill);
  font-family: var(--fm-font-serif);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--fm-duration-base) var(--fm-ease), color var(--fm-duration-base) var(--fm-ease), opacity var(--fm-duration-base) var(--fm-ease);
}
.rs-btn--ghost { color: var(--rs-muted); }
.rs-btn--ghost:hover { color: var(--rs-ink); }
.rs-btn--main { background: var(--rs-accent); color: var(--rs-on-accent); }
.rs-btn--main:hover { opacity: 0.85; }
.rs-btn[hidden] { display: none; }
.rs-slot:focus-visible,
.rs-opt:focus-visible,
.rs-btn:focus-visible { outline: 2px solid var(--rs-accent); outline-offset: 3px; border-radius: var(--fm-radius-sm); }

/* ---------------- responsive ---------------- */
@media (max-width: 700px) {
  .rs-section { padding: 0 16px 52px; }
  .rs-sentence { padding-top: 28px; line-height: 1.9; }
  .rs-opts { gap: 10px; }
  .rs-opt { width: calc(33.333% - 7px); min-height: 112px; font-size: 13px; }
  .rs-opt--price { width: calc(50% - 5px); min-height: 72px; font-size: 17px; }
  .rs-opt .rf-ico { width: 40px; height: 40px; }
  .rs-opt .rf-ico--style { width: 52px; height: 52px; }
  .rs-opt .rf-sw { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .rs-tray, .rs-slot, .rs-opt, .rs-btn { transition: none; }
  .rs-opt:hover { transform: none; }
}

/* ---------------- LIGHT THEME ----------------
   Same palette as Shop by Category / the stepper Ring Finder. */
html[data-theme="light"] .rs-section {
  --rs-bg: #F5EDE6;
  --rs-ink: #1a1714;
  --rs-muted: #5b554d;
  --rs-accent: #a8752a;
  --rs-on-accent: #ffffff;
  --rs-card-bg: rgba(255, 255, 255, 0.75);
  --rs-line: #eadfcf;
  --rs-tile-bg: linear-gradient(180deg, #fffdf9 0%, #faf5ee 100%);
  --rs-tile-line: #e6d9c6;
}
