/* ============================================================
   SCRIBENEX — production supplements
   Bridges the prototype's class-based components to the
   static, JS-free markup this build emits (details/summary,
   wizard steps, star buttons, filters).
   ============================================================ */

/* ---------- Accordion via <details> (keyboard accessible) ---------- */
.acc details.acc-item { border-bottom: 1px solid var(--line); }
.acc details.acc-item > summary.acc-q {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  color: var(--ink);
  font-weight: 500;
}
.acc details.acc-item > summary.acc-q::-webkit-details-marker { display: none; }
.acc details.acc-item .pm {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  color: var(--gold-text);
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.acc details.acc-item[open] .pm { transform: rotate(45deg); background: var(--gold-tint); }
.acc details.acc-item .acc-a > div { padding: 0 0 22px; }
.acc details.acc-item .acc-a p { color: var(--muted); margin: 0; max-width: 70ch; }

/* ---------- Wizard ---------- */
.wizard-steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 26px;
  counter-reset: w;
}
.wizard-steps li {
  flex: 1 1 130px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--subtle);
  padding: 8px 10px;
  border-radius: var(--r);
  background: var(--paper-2);
  border: 1px solid transparent;
}
.wizard-steps li.is-active { color: var(--ink); background: var(--gold-tint); border-color: #E8D9B8; }

.wizard-step { border: 0; margin: 0; padding: 0; min-width: 0; }
.wizard-step legend { padding: 0; }
.wizard-step[hidden] { display: none !important; }

/* ---------- Star rating buttons ---------- */
.star-btn {
  background: none;
  border: 0;
  padding: 2px;
  cursor: pointer;
  color: var(--line-2);
  line-height: 0;
  transition: color .15s var(--ease), transform .15s var(--ease);
}
.star-btn svg { fill: none; stroke: currentColor; }
.star-btn.on { color: var(--gold); }
.star-btn.on svg { fill: var(--gold); }
.star-btn:hover { transform: translateY(-1px); }
.stars[role="radiogroup"] { display: inline-flex; gap: 4px; }

/* ---------- Segmented control (buttons) ---------- */
.seg button { border: 0; background: transparent; cursor: pointer; }
.seg button.is-on { background: var(--surface); box-shadow: var(--sh-1); color: var(--ink); font-weight: 600; }

/* ---------- Chips ---------- */
.btn[aria-pressed="true"] { font-weight: 600; }

/* ---------- Filter sidebar ---------- */
.filters .check { cursor: pointer; }
.filters .check input { accent-color: var(--ink); }

/* ---------- Sticky side nav ---------- */
.side-nav a { cursor: pointer; }

/* ---------- Mobile drawer via <details> ---------- */
details.mobile-menu { position: relative; }
details.mobile-menu > summary { list-style: none; cursor: pointer; }
details.mobile-menu > summary::-webkit-details-marker { display: none; }
details.mobile-menu .drawer-back {
  position: fixed; inset: 0;
  background: rgba(19,34,63,.42);
  z-index: 90;
  animation: snxFade .2s var(--ease);
}
details.mobile-menu .drawer { z-index: 100; }
details.mobile-menu .drawer-close { cursor: pointer; color: var(--ink); display: grid; place-items: center; }
details.mobile-menu[open] body { overflow: hidden; }
.drawer-group-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink);
  padding: 14px 0 6px;
}
.drawer-group ul { list-style: none; margin: 0; padding: 0 0 10px; }
.drawer-group ul li a {
  display: block;
  padding: 9px 0 9px 14px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .95rem;
  border-left: 2px solid var(--line);
}
.drawer-group ul li a:hover { border-left-color: var(--gold); color: var(--ink); }

@keyframes snxFade { from { opacity: 0 } to { opacity: 1 } }

/* ---------- Nav dropdown keyboard/hover bridge ---------- */
.nav-item.open > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-item { position: relative; }

/* ---------- Detail page grid + review summary on mobile ---------- */
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr !important; }
  .rev-sum { grid-template-columns: 1fr !important; }
}

/* ---------- Reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
