:root{
  --color_vert : #9dbe55;
  --color_vert_pastel : #e4edd0;
  --color_vert_fonce : #7FA638;
  --color_marron : #b68a43;
  --color_gris_clair : #f5f8ee;
}
/* ─── Bibliothèque Ressources ─────────────────────────────── */
#wpr-bibliotheque {
  font-family: inherit;
}

/* ─── Barre de filtres horizontale ───────────────────────── */
.wpr-filtres {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  border-radius: 30px;
  background-color: var(--color_vert_pastel);
  overflow: visible;
}
.wpr-filtre-groupe {
  position: relative;
  background-color: var(--color_vert);
  border-radius: 30px;
  display: inline-flex;
}
.hidden{
  min-width: 200px;
}
.hidden .wpr-bloc-filtre-liste{
  display: none;
}


/* ─── En-tête du groupe (titre + croix) ──────────────────── */
.wpr-filtre-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
}
.wpr-filtre-titre {
  font-size: 1.2em;
  color: white;
  cursor: pointer;
  padding: 8px 55px 8px 15px;
  transition: transform 0.3s ease;
}
.wpr-filtre-titre:after {
  content: '';
  display: block;
  background: url('../../assets/picto-liste-montante.png') no-repeat center;
  background-size: contain;
  width: 22px;
  height: 12px;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg); 
  transition: transform 0.3s ease;
}
.hidden .wpr-filtre-titre:after {
  transform: translateY(-50%) rotate(180deg);
}
.wpr-reset-groupe-open .wpr-filtre-titre{
  padding-right: 80px;
}
.wpr-reset-groupe-open .wpr-filtre-titre:after {
  right: 50px;
}
.wpr-reset-groupe {
  position: absolute;
  right: 20px;
  top: -2px;
  background: none;
  border: none;
  border-left: 1px solid white;
  padding: 0 0 0 15px;
  width: 20px;
  height: 100%;
  font-size: 2rem;
  color: var(--color_marron);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  z-index: 10;
}

/* ─── Liste de cases ──────────────────────────────────────── */
.wpr-bloc-filtre-liste{
  position: absolute;
  left: 0px;
  top: 55px;
   z-index: 99;
   min-width: 450px;
}
.wpr-filtre-liste {
  list-style: none;
  margin: 0;
  padding: 10px;
  display: flex;
  flex-direction: row;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 7px;
  background-color: var(--color_vert);
  border-radius: 10px;
}
.wpr-filtre-liste-focus1{
  background-color: var(--color_vert_fonce);
  margin-bottom: 0px !important;
  border-radius: 10px 10px 0px 0px;
}
.wpr-filtre-liste-focus1 .wpr-checkbox-text{
  font-size: 16px;
}
.wpr-filtre-liste-focus2{
  border-radius: 0px 0px 10px 10px;
}

/* ─── Checkbox custom ─────────────────────────────────────── */
.wpr-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 2px;
}
.wpr-checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.wpr-checkbox-custom {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--color_marron);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, background .15s;
}
.wpr-checkbox-custom::after {
  content: '';
  display: block;
  width: 4px;
  height: 7px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0;
  transition: opacity .15s;
}
.wpr-checkbox-label input:checked ~ .wpr-checkbox-custom {
  background: var(--color_marron);
  border-color: var(--color_marron);
}
.wpr-checkbox-label input:checked ~ .wpr-checkbox-custom::after {
  opacity: 1;
}
.wpr-checkbox-label:hover .wpr-checkbox-custom {
  border-color: #3b82f6;
}
.wpr-checkbox-text {
  font-size: 16px;
  color: white;
  line-height: 1.3;
  opacity: 0.5;
}
.wpr-checkbox-text em {
  font-style: normal;
  color: #9ca3af;
  font-size: .8rem;
  margin-left: 3px;
}
.wpr-checkbox-label input:checked ~ .wpr-checkbox-text {
  opacity: 1;
}

/* ─── Toolbar ─────────────────────────────────────────────── */
.wpr-toolbar {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  min-height: 20px;
}
.wpr-count {
  font-size: .85rem;
  color: #6b7280;
}

/* ─── Grille ──────────────────────────────────────────────── */
#wpr-grid {
}

/*
#wpr-grid {
  display: grid;
  grid-template-columns: repeat(var(--wpr-cols, 3), 1fr);
  gap: 20px;
  min-height: 100px;
}

@media (max-width: 768px) {
  #wpr-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  #wpr-grid { grid-template-columns: 1fr; }
}
*/

/* ─── Carte ───────────────────────────────────────────────── */

.wpr-card {
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.wpr-card:nth-child(odd) {
  background: var(--color_gris_clair);
}
.wpr-card-body {
  position: relative;
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.wpr-card-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  width: fit-content;
}
.wpr-type-pdf      { background: #fee2e2; color: #b91c1c; }
.wpr-type-video    { background: #dbeafe; color: #1d4ed8; }
.wpr-type-external { background: #d1fae5; color: #065f46; }

.wpr-card-title{
  font-size: 1em !important;
  margin: 0 !important;
  color: var(--color_vert) !important;
  max-width: 50%;
}
.wpr-card-auteur{
  font-size: 1em !important;
  margin: 0 !important;
  color: var(--color_marron) !important;
  max-width: 50%;
}
.wpr-card-gdtheme-pictos{
  position: absolute;
  min-width: 160px;
  left: 60%;
  top: 20px;
  text-align: right;
}
.wpr-card-gdtheme-pictos img{
  width: 100%;
  max-width: 40px;
  margin-left: 10px;
}

.wpr-card-type{
  min-width: 200px;
  background-color: var(--color_marron);
  color: white;
  text-transform: inherit;
  font-weight: 400;
  border-radius: 10px;
}

.wpr-card-title a {
  color: inherit;
  text-decoration: none;
}

.wpr-card-title a:hover { text-decoration: underline; }

.wpr-card-excerpt {
  font-size: .875rem;
  color: #6b7280;
  flex: 1;
  margin-bottom: 14px;
}

.wpr-card-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.wpr-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background .2s;
}

.wpr-btn-primary   { background: #3b82f6; color: #fff; }
.wpr-btn-primary:hover { background: #2563eb; color: #fff; }
.wpr-btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.wpr-btn-secondary:hover { background: #e5e7eb; }

/* ─── Infinite scroll ─────────────────────────────────────── */

#wpr-sentinel {
  height: 1px;
  margin-top: 20px;
}

#wpr-loader {
  display: none;
  text-align: center;
  padding: 28px 0;
}

.wpr-spinner {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: wpr-spin .7s linear infinite;
}

@keyframes wpr-spin {
  to { transform: rotate(360deg); }
}

#wpr-end {
  display: none;
  text-align: center;
  padding: 24px 0 8px;
  color: #9ca3af;
  font-size: .85rem;
}

#wpr-end::before {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: #e5e7eb;
  margin: 0 auto 10px;
}

/* ─── Messages ────────────────────────────────────────────── */

.wpr-no-results, .wpr-error {
  grid-column: 1 / -1;
  text-align: center;
  color: #6b7280;
  padding: 40px 20px;
}


/* ─── Popover ─────────────────────────────────────────────── */
/*
.wpr-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) !important;
  z-index: 9999;
  width: 50%;
  max-width: 720px;
  max-height: 95vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 30px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .14);
  padding: 20px 30px;
  box-sizing: border-box;  
  opacity: 0;
  pointer-events: none;
}
*/
.wpr-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) !important;
  z-index: 9999;
  width: 50%;
  max-width: 720px;
  max-height: 90vh;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 30px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .14);
  box-sizing: border-box;
  overflow: hidden; /* ← clipe la scrollbar dans les coins arrondis */
  opacity: 0;
  pointer-events: none;
}

/* Le scroll se fait ici, pas sur le parent */
.wpr-popover-inner {
  max-height: 95vh;
  overflow-y: auto;
  padding: 20px 30px;
  box-sizing: border-box;
}

.wpr-popover-inner::-webkit-scrollbar {
  width: 8px;
}
.wpr-popover-inner::-webkit-scrollbar-track {
  background: transparent;
}
.wpr-popover-inner::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}
.wpr-popover--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Bouton fermeture */
.wpr-popover-close {
  position: absolute;
  width: 45px;
  top: 10px;
  right: 35px;
  background: none;
  border: none;
  font-size: 30px;
  line-height: 1;
  color: var(--color_marron);
  cursor: pointer;
  text-align: center;
  z-index: 998;
}
.wpr-popover-close:after{
  content:'';
  position: absolute;
  top: 1px;
  right: 0px;
  display: block;
  width: 45px;
  height: 35px;
  border-radius: 22px;
  background-color: var(--color_vert);
  z-index: -1;
  transition: background .15s;
}

/* Contenu */
.wpr-pop-pictos{
  text-align: left;
}
.wpr-pop-pictos img{
  width: 100%;
  max-width: 40px;
  margin-right: 5px;
}
.wpr-pop-themes{
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  color: var(--color_marron);
  padding-right: 10%;
  margin: 10px 0px 20px 0px;
}
.wpr-pop-title {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--color_vert);
  padding-right: 20px;
  margin: 0px 0px 10px 0px;
}
.wpr-pop-copyright{
  font-size: 16px;
  line-height: 1.4;
  color: var(--color_marron);
  padding-right: 20px;
  margin: 0px 0px 10px 0px;
}

.wpr-pop-image{
  width: 100%;
  margin: 10px 0px 10px 0px;
}
.wpr-pop-image img{
  width: 100%;
  max-width: 100%;
}

.wpr-pop-contenu {
  font-size: 16px;
  line-height: 1.4;
  margin: 0px 0px 10px 0px;
  color: #333333;
}
.wpr-pop-contenu ul{
  margin: 5px 20px;
}
.wpr-pop-contenu img{
  margin: 10px 0px;
}

.wpr-pop-meta {
  font-size: 16px;
  line-height: 1.4;
  color: var(--color_marron);
  padding-right: 20px;
  margin: 5px 0px 10px 0px;
}

.wpr-pop-btn{
  display: inline-block;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  padding: 8px 15px !important;
  margin: 5px 0px;
  background-color: var(--color_vert);
  color: white;
  width: 50%;
  border-radius: 20px;
}
.wpr-pop-btn:hover{
  color: white;
}
.wpr-pop-btn:after{
  content:'>';
  color: var(--color_marron);
  font-size: 2 rem;
  float: right;
}
.wpr-pop-iframe iframe{
  width: 100%;
  min-height: 400px;
  margin: 10px 0px;
}

/* ─── Overlay ─────────────────────────────────────────────── */
.wpr-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(157, 190, 85, .9);
  z-index: 9998;
}

body.wpr-popover-open .wpr-overlay {
  display: block;
}


/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .wpr-filtre-groupe {
    flex: 1 1 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }
  .wpr-filtre-groupe:last-child {
    border-bottom: none;
  }
  .wpr-card-body{
    min-height: 140px;
  }
  .wpr-card-gdtheme-pictos{
    position: absolute;
    min-width: 40px;
    left: unset;
    right: 20px;
    top: 20px;
    text-align: center;
  }
  .wpr-card-gdtheme-pictos img{
    display: block;
    margin-left: 0px;
    margin-bottom: 5px;
  }
  .wpr-card-title{
    max-width: 80%;
  }
  .wpr-popover{
    width: 90%;
  }
  .wpr-pop-title{
    font-size: 20px;
  }
  .wpr-pop-btn{
    width: 100%;
  }
  .wpr-popover-close{
    top: 20px;
    right: 28px;
  }
  .wpr-bloc-filtre-liste{
    min-width: 100%;
  }
  .wpr-filtre-liste li{
    width: 100%;
  }
}