/**
 * Blog Modal Styles
 * Styles personnalisés pour le modal d'affichage des articles
 * AS Consult - www.asconsult.lu
 */

/* Force le redimensionnement des images dans les cartes d'articles */
.blog-posts .post-img img {
  width: 100%;
  max-height: 150px;
  height: auto;
  object-fit: contain;
  object-position: center;
}

/* Modal personnalisé pour les articles */
#articleModal .modal-dialog {
  max-width: 900px;
}

#articleModal .modal-content {
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#articleModal .modal-header {
  background-color: #f8f9fa;
  border-bottom: 2px solid #e43c5c;
  padding: 1.5rem;
}

#articleModal .modal-title {
  color: #493c3e;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.3;
}

#articleModal .modal-body {
  padding: 2rem;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* Image de l'article dans le modal */
#articleModalImage {
  width: 100%;
  max-height: 150px;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Métadonnées de l'article */
.article-meta {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.article-meta i {
  color: #e43c5c;
  margin-right: 0.25rem;
}

/* Boutons de partage dans les cartes d'articles */
.share-buttons {
  display: flex;
  gap: 0.5rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #f8f9fa;
  color: #493c3e;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.share-btn[data-share="facebook"]:hover {
  background-color: #1877f2;
  color: white;
}

.share-btn[data-share="twitter"]:hover {
  background-color: #000000;
  color: white;
}

.share-btn[data-share="linkedin"]:hover {
  background-color: #0a66c2;
  color: white;
}

.share-btn[data-share="email"]:hover {
  background-color: #e43c5c;
  color: white;
}

.share-btn[data-share="copy"]:hover {
  background-color: #6c757d;
  color: white;
}

/* Boutons de partage dans le modal */
.share-buttons-modal {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.share-btn-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #f8f9fa;
  color: #493c3e;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.share-btn-modal:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.share-btn-modal[data-share="facebook"]:hover {
  background-color: #1877f2;
  color: white;
}

.share-btn-modal[data-share="twitter"]:hover {
  background-color: #000000;
  color: white;
}

.share-btn-modal[data-share="linkedin"]:hover {
  background-color: #0a66c2;
  color: white;
}

.share-btn-modal[data-share="email"]:hover {
  background-color: #e43c5c;
  color: white;
}

.share-btn-modal[data-share="copy"]:hover {
  background-color: #6c757d;
  color: white;
}

/* Contenu de l'article */
.article-content {
  color: #444;
  font-size: 1rem;
  line-height: 1.7;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  color: #493c3e;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.article-content h3 {
  font-size: 1.5rem;
}

.article-content h4 {
  font-size: 1.25rem;
}

.article-content p {
  margin-bottom: 1rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content a {
  color: #e43c5c;
  text-decoration: none;
  transition: color 0.3s ease;
}

.article-content a:hover {
  color: #c9335a;
  text-decoration: underline;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1rem 0;
}

.article-content blockquote {
  border-left: 4px solid #e43c5c;
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: #666;
  font-style: italic;
}

.article-content code {
  background-color: #f5f5f5;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.article-content pre {
  background-color: #f5f5f5;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
}

.article-content pre code {
  background-color: transparent;
  padding: 0;
}

/* Bouton de fermeture personnalisé */
#articleModal .btn-close {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

#articleModal .btn-close:hover {
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  #articleModal .modal-dialog {
    margin: 0.5rem;
  }

  #articleModal .modal-title {
    font-size: 1.5rem;
  }

  #articleModal .modal-body {
    padding: 1.5rem;
  }

  .article-content {
    font-size: 0.95rem;
  }

  /* Ajuster les boutons de partage sur mobile */
  .share-buttons-modal {
    flex-wrap: wrap;
  }

  .article-meta .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .share-buttons-modal {
    margin-top: 0.75rem;
  }
}

/* Animation d'entrée du modal */
#articleModal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
}

#articleModal.show .modal-dialog {
  transform: none;
}

/* Scrollbar personnalisée pour le contenu du modal */
#articleModal .modal-body::-webkit-scrollbar {
  width: 8px;
}

#articleModal .modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

#articleModal .modal-body::-webkit-scrollbar-thumb {
  background: #e43c5c;
  border-radius: 4px;
}

#articleModal .modal-body::-webkit-scrollbar-thumb:hover {
  background: #c9335a;
}
