/**
 * Artystyczna Magic — Checklist Shortcode Styles
 */

.am-checklist {
  --am-cl-bg: var(--am-white, #ffffff);
  --am-cl-surface: var(--am-surface, #f9f4f7);
  --am-cl-line: var(--am-line, #ddd0d8);
  --am-cl-ink: var(--am-charcoal, #332a30);
  --am-cl-ink-soft: var(--am-ink-soft, #5e535a);
  --am-cl-meta: var(--am-meta, #8a7d85);

  --am-cl-orchid: var(--am-orchid, #c9a0c9);
  --am-cl-orchid-deep: var(--am-orchid-deep, #a87ba8);
  --am-cl-mauve: var(--am-mauve, #b8a0b8);
  --am-cl-mauve-deep: var(--am-mauve-deep, #8f7a8f);

  background: var(--am-cl-bg);
  border: 1px solid var(--am-cl-line);
  border-radius: var(--am-radius-md, 10px);
  padding: var(--am-space-md, 1.5rem);
  box-shadow: var(--am-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));
  font-family: var(--am-font-body, 'Lato', system-ui, sans-serif);
}

.am-checklist__title {
  font-family: var(--am-font-heading, 'Raleway', system-ui, sans-serif);
  font-size: clamp(1.02rem, 1.4vw, 1.25rem);
  font-weight: 600;
  color: var(--am-cl-ink);
  line-height: 1.2;
  margin: 0 0 var(--am-space-sm, 1rem);
}

/* ── Section ─────────────────────────────────────────────────────────── */

.am-checklist__section {
  margin-bottom: var(--am-space-md, 1.5rem);
}

.am-checklist__section:last-child {
  margin-bottom: 0;
}

.am-checklist__section-heading {
  font-family: var(--am-font-heading, 'Raleway', system-ui, sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--am-cl-ink-soft);
  margin: 0 0 var(--am-space-xs, 0.75rem);
  padding-left: var(--am-space-sm, 1rem);
  border-left: 3px solid var(--am-cl-orchid);
}

/* ── List & Item ────────────────────────────────────────────────────── */

.am-checklist__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.am-checklist__item {
  position: relative;
  border-radius: var(--am-radius-sm, 6px);
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.am-checklist__item:hover {
  background: var(--am-cl-surface);
}

.am-checklist__label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  min-height: 2.5rem;
}

/* ── Custom Checkbox ─────────────────────────────────────────────────── */

.am-checklist__checkbox {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--am-cl-orchid);
  border-radius: 4px;
  background: var(--am-cl-bg);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  position: relative;
}

.am-checklist__checkbox:hover {
  border-color: var(--am-cl-orchid-deep);
  transform: scale(1.05);
}

.am-checklist__checkbox:focus-visible {
  outline: 2px solid var(--am-cl-orchid);
  outline-offset: 2px;
}

.am-checklist__checkbox:checked {
  background: var(--am-cl-orchid);
  border-color: var(--am-cl-orchid-deep);
}

.am-checklist__checkbox:checked::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8.5L6.5 12L13 5' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 80%;
  background-position: center;
  background-repeat: no-repeat;
}

/* ── Text ───────────────────────────────────────────────────────────── */

.am-checklist__text {
  flex: 1 1 auto;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--am-cl-ink);
  transition: color 0.2s ease, text-decoration 0.2s ease, opacity 0.2s ease;
}

.am-checklist__item.is-checked .am-checklist__text {
  text-decoration: line-through;
  opacity: 0.55;
  color: var(--am-cl-meta);
}

/* ── Category Badges ────────────────────────────────────────────────── */

.am-checklist__badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--am-radius-pill, 999px);
  white-space: nowrap;
}

.am-checklist__badge--must-have {
  background: rgba(201, 160, 201, 0.15);
  color: var(--am-cl-orchid-deep);
  border: 1px solid rgba(201, 160, 201, 0.35);
}

.am-checklist__badge--nice-to-have {
  background: rgba(184, 160, 184, 0.15);
  color: var(--am-cl-mauve-deep);
  border: 1px solid rgba(184, 160, 184, 0.35);
}

.am-checklist__badge--optional {
  background: rgba(142, 131, 137, 0.1);
  color: var(--am-cl-meta);
  border: 1px solid rgba(142, 131, 137, 0.25);
}

/* ── Clear Button ───────────────────────────────────────────────────── */

.am-checklist__clear {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--am-space-sm, 1rem);
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--am-cl-ink-soft);
  background: var(--am-cl-surface);
  border: 1px solid var(--am-cl-line);
  border-radius: var(--am-radius-sm, 6px);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.am-checklist__clear:hover {
  background: var(--am-cl-line);
  color: var(--am-cl-ink);
}

.am-checklist__clear:focus-visible {
  outline: 2px solid var(--am-cl-orchid);
  outline-offset: 2px;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .am-checklist {
    padding: var(--am-space-sm, 1rem);
    border-radius: var(--am-radius-sm, 6px);
  }

  .am-checklist__label {
    gap: 0.5rem;
    padding: 0.45rem 0.4rem;
  }

  .am-checklist__text {
    font-size: 0.9rem;
  }

  .am-checklist__badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
  }
}

/* ── Reduced Motion ─────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .am-checklist__item,
  .am-checklist__checkbox,
  .am-checklist__text,
  .am-checklist__clear {
    transition: none !important;
  }

  .am-checklist__checkbox:hover {
    transform: none;
  }
}
