/* =====================================================
   Peuple Souverain — Lois (psl-)
   Identité : rouge #E1000F + fond rouge clair + bandeau
   latéral tricolore. Mêmes couleurs Marianne que les
   propositions (bleu #000091) mais design distinct.
   ===================================================== */

.psl-liste,
.psl-livre,
.psl-formulaire,
.psl-loi-seule {
    max-width: 1100px;
    margin: 0 auto;
}

/* Bandeau latéral tricolore (bleu / blanc / rouge) */
.psl-tricolore {
    width: 8px;
    min-width: 8px;
    border-radius: 10px 0 0 10px;
    background: linear-gradient(to bottom,
        #000091 0%, #000091 33%,
        #ffffff 33%, #ffffff 66%,
        #E1000F 66%, #E1000F 100%);
    border: 1px solid rgba(0, 0, 145, .15);
}

/* Cartes de lois au vote */
.psl-carte,
.psl-entree {
    display: flex;
    background: #fff5f5;
    border: 2px solid #E1000F;
    border-radius: 18px;
    overflow: hidden;
    padding: 0;
}
.psl-carte {
    flex-direction: column;
}
.psl-carte .psl-tricolore {
    width: 100%;
    min-width: 0;
    height: 6px;
    border-radius: 0;
    background: linear-gradient(to right,
        #000091 0%, #000091 33%,
        #ffffff 33%, #ffffff 66%,
        #E1000F 66%, #E1000F 100%);
    border: 0;
    border-bottom: 1px solid #f0d5d5;
}
.psl-corps {
    padding: 1.1rem 1.3rem;
    flex: 1;
}
.psl-carte {
    margin: 0;
}

.psl-grille {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 1100px) {
    .psl-grille { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .psl-grille { grid-template-columns: 1fr; }
}

.psl-carte-tete {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: .5rem;
}
.psl-carte-titre {
    color: #E1000F;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.3;
}
.psl-carte-titre:hover {
    text-decoration: underline;
}
.psl-extrait {
    color: #333;
    font-size: .93rem;
    line-height: 1.5;
    margin: 0 0 .8rem;
}
.psl-puce {
    display: inline-block;
    padding: 3px 12px;
    border: 1.5px solid #E1000F;
    border-radius: 20px;
    color: #E1000F;
    font-size: .8rem;
    text-decoration: none;
    white-space: nowrap;
    background: #ffffff;
}
.psl-puce-actif {
    background: #E1000F;
    color: #ffffff;
}

.psl-badge-adoptee {
    display: inline-block;
    background: #E1000F;
    color: #ffffff;
    font-weight: 700;
    font-size: .85rem;
    padding: 4px 14px;
    border-radius: 16px;
    margin-bottom: .6rem;
}

/* Progression vers le seuil (rouge) */
.psl-progression {
    height: 10px;
    background: #ffd7d7;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: .6rem;
}
.psl-progression-barre {
    height: 100%;
    background: #E1000F;
    border-radius: 6px;
    transition: width .3s ease;
}

/* Pied de carte : score + boutons + lien */
.psl-carte-pied {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    border-top: 1px solid #f2caca;
    padding-top: .7rem;
}
.psl-voix {
    color: #E1000F;
    font-weight: 700;
    font-size: .95rem;
}
.psl-vote-boutons {
    display: flex;
    gap: 8px;
    flex: 1;
}
.psl-bouton-vote {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    border: 2px solid #E1000F;
    border-radius: 14px;
    color: #E1000F;
    font-weight: 700;
    text-decoration: none;
    background: #ffffff;
    transition: background .15s ease;
}
.psl-bouton-vote:hover {
    background: #ffecec;
}
.psl-vote-deja {
    background: #E1000F;
    color: #ffffff;
}
.psl-vote-contre {
    border-color: #9d9d9d;
    color: #666;
}
.psl-vote-contre:hover {
    background: #f2f2f2;
}
.psl-vote-contre-actif {
    background: #666;
    color: #fff;
    border-color: #666;
}
.psl-vote-inactif {
    opacity: .6;
    cursor: default;
}
.psl-lien {
    color: #E1000F;
    font-weight: 600;
    text-decoration: underline;
}

/* Filtres */
.psl-filtres {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}
.psl-filtre-recherche {
    display: flex;
    gap: 6px;
}
.psl-filtre-recherche input {
    border: 2px solid #E1000F;
    border-radius: 24px;
    padding: 8px 16px;
    min-width: 240px;
}
.psl-bouton-mini {
    background: #ffffff;
    border: 2px solid #E1000F;
    border-radius: 24px;
    padding: 8px 18px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background .15s ease, transform .1s ease;
}
.psl-bouton-mini:hover {
    background: #E1000F;
}
.psl-bouton-mini:active {
    transform: scale(.95);
}
.psl-filtre-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Pagination */
.psl-pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 1.4rem;
}
.psl-page {
    padding: 6px 14px;
    border: 1.5px solid #E1000F;
    border-radius: 16px;
    color: #E1000F;
    text-decoration: none;
}
.psl-page-actif {
    background: #E1000F;
    color: #fff;
}

/* Messages */
.psl-msg {
    padding: .8rem 1.2rem;
    border-radius: 14px;
    margin-bottom: 1rem;
    font-weight: 600;
}
.psl-msg-ok {
    background: #e7f4e7;
    border: 2px solid #2e7d32;
    color: #2e7d32;
}
.psl-msg-info {
    background: #f0f0fa;
    border: 2px solid #000091;
    color: #000091;
}
.psl-msg-err {
    background: #fff0f0;
    border: 2px solid #E1000F;
    color: #E1000F;
}

/* État vide */
.psl-vide {
    text-align: center;
    border: 2px dashed #E1000F;
    border-radius: 18px;
    padding: 2rem;
    color: #E1000F;
    font-size: 1.05rem;
    background: #fff5f5;
    margin-top: 1.5rem;
    line-height: 1.8;
}

/* Formulaire de proposition */
.psl-intro {
    font-size: 1.05rem;
    color: #333;
    max-width: 720px;
}
.psl-form {
    background: #fff5f5;
    border: 2px solid #E1000F;
    border-radius: 20px;
    padding: 1.6rem;
    max-width: 760px;
}
.psl-label {
    display: block;
    font-weight: 700;
    color: #E1000F;
    margin-bottom: .3rem;
}
.psl-champ {
    width: 100%;
    border: 2px solid #E1000F;
    border-radius: 14px;
    padding: 10px 14px;
    background: #ffffff;
}
.psl-champ:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(225, 0, 15, .2);
}
textarea.psl-champ {
    min-height: 180px;
    resize: vertical;
}
.psl-bouton-envoi {
    background: #E1000F;
    color: #ffffff;
    border: 0;
    border-radius: 16px;
    padding: 12px 26px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}
.psl-bouton-envoi:hover {
    background: #b9000c;
}
.psl-bouton-envoi:active {
    transform: scale(.97);
}
.psl-miel {
    position: absolute;
    left: -9999px;
}

/* Livre des lois */
.psl-livre-entete {
    text-align: center;
    padding: 1.6rem 1rem 1.2rem;
    border-bottom: 4px solid #E1000F;
    margin-bottom: 1.6rem;
}
.psl-livre-titre {
    color: #E1000F;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin: 0;
}
.psl-livre-sous {
    color: #000091;
    font-weight: 600;
    margin: .5rem 0 0;
}
.psl-entree {
    margin: 1.1rem 0;
    background: #fff5f5;
}
.psl-entree-titre {
    color: #E1000F;
    font-size: 1.35rem;
    margin: 0 0 .6rem;
}
.psl-entree-theme {
    color: #000091;
    font-weight: 600;
    margin: 0 0 .8rem;
    font-size: .9rem;
}
.psl-entree-texte {
    line-height: 1.65;
}
.psl-entree-meta {
    color: #666;
    font-size: .85rem;
    margin: .9rem 0 0;
    border-top: 1px solid #f2caca;
    padding-top: .6rem;
}

/* Loi seule */
.psl-loi-seule {
    padding: 2rem 1rem;
}
.psl-loi-encart {
    max-width: 860px;
    margin: 0 auto;
    background: #fff5f5;
}
.psl-vote-seule {
    max-width: 400px;
}
.psl-retour {
    text-align: center;
    margin-top: 1.4rem;
}

/* ===== Bloc accueil [ps_lois_accueil] ===== */
.psl-accueil {
    max-width: 1100px;
    margin: 2.5rem auto;
}
.psl-accueil-entete {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.psl-accueil-titre {
    color: #E1000F;
    font-size: 1.5rem;
    margin: 0;
}
.psl-accueil-tout {
    color: #E1000F;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}

/* ===== Carrousel accueil [ps_lois_accueil] ===== */
.psl-accueil-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.psl-carrousel-fleche {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #E1000F;
    background: #ffffff;
    color: #E1000F;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease;
    padding: 0;
}
.psl-carrousel-fleche:hover {
    background: #E1000F;
    color: #ffffff;
}
.psl-carrousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 8px;
}
.psl-carrousel::-webkit-scrollbar {
    display: none;
}
.psl-carrousel .psl-carte {
    flex: 0 0 calc(25% - 12px);
    scroll-snap-align: start;
}
@media (max-width: 1100px) {
    .psl-carrousel .psl-carte { flex: 0 0 calc(50% - 8px); }
}
@media (max-width: 600px) {
    .psl-carrousel .psl-carte { flex: 0 0 100%; }
}

/* ===== Correctif bordures (v1.0.4) =====
   box-sizing: border-box sur TOUT : sans lui, width:100% + padding
   + bordure fait déborder les champs hors du cadre (bord droite
   manquante, coins chevauchés). */
.psl-liste,
.psl-livre,
.psl-formulaire,
.psl-loi-seule,
.psl-accueil,
.psl-liste *,
.psl-livre *,
.psl-formulaire *,
.psl-loi-seule *,
.psl-accueil * {
    box-sizing: border-box;
}
.psl-form {
    max-width: 760px;
    margin: 0 auto;
}
.psl-champ {
    width: 100%;
    max-width: 100%;
    display: block;
}

/* ===== v1.0.5 — Boutons de vote harmonisés avec les idées =====
   Pilules pleines (comme .ps-bouton-vote) : Pour = rouge,
   Contre = gris, voté = rouge foncé. */
.psl-bouton-vote {
    background: #E1000F;
    color: #ffffff;
    border: 0;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.6;
    transition: background .2s ease;
}
.psl-bouton-vote:hover {
    background: #b9000c;
    color: #ffffff;
}
.psl-bouton-vote.psl-vote-deja {
    background: #b9000c;
    color: #ffffff;
}
.psl-bouton-vote.psl-vote-contre {
    background: #767676;
    color: #ffffff;
    border: 0;
}
.psl-bouton-vote.psl-vote-contre:hover {
    background: #E1000F;
}
.psl-bouton-vote.psl-vote-contre-actif {
    background: #b9000c;
    border: 0;
}
.psl-bouton-vote.psl-vote-inactif {
    background: #767676;
    opacity: .7;
    cursor: default;
}

/* ===== v1.0.8 — Badge lu / pas lu (bascule au clic, comme les idées) ===== */
.psl-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;
}
.psl-badge-lecture.psl-lu {
    border-color: #1c8a4b;
    color: #14532d;
    background: #e7f5ec;
}
.psl-badge-lecture.psl-non-lu:hover { background: #fdecec; }
.psl-badge-lecture.psl-lu:hover { background: #d7eedf; }

/* =====================================================
 * v1.0.12 — Page loi seule plus étroite (900px, -200px
 * sur demande de Franck) 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).
 * ===================================================== */
.psl-loi-seule {
    max-width: 900px !important;
}

/* =====================================================
 * v1.0.15 — Pied de carte harmonisé avec les idées :
 * le lien « Lire la loi → » passe en taille compacte
 * (0.8rem), centré, avec filet séparateur discret —
 * comme « Lire l'idée → » (.ps-carte-pied .ps-lien).
 * ===================================================== */
/* v1.0.17 — Lien « Lire la loi → » ROUGE GRAS (choix de Franck),
   centré, compact, avec filet séparateur ; boutons Pour/Contre
   de largeur strictement égale (flex 1 1 0) comme les idées. */
.psl-carte-pied .psl-lien {
    color: #E1000F;
    font-weight: 600;
    text-decoration: underline;
    text-align: center;
    font-size: 0.8rem;
    border-top: 1px solid #f0d5d5;
    padding-top: 7px;
    margin-top: 2px;
}
.psl-vote-boutons .psl-bouton-vote {
    flex: 1 1 0;
    text-align: center;
}

/* =====================================================
 * v1.0.19 — Hauteur des cartes de lois égale à celle des
 * cartes d'idées : le JS (accueil.js) mesure la hauteur
 * réelle des cartes d'idées (.ps-carte-idee) et l'applique
 * en min-height aux cartes de lois. Le bloc loi retrouve
 * sa taille normale ET s'aligne au pixel sur le bloc idées.
 * ===================================================== */

/* =====================================================
 * v1.0.20 — Pied de carte (Pour/Contre + Lire la loi)
 * aligné VERS LE BAS : comme les idées (.ps-extrait
 * { flex: 1 }), l'extrait s'étire et pousse le pied en
 * bas de la carte, quelle que soit la longueur du texte.
 * ===================================================== */
.psl-carte .psl-corps {
    display: flex;
    flex-direction: column;
}
.psl-carte .psl-extrait {
    flex: 1;
}
