/* checklist — auto-split from content-blocks.css */

/* ── Checklist
   Usage: <div class="checklist"><div class="checklist-items">...<div class="checklist-item"><div class="checklist-checkbox"></div><div class="checklist-text">...</div></div>...</div></div>
── */

article .checklist {
  background: #fff;
  border: 1px solid var(--color-neutral-200);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

article .checklist--navy {
  background: var(--color-primary-50);
  border: none;
  padding: 0.5rem 1rem;
}

article .checklist--navy .checklist-item {
  border-bottom: 1px solid var(--color-primary-100);
  border-radius: 0;
  padding: 0.75rem 0.25rem;
}

article .checklist--navy .checklist-item:last-child {
  border-bottom: none;
}

article .checklist--navy .checklist-item:hover {
  background: var(--color-primary-50);
}

article .checklist--navy .checklist-checkbox {
  background: var(--color-primary-50);
  border-color: var(--color-primary-100);
  color: var(--color-primary-100);
}

article .checklist--navy .checklist-item.ck-light .checklist-checkbox {
  background: var(--color-primary-100);
  border-color: #6b82b4;
  color: #6b82b4;
}

article .checklist--navy .checklist-item.ck-green .checklist-checkbox,
article .checklist--navy .checklist-item.checked .checklist-checkbox {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

article .checklist h4 {
  color: var(--color-primary);
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
}

article .checklist-items {
  display: flex;
  flex-direction: column;
}

article .checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 0.625rem;
  border-radius: 4px;
  transition: background 150ms;
}

article .checklist-item:hover {
  background: var(--color-neutral-50);
}

article .checklist-checkbox {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--color-neutral-100);
  border: 2px solid var(--color-neutral-300);
  border-radius: 4px;
  margin-top: 0.1875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-neutral-300);
}

article .checklist-checkbox::before {
  content: "";
}

article .checklist-item.ck-grey .checklist-checkbox::before,
article .checklist-item.ck-light .checklist-checkbox::before,
article .checklist-item.ck-green .checklist-checkbox::before,
article .checklist-item.checked .checklist-checkbox::before {
  content: "✓";
}

article .checklist-item.ck-grey .checklist-checkbox {
  background: var(--color-neutral-200);
  border-color: #c8d4e0;
  color: var(--color-neutral-400);
}

article .checklist-item.ck-light .checklist-checkbox {
  background: #e8f5d0;
  border-color: #e8f5d0;
  color: #8daa65;
}

article .checklist-item.ck-green .checklist-checkbox {
  background: #52a80c;
  border-color: #52a80c;
  color: #fff;
}

article .checklist-item.checked .checklist-checkbox {
  background: #52a80c;
  border-color: #52a80c;
  color: #fff;
}

article .checklist-text {
  flex: 1;
}

article .checklist-text strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.2rem;
}

article .checklist-item.checked .checklist-text strong {
  color: var(--color-neutral-400);
  text-decoration: line-through;
  text-decoration-color: var(--color-neutral-300);
}

article .checklist-text p {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.55;
}

article .checklist-item.checked .checklist-text p {
  color: var(--color-neutral-400);
}

article .checklist--green .checklist-checkbox {
  background: #f2fce0;
  border-color: #a3cc72;
  color: #a3cc72;
}

article .checklist--green .checklist-item.ck-green .checklist-checkbox,
article .checklist--green .checklist-item.checked .checklist-checkbox {
  background: #52a80c;
  border-color: #52a80c;
  color: #fff;
}

article .checklist--green-stack {
  background: #f2fce0;
  border: none;
  padding: 0.5rem 1rem;
}

article .checklist--green-stack .checklist-item {
  border-bottom: 1px solid #c8e4a0;
  border-radius: 0;
  padding: 0.75rem 0.25rem;
}

article .checklist--green-stack .checklist-item:last-child {
  border-bottom: none;
}

article .checklist--green-stack .checklist-item:hover {
  background: #e8f5d0;
}

article .checklist--green-stack .checklist-checkbox {
  background: #e8f5d0;
  border-color: #b8d98a;
  color: #b8d98a;
}

article .checklist--green-stack .checklist-item.ck-light .checklist-checkbox {
  background: #d4eaa0;
  border-color: #d4eaa0;
  color: #8daa65;
}

article .checklist--green-stack .checklist-item.ck-green .checklist-checkbox,
article .checklist--green-stack .checklist-item.checked .checklist-checkbox {
  background: #52a80c;
  border-color: #52a80c;
  color: #fff;
}

/* ── Checked state — plain text items (no <strong>) ── */
article .checklist-item.checked .checklist-text {
  color: var(--color-neutral-400);
  text-decoration: line-through;
  text-decoration-color: var(--color-neutral-300);
}
article .checklist-item.checked .checklist-text p {
  text-decoration: none;
}

/* ── Section heading ── */
article .checklist-section-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-neutral-50);
  border-radius: 3px;
  padding: 0.5625rem 0.875rem;
  margin: 0.75rem 0 0.25rem;
}

article .checklist-section + .checklist-section {
  margin-top: 0.25rem;
}

/* Theme overrides for section heading background */
article .checklist--navy .checklist-section-heading {
  background: var(--color-primary-100);
}
article .checklist--green-stack .checklist-section-heading,
article .checklist--green.checklist--stack .checklist-section-heading {
  background: #c8e4a0;
}

/* ── Compact variant ── */
article .checklist--compact .checklist-item {
  padding: 0.5rem 0.5rem;
}
article .checklist--compact .checklist-section-heading {
  font-size: 0.875rem;
  padding: 0.625rem 0.5rem 0.25rem;
}

/* ── Section items wrapper ── */
article .checklist-section-items {
  display: flex;
  flex-direction: column;
}

/* ── Collapsed sections (JS-controlled) ── */
article .checklist-section--collapsed .checklist-section-heading {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  border-radius: 3px;
  transition: background 100ms;
}
article .checklist-section--collapsed .checklist-section-heading:hover {
  background: rgba(0, 0, 0, 0.04);
}
article .checklist-section--collapsed .checklist-section-heading::after {
  content: "▾";
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  color: var(--color-primary);
  background: var(--color-primary-50);
  border: 1.5px solid var(--color-primary-100);
  border-radius: 3px;
  padding: 0.1875rem 0.4375rem;
  margin-left: auto;
  flex-shrink: 0;
  display: inline-block;
}
article .checklist-section--collapsed.is-open .checklist-section-heading::after {
  content: "▴";
  background: var(--color-primary-100);
  border-color: var(--color-primary);
}
article .checklist-section--collapsed .checklist-section-items {
  display: none;
}
article .checklist-section--collapsed.is-open .checklist-section-items {
  display: flex;
  flex-direction: column;
}

/* ── Collapsed item descriptions (JS-controlled) ── */
article .checklist-text--collapsed p {
  display: none;
}
article .checklist-text--collapsed.is-open p {
  display: block;
}
/* ▾ / ▴ badge on the item row — mirrors the section +/- badge */
article .checklist-item:has(.checklist-text--collapsed) {
  cursor: pointer;
}
article .checklist-item:has(.checklist-text--collapsed)::after {
  content: "▾";
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  color: var(--color-primary);
  background: var(--color-primary-50);
  border: 1.5px solid var(--color-primary-100);
  border-radius: 3px;
  padding: 0.1875rem 0.4375rem;
  align-self: flex-start;
  margin-top: 0.1875rem;
  flex-shrink: 0;
}
article .checklist-item:has(.checklist-text--collapsed.is-open)::after {
  content: "▴";
  background: var(--color-primary-100);
  border-color: var(--color-primary);
}

/* ── Interactive variant ── */
article .checklist--interactive .checklist-item {
  cursor: pointer;
  user-select: none;
}

/* ── Checkmark color overrides (checks="…") ──────────────────────────────── */
/* Overrides only filled checkbox states; empty/open state stays theme-tinted */

article .checklist-checks--green .checklist-item.ck-light .checklist-checkbox {
  background: #e8f5d0;
  border-color: #e8f5d0;
  color: #8daa65;
}
article .checklist-checks--green .checklist-item.ck-green .checklist-checkbox,
article .checklist-checks--green .checklist-item.checked .checklist-checkbox {
  background: #52a80c;
  border-color: #52a80c;
  color: #fff;
}

article .checklist-checks--navy .checklist-item.ck-light .checklist-checkbox {
  background: var(--color-primary-100);
  border-color: #6b82b4;
  color: #6b82b4;
}
article .checklist-checks--navy .checklist-item.ck-green .checklist-checkbox,
article .checklist-checks--navy .checklist-item.checked .checklist-checkbox {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

article .checklist-checks--grey .checklist-item.ck-light .checklist-checkbox {
  background: var(--color-neutral-200);
  border-color: var(--color-neutral-300);
  color: var(--color-neutral-400);
}
article .checklist-checks--grey .checklist-item.ck-green .checklist-checkbox,
article .checklist-checks--grey .checklist-item.checked .checklist-checkbox {
  background: var(--color-neutral-400);
  border-color: var(--color-neutral-400);
  color: #fff;
}

/* ── Stack variant (flat rows, no card border) ─────────────────────────────── */
article .checklist--stack .checklist-item {
  border-bottom: 1px solid var(--color-neutral-200);
  border-radius: 0;
  padding: 0.75rem 0.25rem;
}
article .checklist--stack .checklist-item:last-child {
  border-bottom: none;
}
article .checklist--stack .checklist-item:hover {
  background: var(--color-neutral-50);
}

/* Stack font sizes — proportional to labeled-stack */
article .checklist--stack .checklist-text {
  font-size: 0.875rem;
}
article .checklist--stack .checklist-text strong {
  font-size: 0.875rem;
  font-weight: 600;
}
article .checklist--stack .checklist-text p {
  font-size: 0.8125rem;
}

/* Stack + navy — higher specificity restores navy divider colour */
article .checklist--navy.checklist--stack .checklist-item {
  border-bottom-color: var(--color-primary-100);
}
article .checklist--navy.checklist--stack .checklist-item:hover {
  background: var(--color-primary-50);
}

/* Stack + green — adds green background (.checklist--green alone has none) */
article .checklist--green.checklist--stack {
  background: #f2fce0;
  border: none;
  padding: 0.5rem 1rem;
}
article .checklist--green.checklist--stack .checklist-item {
  border-bottom-color: #c8e4a0;
}
article .checklist--green.checklist--stack .checklist-item:hover {
  background: #e8f5d0;
}
article .checklist--green.checklist--stack .checklist-section + .checklist-section {
  border-top-color: #c8e4a0;
}
