/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.manifeste-header {
  text-align: center;
  padding: 2rem 1rem;
}

.manifeste-header h1 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

/* Titre du manifeste : nom du label plus grand que « LE LABEL » et que les chevrons */
.manifeste-header h1 .label-name {
  font-size: 2.5em;
  line-height: 1;
  vertical-align: -0.08em;
}

/* Manifeste : « L » et « Q » du nom du label dans le violet du logo */
.manifeste-header h1 .label-initial {
  color: #a4009d;
}

.manifeste-subtitle {
  font-size: 1.68rem;
  margin-top: 0.2rem;
  color: #555;
}

:root {
  --label-font: "Great Vibes", cursive; /* police du logo, réservée aux usages décoratifs */
}

.label-font {
  font-family: var(--label-font);
  font-weight: normal;
}

.site-logo {
  margin-right: auto;
}

.site-logo img {
  display: block;
  width: 120px;
  height: auto;
}

/* Page de texte à lire */
.text-page {
  max-width: 36rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  font-size: 1.55rem;
  line-height: 1.25;
  text-align: justify;
}

.text-page h1, .text-page h2, .text-page h3, .text-page h4, .text-page h5, .text-page h6 {
  text-align: left;
}

/* Encarts asciidoc (NOTE:, TIP:, [NOTE,caption=…], etc.) */
.text-page .admonitionblock {
  margin: 1.2em 0 1.2em 1.5em;
  padding: 0.6em 1em 0.6em 0.5em;
  border-left: 4px solid #888;
  background: #f5f5f5;
}

.text-page .admonitionblock table {
  table-layout: auto;
  border-collapse: collapse;
  width: 100%;
}

.text-page .admonitionblock td {
  padding: 0;
  vertical-align: baseline;
}

.text-page .admonitionblock td.icon {
  width: 1%;
  white-space: nowrap;
  padding-right: 1em;
  font-weight: bold;
  font-size: 0.8em;
  text-transform: uppercase;
  text-align: left;
}

.text-page .admonitionblock td.content {
  text-align: justify;
  hyphens: auto;
}

.text-page .admonitionblock td.content > :first-child { margin-top: 0; }
.text-page .admonitionblock td.content > :last-child { margin-bottom: 0; }

/* Tables asciidoc : chaque cellule contient un paragraphe */
.text-page p.tableblock {
  margin: 0;
}

/* Listes asciidoc : chaque élément contient un paragraphe */
.text-page li > p {
  margin: 0;
}

.text-page li + li {
  margin-top: 0.4em;
}

/* Note « :if_no_gender: » : genre non précisé */
.no-gender-note {
  font-style: italic;
  font-size: 0.85em;
}

.form-page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.form-page fieldset {
  border: 1px solid #ccc;
  margin-bottom: 1.5rem;
  padding: 1rem;
}

.form-page label {
  display: block;
  margin-bottom: 0.8rem;
}

.form-page [hidden] {
  display: none !important;
}

/* Champ dont le libellé est suivi d'une action (« Vous êtes déjà inscrit ») */
.form-page .field {
  margin-bottom: 0.8rem;
}

.form-page .field-label {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.form-page .field-label label {
  margin-bottom: 0;
}

.form-page .link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Champs : trois largeurs (plain, mid, short). Par défaut : mid, sauf textarea (plain)
   et nombre (short). */
.form-page input[type=text], .form-page input[type=email], .form-page input[type=password],
.form-page input[type=url], .form-page input[type=number], .form-page select, .form-page textarea {
  display: block;
  width: 60%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 0.2rem;
}

.form-page textarea, .form-page :is(input, select, textarea).plain {
  width: 100%;
}

.form-page input[type=number], .form-page :is(input, select, textarea).short {
  width: 12rem;
}

.form-page :is(input, select, textarea).mid {
  width: 60%;
}

.form-page :is(input, select, textarea).tiny {
  width: calc(3ch + 3.5rem);
}

/* Cases à cocher et boutons radio, dans tous les formulaires */
.form-page label.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}

/* Case à cocher suivie d'un champ sur la même ligne */
.form-page .checkbox-with-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.form-page .checkbox-with-field label.checkbox {
  margin-bottom: 0;
}

.form-page .checkbox-with-field input[type=email] {
  flex: 1;
  margin-top: 0;
}

.form-page input[type=checkbox], .form-page input[type=radio] {
  display: inline-block;
  flex-shrink: 0;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.15rem 0 0;
  accent-color: #2f7d52;
  cursor: pointer;
}

/* Boutons : alignés à droite par défaut ; bouton principal en vert */
.form-page button, .form-page input[type=submit] {
  display: block;
  margin: 0.5rem 0 0.8rem auto;
}

.form-page input[type=submit].spaced {
  margin-top: 2.5rem;
}

/* Liens d'aide : cadre léger, à droite de la page (partial shared/quick_help ;
   dans les textes _T_ : « [.quick-help] » au-dessus d'une liste de liens) */
.quick-help {
  display: table;
  margin: 0 0 1rem auto;
  padding: 0.3rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9em;
}

.quick-help ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.quick-help li, .quick-help p {
  margin: 0;
}

/* Page d'un livre : auteurs à peine plus petits que le titre, résumé replié sur 3 lignes */
/* Pictogrammes SVG (IconsHelper) */
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  margin-right: 0.4em;
}

.icon.icon-after {
  margin-right: 0;
  margin-left: 0.4em;
}

.form-page .book-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 1.5rem;
}

.form-page .book-authors {
  font-size: 1.7em;
  margin: 0;
  text-align: right;
  margin-left: auto;
}

.form-page .book-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  cursor: pointer;
}

.form-page .book-summary.open {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: none;
}

.form-page .book-steps {
  clear: both;
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

.form-page .book-steps th, .form-page .book-steps td {
  padding: 0.2rem 1rem 0.2rem 0;
  text-align: left;
}

.form-page .book-steps :is(th, td):first-child {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  padding-right: 1.5rem;
  font-variant-numeric: tabular-nums;
}

/* Champ fichier sans le texte « Aucun fichier sélectionné » */
.form-page input[type=file].no-filename {
  color: transparent;
}

.form-page fieldset button {
  margin-left: 0;
  margin-right: auto;
}

.form-page input[type=submit].primary, .form-page button.primary {
  background: #8fd4a8;
  border: 1px solid #5fae7e;
  color: #000;
}

.form-page input[type=submit].primary:hover, .form-page button.primary:hover {
  background: #74c592;
}

/* Autrices et auteurs : séparateurs (sous la case « responsable », entre les autrices
   et auteurs, au-dessus du bouton d'ajout) */
.form-page .authors-list, .form-page .author + .author, .form-page .add-author {
  border-top: 2px solid #999;
}

.form-page .authors-list {
  margin-top: 0.8rem;
}

.form-page .author {
  position: relative;
  padding-top: 0.8rem;
}

.form-page .add-author {
  padding-top: 0.5rem;
}

.form-page .add-author button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.form-page .add-author .plus {
  font-size: 1.6em;
  font-weight: bold;
  line-height: 1;
}

.form-page .author button.remove-author {
  position: absolute;
  top: 0.4rem;
  right: 0;
  margin: 0;
  padding: 0 0.5rem;
  font-size: 1.4rem;
  line-height: 1.4;
}

.form-note {
  font-size: 0.9rem;
  color: #555;
}

.form-errors {
  color: #a00;
}

.account-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.account-bar form.inline {
  display: inline;
}

/* Menu de l'user connecté (pseudo) : Tableau de bord, Profil, Déconnexion */
.user-menu {
  position: relative;
  display: inline-block;
}

.user-menu .user-menu-toggle {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.user-menu .user-menu-toggle:hover, .user-menu .user-menu-toggle:focus {
  background: none;
  box-shadow: none;
  text-decoration: underline;
}

.user-menu .user-menu-toggle::after {
  content: " ▾";
}

.user-menu ul {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  min-width: 11rem;
  margin: 0.4rem 0 0;
  padding: 0.4rem 0;
  list-style: none;
  background: var(--background-body, #fff);
  border: 1px solid var(--border, #ccc);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-menu li {
  margin: 0;
  padding: 0;
}

.user-menu li a,
.user-menu .link-button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.35rem 1rem;
  text-align: left;
  white-space: nowrap;
}

.user-menu .link-button {
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--links, inherit);
  font: inherit;
  cursor: pointer;
}

.user-menu li a:hover,
.user-menu .link-button:hover {
  background: var(--background, #f2f2f2);
  text-decoration: none;
}

.manifeste-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 0 1rem 2rem;
}

a.button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border: 1px solid #333;
  border-radius: 4px;
  color: #000;
  text-decoration: none;
}

a.button:hover {
  background: #eee;
}

.library {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
}

.library th, .library td {
  text-align: left;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid #ddd;
}

iframe.dev-mail {
  width: 100%;
  height: 32rem;
  border: 1px solid #ccc;
}

.gender-menu, .theme-menu, .font-menu {
  display: inline;
  font-size: 0.9rem;
}

.gender-menu label, .theme-menu label, .font-menu label,
.gender-menu select, .theme-menu select, .font-menu select {
  display: inline-block;
  width: auto;
  margin: 0 0 0 0.3rem;
}

.site-footer {
  margin-top: 3rem;
  text-align: center;
  font-size: 0.9rem;
}

/* Bouton d'action grave (refus définitif, suppression…) */
button.warning, input[type=submit].warning {
  background: #e9a3a3;
  border: 1px solid #c0504d;
  color: #000;
}

button.warning:hover, input[type=submit].warning:hover {
  background: #df8585;
}

/* Picto « ? » : aide ouverte dans une nouvelle page */
.help-link {
  display: inline-flex;
  align-items: center;
  color: #888;
  text-decoration: none;
}

.help-link:hover {
  color: inherit;
}

.help-link .icon {
  width: 2em;
  height: 2em;
}

/* Bouton + « ? » : aide à droite d'un bouton aligné à gauche, à gauche d'un bouton aligné à droite */
.button-with-help {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.widget-actions .button-with-help, .align-right .button-with-help {
  flex-direction: row-reverse;
}

/* Lien présenté comme un bouton */
a.button-link {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.8rem;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #d0cfcf;
  color: #000;
  font-size: 0.85rem;
  text-decoration: none;
}

a.button-link.primary {
  background: #8fd4a8;
  border-color: #5fae7e;
}

a.button-link.primary:hover {
  background: #74c592;
}

/* « Vous en êtes à : » (étape de lecture du membre) */
.step-menu {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
}

.step-menu label {
  margin: 0;
}

.step-menu select {
  width: auto;
  margin: 0;
  padding: 0.15rem 1.8rem 0.15rem 0.5rem;
  font-size: 0.85rem;
}

.manager-note {
  color: #b5651d;
  font-weight: bold;
}

/* Message après une action (merci, déjà fait…) */
.flash-notice {
  margin: 1rem 0;
  padding: 0.6rem 1rem;
  border: 1px solid #5fae7e;
  border-radius: 8px;
  background: #eaf6ee;
  color: #1d4d2f;
}

/* Livres des listings : un cadre par livre, picto du livre fermé */
.book-list, .widget-list.book-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.book-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.5rem 0;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
}

.book-item-icon {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: 0.1rem;
  color: #8a6d3b;
}

.book-item-body {
  flex: 1;
  min-width: 0;
}

/* Nom du label en cursive (police du logo), titre du manifeste */
.label-name {
  font-family: var(--label-font);
  font-weight: normal;
  font-size: 1.35em;
  text-transform: none;
  letter-spacing: 0;
}

/* Lien discret (actions secondaires : modifier, personnaliser…) */
.discreet-link {
  color: #888;
  font-size: 0.85rem;
  text-decoration: none;
}

.discreet-link:hover {
  color: inherit;
  text-decoration: underline;
}

/* Tableau de bord : rangées de widgets (3 au plus, le 3e passe dessous si la page est étroite) */
.dashboard-page {
  padding: 1rem 0;
}

.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dashboard-header h1 {
  margin: 0;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.dashboard-actions button {
  margin: 0;
}

.dashboard-actions button.primary {
  background: #8fd4a8;
  border: 1px solid #5fae7e;
  color: #000;
}

.dashboard-actions button.primary:hover {
  background: #74c592;
}

.dashboard-cancel, .dashboard-save, .dashboard-help, .dashboard-tools,
.dashboard-page.editing .dashboard-edit {
  display: none;
}

.dashboard-page.editing .dashboard-cancel,
.dashboard-page.editing .dashboard-save {
  display: inline-block;
}

.dashboard-page.editing .dashboard-help {
  display: block;
  font-size: 0.9rem;
}

.dashboard-page.editing .dashboard-tools {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.dashboard-tools select, .dashboard-tools button {
  width: auto;
  margin: 0;
}

.dashboard-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.widget, .widget-slot {
  flex: 1 1 15rem;
  min-width: 0;
}

.widget {
  margin-top: 0.7rem;
  padding: 0.2rem 0.9rem 0.7rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 8px;
  background: var(--background-body, #fff);
}

/* Titre du widget posé sur le trait du cadre (comme la légende d'un fieldset) */
.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: -0.95rem -0.4rem 0.3rem;
}

.widget-header h2, .widget-header .widget-remove {
  background: var(--background-body, #fff);
}

.widget-header h2 {
  margin: 0;
  padding: 0 0.4rem;
  font-size: 1.05rem;
  line-height: 1.5;
}

.widget-remove {
  display: none;
}

.dashboard-page.editing .widget-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.widget-remove .icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.dashboard-page.editing .widget-remove:disabled {
  opacity: 0.3;
  cursor: default;
}

.widget-slot {
  display: none;
}

.dashboard-page.editing .widget-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 6rem;
  border: 2px dashed var(--border, #ccc);
  border-radius: 8px;
  color: #888;
  font-size: 0.9rem;
}

.dashboard-page.editing .widget {
  cursor: move;
  border-style: dashed;
}

.row-add-slot {
  align-self: center;
  margin: 0;
  padding: 0.2rem 0.7rem;
}

.widget.dragging {
  opacity: 0.4;
}

.widget.drop-over, .widget-slot.drop-over {
  outline: 3px solid #5fae7e;
}

.widget-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.8rem;
  margin: 0;
}

.widget-facts dt {
  font-weight: normal;
  color: #666;
}

.widget-facts dd {
  margin: 0;
  font-weight: bold;
}

.widget-list {
  margin: 0;
  padding-left: 1.1rem;
}

.widget-list li {
  margin: 0.2rem 0;
}

.widget-note {
  display: block;
  font-size: 0.85rem;
  color: #777;
}

/* Crédits d'une action : pastille orange, flèche vers le haut (gain) ; rouge, flèche vers le bas (perte) */
.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  line-height: 1.3;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: #e8740c;
  color: #fff;
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
}

.credit-badge .icon {
  width: auto;
  height: 0.95em;
  margin-right: 0.12em;
}

.credit-badge.credit-loss {
  background: #c62828;
}

/* Bouton contenant une pastille : texte et pastille alignés */
button:has(.credit-badge) {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.widget-actions-list {
  list-style: none;
  padding-left: 0;
}

.widget-actions-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border, #ddd);
}

.widget-actions-list li:last-child {
  border-bottom: 0;
}

.widget-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
}

/* Propositions de livres à valider : livre à gauche, boutons en regard */
.validation-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.validation-line .widget-actions {
  margin: 0;
}

.file-link {
  font-size: 0.85rem;
  white-space: nowrap;
}

.file-link .icon, .file-icon {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.15em;
}

.waiting-file {
  color: #b5651d;
}

/* Boîtes de dialogue du label (jamais celles du navigateur) */
.ldq-dialog {
  width: min(32rem, calc(100vw - 2rem));
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 10px;
  background: var(--background-body, #fff);
  color: inherit;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.ldq-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.ldq-dialog-title, .ldq-dialog-message {
  margin: 0 0 0.8rem;
  font-weight: bold;
}

.ldq-dialog label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

.ldq-dialog input[type=text] {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
}

.ldq-dialog-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.ldq-dialog-buttons button {
  margin: 0;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
}

.ldq-dialog-buttons button.primary {
  background: #8fd4a8;
  border: 1px solid #5fae7e;
  color: #000;
}

.widget-actions button, .widget-actions input[type=submit] {
  margin: 0;
  padding: 0.2rem 0.8rem;
  font-size: 0.85rem;
}

.widget-actions .primary {
  background: #8fd4a8;
  border: 1px solid #5fae7e;
  color: #000;
}

.widget-ranking .widget-note {
  display: inline;
  margin-left: 0.4rem;
}

.widget-ranking .is-you {
  font-weight: bold;
}

.widget-empty {
  margin: 0;
  color: #777;
}

/* Profil, préférences, fiche du livre du membre */
.profile-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
}

.profile-facts dt {
  font-weight: normal;
  color: #666;
}

.profile-facts dd {
  margin: 0;
}

/* Petits écrans (téléphone) */
@media (max-width: 600px) {
  .account-bar {
    justify-content: center;
    gap: 0.6rem;
  }

  .user-menu ul {
    right: 50%;
    transform: translateX(50%);
  }

  .manifeste-actions {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .form-page {
    padding: 1rem 0.8rem;
  }

  .form-page input[type=text], .form-page input[type=email], .form-page input[type=password],
  .form-page select, .form-page :is(input, select, textarea).mid {
    width: 100%;
  }

  .form-page fieldset {
    padding: 0.6rem;
  }
}
