/* Dynamic Content Panel — Front-end Styles v2.1 */
:root {
  --dcp-radius: 10px;
  --dcp-shadow: 0 4px 20px rgba(0,0,0,.10);
  --dcp-sidebar-w: 25%;
  --dcp-content-w: 75%;
  --dcp-btn-gap: 8px;
  --dcp-columns: 2;
  --dcp-sidebar-bg: #1a1a2e;
  --dcp-sidebar-txt: #ffffff;
  --dcp-content-bg: #f8f9fb;
  --dcp-content-txt: #333333;
}

/* ===== PANEL WRAPPER ===== */
.dcp-panel {
  display: flex; width: 100%; box-sizing: border-box;
  border-radius: var(--dcp-radius); overflow: hidden;
  box-shadow: var(--dcp-shadow); border: 1px solid #e5e7eb;
}
.dcp-panel.dcp-pos-right { flex-direction: row-reverse; }

/* ===== SIDEBAR ===== */
.dcp-sidebar {
  width: var(--dcp-sidebar-w); flex-shrink: 0;
  background: var(--dcp-sidebar-bg); color: var(--dcp-sidebar-txt);
  padding: 16px 12px; display: flex; flex-direction: column;
  gap: var(--dcp-btn-gap); box-sizing: border-box;
}

/* ===== NAV BUTTONS ===== */
.dcp-nav-btn {
  display: block; width: 100%; border: 2px solid;
  font-size: 13px; font-weight: 700; cursor: pointer;
  text-align: center; letter-spacing: .3px;
  transition: transform .15s, box-shadow .15s, filter .15s;
  font-family: inherit; box-sizing: border-box; line-height: 1.4;
}
.dcp-nav-btn:hover { transform: translateX(3px); box-shadow: 3px 3px 10px rgba(0,0,0,.25); filter: brightness(1.08); }
.dcp-nav-btn.active { transform: translateX(4px); box-shadow: 4px 4px 14px rgba(0,0,0,.3); filter: brightness(1.12); }
.dcp-btn-hidden { display: none !important; }

/* ===== VOIR PLUS BUTTON ===== */
.dcp-show-more-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; padding: 8px 12px; background: rgba(255,255,255,.1);
  border: 1px dashed rgba(255,255,255,.3); border-radius: 8px;
  color: rgba(255,255,255,.8); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .2s; margin-top: 4px;
}
.dcp-show-more-btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.dcp-sm-arrow { width: 16px; height: 16px; fill: currentColor; transition: transform .2s; }
.dcp-show-more-btn[aria-expanded="true"] .dcp-sm-arrow { transform: rotate(180deg); }
.dcp-show-more-btn[aria-expanded="true"] .dcp-sm-label::before { content: "Voir moins"; }
.dcp-show-more-btn[aria-expanded="true"] .dcp-sm-label { font-size: 0; }
.dcp-show-more-btn[aria-expanded="true"] .dcp-sm-label::before { font-size: 12px; }

/* ===== CONTENT AREA ===== */
.dcp-content-area { flex: 1; min-width: 0; background: var(--dcp-content-bg); color: var(--dcp-content-txt); position: relative; }
.dcp-content-inner { padding: 24px; position: relative; }

/* ===== SPINNER ===== */
.dcp-spinner { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 10; }
.dcp-spinner span { display: block; width: 36px; height: 36px; border: 4px solid #e0e0e0; border-top-color: #f5a623; border-radius: 50%; animation: dcp-spin .7s linear infinite; }
@keyframes dcp-spin { to { transform: rotate(360deg); } }

/* Content title */
.dcp-content-title { font-size: 20px; font-weight: 700; margin: 0 0 20px; color: var(--dcp-content-txt); border-bottom: 2px solid #f5a623; padding-bottom: 10px; }

/* ===== ANIMATIONS ===== */
.dcp-anim-fade .dcp-content-output { transition: opacity .3s ease, transform .3s ease; }
.dcp-anim-fade .dcp-content-output.dcp-loading { opacity: 0; transform: translateY(6px); pointer-events: none; }
.dcp-anim-slide .dcp-content-output { transition: opacity .25s, transform .25s; overflow: hidden; }
.dcp-anim-slide .dcp-content-output.dcp-loading { opacity: 0; transform: translateX(-12px); pointer-events: none; }

/* ===== POSTS GRID ===== */
.dcp-posts-grid { display: grid; grid-template-columns: repeat(var(--dcp-columns), 1fr); gap: 20px; }

/* ===== CARD ===== */
.dcp-card {
  background: #fff; border-radius: var(--dcp-radius); overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.07); border: 1px solid #eee;
  display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; position: relative;
}
.dcp-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.13); transform: translateY(-3px); }
.dcp-card-thumb { display: block; overflow: hidden; aspect-ratio: 16/9; position: relative; }
.dcp-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.dcp-card:hover .dcp-card-thumb img { transform: scale(1.04); }
.dcp-card-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.dcp-card-title { font-size: 14px; font-weight: 700; margin: 0 0 6px; line-height: 1.4; }
.dcp-card-title a { color: #1a1a2e; text-decoration: none; transition: color .15s; }
.dcp-card-title a:hover { color: #f5a623; }
.dcp-card-date { font-size: 11px; color: #aaa; margin: 0 0 8px; }
.dcp-card-excerpt { font-size: 12px; color: #666; line-height: 1.5; margin: 0 0 12px; flex: 1; }

/* ===== CARD ACTION BAR (icône page + icône partage) ===== */
.dcp-card-actions {
  display: flex; align-items: center; gap: 6px;
  margin-top: auto; padding-top: 10px; border-top: 1px solid #f0f0f0;
}
.dcp-card-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 7px; border: none;
  cursor: pointer; transition: transform .15s, opacity .15s, background .15s;
  background: #f0f2f5; color: #555; flex-shrink: 0; padding: 0;
}
.dcp-card-action-btn:hover { transform: scale(1.12); background: #e4e6ea; color: #1a1a2e; }
.dcp-card-action-btn svg { width: 16px; height: 16px; fill: currentColor; display: block; }
.dcp-card-action-btn.dcp-open-page-btn { background: #eaf0ff; color: #1a56db; }
.dcp-card-action-btn.dcp-open-page-btn:hover { background: #d1e0ff; }
.dcp-card-action-btn.dcp-share-trigger { background: #e8faf0; color: #1a8a4a; }
.dcp-card-action-btn.dcp-share-trigger:hover { background: #c6f2d7; }

/* ===== SHARE BAR (inside single post view) ===== */
.dcp-share { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; border-top: 1px solid #f0f0f0; }
.dcp-share-label { font-size: 11px; color: #888; font-weight: 600; white-space: nowrap; }

/* Share trigger inside single post view */
.dcp-share-icons { display: flex; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid #eee; align-items: center; }
.dcp-share-icon-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: #fff; text-decoration: none; cursor: pointer; border: none;
  transition: transform .15s, filter .15s;
}
.dcp-share-icon-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.dcp-share-icon-btn svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }

/* Legacy inline share buttons */
.dcp-share-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; transition: transform .15s, opacity .15s; flex-shrink: 0; }
.dcp-share-btn:hover { transform: scale(1.12); opacity: .9; }
.dcp-share-btn svg { width: 15px; height: 15px; fill: #fff; display: block; }
.dcp-fb { background: #1877f2; } .dcp-tw { background: #000; } .dcp-li { background: #0a66c2; } .dcp-wa { background: #25d366; }

/* ===== SHARE POPUP ===== */
.dcp-share-popup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.dcp-share-popup-overlay.is-open { opacity: 1; pointer-events: all; }
.dcp-share-popup {
  background: #fff; border-radius: 16px; padding: 28px 24px 22px;
  width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  position: relative; transform: translateY(12px); transition: transform .2s;
  box-sizing: border-box; margin: 16px;
}
.dcp-share-popup-overlay.is-open .dcp-share-popup { transform: translateY(0); }
.dcp-share-popup-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  background: #f3f4f6; border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0; transition: background .15s;
}
.dcp-share-popup-close:hover { background: #e5e7eb; }
.dcp-share-popup-close svg { width: 16px; height: 16px; fill: #555; display: block; }
.dcp-share-popup-title { font-size: 17px; font-weight: 700; color: #1a1a2e; margin-bottom: 20px; }
.dcp-share-popup-networks {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px;
}
.dcp-sn-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 12px 8px; border-radius: 10px; text-decoration: none;
  font-size: 11px; font-weight: 600; color: #fff; transition: transform .15s, filter .15s;
}
.dcp-sn-btn:hover { transform: translateY(-2px); filter: brightness(1.08); color: #fff; }
.dcp-sn-btn svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.dcp-sn-fb  { background: #1877f2; }
.dcp-sn-tw  { background: #000; }
.dcp-sn-wa  { background: #25d366; }
.dcp-sn-tg  { background: #2ca5e0; }
.dcp-sn-li  { background: #0a66c2; }
.dcp-sn-em  { background: #6b7280; }
.dcp-share-popup-copy { display: flex; gap: 8px; align-items: center; }
.dcp-share-popup-url {
  flex: 1; padding: 9px 12px; border: 1px solid #e0e0e0; border-radius: 8px;
  font-size: 12px; color: #555; background: #f9fafb; min-width: 0;
}
.dcp-share-popup-copybtn {
  padding: 9px 16px; background: #1a1a2e; color: #fff; border: none;
  border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.dcp-share-popup-copybtn:hover { background: #2d2d4e; }
body.dcp-noscroll { overflow: hidden; }

/* ===== NO POSTS ===== */
.dcp-no-posts { text-align: center; color: #999; padding: 40px; font-size: 14px; }

/* ===== BACK BUTTON ===== */
.dcp-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px 7px 10px; margin-bottom: 18px;
  background: #fff; border: 2px solid #e0e0e0; border-radius: 24px;
  font-size: 13px; font-weight: 700; color: #1a1a2e; cursor: pointer;
  transition: all .18s; box-shadow: 0 2px 6px rgba(0,0,0,.07);
}
.dcp-back-btn:hover { border-color: #f5a623; color: #c17d00; background: #fffbf2; transform: translateX(-2px); }
.dcp-back-btn svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; transition: transform .18s; }
.dcp-back-btn:hover svg { transform: translateX(-2px); }

/* ===== IFRAME ===== */
.dcp-iframe { width: 100%; min-height: 520px; border: none; border-radius: 6px; display: block; }

/* ===== SINGLE POST VIEW ===== */
.dcp-single-thumb { width: 100%; max-height: 280px; overflow: hidden; border-radius: 8px; margin-bottom: 20px; }
.dcp-single-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dcp-single-content { font-size: 15px; line-height: 1.75; color: #333; }
.dcp-single-content p { margin: 0 0 1em; }
.dcp-single-content h1, .dcp-single-content h2, .dcp-single-content h3 { color: #1a1a2e; margin: 1.2em 0 .5em; }
.dcp-single-content img { max-width: 100%; height: auto; border-radius: 6px; }
.dcp-single-content a { color: #f5a623; }
.dcp-single-content a:hover { color: #c17d00; }
.dcp-panel-link { cursor: pointer; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .dcp-panel { flex-direction: column !important; }
  .dcp-sidebar { width: 100% !important; flex-direction: row; flex-wrap: wrap; padding: 12px; gap: 6px; }
  .dcp-nav-btn { width: auto; flex: 1 1 auto; min-width: 100px; font-size: 12px !important; padding: 8px 10px !important; }
  .dcp-nav-btn:hover { transform: none; }
  .dcp-posts-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
  .dcp-content-inner { padding: 14px; }
  .dcp-share-popup-networks { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .dcp-posts-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .dcp-share-popup-networks { grid-template-columns: repeat(2, 1fr); }
}

/* ===== CARD META ===== */
.dcp-card-meta { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; flex-wrap: wrap; }
.dcp-card-date { font-size: 11px; color: #aaa; }
.dcp-card-author { font-size: 11px; color: #888; }
.dcp-card-author::before { content: '·'; margin-right: 8px; color: #ccc; }

/* ===== CATEGORIES ===== */
.dcp-card-cats { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.dcp-card-cat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; background: var(--dcp-sidebar-bg, #1a1a2e); color: #fff; border-radius: 20px; }

/* ===== READ MORE ===== */
.dcp-read-more { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--dcp-sidebar-bg, #1a1a2e); text-decoration: none; margin-top: 8px; border-bottom: 2px solid currentColor; padding-bottom: 1px; transition: opacity .15s; }
.dcp-read-more:hover { opacity: .7; }

/* ===== CARD STYLE: COMPACT ===== */
.dcp-card--compact { flex-direction: row !important; align-items: stretch; }
.dcp-card--compact .dcp-card-thumb { display: none !important; }
.dcp-card--compact .dcp-card-body { padding: 10px 12px; }
.dcp-card--compact .dcp-card-title { font-size: 13px; margin-bottom: 4px; }
.dcp-card--compact .dcp-card-excerpt { font-size: 11px; }

/* ===== CARD STYLE: HORIZONTAL ===== */
.dcp-card--horizontal { flex-direction: row !important; }
.dcp-card--horizontal .dcp-card-thumb { width: 120px; min-width: 120px; aspect-ratio: unset !important; border-radius: 8px 0 0 8px; }
.dcp-card--horizontal .dcp-card-body { padding: 12px; }
.dcp-card--horizontal .dcp-card-title { font-size: 13px; }

/* ===== PDF INTÉGRÉ DANS LA CARTE (PDF Pro Sénat) ===== */
.dcp-card-pdf-wrap {
  display: none;
  width: 100%;
  margin-top: 14px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e6e6e6;
  background: #f4f4f4;
}
.dcp-card-pdf-frame {
  display: block;
  width: 100%;
  height: 65vh;
  min-height: 420px;
  max-height: 720px;
  border: none;
}
.dcp-card.dcp-card-pdf-open {
  grid-column: 1 / -1;   /* la carte occupe toute la largeur de la grille pour laisser respirer le PDF */
}
.dcp-card.dcp-card-pdf-open .dcp-card-pdf-wrap { display: block; }
.dcp-open-page-btn { cursor: pointer; }

@media (max-width: 480px) {
  .dcp-card-pdf-frame { height: 70vh; min-height: 360px; }
}
