/* Dad's Corner reusable checklist component
   Markup: <section class="dc-checklist" data-checklist-id="UNIQUE-ID" data-title="Print title"> ... </section>
   Script: /js/dads-checklist.js
   Uses the page's brand variables (--sage, --plum, --gold, --ivory, --muted, --line) with fallbacks. */

.dc-checklist { background: #fff; border: 1px solid var(--line, rgba(61,43,46,.14)); border-radius: 18px; padding: 20px 22px 18px; margin: 22px 0; }
.dc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dc-progress { margin: 0; font-family: "Space Mono", ui-monospace, monospace; font-size: 14px; color: var(--sage-deep, #4F6347); }
.dc-actions { display: flex; gap: 8px; }
.dc-btn { font: inherit; font-size: 14px; font-weight: 600; background: transparent; color: var(--plum, #3D2B2E); border: 1px solid var(--line, rgba(61,43,46,.3)); border-radius: 999px; padding: 7px 16px; cursor: pointer; }
.dc-btn:hover { background: var(--gold-soft, #F4EBDB); }
.dc-bar { height: 8px; border-radius: 999px; background: var(--sage-soft, #E7EEE3); margin: 12px 0 4px; overflow: hidden; }
.dc-bar > span { display: block; height: 100%; width: 0; background: var(--sage, #93A889); border-radius: 999px; transition: width .25s ease; }
.dc-bar.done > span { background: var(--gold, #C9A66B); }
@media (prefers-reduced-motion: reduce) { .dc-bar > span { transition: none; } }

.dc-checklist h3 { margin: 18px 0 8px; color: var(--sage-deep, #4F6347); font-family: "Space Mono", ui-monospace, monospace; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.dc-checklist ul { list-style: none; margin: 0; padding: 0; }
.dc-checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; }
.dc-checklist input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: 0 0 22px; width: 22px; height: 22px; margin-top: 3px; border: 2px solid var(--sage, #93A889); border-radius: 6px; background: #fff; cursor: pointer; }
.dc-checklist input[type="checkbox"]:checked { background: var(--sage, #93A889) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='%233D2B2E' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.dc-checklist label { cursor: pointer; }
.dc-checklist input:checked + label { color: var(--muted, #6B5A5D); text-decoration: line-through; text-decoration-color: var(--sage, #93A889); }
.dc-print-title, .dc-print-foot { display: none; }

/* Print: show only the checklist, on one page.
   dads-checklist.js adds .dc-printing to <body> and .dc-ancestor to the checklist's parents while printing. */
@media print {
  @page { margin: 14mm; }
  body.dc-printing *:not(.dc-ancestor):not(.dc-checklist):not(.dc-checklist *) { display: none !important; }
  body.dc-printing .dc-ancestor { margin: 0 !important; padding: 0 !important; max-width: none !important; border: 0 !important; background: none !important; }
  body.dc-printing { background: #fff !important; }
  .dc-checklist { border: 0; padding: 0; margin: 0; box-shadow: none; break-inside: avoid; page-break-inside: avoid; font-size: 12.5pt; line-height: 1.35; }
  .dc-actions, .dc-bar { display: none !important; }
  .dc-print-title { display: block; font-family: "Fraunces", Georgia, serif; font-size: 20pt; margin: 0 0 4pt; }
  .dc-print-foot { display: block; margin-top: 12pt; font-size: 10pt; color: #555; }
  .dc-head { margin-bottom: 4pt; }
  .dc-checklist li { padding: 3pt 0; break-inside: avoid; }
  .dc-checklist h3 { margin: 10pt 0 2pt; }
  .dc-checklist input[type="checkbox"] { border-color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dc-checklist input:checked + label { text-decoration: none; color: #000; }
}
