/* DuckPublic — Front-end CSS
   Variables injectées via wp_localize_script depuis les réglages admin */

:root {
  --dp-primary:   #3a6aa8;
  --dp-secondary: #1a1a1a;
  --dp-accent:    #F72803;
  --dp-bg:        #f8f9fa;
  --dp-border:    #e2e8f0;
  --dp-radius:    8px;
  --dp-shadow:    0 2px 8px rgba(0,0,0,.08);
  --dp-font:      inherit;
}

/* ─── Fiche ──────────────────────────────────────────────────────────────── */

.dp-fiche {
  font-family: var(--dp-font);
  max-width: 860px;
  color: var(--dp-secondary);
}

.dp-breadcrumb {
  font-size: .85rem;
  color: #64748b;
  margin-bottom: 1.25rem;
}
.dp-breadcrumb a { color: var(--dp-primary); text-decoration: none; }
.dp-breadcrumb a:hover { text-decoration: underline; }
.dp-bc-sep { margin: 0 .4rem; }

.dp-fiche-header { margin-bottom: 1.5rem; border-bottom: 3px solid var(--dp-primary); padding-bottom: 1rem; }
.dp-fiche-titre { font-size: 1.75rem; font-weight: 700; color: var(--dp-secondary); margin: 0 0 .5rem; }
.dp-date-maj { font-size: .8rem; color: #94a3b8; margin: 0; }

.dp-introduction {
  background: var(--dp-bg);
  border-left: 4px solid var(--dp-primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--dp-radius) var(--dp-radius) 0;
  margin-bottom: 1.5rem;
}

/* Services en ligne */
.dp-services-en-ligne {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--dp-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.dp-services-en-ligne h3 { margin: 0 0 .75rem; font-size: 1rem; color: var(--dp-primary); }
.dp-services-en-ligne ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.dp-btn-sel {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--dp-primary); color: #fff;
  padding: .45rem .85rem; border-radius: 20px;
  font-size: .875rem; text-decoration: none; transition: opacity .2s;
}
.dp-btn-sel:hover { opacity: .85; }
.dp-ext-icon { font-style: normal; font-size: .8rem; }

/* Chapitres */
.dp-chapitre { margin-bottom: 1.75rem; }
.dp-chapitre-titre {
  font-size: 1.2rem; font-weight: 600;
  color: var(--dp-primary);
  border-bottom: 2px solid var(--dp-border);
  padding-bottom: .5rem; margin-bottom: 1rem;
}

/* Bloc cas (accordéon) */
.dp-bloc-cas { margin-bottom: 1.5rem; }
.dp-cas {
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius);
  margin-bottom: .5rem;
  overflow: hidden;
}
.dp-cas-titre {
  padding: .875rem 1rem;
  cursor: pointer;
  font-weight: 600;
  background: var(--dp-bg);
  user-select: none;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.dp-cas-titre::after { content: '›'; font-size: 1.2rem; transition: transform .2s; }
.dp-cas[open] .dp-cas-titre::after { transform: rotate(90deg); }
.dp-cas-contenu { padding: 1rem; border-top: 1px solid var(--dp-border); }

/* Callouts */
.dp-attention, .dp-anote, .dp-important, .dp-rappel {
  padding: .875rem 1rem;
  border-radius: var(--dp-radius);
  margin: 1rem 0;
  font-size: .9rem;
  border-left: 4px solid;
}
.dp-attention  { background: #fff7ed; border-color: #f97316; }
.dp-anote      { background: #f0fdf4; border-color: #22c55e; }
.dp-important  { background: #fef2f2; border-color: var(--dp-accent); }
.dp-rappel     { background: #eff6ff; border-color: var(--dp-primary); }

/* Tableaux */
.dp-table-wrap { overflow-x: auto; margin: 1rem 0; }
.dp-tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dp-tableau th { background: var(--dp-primary); color: #fff; padding: .6rem .75rem; text-align: left; }
.dp-tableau td { padding: .55rem .75rem; border-bottom: 1px solid var(--dp-border); }
.dp-tableau tr:nth-child(even) td { background: var(--dp-bg); }

/* Listes */
.dp-liste { padding-left: 1.5rem; }
.dp-liste li { margin-bottom: .35rem; }

/* Organismes */
.dp-organismes {
  background: var(--dp-bg);
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius);
  padding: 1rem 1.25rem;
  margin-top: 2rem;
}
.dp-organismes h3 { margin: 0 0 .75rem; font-size: 1rem; color: var(--dp-primary); }
.dp-organismes ul { list-style: none; margin: 0; padding: 0; }
.dp-organismes li { padding: .3rem 0; border-bottom: 1px solid var(--dp-border); font-size: .9rem; }
.dp-organismes li:last-child { border: none; }

/* Footer fiche */
.dp-fiche-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--dp-border); }
.dp-source { font-size: .8rem; color: #94a3b8; }
.dp-source a { color: var(--dp-primary); }

/* ─── Sommaire ───────────────────────────────────────────────────────────── */

.dp-sommaire { width: 100%; }
.dp-sommaire-titre { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--dp-secondary); }

.dp-themes-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(3, 1fr);
}
.dp-cols-1 .dp-themes-grid { grid-template-columns: 1fr; }
.dp-cols-2 .dp-themes-grid { grid-template-columns: repeat(2, 1fr); }
.dp-cols-4 .dp-themes-grid { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .dp-themes-grid { grid-template-columns: 1fr !important; }
}

.dp-theme-card {
  background: var(--dp-bg);
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius);
  padding: 1.125rem;
  box-shadow: var(--dp-shadow);
}
.dp-theme-titre {
  font-size: 1rem; font-weight: 700;
  color: var(--dp-primary);
  margin: 0 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--dp-primary);
}
.dp-theme-fiches { list-style: none; margin: 0; padding: 0; }
.dp-theme-fiches li { padding: .2rem 0; }
.dp-theme-fiches a { color: var(--dp-secondary); font-size: .875rem; text-decoration: none; }
.dp-theme-fiches a:hover { color: var(--dp-primary); text-decoration: underline; }
.dp-sous-theme { margin-top: .75rem; }
.dp-sous-theme-titre { font-size: .85rem; font-weight: 600; color: #64748b; margin: 0 0 .3rem; }

/* ─── Recherche ──────────────────────────────────────────────────────────── */

.dp-recherche { position: relative; }
.dp-search-box {
  display: flex; align-items: center;
  border: 2px solid var(--dp-border);
  border-radius: 50px;
  overflow: hidden;
  background: #fff;
  transition: border-color .2s;
}
.dp-search-box:focus-within { border-color: var(--dp-primary); }
.dp-search-input {
  flex: 1; border: none; outline: none;
  padding: .75rem 1rem;
  font-size: .95rem; background: transparent;
}
.dp-search-btn {
  background: var(--dp-primary); color: #fff;
  border: none; cursor: pointer;
  padding: .75rem 1.125rem;
  display: flex; align-items: center;
  transition: opacity .2s;
}
.dp-search-btn:hover { opacity: .85; }

.dp-search-results {
  position: absolute; top: calc(100% + 6px);
  left: 0; right: 0; z-index: 9999;
  background: #fff;
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  max-height: 380px; overflow-y: auto;
}
.dp-result-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem;
  text-decoration: none;
  color: var(--dp-secondary);
  border-bottom: 1px solid var(--dp-border);
  transition: background .15s;
}
.dp-result-item:last-child { border: none; }
.dp-result-item:hover { background: var(--dp-bg); }
.dp-result-id {
  font-size: .75rem; font-weight: 700;
  color: #fff; background: var(--dp-primary);
  padding: .15rem .5rem; border-radius: 4px;
  white-space: nowrap; flex-shrink: 0;
}
.dp-result-titre { font-size: .9rem; }
.dp-no-result { padding: .75rem 1rem; color: #94a3b8; font-size: .9rem; margin: 0; }

/* ─── Actualités ─────────────────────────────────────────────────────────── */

.dp-actualites.dp-actu-style-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
@media (max-width: 768px) {
  .dp-actualites.dp-actu-style-cards { grid-template-columns: 1fr; }
}

.dp-actu-item {
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--dp-shadow);
  transition: transform .2s, box-shadow .2s;
}
.dp-actu-item:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.12); }

.dp-actu-body { padding: 1rem; }
.dp-actu-theme {
  display: inline-block;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--dp-primary);
  background: color-mix(in srgb, var(--dp-primary) 10%, white);
  padding: .2rem .6rem; border-radius: 4px; margin-bottom: .5rem;
}
.dp-actu-titre { font-size: .95rem; font-weight: 600; margin: 0 0 .5rem; }
.dp-actu-titre a { color: var(--dp-secondary); text-decoration: none; }
.dp-actu-titre a:hover { color: var(--dp-primary); }
.dp-actu-desc { font-size: .85rem; color: #64748b; margin: 0 0 .5rem; }
.dp-actu-date { font-size: .75rem; color: #94a3b8; }

/* Style liste */
.dp-actu-style-list .dp-actu-item {
  display: flex; border-radius: 0; border-left: none; border-right: none;
  border-top: none; box-shadow: none;
}
.dp-actu-style-list .dp-actu-item:last-child { border-bottom: none; }

/* ─── Commun ──────────────────────────────────────────────────────────────── */

.dp-container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.dp-error-box, .dp-error {
  background: #fef2f2; border: 1px solid #fecaca;
  color: #dc2626; padding: .75rem 1rem; border-radius: var(--dp-radius);
  font-size: .875rem;
}
.dp-placeholder { color: #94a3b8; font-style: italic; padding: 1rem; }
.dp-empty { color: #94a3b8; }
