/*
 * MesPoèmes.net — styles du portail et de l'espace membre.
 * Bootstrap 5.3 fournit la mise en page ; on n'en redéfinit que les couleurs
 * (variables --bs-*) et quelques éléments propres au site. Les mini-sites ont
 * leur propre thème, construit à partir des réglages de chaque membre.
 */

:root {
    --mp-prune: #5b2a6e;
    --mp-prune-fonce: #43204f;
    --mp-prune-clair: #efe4f3;
    --mp-creme: #faf7f2;
    --mp-encre: #2c2333;
    --mp-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;

    --bs-body-bg: var(--mp-creme);
    --bs-body-color: var(--mp-encre);
    --bs-primary: var(--mp-prune);
    --bs-primary-rgb: 91, 42, 110;
    --bs-link-color: var(--mp-prune);
    --bs-link-color-rgb: 91, 42, 110;
    --bs-link-hover-color: var(--mp-prune-fonce);
    --bs-link-hover-color-rgb: 67, 32, 79;
    --bs-border-radius: .6rem;
}

.btn-primary {
    --bs-btn-bg: var(--mp-prune);
    --bs-btn-border-color: var(--mp-prune);
    --bs-btn-hover-bg: var(--mp-prune-fonce);
    --bs-btn-hover-border-color: var(--mp-prune-fonce);
    --bs-btn-active-bg: var(--mp-prune-fonce);
    --bs-btn-active-border-color: var(--mp-prune-fonce);
    --bs-btn-disabled-bg: var(--mp-prune);
    --bs-btn-disabled-border-color: var(--mp-prune);
}

.btn-outline-primary {
    --bs-btn-color: var(--mp-prune);
    --bs-btn-border-color: var(--mp-prune);
    --bs-btn-hover-bg: var(--mp-prune);
    --bs-btn-hover-border-color: var(--mp-prune);
    --bs-btn-active-bg: var(--mp-prune-fonce);
    --bs-btn-active-border-color: var(--mp-prune-fonce);
}

.mp-titre-poetique,
.mp-marque,
h1, h2, .h1, .h2 {
    font-family: var(--mp-serif);
}

.mp-navbar {
    background: var(--mp-prune);
    --bs-navbar-color: rgba(255, 255, 255, .85);
    --bs-navbar-hover-color: #fff;
    --bs-navbar-active-color: #fff;
    --bs-navbar-brand-color: #fff;
    --bs-navbar-brand-hover-color: #fff;
    --bs-navbar-toggler-border-color: rgba(255, 255, 255, .4);
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.mp-marque {
    font-size: 1.45rem;
    letter-spacing: .01em;
}

.mp-bandeau-apercu {
    background: #fff3cd;
    color: #664d03;
}

.mp-accroche {
    background: linear-gradient(135deg, var(--mp-prune-clair), #fff);
    border: 1px solid rgba(91, 42, 110, .12);
}

.mp-etroit {
    max-width: 40rem;
}

.mp-moyen {
    max-width: 52rem;
}

/* Numéros des étapes de l'inscription */
.mp-etape {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-right: .4rem;
    border-radius: 50%;
    background: var(--mp-prune);
    color: #fff;
    font-size: .95rem;
}

.mp-pied {
    background: var(--mp-prune-fonce);
    color: rgba(255, 255, 255, .8);
}

.mp-pied a {
    color: #fff;
    text-decoration: none;
}

.mp-pied a:hover,
.mp-pied a:focus {
    text-decoration: underline;
}

/* Accueil : chiffres de la communauté */
.mp-chiffres li { font-size: 1.1rem; padding: .35rem 0; border-bottom: 1px dashed rgba(91, 42, 110, .2); }
.mp-chiffres li:last-child { border-bottom: 0; }
.mp-chiffres strong { font-family: var(--mp-serif); font-size: 1.6rem; color: var(--mp-prune); margin-right: .25rem; }

/* Textes longs (principe, règlement, mentions) */
.mp-texte-long { line-height: 1.7; }

/* Annuaire */
.mp-carte-site { transition: transform .12s ease, box-shadow .12s ease; }
.mp-carte-site:hover, .mp-carte-site:focus { transform: translateY(-2px); box-shadow: 0 .5rem 1.25rem rgba(60, 30, 70, .12) !important; }
.mp-carte-site .card-title { color: var(--mp-prune); }

/* Actualités : encart des accueils */
.mp-actualite { border-left: 4px solid var(--mp-prune); }

/* Tableau de bord de Mon espace : logo du site, pieds de carte cliquables */
.mp-logo-espace { padding: .75rem; background: #fff; border: 1px solid rgba(91, 42, 110, .12); border-radius: .5rem; text-align: center; }
.mp-logo-espace img { width: auto; max-width: 100%; height: auto; max-height: 120px; object-fit: contain; vertical-align: middle; }
.mp-pied-carte {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    font-weight: 600;
    color: var(--mp-prune);
    text-decoration: none;
    background: var(--mp-prune-clair);
    border-top-color: rgba(91, 42, 110, .15);
    transition: background-color .15s ease, color .15s ease;
}
.mp-pied-carte:hover, .mp-pied-carte:focus-visible { background: var(--mp-prune); color: #fff; }
.mp-pied-carte .bi-arrow-right { display: inline-block; transition: transform .15s ease; }
.mp-pied-carte:hover .bi-arrow-right, .mp-pied-carte:focus-visible .bi-arrow-right { transform: translateX(3px); }

/* Poème sans fin, concours */
.mp-vers .list-group-item { font-size: 1.05rem; }
.mp-texte-poeme { font-family: var(--mp-serif); font-size: 1.1rem; line-height: 1.75; }
.mp-smiley { vertical-align: middle; max-height: 2em; }

/* Espace membre */
.mp-menu-espace .list-group-item.active { background: var(--mp-prune); border-color: var(--mp-prune); }
.mp-saisie-poeme { font-family: var(--mp-serif); font-size: 1.05rem; line-height: 1.7; }
.mp-apercu-photo { max-width: 160px; max-height: 160px; width: auto; height: auto; object-fit: contain; }
.mp-apercu-logo { width: fit-content; max-width: 100%; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.mp-apercu-logo img { display: block; width: auto; max-width: 100%; height: auto; max-height: 240px; }
/* Bouton d'enregistrement d'un long formulaire : reste visible en bas de l'écran. */
.mp-barre-enregistrer { position: sticky; bottom: 0; z-index: 2; background: var(--bs-body-bg); box-shadow: 0 -.5rem 1rem -.75rem rgba(0, 0, 0, .25); }
.mp-vignette-fond { object-fit: cover; }
.mp-photo-membre { max-width: 200px; height: auto; }
.mp-galerie-fonds { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.mp-fond-choix { padding: 0; border: 3px solid transparent; border-radius: .5rem; background: none; overflow: hidden; aspect-ratio: 1; }
.mp-fond-choix img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-fond-choix:hover, .mp-fond-choix:focus-visible { border-color: rgba(91, 42, 110, .4); }
.mp-fond-actuel { border-color: var(--mp-prune); }

/* Choix de la mise en page des mini-sites (Mon site, inscription) : petits schémas. */
.mp-choix-mise { cursor: pointer; border-width: 2px; }
.btn-check:checked + .mp-choix-mise { border-color: var(--mp-prune); box-shadow: 0 0 0 .2rem rgba(91, 42, 110, .15); }
.btn-check:focus-visible + .mp-choix-mise { outline: 2px solid var(--mp-prune); outline-offset: 2px; }
.mp-schema { position: relative; display: block; height: 70px; border-radius: .4rem; overflow: hidden;
    background: repeating-linear-gradient(45deg, #b48cc3 0 6px, #cdb2d8 6px 12px); }
.mp-schema span { position: absolute; display: block; }
.mp-schema-carnet span:nth-child(1) { left: 22%; right: 22%; top: 10px; bottom: 0; background: #fffdf8; border-radius: 3px 3px 0 0; }
.mp-schema-carnet span:nth-child(2) { left: 32%; right: 32%; top: 22px; height: 4px; background: #5b2a6e; }
.mp-schema-carnet span:nth-child(3) { left: 30%; right: 40%; top: 34px; height: 24px;
    background: repeating-linear-gradient(#999 0 2px, transparent 2px 7px); }
.mp-schema-couverture { background: #f1edf3; }
.mp-schema-couverture span:nth-child(1) { left: 0; right: 0; top: 0; height: 28px;
    background: repeating-linear-gradient(45deg, #8e5aa3 0 6px, #a57cb6 6px 12px); }
.mp-schema-couverture span:nth-child(2) { left: 25%; right: 25%; top: 36px; bottom: 0; background: #fff; border-radius: 3px 3px 0 0; }
.mp-schema-couverture span:nth-child(3) { left: 32%; right: 40%; top: 44px; height: 22px;
    background: repeating-linear-gradient(#999 0 2px, transparent 2px 7px); }
.mp-schema-voile span:nth-child(1) { left: 18%; right: 18%; top: 8px; height: 14px; background: rgba(240, 240, 240, .9); border-radius: 4px; }
.mp-schema-voile span:nth-child(2) { left: 18%; right: 18%; top: 26px; bottom: 0; background: rgba(240, 240, 240, .9); border-radius: 4px 4px 0 0; }
.mp-schema-voile span:nth-child(3) { left: 26%; right: 40%; top: 34px; height: 24px;
    background: repeating-linear-gradient(#777 0 2px, transparent 2px 7px); }

/* Gestion : avancement d'une annonce par e-mail. */
.mp-progression { display: block; width: 100%; height: 1rem; accent-color: var(--mp-prune); }

/* Barre d'outils du poème (gras, italique, souligné, émojis), collée au champ de texte. */
.mp-barre-outils {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .4rem .5rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-bottom: 0;
    border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
    background: #f3eef5;
}
.mp-barre-outils .btn-light { background: #fff; border-color: rgba(0, 0, 0, .12); min-width: 2.25rem; }
.mp-barre-aide { margin-left: auto; font-size: .8rem; color: var(--bs-secondary-color); }
.mp-sous-barre { border-top-left-radius: 0; border-top-right-radius: 0; }

/* Champ qui grandit avec son texte (data-mp-hauteur-auto, posé par site.js) : ni défilement ni poignée. */
.mp-hauteur-auto { overflow-y: hidden; resize: none; }

/* Mode sans distraction (page d'un poème) : seul le formulaire reste, au centre. */
body:not(.mp-concentration) .mp-quitter-concentration { display: none; }
body.mp-concentration > header,
body.mp-concentration .mp-pied,
body.mp-concentration .mp-bandeau-apercu,
body.mp-concentration .mp-menu-lateral,
body.mp-concentration .mp-hors-concentration { display: none !important; }
body.mp-concentration main { padding-top: 4.5rem !important; }
body.mp-concentration .mp-menu-lateral + [class*="col-"] { width: 100%; max-width: 52rem; margin-inline: auto; }
.mp-concentration .mp-quitter-concentration { position: fixed; top: 1rem; right: 1rem; z-index: 1030; }
.mp-palette-emojis { width: min(22rem, 90vw); max-height: 22rem; overflow-y: auto; }
.mp-export-pdf { width: min(21rem, 90vw); }
.mp-groupe-emojis { margin: .35rem .25rem .2rem; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--bs-secondary-color); }
.mp-grille-emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.4rem, 1fr)); }
.mp-grille-emojis button {
    height: 2.4rem;
    border: 0;
    border-radius: .4rem;
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
}
.mp-grille-emojis button:hover, .mp-grille-emojis button:focus-visible { background: var(--mp-prune-clair); }
