/* Widget 52: story deck (content-intelligence STORY_DECK_SPEC.md; design: v2 canvas "Blog widgets",
   generators/v2_story_deck_run.py). A deck of real accounts, one per card, in a snapping row: the
   next card peeks, the labels above jump to any card, nothing is numbered. Progression
   "night-to-dawn" takes the cards from deep night to dusk and the "dawn" card is the brightest;
   progression "none" is quiet paper, like letters. Who is speaking is a mark (a ring for a grown
   child, a filled dot for a parent), never a colour. Selectors sit under .hc-sd so they outrank
   Astra's ".entry-content p" spacing. */

.hc-sd {
  --sd-indigo: #5865bd;
  --sd-help-bg: #f7f9fe;
  --sd-help-line: #dfe5fe;
  --sd-paper: #fffbf8;
  --sd-paper-shadow: 0 1px 2px rgba(10, 10, 11, 0.06), 0 14px 30px -22px rgba(10, 10, 11, 0.3);
  --sd-night-shadow: none;
  --sd-dawn: radial-gradient(
      130% 70% at 50% 118%,
      rgba(254, 182, 185, 0.55),
      rgba(254, 182, 185, 0) 70%
    ), linear-gradient(165deg, #e6eafd 0%, #fbeef1 58%, #fff6ef 100%);
  --sd-pad: 36px;
  background: var(--hc-alt);
  border-radius: 24px;
  padding: 34px var(--sd-pad) 28px;
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
  color: var(--hc-text);
}
:root[data-theme="dark"] .hc-sd {
  --sd-indigo: #a8b5f1;
  --sd-help-bg: #1d2133;
  --sd-help-line: #2f3550;
  --sd-paper: var(--hc-card);
  --sd-paper-shadow: inset 0 0 0 1px #2e3239;
  --sd-night-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  --sd-dawn: radial-gradient(
      130% 70% at 50% 118%,
      rgba(254, 182, 185, 0.42),
      rgba(254, 182, 185, 0) 70%
    ), linear-gradient(165deg, #d6dbf4 0%, #f0dfe4 58%, #f6e9e1 100%);
}
.hc-sd,
.hc-sd * {
  box-sizing: border-box;
}
.hc-sd [hidden] {
  display: none !important;
}
.hc-sd p {
  margin: 0;
}

/* Header */
.hc-sd .sd-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hc-sd .sd-kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sd-indigo);
}
.hc-sd .sd-title {
  font-size: 30px;
  line-height: 1.25;
  font-weight: 400;
  letter-spacing: -0.4px;
  text-wrap: balance;
  color: var(--hc-text);
}
.hc-sd .sd-intro {
  font-size: 17px;
  line-height: 1.6;
  color: var(--hc-body);
  text-wrap: pretty;
}

.hc-sd .sd-scroller::-webkit-scrollbar {
  display: none;
}
.hc-sd .sd-scroller:focus-visible,
.hc-sd button:focus-visible,
.hc-sd a:focus-visible {
  outline: 2px solid var(--hc-focus);
  outline-offset: 2px;
}

/* Who is speaking: a ring for a grown child, a filled dot for a parent */
.hc-sd .sd-child::before,
.hc-sd .sd-parent::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex-shrink: 0;
}
.hc-sd .sd-child::before {
  box-shadow: inset 0 0 0 1.6px currentColor;
}
.hc-sd .sd-parent::before {
  background: currentColor;
}

/* The row of cards */
.hc-sd .sd-scroller {
  display: flex;
  align-items: stretch;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--sd-pad));
  padding: 4px var(--sd-pad) 6px;
  scroll-padding-inline: var(--sd-pad);
}
.hc-sd .sd-end {
  flex: 0 0 22px;
}
.hc-sd .sd-card {
  flex: 0 0 auto;
  width: min(470px, calc(100% - 30px));
  scroll-snap-align: start;
  border-radius: 20px;
  padding: 26px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--sd-ink);
}
.hc-sd .sd-night {
  --sd-ink: #f4f5f8;
  --sd-soft: #dfe2e8;
  --sd-faint: #c3c7d0;
  --sd-rule: rgba(255, 255, 255, 0.16);
  --sd-track: rgba(255, 255, 255, 0.14);
  --sd-seg: #c9cffa;
  --sd-btn: rgba(255, 255, 255, 0.07);
  --sd-btn-line: rgba(255, 255, 255, 0.26);
  --sd-on: #f4f5f8;
  --sd-on-fg: #171b27;
  box-shadow: var(--sd-night-shadow);
}
.hc-sd .sd-n0 {
  background: #171b27;
}
.hc-sd .sd-n1 {
  background: #1f2436;
}
.hc-sd .sd-n2 {
  background: #2a3047;
}
.hc-sd .sd-n3 {
  background: #363c58;
}
.hc-sd .sd-n4 {
  background: #454a6a;
}
.hc-sd .sd-dawn {
  --sd-ink: #0a0a0b;
  --sd-soft: #33312f;
  --sd-faint: #55524f;
  --sd-rule: rgba(10, 10, 11, 0.14);
  --sd-track: rgba(10, 10, 11, 0.1);
  --sd-seg: #5865bd;
  --sd-btn: rgba(255, 255, 255, 0.55);
  --sd-btn-line: rgba(10, 10, 11, 0.28);
  --sd-on: #0a0a0b;
  --sd-on-fg: #ffffff;
  background: var(--sd-dawn);
  box-shadow: 0 18px 40px -24px rgba(88, 101, 189, 0.45);
}
.hc-sd .sd-paper {
  --sd-ink: var(--hc-text);
  --sd-soft: var(--hc-body);
  --sd-faint: var(--hc-muted);
  --sd-rule: var(--hc-hair);
  --sd-track: var(--hc-hair);
  --sd-seg: var(--hc-body);
  --sd-btn: var(--hc-card);
  --sd-btn-line: var(--hc-line);
  --sd-on: var(--hc-text);
  --sd-on-fg: var(--hc-band);
  background: var(--sd-paper);
  box-shadow: var(--sd-paper-shadow);
}
.hc-sd .sd-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--sd-faint);
}
.hc-sd .sd-line {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: var(--sd-ink);
  text-wrap: balance;
}
.hc-sd .sd-story {
  margin: 0;
  padding: 0 0 0 16px;
  border: 0;
  border-left: 2px solid var(--sd-rule);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-style: normal;
  background: none;
}
.hc-sd .sd-story + .sd-story {
  margin-top: 6px;
}
.hc-sd .sd-story p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--sd-soft);
  text-wrap: pretty;
}
.hc-sd .sd-src {
  font-size: 13px;
  line-height: 1.4;
  color: var(--sd-faint);
}
.hc-sd .sd-src a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* A card's one tap and its result */
.hc-sd .sd-foot {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hc-sd .sd-foot:empty {
  display: none;
}
.hc-sd .sd-opts,
.hc-sd .sd-copts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hc-sd .sd-o {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--sd-btn);
  box-shadow: inset 0 0 0 1px var(--sd-btn-line);
  color: var(--sd-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}
.hc-sd .sd-o.on {
  background: var(--sd-on);
  color: var(--sd-on-fg);
  box-shadow: inset 0 0 0 1px var(--sd-on);
}
.hc-sd .sd-o.off,
.hc-sd .sd-c.off {
  opacity: 0.5;
  cursor: default;
}
.hc-sd .sd-o:disabled,
.hc-sd .sd-c:disabled {
  cursor: default;
}
.hc-sd .sd-res {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: sd-in 0.35s ease-out both;
}
.hc-sd .sd-bar {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--sd-track);
  margin: 6px 0 4px;
}
.hc-sd .sd-seg {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 3px;
  background: var(--sd-seg);
  transition: width 0.7s cubic-bezier(0.3, 0.7, 0.3, 1);
}
.hc-sd .sd-seg .sd-loop {
  position: absolute;
  right: -8px;
  top: -5px;
  color: var(--sd-seg);
  animation: sd-spin 0.9s 0.2s ease-out both;
}
.hc-sd .sd-note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--sd-faint, var(--hc-muted));
}
.hc-sd .sd-strong {
  color: var(--sd-soft, var(--hc-body));
}

/* Under the row: how many more, and the arrows */
.hc-sd .sd-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}
.hc-sd .sd-more {
  font-size: 14px;
  color: var(--hc-muted);
}
.hc-sd .sd-more.gone {
  visibility: hidden;
}
.hc-sd .sd-arrows {
  display: flex;
  gap: 8px;
}
.hc-sd .sd-a {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hc-card);
  box-shadow: inset 0 0 0 1px var(--hc-line);
  color: var(--hc-text);
  cursor: pointer;
}
.hc-sd .sd-a.off {
  opacity: 0.35;
  cursor: default;
}
