/**
 * DCOD Format CSS – Version 2.16
 * Auteur : DCOD (Marc)
 * Mise à jour :
 * - Uniformisation des encadrés .dcod-encadre-veille et .dcod-resume-encadre
 * - Suppression du point vert (🟢)
 * - Aucune réduction de marge latérale sur mobile
 * - Aucune modification de taille de police (desktop & mobile)
 */

/* ==== Encadré générique (utilisé partout, neutre) ==== */
.dcod-encadre,
.wp-block-group.dcod-encadre {
  background-color: #f7fdf0;
  color: #1a1a1a;
  border: 2px solid #88cc00;
  border-radius: 0;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.wp-block-group.dcod-encadre {
  max-width: 1024px;
  margin-left: auto;
  margin-right: auto;
}

/* ✅ Variante compacte sidebar */
.dcod-encadre.sidebar {
  font-size: 0.9rem;
  line-height: 1.4;
  padding: 16px;
  margin: 0 0 20px 0;
}

/* ==== Encadré résumé veille (style harmonisé) ==== */
.wp-block-group.dcod-encadre-veille,
.dcod-encadre-veille {
  background-color: #f7fdf0;
  border: 2px solid #88cc00;
  border-radius: 0;
  padding: 20px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 1024px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dcod-encadre-veille p strong {
  color: #2d4d1e;
  font-weight: bold;
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.8rem;
}

.dcod-encadre-veille ul {
  margin: 0;
  padding-left: 1.5em;
  list-style-type: disc;
}

.dcod-encadre-veille li {
  font-size: 15px;
  line-height: 1.6;
  color: #1a2d12;
  margin-bottom: 0.6em;
}

/* ==== Encadré de résumé DCOD (veille hebdo, synthèse) ==== */
.dcod-resume-encadre {
  background-color: #f7fdf0;
  border: 2px solid #88cc00;
  border-radius: 0;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1024px;
  margin: 2rem auto;
}


.dcod-resume-encadre ul {
  margin: 0;
  padding-left: 1.5em;
  list-style-type: disc;
}


/* ==== Boutons d'action dans les encadrés ==== */
.dcod-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.dcod-links a {
  background-color: #88cc00;
  color: #1a1a1a;
  text-align: center;
  padding: 10px;
  border-radius: 5px;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.dcod-links a:hover {
  background-color: #76b800;
  color: white;
}

.dcod-links .telegram-link {
  background-color: #0088cc;
  color: #fff;
}

.dcod-links .telegram-link:hover {
  background-color: #006fa4;
}

.dcod-icon {
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

/* ==== Responsive ==== */
@media screen and (max-width: 600px) {
  .dcod-encadre,
  .wp-block-group.dcod-encadre {
    padding: 16px;
    margin: 1.5rem 1rem;
  }

  .dcod-encadre-veille,
  .wp-block-group.dcod-encadre-veille,
  .dcod-resume-encadre {
    padding: 20px;
    margin: 1.5rem auto;
  }

  /* ✅ Aucune modification de police sur mobile */
  .dcod-encadre-veille li,
  .dcod-resume-encadre li {
    font-size: 15px;
    line-height: 1.6;
  }

  .dcod-encadre-veille p strong,
  .dcod-resume-encadre p strong {
    font-size: 1.1rem;
  }
}

/* ==== Tableaux admin ==== */
.veille-options table {
  width: 100%;
  border-collapse: collapse;
}

.veille-options th,
.veille-options td {
  border: 1px solid #ccd0d4;
  padding: 10px;
  text-align: left;
}

.veille-options th {
  background-color: #f1f1f1;
}

/* Harmonisation avec l’encadré front "Pourquoi suivre DCOD ?" */
.dcod-resume-encadre,
.dcod-encadre-veille,
.wp-block-group.dcod-resume-encadre,
.wp-block-group.dcod-encadre-veille {
  border: 2px solid #88cc00;
  color: #2d2d2d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  padding: 24px;
  border-radius: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Style des paragraphes et titres */
.dcod-resume-encadre p,
.dcod-encadre-veille p {
  margin-bottom: 1em;
}

.dcod-resume-encadre p strong,
.dcod-encadre-veille p strong {
  font-size: 1.15rem;
  font-weight: 600;
  color: #000;
  margin-bottom: 1rem;
  display: block;
}

/* Liste à puces */
.dcod-resume-encadre ul,
.dcod-encadre-veille ul {
  list-style-type: disc;
  padding-left: 1.5em;
  margin: 0;
}

.dcod-resume-encadre li,
.dcod-encadre-veille li {
  margin-bottom: 0.75em;
  font-size: 16px;
}

/* ==== Encadré résumé DCOD ==== */
.dcod-resume-encadre {
  background-color: #f7fdf0;
  color: #1a1a1a;
  border: 2px solid #88cc00;
  border-radius: 0;
  padding: 20px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.dcod-resume-encadre h3 {
  margin-top: 0;
  margin-bottom: 0.3em; /* Réduction de l’espace après le titre */
  font-size: 1.1rem;
}

.dcod-resume-encadre ul {
  margin-top: 0.3em; /* Harmonise l’espacement entre le titre et la liste */
  padding-left: 20px;
}

.dcod-resume-encadre ul li {
  margin-bottom: 8px;
}


/* ===== Amazon DCOD – Styles communs pour bloc et ad ===== */
.dcod-amazon-block,
.dcod-amazon-books {
  max-width: 1024px;
  margin: 0 auto;
  background-color: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  gap: 40px;
}

.dcod-amazon-block {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  margin: 1.5rem auto;
}

.dcod-amazon-books .wp-block-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-right: 20px;
}

.dcod-amazon-books .wp-block-column:last-child {
  margin-right: 0;
}

.dcod-amazon-img,
.dcod-amazon-books .wp-block-image img {
  width: 160px;
  max-width: 100%;
  aspect-ratio: 5 / 7;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

.dcod-amazon-books .wp-block-image img:hover {
  transform: scale(1.03);
  transition: transform 0.3s ease;
}

.dcod-amazon-content {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dcod-amazon-title {
  font-size: 17px;
  font-weight: bold;
  margin: 0 0 6px 0;
}

.dcod-amazon-title a,
.dcod-amazon-books p strong a {
  color: #0057B8;
  text-decoration: none;
}

.dcod-amazon-title a:hover,
.dcod-amazon-books p strong a:hover {
  text-decoration: underline;
}

.dcod-amazon-summary,
.dcod-amazon-books p em {
  font-size: 15px;
  color: #333;
}

.amazon-button {
  display: inline-block;
  padding: 8px 14px;
  background: #111;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  margin-top: 10px;
  transition: background 0.3s ease;
}

.amazon-button:hover,
.dcod-amazon-books a.amazon-button:hover {
  background-color: #ff4081 !important;
  color: #fff !important;
}

.dcod-amazon-note,
.dcod-amazon-books-note {
  font-size: 13px;
  color: #666;
  text-align: center;
  margin-top: 20px;
}

@media (max-width: 600px) {
  .dcod-amazon-block {
    flex-direction: column;
    align-items: center;
    padding: 16px;
  }

  .dcod-amazon-image {
    width: 100%;
    margin-bottom: 16px;
  }

  .dcod-amazon-img {
    width: 140px;
  }

  .dcod-amazon-content {
    width: 100%;
    text-align: center;
  }

  .amazon-button {
    align-self: center;
  }

  .dcod-amazon-books .wp-block-image img {
    width: 100%;
    max-width: 140px;
  }
}

/* DCOD – Vue compacte annotations Inoreader */
#dcod-inoreader-page table.widefat.fixed.striped {
  table-layout: fixed;
  font-size: 13px; /* densité */
}

/* Hauteur de ligne compacte */
#dcod-inoreader-page table.widefat.fixed.striped td,
#dcod-inoreader-page table.widefat.fixed.striped th {
  padding: 6px 8px;
  vertical-align: middle;
}

/* Largeurs de colonnes (1: checkbox, 2: titre, 3: annotation) */
#dcod-inoreader-page table.widefat.fixed.striped th:nth-child(1),
#dcod-inoreader-page table.widefat.fixed.striped td:nth-child(1) { width: 2.5ch; }

#dcod-inoreader-page table.widefat.fixed.striped th:nth-child(2),
#dcod-inoreader-page table.widefat.fixed.striped td:nth-child(2) { width: 58%; }

#dcod-inoreader-page table.widefat.fixed.striped th:nth-child(3),
#dcod-inoreader-page table.widefat.fixed.striped td:nth-child(3) { width: 38%; }

/* Titre: une ligne + ellipsis */
#dcod-inoreader-page table.widefat.fixed.striped td:nth-child(2) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Annotation: une ligne + ellipsis */
#dcod-inoreader-page table.widefat.fixed.striped td:nth-child(3) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0; /* requis avec table-layout: fixed */
}

/* Annotation vide: indicateur discret */
#dcod-inoreader-page table.widefat.fixed.striped td:nth-child(3):empty::before {
  content: "—";
  color: #999;
  font-style: italic;
}

/* Header collant sous la barre admin */
#dcod-inoreader-page table.widefat.fixed.striped thead th {
  position: sticky;
  top: 32px;
  z-index: 10;
  background: #fff;
}

/* Survol doux pour les lignes non marquées */
#dcod-inoreader-page table.widefat.fixed.striped tr:hover > td {
  background: #f9fafb;
}

/* ===== Remise en évidence des lignes marquées (écrase le zebra WP) ===== */
#dcod-inoreader-page table.widefat.fixed.striped tr.dcod-used > td {
  background-color: #ffe0b2 !important; /* orange clair */
}
#dcod-inoreader-page table.widefat.fixed.striped tr.dcod-analysis-used > td {
  background-color: #bbdefb !important; /* bleu clair */
}
#dcod-inoreader-page table.widefat.fixed.striped tr.dcod-used.dcod-analysis-used > td {
  background-color: #c8e6c9 !important; /* vert clair */
}

/* Conserver la couleur au survol pour ces lignes */
#dcod-inoreader-page table.widefat.fixed.striped tr.dcod-used:hover > td,
#dcod-inoreader-page table.widefat.fixed.striped tr.dcod-analysis-used:hover > td,
#dcod-inoreader-page table.widefat.fixed.striped tr.dcod-used.dcod-analysis-used:hover > td {
  background-color: inherit !important;
}

/* Surlignage contour pour highlight_ids (compatible avec fond coloré) */
#dcod-inoreader-page table.widefat.fixed.striped tr.dcod-highlight {
  outline: 2px solid #2ecc71;
  outline-offset: -2px;
}

/* renforcer la visibilité */
#dcod-inoreader-page table.widefat.fixed.striped tr.dcod-highlight > td { box-shadow: inset 0 0 0 2px #2ecc71; }

/* code pour affichage alerte dans page admin */

/* Base générique */
.dcod-inline-notice{
  display:flex; align-items:flex-start; gap:8px;
  margin: 1em 0; padding:12px 15px;
  background:#fff; box-shadow:0 1px 1px rgba(0,0,0,.04);
  border-left:4px solid #72aee6; /* valeur par défaut (info) */
  font-size:14px; line-height:1.5;
}
.dcod-inline-notice p{ margin:0; }
.dcod-inline-notice a{ text-decoration: underline; }

/* Icône à gauche, comme les notices WP */
.dcod-inline-notice::before{
  content:"\f147"; /* dashicons-yes */
  font: normal 20px/1 dashicons;
  color:#00a32a; /* couleur succès par défaut */
  margin-top:1px;
}

/* Variantes */
.dcod-inline-notice.dcod-success{ border-left-color:#00a32a; }
.dcod-inline-notice.dcod-warning{ border-left-color:#dba617; }
.dcod-inline-notice.dcod-error{   border-left-color:#d63638; }
.dcod-inline-notice.dcod-warning::before{ content:"\f534"; color:#dba617; } /* info-outline */
.dcod-inline-notice.dcod-error::before{   content:"\f534"; color:#d63638; }

