/* =====================================================================
   Bill Explorer
   Interactive sample bill for the "bill-explorer" content-strip style.
   Markup: includes/strips/bill-explorer.php

   - Self-contained: nothing here depends on main.css.
   - px only. styles.css sets html { font-size: 50px }, so rem sizing
     would blow up inside this component.
   - Specificity: strip themes in main-base.css recolour descendants, e.g.
       .content-strips section.colour :is(... p ...)            (0,2,3)
       .content-strips section.colour :is(.btn, button)         (0,3,1)
       .content-strips section.colour :is(.btn:hover, ...)      (0,4,1)
     Text rules below use three classes and every button carries
     .bx-btn plus its own class, so these rules win on every theme
     without !important or relying on stylesheet order.
   ===================================================================== */

.bill-explorer {
  --bx-blue: #155EA6;
  --bx-navy: #0B3259;
  --bx-green: #86b738;
  --bx-text: #4A4A4A;
  --bx-muted: #5f6b7a;
  --bx-line: #e1e6ec;
  --bx-tint: #eef4fb;
  --bx-dim: rgba(11, 50, 89, 0.45);
  --bx-radius: 12px;
  --bx-marker: 34px;
  --bx-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  margin-top: 40px;
  font-family: "Noto Sans", sans-serif;
}

.bill-explorer .bx-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 36px;
  align-items: start;
}

/* ---------- Bill ---------- */
.bill-explorer .bx-layout .bx-figure {
  margin: 0;
}
.bill-explorer .bx-figure .bx-sheet {
  background: #fff;
  border-radius: var(--bx-radius);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(11, 50, 89, 0.08), 0 14px 34px rgba(11, 50, 89, 0.18);
}
.bill-explorer .bx-sheet .bx-stage {
  position: relative;
}
.bill-explorer .bx-stage .bx-bill {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
}
/* A <p> on purpose: the strip theme recolours paragraphs (white on colour
   and dark strips), so the caption always contrasts with its background. */
.bill-explorer .bx-figure .bx-caption {
  margin: 12px 4px 0;
  font-size: 13px;
  line-height: 20px;
  opacity: 0.9;
}

/* Spotlight: dims everything but the selected region. The dim layer is
   clipped to the bill; the markers sit above it and are not clipped. */
.bill-explorer .bx-stage .bx-dim {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
}
.bill-explorer .bx-dim .bx-spot {
  position: absolute;
  border-radius: 6px;
  box-shadow: 0 0 0 3px var(--bx-green), 0 0 0 4000px var(--bx-dim);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.bill-explorer .bx-stage .bx-dim.is-on .bx-spot {
  opacity: 1;
}
.bill-explorer .bx-stage .bx-dim.is-animated .bx-spot {
  transition: left 0.45s var(--bx-ease), top 0.45s var(--bx-ease),
    width 0.45s var(--bx-ease), height 0.45s var(--bx-ease), opacity 0.25s ease;
}

/* ---------- Markers ---------- */
/* A marker is anchored on a corner of its region (data-corner) and nudged
   diagonally outward, so it straddles the box corner instead of covering
   the first characters inside the box. */
.bill-explorer .bx-stage .bx-btn.bx-marker {
  --bx-nudge: calc(var(--bx-marker) * 0.26);
  --bx-dx: calc(var(--bx-nudge) * -1);
  --bx-dy: calc(var(--bx-nudge) * -1);
  position: absolute;
  z-index: 2;
  width: var(--bx-marker);
  height: var(--bx-marker);
  margin: calc(var(--bx-marker) / -2 + var(--bx-dy)) 0 0 calc(var(--bx-marker) / -2 + var(--bx-dx));
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--bx-blue);
  color: #fff;
  font: 700 15px/1 "Noto Sans", sans-serif;
  box-shadow: 0 2px 6px rgba(11, 50, 89, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.bill-explorer .bx-stage .bx-btn.bx-marker[data-corner$="r"] {
  --bx-dx: var(--bx-nudge);
}
.bill-explorer .bx-stage .bx-btn.bx-marker[data-corner^="b"] {
  --bx-dy: var(--bx-nudge);
}
.bill-explorer .bx-stage .bx-btn.bx-marker::before {
  /* 48px touch target without a bigger visual */
  content: "";
  position: absolute;
  top: -8px;
  right: -8px;
  bottom: -8px;
  left: -8px;
  border-radius: 50%;
}
.bill-explorer .bx-stage .bx-btn.bx-marker:hover {
  background: var(--bx-navy);
  color: #fff;
  transform: scale(1.08);
}
.bill-explorer .bx-stage .bx-btn.bx-marker[aria-current="true"] {
  background: var(--bx-navy);
  color: #fff;
  transform: scale(1.14);
  box-shadow: 0 0 0 4px var(--bx-green), 0 4px 12px rgba(11, 50, 89, 0.45);
}
.bill-explorer .bx-stage .bx-btn.bx-marker:focus {
  outline: none;
}
.bill-explorer .bx-stage .bx-btn.bx-marker:focus-visible {
  outline: 3px solid var(--bx-navy);
  outline-offset: 4px;
}

.bill-explorer.bx-hint .bx-stage .bx-btn.bx-marker {
  animation: bx-pulse 1.1s ease-out 2;
  animation-delay: calc(var(--bx-i, 0) * 70ms);
}
@keyframes bx-pulse {
  0% { box-shadow: 0 0 0 0 rgba(21, 94, 166, 0.55), 0 2px 6px rgba(11, 50, 89, 0.35); }
  100% { box-shadow: 0 0 0 14px rgba(21, 94, 166, 0), 0 2px 6px rgba(11, 50, 89, 0.35); }
}

/* ---------- Panel / card ---------- */
.bill-explorer .bx-layout .bx-panel {
  position: relative;
  align-self: stretch;
}
.bill-explorer .bx-panel .bx-card {
  background: #fff;
  color: var(--bx-text);
  border-radius: var(--bx-radius);
  padding: 26px 28px 24px;
  box-shadow: 0 1px 2px rgba(11, 50, 89, 0.08), 0 14px 34px rgba(11, 50, 89, 0.18);
}
.bill-explorer.bx-ready.bx-wide .bx-panel .bx-card {
  position: absolute;
  left: 0;
  right: 0;
}
.bill-explorer.bx-ready.bx-wide.bx-animate .bx-panel .bx-card {
  transition: top 0.45s var(--bx-ease);
}
.bill-explorer .bx-panel .bx-card:focus {
  outline: none;
}

.bill-explorer .bx-card .bx-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bx-blue);
}
.bill-explorer .bx-card .bx-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  color: var(--bx-navy);
}
.bill-explorer .bx-card .bx-lede {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 24px;
  color: var(--bx-muted);
}
.bill-explorer .bx-card .bx-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bx-blue);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}

/* Rich-text body (comes from the admin editor) */
.bill-explorer .bx-card .bx-body {
  font-size: 16px;
  line-height: 26px;
}
.bill-explorer .bx-card .bx-body p,
.bill-explorer .bx-card .bx-body li {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 26px;
  color: var(--bx-text);
}
.bill-explorer .bx-card .bx-body ul {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.bill-explorer .bx-card .bx-body ul li {
  position: relative;
  padding-left: 20px;
}
.bill-explorer .bx-card .bx-body ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bx-green);
}
.bill-explorer .bx-card .bx-body strong {
  color: var(--bx-navy);
}
.bill-explorer .bx-card .bx-body a:not(.button):not(.superbutton) {
  color: var(--bx-blue);
  text-decoration: underline;
}
.bill-explorer .bx-card .bx-body > :last-child {
  margin-bottom: 0;
}

/* Intro list of sections */
.bill-explorer .bx-card .bx-toc {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--bx-line);
}
.bill-explorer .bx-card .bx-toc li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--bx-line);
}
.bill-explorer .bx-toc li .bx-btn.bx-toc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 8px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--bx-navy);
  font: 700 15px/20px "Noto Sans", sans-serif;
  text-align: left;
  cursor: pointer;
}
.bill-explorer .bx-toc li .bx-btn.bx-toc-item:hover {
  background: var(--bx-tint);
  color: var(--bx-navy);
}
.bill-explorer .bx-toc .bx-toc-item .bx-num {
  width: 26px;
  height: 26px;
  font-size: 13px;
}
.bill-explorer .bx-toc .bx-toc-item .bx-toc-label {
  flex: 1 1 auto;
}
.bill-explorer .bx-toc .bx-toc-item .bx-toc-go {
  flex: 0 0 auto;
  color: var(--bx-blue);
  font-size: 20px;
  line-height: 1;
}

/* Detail header + pager */
.bill-explorer .bx-card .bx-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -6px 0 14px;
}
.bill-explorer .bx-item-top .bx-btn.bx-all,
.bill-explorer .bx-item-top .bx-btn.bx-locate {
  margin: 0;
  padding: 6px 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--bx-blue);
  font: 700 14px/20px "Noto Sans", sans-serif;
  cursor: pointer;
}
.bill-explorer .bx-item-top .bx-btn.bx-all:hover,
.bill-explorer .bx-item-top .bx-btn.bx-locate:hover {
  background: transparent;
  color: var(--bx-navy);
  text-decoration: underline;
}
.bill-explorer .bx-item-top .bx-btn.bx-locate {
  display: none;
}
.bill-explorer .bx-card .bx-title:focus {
  outline: none;
}
.bill-explorer .bx-item-top .bx-count {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bx-muted);
}
.bill-explorer .bx-card .bx-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--bx-line);
}
.bill-explorer .bx-pager .bx-btn.bx-step {
  min-height: 44px;
  margin: 0;
  padding: 10px 18px;
  border: 2px solid var(--bx-blue);
  border-radius: 4px;
  background: #fff;
  color: var(--bx-blue);
  font: 700 15px/20px "Noto Sans", sans-serif;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.bill-explorer .bx-pager .bx-btn.bx-step.bx-next {
  margin-left: auto;
  background: var(--bx-blue);
  color: #fff;
}
.bill-explorer .bx-pager .bx-btn.bx-step:hover {
  border-color: var(--bx-navy);
  background: var(--bx-navy);
  color: #fff;
}
.bill-explorer .bx-pager .bx-btn.bx-step[disabled] {
  visibility: hidden;
}

.bill-explorer .bx-btn:focus-visible {
  outline: 3px solid var(--bx-navy);
  outline-offset: 2px;
}

.bill-explorer .bx-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- States ---------- */
/* Without JS: no markers or spotlight; every explanation is listed in order. */
.bill-explorer:not(.bx-ready) .bx-stage .bx-btn.bx-marker,
.bill-explorer:not(.bx-ready) .bx-stage .bx-dim,
.bill-explorer:not(.bx-ready) .bx-card .bx-intro,
.bill-explorer:not(.bx-ready) .bx-card .bx-item-top,
.bill-explorer:not(.bx-ready) .bx-card .bx-pager {
  display: none;
}
.bill-explorer:not(.bx-ready) .bx-card .bx-item + .bx-item {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--bx-line);
}
.bill-explorer.bx-ready .bx-card .bx-item[hidden],
.bill-explorer.bx-ready .bx-card .bx-intro[hidden],
.bill-explorer.bx-ready .bx-card .bx-item-top[hidden],
.bill-explorer.bx-ready .bx-card .bx-pager[hidden] {
  display: none;
}

/* ---------- Narrow screens: stack ---------- */
@media (max-width: 899px) {
  .bill-explorer .bx-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .bill-explorer .bx-figure .bx-sheet {
    padding: 12px;
  }
  .bill-explorer .bx-panel .bx-card {
    padding: 22px 20px 20px;
  }
  .bill-explorer .bx-item-top .bx-btn.bx-locate {
    display: inline-block;
  }
  .bill-explorer .bx-item-top .bx-count {
    display: none;
  }
}
@media (max-width: 599px) {
  .bill-explorer {
    --bx-marker: 26px;
    margin-top: 28px;
  }
  .bill-explorer .bx-stage .bx-btn.bx-marker {
    font-size: 12px;
  }
  .bill-explorer .bx-card .bx-title {
    font-size: 20px;
    line-height: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bill-explorer .bx-stage .bx-btn.bx-marker,
  .bill-explorer .bx-stage .bx-dim.is-animated .bx-spot,
  .bill-explorer.bx-ready.bx-wide.bx-animate .bx-panel .bx-card {
    transition: none;
  }
  .bill-explorer.bx-hint .bx-stage .bx-btn.bx-marker {
    animation: none;
  }
}
