/* ==================== BLOG HERO ==================== */
.blog-hero {
  background: linear-gradient(135deg, rgba(0, 134, 125, 0.08), rgba(244, 223, 194, 0.15));
  padding: 64px 0 48px;
  text-align: center;
}

.blog-hero h1 {
  margin-bottom: 16px;
}

.blog-hero .lead {
  max-width: 600px;
  margin: 0 auto;
}

/* ==================== FILTRES ==================== */
.blog-filters {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  background: rgba(0, 134, 125, 0.05);
  border-color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.filter-btn i {
  width: 16px;
  height: 16px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 400px;
  margin-left: auto;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 20px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 134, 125, 0.1);
}

/* ==================== TAGS ==================== */
.tags-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: rgba(0, 134, 125, 0.08);
  color: var(--primary);
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.tag:hover {
  background: rgba(0, 134, 125, 0.15);
  transform: translateY(-1px);
}

.tag.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tag-count {
  opacity: 0.7;
  font-size: 11px;
}

/* ==================== FEED ==================== */
.blog-feed {
  display: grid;
  gap: 24px;
}

.post-card {
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.post-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  border-color: rgba(0, 134, 125, 0.2);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.post-author-info {
  flex: 1;
}

.post-author {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 2px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.post-meta i {
  width: 14px;
  height: 14px;
}

.post-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(0, 119, 181, 0.1);
  color: #0077b5;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.post-source-badge.blog {
  background: rgba(0, 134, 125, 0.1);
  color: var(--primary);
}

.post-source-badge i {
  width: 12px;
  height: 12px;
}

.post-body {
  padding: 20px;
}

.post-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px 0;
  line-height: 1.4;
}

/* ==================== NOUVEAUX STYLES TITRE CLIQUABLE ==================== */
.post-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.post-title-link:hover {
  color: var(--primary, #00867d);
}

.post-excerpt {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.post-content-preview {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 16px;
  max-height: 200px;
  overflow: hidden;
  position: relative;
}

.post-content-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--card));
}

.post-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.post-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(0, 134, 125, 0.08);
  color: var(--primary);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.post-media {
  margin: 16px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.post-media img {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  display: block;
}

.post-media video {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  display: block;
}

.post-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #f5f5f5;
}

.carousel-track {
  display: flex;
  transition: transform 0.3s ease;
}

.carousel-item {
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.carousel-item img,
.carousel-item video {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  display: block;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: white;
  font-size: 14px;
}

.carousel-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 12px;
  pointer-events: none;
}

.carousel-btn {
  pointer-events: all;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.carousel-btn:hover {
  background: white;
  transform: scale(1.1);
}

.carousel-btn i {
  width: 20px;
  height: 20px;
  color: var(--text);
}

.carousel-indicators {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 12px 0;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.carousel-dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.02);
}

.post-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.post-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-stat i {
  width: 16px;
  height: 16px;
}

/* ==================== NOUVEAUX STYLES ACTIONS ==================== */
.post-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Bouton expand/collapse retravaillé */
.post-expand-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  color: rgba(0, 0, 0, 0.7);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
  min-height: 40px;
}

.post-expand-toggle:hover {
  border-color: var(--primary, #00867d);
  color: var(--primary, #00867d);
  background: rgba(0, 134, 125, 0.05);
}

.post-expand-toggle i {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-expand-toggle .expand-text,
.post-expand-toggle .collapse-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

/* Bouton "Lire l'article complet" (principal) */
.post-read-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary, #00867d);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
  min-height: 40px;
}

.post-read-more:hover {
  background: var(--primary-dark, #006d65);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 134, 125, 0.2);
}

.post-read-more i {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Lien LinkedIn compact */
.post-linkedin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #0077b5;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.post-linkedin-link:hover {
  background: #006399;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 119, 181, 0.2);
}

.post-linkedin-link i {
  width: 20px;
  height: 20px;
}

/* ==================== PAGINATION ==================== */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 32px 0;
}

.pagination button {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ==================== EXPANDED POST (AMÉLIORÉ) ==================== */
.post-card.expanded .post-body {
  padding-bottom: 0;
}

/* Contenu expandable avec nouveaux styles */
.post-expanded-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.post-card.expanded .post-expanded-content {
  max-height: none !important;
  opacity: 1;
  margin-top: 24px;
  padding: 24px;
  background: rgba(0, 134, 125, 0.02);
  border-radius: 12px;
  border: 2px solid rgba(0, 134, 125, 0.15);
}

.post-expanded-body {
  line-height: 1.8;
  color: rgba(0, 0, 0, 0.87);
  font-size: 16px;
}

.post-expanded-body h1,
.post-expanded-body h2,
.post-expanded-body h3 {
  margin-top: 32px;
  margin-bottom: 16px;
  color: var(--primary, #00867d);
  font-weight: 600;
}

.post-expanded-body h1 {
  font-size: 28px;
}

.post-expanded-body h2 {
  font-size: 24px;
}

.post-expanded-body h3 {
  font-size: 20px;
}

.post-expanded-body p {
  margin-bottom: 16px;
}

.post-expanded-body ul,
.post-expanded-body ol {
  margin-left: 24px;
  margin-bottom: 16px;
}

.post-expanded-body li {
  margin-bottom: 8px;
}

.post-expanded-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 24px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-expanded-body a {
  color: var(--primary, #00867d);
  text-decoration: underline;
  font-weight: 500;
}

.post-expanded-body a:hover {
  color: var(--primary-dark, #006d65);
}

.post-expanded-body blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  background: rgba(0, 134, 125, 0.05);
  border-left: 4px solid var(--primary, #00867d);
  font-style: italic;
}

.post-expanded-body code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

.post-expanded-body pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
}

.post-expanded-body pre code {
  background: none;
  padding: 0;
}

/* Cacher l'excerpt quand expanded */
.post-card.expanded .post-excerpt {
  display: none;
}

/* Afficher le contenu preview seulement quand non-expanded */
.post-card:not(.expanded) .post-content-preview {
  display: block;
}

.post-card.expanded .post-content-preview {
  display: none;
}

/* ==================== ÉTATS ==================== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 134, 125, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--muted);
}

.no-results i {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.no-results p {
  font-size: 16px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .blog-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
    justify-content: center;
  }

  .search-box {
    max-width: 100%;
    margin-left: 0;
  }

  .post-title {
    font-size: 18px;
  }

  .modal-content {
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-title {
    font-size: 24px;
  }
  
  /* Réduire encore plus la hauteur sur mobile */
  .carousel-item img,
  .carousel-item video {
    max-height: 400px;
  }
  
  /* Actions en colonne sur mobile */
  .post-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .post-expand-toggle,
  .post-read-more {
    width: 100%;
    justify-content: center;
  }
  
  .post-linkedin-link {
    align-self: flex-end;
  }
}