/**
 * FdC Search Engine — Styles frontend v1.2
 * Terre de Pixels · terredepixels.fr
 * Désactivable via Réglages → FdC Recherche
 */

/* ── Variables ──────────────────────────────────────────────────────── */
:root {
  --fdc-green:        #0F5D62;
  --fdc-green-hover:  #0DB4BF;
  --fdc-green-light:  #D1EEF0;
  --fdc-border:       #ddd8d0;
  --fdc-bg:           #f9f8f6;
  --fdc-text:         #2d2d2d;
  --fdc-muted:        #888;
  --fdc-radius:       7px;
  --fdc-input-h:      38px;
  --fdc-shadow:       0 2px 8px rgba(0,0,0,.07);
  --fdc-shadow-drop:  0 4px 16px rgba(0,0,0,.12);
  --fdc-font:         inherit;
}


/* ── Wrapper de chaque filtre individuel ────────────────────────────── */
.fdc-filter-wrap {
  display: flex;
  flex-direction: column;
  font-family: var(--fdc-font);
}

.fdc-filter-wrap--titre    { flex: 2 1 240px; min-width: 180px; }
.fdc-filter-wrap--rubrique,
.fdc-filter-wrap--auteur   { flex: 1 1 160px; min-width: 140px; }
.fdc-filter-wrap--fdc      { flex: 0 1 110px; min-width: 90px; }
.fdc-filter-wrap--date     { flex: 1 1 220px; min-width: 180px; }
.fdc-filter-wrap--reset    { flex: 0 0 auto; align-self: flex-end; }
.fdc-filter-wrap--counter  { flex: 1 1 100%; margin-top: .25rem; }

/* ── Barre résultats ────────────────────────────────────────────────── */
.fdc-results-bar {
  font-size: 16px;
  color: var(--fdc-muted);
  min-height: 1.2em;
  padding: .15rem 0;
}

.fdc-results-count {
  font-weight: 700;
  color: var(--fdc-green);
}

/* ════════════════════════════════════════════════════════════════════
   COMBOBOX — champ texte libre + liste déroulante filtrée
   ════════════════════════════════════════════════════════════════════ */
.fdc-combobox {
  position: relative;
}

.fdc-combobox__input {
  width: 100%;
  height: var(--fdc-input-h);
  padding: 0 2.2rem 0 .75rem;
  border: 1px solid var(--fdc-border);
  border-radius: var(--fdc-radius);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23aaa'/%3E%3C/svg%3E") no-repeat right .75rem center;
  font-size: 16px;
  font-family: var(--fdc-font);
  color: var(--fdc-text);
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
  cursor: text;
}

.fdc-combobox__input:focus {
  outline: none;
  border-color: var(--fdc-green);
  box-shadow: 0 0 0 3px rgba(74,124,89,.15);
}

.fdc-combobox__input::placeholder { color: var(--fdc-muted); }

/* ── Bouton effacer (×) dans le champ ──────────────────────────────── */
.fdc-combobox__clear {
    position: absolute;
    right: 0.60rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0 0 2px 0;
    background: var(--fdc-muted);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    line-height: 2.1rem;
    cursor: pointer;
    opacity: 1;
    transition: opacity .15s, background .15s;
    z-index: 2;
    align-content: center;
}

.fdc-combobox__clear:hover {
  opacity: 1;
  background: #555;
}

.fdc-combobox__clear[hidden] {
  display: none;
}

/* ── Liste déroulante ───────────────────────────────────────────────── */
.fdc-combobox__list {
  display: none;
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border: 1px solid var(--fdc-border);
  border-radius: var(--fdc-radius);
  box-shadow: var(--fdc-shadow-drop);
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: .3rem 0;
  overscroll-behavior: contain;
}

.fdc-combobox__option {
  padding: .45rem .85rem;
  font-size: 16px;
  font-family: var(--fdc-font);
  color: var(--fdc-text);
  cursor: pointer;
  border-radius: 0;
  transition: background .1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fdc-combobox__option:hover,
.fdc-combobox__option--active {
  background: var(--fdc-green-light);
  color: var(--fdc-green);
}

.fdc-combobox__option mark {
  background: #fff9c4;
  color: inherit;
  font-weight: 700;
  border-radius: 2px;
}

/* Scrollbar fine dans la liste */
.fdc-combobox__list::-webkit-scrollbar { width: 5px; }
.fdc-combobox__list::-webkit-scrollbar-track { background: transparent; }
.fdc-combobox__list::-webkit-scrollbar-thumb { background: var(--fdc-border); border-radius: 3px; }

/* ════════════════════════════════════════════════════════════════════
   FILTRE DATES
   ════════════════════════════════════════════════════════════════════ */
.fdc-filter-dates {
  display: flex;
  gap: .4rem;
  align-items: center;
}

.fdc-date-sub { display: flex; flex-direction: column; flex: 1; }

.fdc-date-sep {
  color: var(--fdc-muted);
  font-size: 16px;
  flex-shrink: 0;
  padding-top: 2px;
}

.fdc-date-input {
  width: 100%;
  height: var(--fdc-input-h);
  padding: 0 .65rem;
  border: 1px solid var(--fdc-border);
  border-radius: var(--fdc-radius);
  background: #fff;
  font-size: 16px;
  font-family: var(--fdc-font);
  color: var(--fdc-text);
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}

.fdc-date-input:focus {
  outline: none;
  border-color: var(--fdc-green);
  box-shadow: 0 0 0 3px rgba(74,124,89,.15);
}

/* ════════════════════════════════════════════════════════════════════
   BOUTON RESET
   ════════════════════════════════════════════════════════════════════ */
.fdc-btn-reset {
  height: var(--fdc-input-h);
  padding: 0 1rem;
  background: #fff;
  border: 1px solid var(--fdc-border);
  border-radius: var(--fdc-radius);
  font-size: 16px;
  font-family: var(--fdc-font);
  color: var(--fdc-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}

.fdc-btn-reset:hover {
  background: #f0ede7;
  color: var(--fdc-text);
  border-color: #b5b0a8;
}

/* ── Notice d'erreur ─────────────────────────────────────────────── */
.fdc-notice {
  padding: .75rem 1rem;
  border-radius: var(--fdc-radius);
  font-size: 16px;
}

.fdc-notice--warn {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #664d03;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .fdc-filters-bar { flex-direction: column; }
  .fdc-filter-wrap,
  .fdc-filter-wrap--titre,
  .fdc-filter-wrap--fdc,
  .fdc-filter-wrap--date { flex: 1 1 100%; min-width: 100%; }
  .fdc-filter-dates { flex-wrap: wrap; }
}

/* ══════════════════════════════════════════════════════════════════════
   RÉPERTOIRE DES ARTICLES — [fdc_repertoire_contenu]
   Contenu seul (sans overlay) · seniors-friendly · 16px · responsive
   ══════════════════════════════════════════════════════════════════════ */

/* ── Wrapper racine ─────────────────────────────────────────────────── */
.fdc-rep {
  width: 100%;
  font-family: var(--fdc-font);
  color: var(--fdc-text);
  font-size:16px;       /* 16 px */
  box-sizing: border-box;
}

/* ── Barre de recherche interne ─────────────────────────────────────── */
.fdc-rep__search {
  margin-bottom: 16px;
}

.fdc-rep__search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 18px;
  font-size: 16px;
  font-family: var(--fdc-font);
  border: 2px solid var(--fdc-border);
  border-radius: var(--fdc-radius);
  background: var(--fdc-bg);
  color: var(--fdc-text);
  transition: border-color .2s, box-shadow .2s;
}

.fdc-rep__search-input:focus {
  outline: none;
  border-color: var(--fdc-green);
  box-shadow: 0 0 0 3px rgba(74, 124, 89, .15);
}

/* ── Résumé : "X articles trouvés" ─────────────────────────────────── */
.fdc-rep__info {
  font-size: 16px;
  color: var(--fdc-muted);
  margin-bottom: 10px;
  min-height: 1.4em;
}

/* ── Zone scrollable du tableau ─────────────────────────────────────── */
.fdc-rep__scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--fdc-border);
  border-radius: var(--fdc-radius);
}

/* ── Tableau ─────────────────────────────────────────────────────────── */
.fdc-rep__table {
  width: 100%;
  border-collapse: collapse;
  font-size:16px;
  background: #fff;
}

/* En-têtes */
.fdc-rep__table thead th {
  background: var(--fdc-green);
  color: #fff;
  text-align: left;
  padding: 13px 14px;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 2px solid var(--fdc-green-hover);
  cursor: pointer;
  user-select: none;
}

.fdc-rep__table thead th:hover {
  background: var(--fdc-green-hover);
}

.fdc-rep__table thead th[aria-sort="ascending"]::after  { content: " ↑"; font-weight: 900; }
.fdc-rep__table thead th[aria-sort="descending"]::after { content: " ↓"; font-weight: 900; }

/* Cellules */
.fdc-rep__table tbody tr {
  border-bottom: 1px solid var(--fdc-border);
  transition: background .15s;
}

.fdc-rep__table tbody tr:last-child { border-bottom: none; }

.fdc-rep__table tbody tr:nth-child(even) { background: var(--fdc-bg); }
.fdc-rep__table tbody tr:hover           { background: var(--fdc-green-light); }

.fdc-rep__table td {
  padding: 11px 14px;
  vertical-align: top;
  line-height: 1.5;
  font-size: 16px;
}

/* Colonnes spécifiques */
.fdc-rep__col-fdc {
  font-weight: 700;
  color: var(--fdc-green);
  white-space: nowrap;
}

.fdc-rep__col-date {
  white-space: nowrap;
  color: var(--fdc-muted);
}

.fdc-rep__col-rubrique { white-space: nowrap; }
.fdc-rep__col-titre    { min-width: 200px; }

/* ── Ligne "aucun résultat" ──────────────────────────────────────────── */
.fdc-rep__empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--fdc-muted);
  font-size: 16px;
  font-style: italic;
}

/* ── Pagination ──────────────────────────────────────────────────────── */
.fdc-rep__pied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.fdc-rep__page-info {
  font-size: 16px;
  color: var(--fdc-muted);
}

.fdc-rep__pager {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.fdc-rep__pager-btn {
  padding: 8px 14px;
  border: 1px solid var(--fdc-border);
  border-radius: var(--fdc-radius);
  background: #fff;
  font-size:16px;
  font-family: var(--fdc-font);
  color: var(--fdc-text);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  line-height: 1;
}

.fdc-rep__pager-btn:hover:not(:disabled),
.fdc-rep__pager-btn:focus:not(:disabled) {
  background: var(--fdc-green-light);
  border-color: var(--fdc-green);
  color: var(--fdc-green);
  outline: none;
}

.fdc-rep__pager-btn:disabled {
  opacity: .35;
  cursor: default;
}

.fdc-rep__pager-btn--actif {
  background: var(--fdc-green);
  border-color: var(--fdc-green);
  color: #fff;
  font-weight: 700;
}

.fdc-rep__pager-btn--actif:hover {
  background: var(--fdc-green-hover);
  border-color: var(--fdc-green-hover);
  color: #fff;
}

.fdc-rep__pager-sep {
  display: inline-block;
  padding: 8px 4px;
  color: var(--fdc-muted);
  font-size: 16px;
  line-height: 1;
}

/* ── Responsive : mode "cartes" sur mobile ───────────────────────────── */
@media (max-width: 640px) {
  /* On masque l'en-tête du tableau */
  .fdc-rep__table thead { display: none; }

  /* Chaque ligne devient un bloc */
  .fdc-rep__table tbody tr {
    display: block;
    padding: 12px 14px;
    border-bottom: 2px solid var(--fdc-border);
    background: #fff !important; /* annule le zebra */
  }

  .fdc-rep__table tbody tr:nth-child(even) { background: var(--fdc-bg) !important; }
  .fdc-rep__table tbody tr:hover           { background: var(--fdc-green-light) !important; }

  /* Chaque cellule sur sa propre ligne avec libellé */
  .fdc-rep__table td {
    display: flex;
    gap: 8px;
    padding: 5px 0;
    border-bottom: none;
    font-size: 16px;
    line-height: 1.45;
  }

  .fdc-rep__table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--fdc-green);
    min-width: 90px;
    flex-shrink: 0;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding-top: 2px;
  }

  /* On réinitialise les colonnes spécifiques */
  .fdc-rep__col-date,
  .fdc-rep__col-rubrique,
  .fdc-rep__col-titre {
    white-space: normal;
    min-width: 0;
  }

  /* Pagination centrée sur mobile */
  .fdc-rep__pied      { justify-content: center; }
  .fdc-rep__page-info { text-align: center; width: 100%; }
}


/* ════════════════════════════════════════════════════════════════════
   THÈME FRONT PERSONNALISÉ
   Intégré au plugin · Terre de Pixels · FdC Search v1.3
   ════════════════════════════════════════════════════════════════════ */

/* ── Inputs de la barre de filtres ──────────────────────────────────── */
.fdc-filters-bar .fdc-filter-wrap > * > input {
  border-radius: 10px;
  color: #2A221A;
  font-size: 1.1em;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  position: relative;
  border: none;
  font-weight: 400;
  padding: 10px 20px;
  background-color: #F6F6F5 !important;
  line-height: 60px;
  min-height: 60px;
}

/* ── Wrappers pleine largeur ─────────────────────────────────────────── */
.fdc-filters-bar,
.fdc-filters-bar .fdc-filter-wrap,
.fdc-filters-bar .fdc-filter-wrap > * {
  position: relative;
  width: 100%;
}

/* ── Barre horizontale ───────────────────────────────────────────────── */
.fdc-filters-bar {
  display: flex;
  gap: 10px;
  flex-direction: row;
}

/* ── Reset + compteur masqués ───────────────────────────────────────── */
.fdc-filter-wrap.fdc-filter-wrap--reset,
.fdc-filter-wrap.fdc-filter-wrap--counter.fdc-results-bar {
  display: none;
}

/* ── Liste déroulante — bloc avec scroll interne ─────────────────────── */
ul.fdc-combobox__list {
  position: absolute;
  z-index: 9999;
  padding: 15px 5px;
  background-color: #f6f8f8f7;
  margin: 0;
  list-style: none;
  width: auto;
  min-width: 100%;           /* au moins aussi large que l'input */
  margin-top: 10px;
  box-shadow: 0 5px 10px #00000036;
  border-radius: 20px;
  border: 1px solid #D4D4D4;
  display: block;
  /* ↓ scroll interne : pas de scroll de page */
  max-height: 360px;
  overflow-y: scroll;
  overflow-x: hidden;
  overscroll-behavior: contain;
  transition: opacity .2s ease-in-out;
}

/* ── Options de la liste ─────────────────────────────────────────────── */
ul.fdc-combobox__list li {
  text-wrap: nowrap;
  cursor: pointer;
  display: block;
  font-size: 16px;
  width: 100%;
  border-radius: 5px;
  padding: 7px 20px;
  transition: background .2s ease-in-out, color .2s ease-in-out;
  box-sizing: border-box;
}

ul.fdc-combobox__list li:hover,
ul.fdc-combobox__list li.fdc-combobox__option--active {
  background-color: #429BFE;
  color: #ffffff;
}

/* ── Icônes Font Awesome par type de combobox ───────────────────────── */
div[data-fdc-combobox="titre"] ul.fdc-combobox__list li::before {
  content: "\f02d";
  padding-right: 10px;
  font-family: "Font Awesome 6 Pro";
  font-weight: 900;
}

div[data-fdc-combobox="rubrique"] ul.fdc-combobox__list li::before {
  content: "\f02c";
  padding-right: 10px;
  font-family: "Font Awesome 6 Pro";
  font-weight: 900;
}

div[data-fdc-combobox="auteur"] ul.fdc-combobox__list li::before {
  content: "\f5ad";
  padding-right: 10px;
  font-family: "Font Awesome 6 Pro";
  font-weight: 900;
}

/* ── Surlignage des correspondances ─────────────────────────────────── */
ul.fdc-combobox__list li mark {
  background-color: #C0DEE0;
  padding: 0 2px;
  color: inherit;
}

/* ── Placeholder des inputs ──────────────────────────────────────────── */
.fdc-filters-bar .fdc-filter-wrap > * > input::placeholder {
  color: #000000;
}

/* ── Picto chevron dans le champ ─────────────────────────────────────── */
.fdc-filters-bar .fdc-filter-wrap > * span.combo-picto {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) scale(0.65, 0.3);
  color: #7F7F7F;
}

/* ── Scrollbar fine pour la liste ───────────────────────────────────── */
ul.fdc-combobox__list::-webkit-scrollbar       { width: 4px; }
ul.fdc-combobox__list::-webkit-scrollbar-track { background: transparent; }
ul.fdc-combobox__list::-webkit-scrollbar-thumb { background: #D4D4D4; border-radius: 4px; }
