/* ==================================================================
   TREATMENTS — formulary INTERIOR refinement (toggleable)
   Restyles only what's inside each dropdown: region headings, intros,
   and the protocol rows (menu-style with dotted leaders). The group
   shells / dropdown behavior are untouched.
   Applies when #formulary carries .is-rows (added by js/trx-rows.js).
   Revert permanently by removing the trx-rows link+script tags from
   treatments.html; on localhost use the floating view toggle.
   ================================================================== */

/* ---- region heading: icon sits beside the name ---- */
#formulary.is-rows .luxe-formulary-region h4 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  padding-bottom: 0.85rem;
}
#formulary.is-rows .luxe-formulary-region h4 .luxe-formulary-intro-icon {
  /* tc.css hides the intro icons with !important — resurface them here */
  display: grid !important;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--luxe-burgundy, #6b2f2a);
  opacity: 0.9;
  flex: 0 0 auto;
}
#formulary.is-rows .luxe-formulary-region h4 .luxe-formulary-intro-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---- intro: lead line + quiet blurb, no leftover icon column ---- */
#formulary.is-rows .luxe-formulary-intro {
  display: block;
  margin-bottom: 1.4rem;
}
#formulary.is-rows .luxe-formulary-intro-areas {
  font-weight: 500;
  color: var(--luxe-ink, #1d1a16);
  margin: 0 0 0.35rem;
  max-width: 56ch;
}
#formulary.is-rows .luxe-formulary-intro-blurb {
  color: var(--luxe-ink-muted, #7d766b);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0;
  max-width: 56ch;
}

/* ---- protocol rows: fine-menu treatment ---- */
#formulary.is-rows .luxe-formulary-list {
  gap: 0;
}
#formulary.is-rows .luxe-formulary-list li {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.8rem 0.4rem;
  margin: 0;
  border-bottom: 1px solid var(--luxe-line-soft, rgba(0, 0, 0, 0.07));
  transition: background 0.16s ease, box-shadow 0.16s ease;
}
#formulary.is-rows .luxe-formulary-list li:last-child { border-bottom: 0; }
#formulary.is-rows .luxe-formulary-list li::before { content: none; }
#formulary.is-rows .luxe-formulary-list li:hover {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 2px 0 0 var(--luxe-burgundy, #6b2f2a);
}

/* label column: the Single / Both … tag becomes quiet small caps */
#formulary.is-rows .luxe-formulary-list .name {
  flex: 0 0 auto;
  min-width: 6.8rem;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--luxe-ink-muted, #7d766b);
}

/* dose becomes the primary reading line */
#formulary.is-rows .luxe-formulary-list .dose {
  flex: 0 1 auto;
  font-family: var(--luxe-sans, var(--sans));
  font-style: normal;
  font-size: 0.97rem;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--luxe-ink, #1d1a16);
  background: none;
  padding: 0;
  border-radius: 0;
  white-space: normal;
}

/* dotted leader between the dose and the action */
#formulary.is-rows .luxe-formulary-list li::after {
  content: "";
  flex: 1 1 2rem;
  order: 2;
  border-bottom: 1px dotted var(--luxe-line-strong, rgba(0, 0, 0, 0.22));
  transform: translateY(-0.28em);
  opacity: 0.65;
  min-width: 1.5rem;
}
#formulary.is-rows .luxe-formulary-list li:not(:has(.trx-inquire))::after {
  content: none;
}

/* the inquire action: quiet text link that wakes on hover */
#formulary.is-rows .luxe-formulary-list .trx-inquire {
  order: 3;
  margin-left: 0;
  appearance: none;
  background: none;
  border: 0;
  padding: 0.1rem 0;
  cursor: pointer;
  font-family: var(--luxe-sans, var(--sans));
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--luxe-burgundy, #6b2f2a);
  white-space: nowrap;
  transition: color 0.16s ease;
}
#formulary.is-rows .luxe-formulary-list .trx-inquire::after {
  content: " →";
  display: inline-block;
  transition: transform 0.16s ease;
}
#formulary.is-rows .luxe-formulary-list li:hover .trx-inquire {
  color: var(--gold-strong, #a67c2e);
}
#formulary.is-rows .luxe-formulary-list li:hover .trx-inquire::after {
  transform: translateX(3px);
}

/* rows that are only a label (e.g. "Both Hips") read as sub-heads */
#formulary.is-rows .luxe-formulary-list li:not(:has(.dose)) .name {
  min-width: 0;
  font-size: 0.7rem;
  color: var(--luxe-burgundy, #6b2f2a);
  padding-top: 0.4rem;
}

@media (max-width: 640px) {
  #formulary.is-rows .luxe-formulary-list li { flex-wrap: wrap; row-gap: 0.15rem; }
  #formulary.is-rows .luxe-formulary-list .name { min-width: 100%; }
  #formulary.is-rows .luxe-formulary-list li::after { display: none; }
  #formulary.is-rows .luxe-formulary-list .trx-inquire { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  #formulary.is-rows .luxe-formulary-list li,
  #formulary.is-rows .luxe-formulary-list .trx-inquire,
  #formulary.is-rows .luxe-formulary-list .trx-inquire::after { transition: none; }
}

/* ---- dev-only view toggle (rendered on localhost only) ---- */
.trx-rows-toggle {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 99998;
  appearance: none;
  border: 1px solid #2c2f36;
  background: #16181d;
  color: #e8e8ec;
  font: 600 12px/1 var(--sans, sans-serif);
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.trx-rows-toggle:hover { background: #262a33; }
