/* Shortcode [canvas_quiz_series_lessons] — liste des thèmes et de leurs leçons. */

.cqsl-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
}

.cqsl-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Recherche ---------- */

.cqsl-search {
    position: relative;
    margin-bottom: 12px;
}

.cqsl-search__input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 44px 14px 16px;
    font-size: 16px;
    color: #2c3e50;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.cqsl-search__input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, .15);
}

.cqsl-search__spinner {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid #e2e8f0;
    border-top-color: #3498db;
    border-radius: 50%;
    opacity: 0;
    transition: opacity .2s ease;
}

.cqsl-wrap.is-loading .cqsl-search__spinner {
    opacity: 1;
    animation: cqsl-spin .6s linear infinite;
}

@keyframes cqsl-spin {
    to { transform: rotate(360deg); }
}

.cqsl-status {
    margin: 0 0 20px;
    padding-left: 2px;
    font-size: 13px;
    color: #7f8c8d;
}

.cqsl-hint {
    margin: 0 0 20px;
    padding-left: 2px;
    font-size: 13px;
    color: #a0aec0;
    font-style: italic;
}

/* Certains thèmes réinitialisent [hidden] : on le réaffirme. */
.cqsl-hint[hidden] {
    display: none;
}

/* ---------- Thème ---------- */

.cqsl-theme {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    margin-bottom: 30px;
    padding: 24px;
    animation: cqsl-fade-in .4s ease-out forwards;
}

@keyframes cqsl-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cqsl-theme__head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f4f8;
}

.cqsl-theme__thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f4f8;
}

.cqsl-theme__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cqsl-theme__thumb[data-empty="1"] {
    background-color: #3498db;
}

.cqsl-theme__thumb[data-empty="1"] span {
    color: #fff;
    font-size: 26px;
    font-weight: 800;
}

.cqsl-theme__info {
    flex: 1;
    min-width: 0;
}

.cqsl-theme__title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
}

.cqsl-theme__desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #7f8c8d;
}

/* ---------- Leçons ---------- */

.cqsl-lessons {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cqsl-lesson {
    margin: 8px 0;
    padding: 0;
}

.cqsl-lesson__link {
    display: block;
    padding: 14px 16px;
    font-size: 16px;
    color: #4a6583;
    text-decoration: none;
    background-color: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #e2e8f0;
    transition: all .2s ease;
}

/* Survol et flèche réservés au lien réel : le titre d'une leçon non publiée est
   un <span> inerte et ne doit pas réagir comme un lien. */
a.cqsl-lesson__link:hover {
    background-color: #edf2f7;
    border-left-color: #3498db;
    color: #2980b9;
    padding-left: 20px;
}

a.cqsl-lesson__link:before {
    content: "\2192";
    margin-right: 10px;
    opacity: 0;
    transform: translateX(-8px);
    display: inline-block;
    transition: all .2s ease;
}

a.cqsl-lesson__link:hover:before {
    opacity: 1;
    transform: translateX(0);
}

.cqsl-snippet {
    margin: 6px 0 0;
    padding: 0 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #7f8c8d;
}

.cqsl-snippet mark {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0 2px;
    border-radius: 2px;
}

.cqsl-empty {
    padding: 12px 16px;
    color: #7f8c8d;
    background-color: #f8f9fa;
    border-radius: 6px;
    font-style: italic;
    text-align: center;
}

.cqsl-no-results {
    padding: 40px 20px;
    color: #4a5568;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
    text-align: center;
}

.cqsl-error {
    background-color: #fff5f5;
    color: #e53e3e;
    padding: 16px;
    border-radius: 6px;
    border-left: 4px solid #fc8181;
    font-weight: 500;
    margin: 20px 0;
    text-align: center;
}

/* ---------- Contenu non publié / thème inactif (éditeurs uniquement) ---------- */

.cqsl-theme.is-inactive {
    background-color: #fafafa;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
}

.cqsl-theme.is-inactive .cqsl-theme__title,
.cqsl-theme.is-inactive .cqsl-theme__desc {
    color: #9ca3af;
}

.cqsl-theme.is-inactive .cqsl-theme__thumb img {
    filter: grayscale(1);
    opacity: .6;
}

.cqsl-lesson__link.is-unpublished {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #9ca3af;
    background-color: #fafafa;
    border-left-color: #e5e7eb;
    border-left-style: dashed;
    cursor: default;
}

.cqsl-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #92400e;
    background-color: #fef3c7;
    border-radius: 20px;
}

.cqsl-badge--inactive {
    color: #6b7280;
    background-color: #e5e7eb;
}

.cqsl-edit {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #2980b9;
    background-color: #fff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    transition: all .2s ease;
}

.cqsl-edit:hover {
    color: #fff;
    background-color: #3498db;
    border-color: #3498db;
}

.cqsl-theme__head .cqsl-edit {
    align-self: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .cqsl-theme {
        padding: 16px;
    }

    .cqsl-theme__title {
        font-size: 20px;
    }

    .cqsl-theme__thumb {
        width: 48px;
        height: 48px;
    }

    .cqsl-lesson__link {
        padding: 12px 14px;
    }

    .cqsl-lesson__link.is-unpublished {
        flex-wrap: wrap;
    }

    .cqsl-edit {
        margin-left: 0;
    }
}
