/* Blog Checklist Widget - Simple interactive checklist for blog posts */

.blog-checklist {
    --cl-border: #e5e7eb;
    --cl-bg: #ffffff;
    --cl-text: #1f2937;
    --cl-text-muted: #6b7280;
    --cl-accent: #88A828;
    --cl-accent-light: #88A82815;
    --cl-check-bg: #f3f4f6;
    --cl-check-border: #d1d5db;

    background: var(--cl-bg);
    border: 1px solid var(--cl-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    font-family: inherit;
}

/* Header */
.blog-checklist__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--cl-border);
}

.blog-checklist__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cl-accent);
    flex-shrink: 0;
}

.blog-checklist__titles {
    flex: 1;
    min-width: 0;
}

.blog-checklist__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--cl-text);
    line-height: 1.3;
}

.blog-checklist__progress {
    flex-shrink: 0;
}

.blog-checklist__progress-text {
    font-size: 0.875rem;
    color: var(--cl-text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* Intro text */
.blog-checklist__intro {
    margin: 0 0 1rem 0;
    font-size: 0.9375rem;
    color: var(--cl-text-muted);
    line-height: 1.5;
}

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

/* List item */
.blog-checklist__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    background: transparent;
    transition: background-color 0.15s ease;
}

.blog-checklist__item:hover {
    background: var(--cl-accent-light);
}

.blog-checklist__item--checked {
    background: var(--cl-accent-light);
}

.blog-checklist__item--checked .blog-checklist__text {
    color: var(--cl-text-muted);
    text-decoration: line-through;
    text-decoration-color: var(--cl-text-muted);
}

/* Checkbox label */
.blog-checklist__label {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

/* Hidden native checkbox */
.blog-checklist__checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom checkmark */
.blog-checklist__checkmark {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: var(--cl-check-bg);
    border: 2px solid var(--cl-check-border);
    border-radius: 4px;
    transition: all 0.15s ease;
    margin-top: 1px;
}

.blog-checklist__checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.blog-checklist__checkbox:checked + .blog-checklist__checkmark {
    background: var(--cl-accent);
    border-color: var(--cl-accent);
}

.blog-checklist__checkbox:checked + .blog-checklist__checkmark::after {
    display: block;
}

.blog-checklist__checkbox:focus-visible + .blog-checklist__checkmark {
    outline: 2px solid var(--cl-accent);
    outline-offset: 2px;
}

/* Item text */
.blog-checklist__text {
    font-size: 0.9375rem;
    color: var(--cl-text);
    line-height: 1.5;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

/* Link */
.blog-checklist__link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--cl-accent);
    text-decoration: none;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 0.5rem;
    transition: opacity 0.15s ease;
}

.blog-checklist__link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.blog-checklist__link svg {
    flex-shrink: 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .blog-checklist {
        --cl-border: #374151;
        --cl-bg: #1f2937;
        --cl-text: #f9fafb;
        --cl-text-muted: #9ca3af;
        --cl-accent-light: #88A82820;
        --cl-check-bg: #374151;
        --cl-check-border: #4b5563;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .blog-checklist {
        padding: 1rem;
    }

    .blog-checklist__header {
        flex-wrap: wrap;
    }

    .blog-checklist__item {
        flex-wrap: wrap;
    }

    .blog-checklist__link {
        width: 100%;
        margin-left: 0;
        padding-left: 1.875rem;
        margin-top: 0.25rem;
    }
}

/* Print styles */
@media print {
    .blog-checklist {
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .blog-checklist__checkbox {
        display: none;
    }

    .blog-checklist__checkmark {
        border: 1px solid #666;
        background: transparent;
    }
}
