/* ═══════════════════════════════════════════════════════════════
   BLOG READER MODAL — blog_reader.css
   Style de la modal/vue lecteur d'article solennel /blog/<post_id>
   ═══════════════════════════════════════════════════════════════ */

#blog-reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-in-out;
}

#blog-reader-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

#blog-reader-modal {
  width: 94vw;
  max-width: 920px;
  height: 92vh;
  max-height: 960px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(59, 130, 246, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(24px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #f8fafc;
  position: relative;
}

#blog-reader-overlay.active #blog-reader-modal {
  transform: translateY(0) scale(1);
}

/* ── Barre supérieure ───────────────────────────────────────── */
.blog-reader-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10;
  flex-shrink: 0;
}

.br-topbar-left,
.br-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.br-back-btn,
.br-share-btn,
.br-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.br-back-btn:hover,
.br-share-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.br-close-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 1rem;
}

.br-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.br-cat-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.br-cat-badge.enquete {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

/* ── Container scrollable ───────────────────────────────────── */
.blog-reader-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* ── Zone Héro ──────────────────────────────────────────────── */
.blog-reader-hero-cover {
  position: relative;
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  background: #090d16;
}

.blog-reader-cover-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.blog-reader-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,0.05) 0%, rgba(15,23,42,0.95) 100%);
  pointer-events: none;
}

.blog-reader-header {
  padding: 24px 32px 16px;
  position: relative;
}

.br-commune-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.br-commune-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.blog-reader-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.28;
  color: #f8fafc;
  margin: 0 0 16px;
  letter-spacing: -0.015em;
}

.blog-reader-accroche {
  font-size: 1.08rem;
  line-height: 1.6;
  color: #cbd5e1;
  font-style: italic;
  background: rgba(59, 130, 246, 0.08);
  border-left: 4px solid #3b82f6;
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  margin-bottom: 20px;
}

.blog-reader-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.86rem;
  color: #94a3b8;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.br-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: #e2e8f0;
}

.br-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #ffffff;
  font-weight: 700;
}

.br-date-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Corps de l'article ─────────────────────────────────────── */
.blog-reader-body {
  padding: 24px 32px;
  font-size: 1.02rem;
  line-height: 1.75;
  color: #e2e8f0;
}

.blog-reader-body h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: #38bdf8;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.blog-reader-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 24px 0 12px;
}

.blog-reader-body h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #cbd5e1;
  margin: 20px 0 10px;
}

.blog-reader-body p {
  margin-bottom: 16px;
}

.blog-reader-body ul,
.blog-reader-body ol {
  padding-left: 24px;
  margin-bottom: 18px;
}

.blog-reader-body li {
  margin-bottom: 6px;
}

.blog-reader-body a,
.blog-reader-body a:visited {
  color: #38bdf8 !important;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s;
}

.blog-reader-body a:hover,
.blog-reader-body a:focus {
  text-decoration: underline;
  color: #7dd3fc !important;
}

.blog-reader-body blockquote {
  background: rgba(30, 41, 59, 0.6);
  border-left: 4px solid #f59e0b;
  padding: 14px 20px;
  margin: 20px 0;
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: #fde68a;
}

.blog-reader-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  margin: 32px 0;
}

/* ── Code & Tables MD ────────────────────────────────────────── */
.blog-reader-body pre {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88rem;
  color: #a7f3d0;
  margin: 18px 0;
}

.blog-reader-body code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
  color: #38bdf8;
}

.blog-reader-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.92rem;
}

.blog-reader-body th,
.blog-reader-body td {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.blog-reader-body th {
  background: #1e293b;
  color: #38bdf8;
  font-weight: 600;
}

/* ── Section Sources & Documents ────────────────────────────── */
.blog-reader-sources-wrap {
  margin: 28px 32px 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.br-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Mots-clés / Tags ───────────────────────────────────────── */
.blog-reader-tags-wrap {
  margin: 20px 32px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.br-tag-pill {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.br-tag-pill:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

/* ── Barre de Partage ───────────────────────────────────────── */
.blog-reader-share-footer {
  margin: 0 32px 36px;
  padding: 20px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.br-share-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
}

.br-share-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.br-share-btn-large {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  padding: 9px 18px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.br-share-btn-large:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.br-share-social-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.br-share-social-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: scale(1.08);
}

/* ── Notification Toast ─────────────────────────────────────── */
#br-toast-notification {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #10b981;
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100001;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

#br-toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Mobile Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  #blog-reader-modal {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  
  .blog-reader-header,
  .blog-reader-body,
  .blog-reader-sources-wrap,
  .blog-reader-tags-wrap,
  .blog-reader-share-footer {
    padding-left: 18px;
    padding-right: 18px;
    margin-left: 0;
    margin-right: 0;
  }
  
  .blog-reader-title {
    font-size: 1.5rem;
  }
}
