/* Peuple Souverain — Propositions & Votes — style Marianne */

.ps-carte {
    background: #f0f4ff;
    border: 2px solid #000091;
    border-radius: 30px;
    padding: 28px 30px;
    margin: 24px auto;
    box-shadow: 0 3px 10px rgba(0, 0, 145, 0.08);
    max-width: 1100px;
}
.ps-carte.ps-prete {
    border-color: #E1000F;
    box-shadow: 0 3px 14px rgba(225, 0, 15, 0.15);
}
.ps-titre-carte {
    margin: 0 0 16px;
    color: #000091;
    font-size: 1.4rem;
}
.ps-note { color: #3a3a3a; }

/* Messages */
.ps-msg {
    padding: 12px 18px;
    border-radius: 16px;
    margin: 0 0 16px;
    font-size: 0.95rem;
}
.ps-msg-ok { background: #e7f5ec; border: 1px solid #1c8a4b; color: #14532d; }
.ps-msg-err { background: #fdecec; border: 1px solid #E1000F; color: #7a0008; }
.ps-msg-info { background: #eef0fb; border: 1px solid #000091; color: #000091; }

/* Formulaire — champs bien espacés, jamais collés */
.ps-carte .ps-form .ps-champ { margin: 0 0 26px; }
.ps-carte .ps-form label { display: block; font-weight: 600; color: #000091; margin: 0 0 10px; }
.ps-req { color: #E1000F; }
.ps-form input[type="text"],
.ps-form select,
.ps-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 2px solid #000091;
    border-radius: 16px;
    padding: 13px 18px;
    font-size: 1rem;
    line-height: 1.5;
    background: #fff;
}
.ps-form input:focus,
.ps-form select:focus,
.ps-form textarea:focus {
    outline: none;
    border-color: #E1000F;
}
.ps-miel { position: absolute !important; left: -9999px !important; height: 1px; width: 1px; overflow: hidden; }

.ps-bouton {
    background: #000091;
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 12px 30px;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 0.2s;
}
.ps-bouton:hover { background: #E1000F; }

/* Liste & filtres */
.ps-filtres {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
}
.ps-filtre-recherche { display: flex; gap: 6px; }
.ps-filtre-recherche input {
    border: 2px solid #000091;
    border-radius: 24px;
    padding: 8px 16px;
    min-width: 240px;
}
.ps-filtre-themes { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-puce {
    display: inline-block;
    padding: 4px 14px;
    border: 1.5px solid #000091;
    border-radius: 20px;
    color: #000091;
    text-decoration: none;
    font-size: 0.85rem;
    background: #fff;
}
.ps-puce:hover { background: #000091; color: #fff; }
.ps-puce-actif { background: #000091; color: #fff; }
.ps-puce-nb {
    color: #E1000F;
    font-weight: 700;
    font-size: 0.85em;
}
.ps-puce-actif .ps-puce-nb { color: #ff9b9b; }

.ps-grille {
    display: grid;
    /* v2.6.9 : même largeur de carte que les lois (.psl-grille) */
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
/* v2.6.10 : .ps-carte (prévu pour les formulaires pleine page) a
   margin:24px auto + max-width:1100px ; dans une grille, les marges
   auto annulent l'étirement → chaque carte prenait la largeur de son
   texte (largeurs inégales). Comme les lois (.psl-carte {margin:0}),
   on force la carte à remplir sa colonne, uniformément. */
.ps-grille .ps-carte {
    margin: 0;
    max-width: none;
    width: 100%;
}
@media (max-width: 1100px) { .ps-grille { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .ps-grille { grid-template-columns: 1fr; } }

.ps-carte-idee {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 18px 20px;
    border-radius: 24px;
}
.ps-carte-tete { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.ps-carte-titre {
    color: #000091;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
}
.ps-carte-titre:hover { color: #E1000F; }
.ps-extrait { flex: 1; color: #333; font-size: 0.92rem; line-height: 1.45; }

.ps-progression {
    height: 10px;
    background: #e8e8f2;
    border-radius: 6px;
    overflow: hidden;
    margin: 10px 0 8px;
}
.ps-progression-barre {
    height: 100%;
    background: linear-gradient(90deg, #000091, #3b3bd6);
    border-radius: 6px;
    transition: width 0.4s;
}
.ps-prete .ps-progression-barre { background: linear-gradient(90deg, #E1000F, #ff5b5b); }

.ps-badge-prete {
    background: #E1000F;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 16px;
    display: inline-block;
    margin-bottom: 8px;
    align-self: flex-start;
}

.ps-carte-pied {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    margin-top: 4px;
}
.ps-vote-boutons {
    display: flex;
    gap: 6px;
}
.ps-vote-boutons .ps-bouton-vote {
    flex: 1;
    text-align: center;
    padding: 6px 8px;
    font-size: 0.82rem;
    white-space: nowrap;
}
.ps-carte-pied .ps-lien {
    text-align: center;
    border-top: 1px solid #e8e8f2;
    padding-top: 7px;
    margin-top: 2px;
}
.ps-voix { font-weight: 700; color: #000091; font-size: 0.95rem; }
.ps-bouton-vote {
    display: inline-block;
    background: #000091;
    color: #fff;
    border-radius: 20px;
    padding: 7px 18px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.ps-bouton-vote:hover { background: #E1000F; color: #fff; }
.ps-bouton-vote.ps-vote-deja { background: #E1000F; }
.ps-bouton-vote.ps-vote-inactif { background: #767676; }
.ps-lien { color: #000091; text-decoration: none; font-size: 0.9rem; }
.ps-lien:hover { color: #E1000F; }

/* Mes idées en attente (visibles par leur auteur seulement) */
.ps-attentes {
    background: #f6f6fa;
    border: 1.5px dashed #000091;
    border-radius: 20px;
    padding: 16px 22px;
    margin: 0 0 24px;
}
.ps-attentes-titre { margin: 0 0 4px; font-size: 1.05rem; color: #000091; }
.ps-attentes-note { margin: 0 0 10px; font-size: 0.85rem; color: #666; }
.ps-attente-ligne { padding: 6px 0; font-size: 0.95rem; }
.ps-badge-attente {
    display: inline-block;
    background: #fff;
    border: 1.5px solid #E1000F;
    color: #E1000F;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 14px;
    margin-right: 6px;
}

/* Pagination */
.ps-pagination { display: flex; gap: 8px; justify-content: center; margin: 24px 0; }.ps-page {
    border: 1.5px solid #000091;
    border-radius: 50%;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    color: #000091;
}
.ps-page-actif, .ps-page:hover { background: #000091; color: #fff; }

/* Page dédiée */
.ps-single h1 { margin: 0 0 10px; color: #000091; }
.ps-single-tete { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; justify-content: space-between; }
.ps-single-meta { color: #666; font-size: 0.9rem; margin-bottom: 18px; }
.ps-single-contenu { line-height: 1.65; font-size: 1.02rem; }
.ps-single-votes { margin-top: 24px; }
.ps-single-retour { max-width: 1100px; margin: 0 auto 40px; padding-left: 20px; }

/* Idées refusées (visibles par leur auteur seulement) */
.ps-refusees { border: 1.5px dashed #E1000F; background: #fdf4f4; }
.ps-badge-refuse {
    display: inline-block;
    background: #fff;
    border: 1.5px solid #E1000F;
    color: #E1000F;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 14px;
    margin-right: 6px;
}
.ps-raison { font-size: 0.85rem; color: #7a0008; }
.ps-refus-ok-form { display: inline-block; margin-left: 10px; }
.ps-bouton-ok {
    background: #fff;
    border: 1.5px solid #E1000F;
    color: #E1000F;
    font-weight: 700;
    border-radius: 16px;
    padding: 2px 14px;
    cursor: pointer;
    font-size: 0.85rem;
}
.ps-bouton-ok:hover { background: #E1000F; color: #fff; }

/* Badge lu / pas lu (bascule au clic) */
.ps-badge-lecture {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 14px;
    margin-bottom: 8px;
    text-decoration: none;
    border: 1.5px solid #E1000F;
    color: #E1000F;
    background: #fff;
}
.ps-badge-lecture.ps-lu {
    border-color: #1c8a4b;
    color: #14532d;
    background: #e7f5ec;
}
.ps-badge-lecture.ps-non-lu:hover { background: #fdecec; }
.ps-badge-lecture.ps-lu:hover { background: #d7eedf; }

/* Cartes compactées pour la grille 6 colonnes */
.ps-carte-idee { padding: 14px 16px; border-radius: 18px; }
.ps-carte-idee .ps-carte-titre { font-size: 0.95rem; }
.ps-carte-idee .ps-extrait { font-size: 0.82rem; }
.ps-carte-idee .ps-voix { font-size: 0.85rem; }
.ps-carte-idee .ps-bouton-vote { padding: 5px 12px; font-size: 0.8rem; }
.ps-carte-idee .ps-lien { font-size: 0.8rem; }
.ps-puce { font-size: 0.75rem; padding: 3px 10px; }

/* Page Propositions en pleine largeur (comme le journal) */
body.ps-pleine-largeur {
    --wp--style--global--content-size: min(1700px, 95vw);
    --wp--style--global--wide-size: min(1800px, 96vw);
}
body.ps-pleine-largeur .alignwide {
    max-width: min(1800px, 96vw) !important;
    margin-inline: auto;
}

/* Votes Pour / Contre */
.ps-bouton-vote.ps-vote-contre { background: #767676; }
.ps-bouton-vote.ps-vote-contre:hover { background: #E1000F; }
.ps-bouton-vote.ps-vote-contre-actif { background: #E1000F; }
.ps-carte-pied .ps-bouton-vote + .ps-bouton-vote { margin-left: 6px; }

/* ===== Bloc accueil [ps_propositions_accueil] ===== */
.ps-accueil {
    margin: 2.5rem 0;
}
.ps-accueil-entete {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.ps-accueil-titre {
    color: #000091;
    font-size: 1.5rem;
    margin: 0;
}
.ps-accueil-tout {
    color: #E1000F;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}
.ps-accueil-grille {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 1100px) {
    .ps-accueil-grille { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .ps-accueil-grille { grid-template-columns: 1fr; }
}

/* ===== Bouton 🔍 de recherche (assorti au champ arrondi) ===== */
.ps-bouton-mini {
    background: #ffffff;
    border: 2px solid #000091;
    border-radius: 24px;
    padding: 8px 18px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background .15s ease, transform .1s ease;
}
.ps-bouton-mini:hover {
    background: #000091;
}
.ps-bouton-mini:active {
    transform: scale(.95);
}

/* ===== Carrousel accueil [ps_propositions_accueil] ===== */
.ps-accueil {
    max-width: 1100px;
    margin: 2.5rem auto;
}
.ps-accueil-entete {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.ps-accueil-titre {
    color: #000091;
    font-size: 1.5rem;
    margin: 0;
}
.ps-accueil-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ps-accueil-tout {
    color: #E1000F;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}
.ps-carrousel-fleche {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #000091;
    background: #ffffff;
    color: #000091;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease;
    padding: 0;
}
.ps-carrousel-fleche:hover {
    background: #000091;
    color: #ffffff;
}
.ps-carrousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 8px;
}
.ps-carrousel::-webkit-scrollbar {
    display: none;
}
.ps-carrousel .ps-carte {
    flex: 0 0 calc(25% - 12px);
    max-width: none;
    margin: 0;
    scroll-snap-align: start;
}
@media (max-width: 1100px) {
    .ps-carrousel .ps-carte { flex: 0 0 calc(50% - 8px); }
}
@media (max-width: 600px) {
    .ps-carrousel .ps-carte { flex: 0 0 100%; }
}

/* =====================================================
 * v2.6.6 — Liseré tricolore en tête des cartes d'idées
 * (même bleu-blanc-rouge que les cartes de lois)
 * ===================================================== */
.ps-carte-idee {
    position: relative;
    overflow: hidden;
}
.ps-carte-idee::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(to right,
        #000091 0%, #000091 33%,
        #ffffff 33%, #ffffff 66%,
        #E1000F 66%, #E1000F 100%);
    border-radius: inherit;
    pointer-events: none;
}

/* =====================================================
 * v2.6.11 — Largeur des cartes identique aux lois
 * Le plugin Lois impose box-sizing: border-box sur tout
 * son bloc (v1.0.4) ; sans lui, une carte avec
 * flex-basis calc(25% - 12px) + padding 16px + bordure 2px
 * rend ~36 px PLUS LARGE que prévu (le basis ne couvre que
 * le contenu). D'où des cartes d'idées plus larges que
 * les cartes de lois. On impose border-box partout, comme
 * les lois.
 * ===================================================== */
.ps-accueil,
.ps-accueil *,
.ps-liste,
.ps-liste *,
.ps-single-retour,
.ps-single-retour * {
    box-sizing: border-box;
}

/* =====================================================
 * v2.6.12 — Page idée seule plus étroite (-200px, comme
 * les lois), boutons de vote compacts (plus en pleine
 * largeur), et vrai bandeau menu du thème à blocs
 * (block_header_part au lieu de get_header qui rend le
 * vieux header de secours sans menu).
 * ===================================================== */
.ps-single {
    max-width: 900px;
}
.ps-single-votes .ps-vote-boutons .ps-bouton-vote {
    flex: 0 0 auto;
}
.ps-single-votes .ps-vote-boutons {
    flex: 0 0 auto;
}
