/* =============================================
   RÉSULTATS PUBLICS — shortcode [pc_results]
   ============================================= */

.pc-results { max-width: 900px; margin: 0 auto; font-family: Arial, sans-serif; }
.pc-results-title { font-size: 1.4em; margin-bottom: 8px; }

.pc-results-subject { margin-bottom: 48px; }
.pc-results-subject h3 {
    font-size: 1.1em;
    padding: 8px 14px;
    background: #f0f6fc;
    border-left: 4px solid #0073aa;
    border-radius: 0 4px 4px 0;
    margin-bottom: 16px;
}

/* Tableau */
.pc-results-table-wrap { overflow-x: auto; margin-bottom: 24px; }
.pc-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92em;
}
.pc-results-table th,
.pc-results-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: center;
}
.pc-results-table th { background: #f5f5f5; font-weight: bold; }
.pc-results-table td:nth-child(2) { text-align: left; }
.pc-results-table .pc-col-rank { width: 36px; font-size: 1.2em; }
.pc-results-table tr.pc-row-top { background: #fafff4; }
.pc-results-table tbody tr:hover { background: #f0f7ff; }

/* Graphiques */
.pc-results-charts {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.pc-results-chart-box {
    flex: 1;
    min-width: 260px;
}
.pc-chart-label {
    font-size: 0.85em;
    color: #555;
    margin: 0 0 6px;
    font-weight: bold;
}

@media (max-width: 600px) {
    .pc-results-charts { flex-direction: column; }
}

/* =============================================
   PUBLIC CONSULTATION — aligné avec class-shortcode.php
   ============================================= */

.pc-consultation { max-width: 860px; margin: 0 auto; font-family: Arial, sans-serif; }

/* Navigation globale (en haut) */
.pc-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.pc-navigation button {
    padding: 8px 18px;
    border: none;
    background: #0073aa;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    transition: background 0.2s;
}
.pc-navigation button:hover:not(:disabled) { background: #005177; }
.pc-navigation button:disabled { background: #ccc; cursor: not-allowed; }
.pc-submit { background: #007a3e !important; }
.pc-submit:hover:not(:disabled) { background: #005a2c !important; }

/* Sujets */
.pc-subject { display: none; }
.pc-subject.is-active { display: block; }
.pc-subject h3 { margin-bottom: 14px; font-size: 1.15em; }

/* Zone drag & drop */
.pc-ranking {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.pc-pool, .pc-slots { flex: 1; min-width: 200px; }
.pc-pool h4, .pc-slots h4 { margin-bottom: 10px; font-size: 1em; color: #333; }

/* Liste d'items (source) */
ul.pc-items {
    list-style: none;
    margin: 0; padding: 8px;
    border: 1px dashed #ccc;
    background: #f9f9f9;
    border-radius: 4px;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

li.pc-item {
    cursor: grab;
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    user-select: none;
    transition: box-shadow 0.15s;
    list-style: none;
}
li.pc-item:active { cursor: grabbing; }
.ui-sortable-helper.pc-item {
    opacity: 0.9;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

/* Placeholder pendant le drag */
.pc-sort-placeholder {
    border: 2px dashed #007cba;
    background: #e6f0fa;
    border-radius: 4px;
    height: 40px;
    list-style: none;
}

/* Slots de classement */
.pc-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    border: 2px dashed #aaa;
    border-radius: 6px;
    padding: 4px 10px;
    background: #fff;
    margin-bottom: 8px;
    transition: background 0.2s, border-color 0.2s;
}
.pc-slot.ui-sortable-over { background: #d0f0ff; border-color: #0073aa; }

/* Numéro de priorité (texte "Priorité X") */
.pc-slot::before {
    content: attr(data-rank);
    font-weight: bold;
    color: #0073aa;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}

/* Liste interne du slot */
ul.pc-slot-list {
    flex: 1;
    min-height: 36px;
    margin: 0; padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Aide à l'utilisation */
.pc-consultation-help {
    background: #f0f6fc;
    border-left: 4px solid #0073aa;
    border-radius: 0 4px 4px 0;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 0.95em;
    color: #333;
    line-height: 1.6;
}
.pc-consultation-help p { margin: 0 0 8px; }
.pc-consultation-help p:last-child { margin-bottom: 0; }

/* Message retour */
.pc-message { margin-top: 16px; font-weight: bold; }

/* Responsive */
@media (max-width: 600px) {
    .pc-ranking { flex-direction: column; }
    .pc-navigation { flex-direction: column; }
    .pc-navigation button { width: 100%; }
}

/* ── Mobile : cibles tactiles et défilement ─────────────── */
@media (max-width: 768px) {
    li.pc-item {
        padding: 14px 16px;
        font-size: 1em;
        /* évite la sélection de texte pendant le drag sur iOS */
        -webkit-user-select: none;
        user-select: none;
    }

    .pc-slot {
        min-height: 56px;
        padding: 8px 12px;
    }

    ul.pc-items,
    .pc-slots {
        /* défilement natif iOS dans les listes */
        -webkit-overflow-scrolling: touch;
    }

    /* empêche le scroll de page pendant le drag */
    .pc-ranking {
        touch-action: none;
    }
}
