/*
Theme Name: Astra Child
Theme URI: http://wpastra.com/about/
Description: Thème enfant pour Astra avec styles personnalisés pour blog
Author: Brainstorm Force
Author URI: http://wpastra.com/about/
Template: astra
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astra-child
*/

/*******************************************************************************
 * TABLE DES MATIÈRES
 * 
 * 1. ÉLÉMENTS DE BASE ET LIENS
 * 2. MÉTA-INFORMATIONS DES ARTICLES
 * 3. BLOC AUTEUR
 * 4. CHAPO ET INTRODUCTION
 * 5. TITRES ET SOUS-TITRES
 * 6. IMAGES ET LÉGENDES
 * 7. CITATIONS ET ÉLÉMENTS DE TEXTE SPÉCIAUX
 * 8. LISTES
 * 9. ÉTIQUETTES ET TAXONOMIES
 * 10. PARTAGE SOCIAL
 * 11. COMMENTAIRES
 * 12. HEADER ET FOOTER
 * 13. TABLEAUX
 * 14. MAILLAGE INTERNE
 * 15. RESPONSIVE ET MEDIA QUERIES
 * 16. ANIMATIONS
 ******************************************************************************/

/*******************************************************************************
 * 1. ÉLÉMENTS DE BASE ET LIENS
 ******************************************************************************/

/* Suppression du soulignement global des liens */
a {
  text-decoration: none;
}

/* Soulignement des liens dans le contenu des articles uniquement */
body.single .entry-content a {
  text-decoration: underline;
  font-weight: bold;
}

/* Style spécial pour les liens externes dans le contenu des articles */
body.single .entry-content a.external-link::after {
  content: "\f08e"; /* Icône de lien externe (Font Awesome) */
  font-family: "FontAwesome";
  display: inline-block;
  margin-left: 5px;
  font-size: 0.8em;
  vertical-align: middle;
  color: var(--ast-global-color-0);
}

/*******************************************************************************
 * 2. MÉTA-INFORMATIONS DES ARTICLES
 ******************************************************************************/

/* Style des métadonnées (date de publication, temps de lecture) */
.my-custom-meta {
  font-size: 14px;
  font-weight: bold;
  color: var(--ast-global-color-0);
  font-family: inherit;
  display: inline-block;
  margin-top: 0.5em;
  line-height: 1.4;
}

/* Style pour la date de mise à jour */
.my-custom-meta .meta-update {
  display: block;
  margin-top: 0.2em;
  margin-left: 0;
}

/*******************************************************************************
 * 3. BLOC AUTEUR
 ******************************************************************************/

/* Conteneur principal du bloc auteur en haut de l'article */
.my-left-author-wrapper {
  margin: 1em 0;
}

/* Disposition en flex pour aligner l'avatar et les informations */
.my-left-author-container {
  display: flex;
  align-items: center;
}

/* Style de l'avatar de l'auteur */
.my-left-author-avatar {
  flex: 0 0 auto;
}

.my-left-author-avatar-img {
  border-radius: 50%;
  display: block;
}

/* Style des informations textuelles sur l'auteur */
.my-left-author-details {
  margin-left: 10px;
}

.my-left-author-name {
  font-size: 16px;
  font-weight: bold;
  color: #000;
  margin: 0 0 4px;
}

.my-left-author-profession {
  font-size: 14px;
  font-style: italic;
  color: #777;
  margin: 0;
}

/* Style du bloc auteur natif d'Astra en bas d'article */
.ast-author-box {
  background-color: #f8f8f8;
  border-radius: 8px;
  padding: 25px;
  margin: 30px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
}

.ast-author-box .ast-author-avatar {
  margin-right: 20px;
}

.ast-author-box .ast-author-avatar img {
  border-radius: 50%;
  border: 3px solid var(--ast-global-color-0);
}

.ast-author-box .ast-author-bio-wrap .ast-author-name {
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--ast-global-color-0);
}

.ast-author-box .ast-author-bio-wrap .ast-author-bio {
  font-size: 0.95em;
  line-height: 1.6;
  margin-top: 10px;
}

.ast-author-box .ast-author-meta-wrapper h5.ast-about-author-title {
  font-size: 1.1em;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ast-global-color-0);
  border-bottom: 2px solid var(--ast-global-color-0);
  padding-bottom: 5px;
  display: inline-block;
  margin-bottom: 15px;
}

/*******************************************************************************
 * 4. CHAPO ET INTRODUCTION
 ******************************************************************************/


/* Style moderne incliné avec radius */
.post-chapo {
  position: relative;
  margin: 35px 0;
  padding: 28px 32px;
  background-color: var(--ast-global-color-0);
  background-image: linear-gradient(135deg, var(--ast-global-color-0) 0%, color-mix(in srgb, var(--ast-global-color-0) 80%, #ffffff) 100%);
  color: #ffffff;
  font-size: 1.15em;
  line-height: 1.6;
  border-radius: 12px;
  transform: skewY(-1.5deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.post-chapo > * {
  transform: skewY(1.5deg); /* Redresse le contenu */
}

.post-chapo::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 20px;
  height: 15px;
  width: 70%;
  background-color: color-mix(in srgb, var(--ast-global-color-0) 85%, #000000);
  border-radius: 6px;
  z-index: -1;
}

.post-chapo p {
  margin-bottom: 0.8em;
}

.post-chapo p:last-child {
  margin-bottom: 0;
}

.post-chapo a {
  color: #ffffff;
  border-bottom: 1px dotted;
  font-weight: bold;
  transition: all 0.3s ease;
}

.post-chapo a:hover {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

/*******************************************************************************
 * 5. TITRES ET SOUS-TITRES
 ******************************************************************************/

/* Style des titres H2 avec décorations en coin */
.entry-content h2 {
  position: relative;
  font-size: 2em;
  margin: 1em 0;
  padding: 0.3em 0.8em;
}

/* Décoration triangle en haut à gauche - utilise la couleur principale du thème */
.entry-content h2::before {
  content: "";
  position: absolute;
  top: 0.1em;
  left: 0.1em;
  border-top: 15px solid var(--ast-global-color-0);
  border-right: 15px solid transparent;
  pointer-events: none;
}

/* Décoration triangle en bas à droite - utilise la couleur principale du thème */
.entry-content h2::after {
  content: "";
  position: absolute;
  bottom: 0.1em;
  right: 0.1em;
  border-bottom: 15px solid var(--ast-global-color-0);
  border-left: 15px solid transparent;
  pointer-events: none;
}

/*******************************************************************************
 * 6. IMAGES ET LÉGENDES
 ******************************************************************************/

/* Radius sur toutes les images */
.entry-content img,
.wp-block-image img,
.wp-post-image,
.wp-block-cover img,
.attachment-featured-image,
.ast-blog-featured-section img {
  border-radius: 6px;
}

/* Conteneur pour l'image mise en avant avec légende */
.featured-image-wrapper {
  position: relative;
  display: inline-block;
  width: 100%; /* Assure que l'image prend toute la largeur disponible */
}

.featured-image-wrapper img {
  border-radius: 6px;
}

/* Style du bandeau de légende */
.custom-featured-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(242, 242, 242, 0.8);
  padding: 5px 10px;
  text-align: center;
  box-sizing: border-box;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* Style du texte de la légende */
.custom-featured-caption .caption-text {
  font-size: 12px;
  font-style: italic;
  color: #666;
  margin: 0;
}

/*******************************************************************************
 * 7. CITATIONS ET ÉLÉMENTS DE TEXTE SPÉCIAUX
 ******************************************************************************/

/* Style des blocs de citation - utilise la couleur principale du thème */
blockquote {
  position: relative;
  background-color: #fff;
  padding: 0.8rem 1rem 0.3rem 2.5rem;
  margin: 1.5rem 0 1rem 0;
  font-style: italic;
  color: #444;
  border: 1px solid #e0e0e0;
  border-left: 5px solid var(--ast-global-color-0);
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Guillemet décoratif au début de la citation - utilise la couleur principale du thème */
blockquote::before {
  content: "❝";
  position: absolute;
  top: 0.3rem;
  left: 0.5rem;
  font-size: 1.8em;
  color: var(--ast-global-color-0);
  opacity: 0.25;
}

/*******************************************************************************
 * 8. LISTES
 ******************************************************************************/

/* Style des listes à puces personnalisées */
.entry-content ul {
  list-style: none;
  padding-left: 0;
  margin: 1em 0;
}

.entry-content ul li {
  position: relative;
  padding-left: 1.5em; /* Espace pour l'icône */
  margin-bottom: 0.5em;
  line-height: 1.4;
}

/* Puce personnalisée - trait vertical épais de la couleur du thème */
.entry-content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  height: 1em;
  width: 4px;
  background-color: var(--ast-global-color-0);
  border-radius: 2px;
}

/*******************************************************************************
 * 9. ÉTIQUETTES ET TAXONOMIES
 ******************************************************************************/

/* Style des étiquettes dans le widget de nuage de tags - utilise la couleur principale du thème */
.widget-tag-cloud .tagcloud a {
  display: inline-block;
  padding: 6px 10px;
  border: 2px solid var(--ast-global-color-0);
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px !important; /* Important pour écraser le style inline de WP */
  font-weight: 500;
  color: var(--ast-global-color-0);
  transition: transform 0.3s ease, background-color 0.3s ease;
  margin: 5px;
}

.widget-tag-cloud .tagcloud a:hover {
  transform: scale(1.05);
  background-color: var(--ast-global-color-0);
  color: #fff;
}

/* Style pour la liste des étiquettes générée par le shortcode [top_tags] */
.custom-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px; /* Espacement entre les étiquettes */
  margin: 20px 0;
  justify-content: flex-start; /* Alignement à gauche */
}

.custom-tag-list .custom-tag-item {
  display: inline-block;
  padding: 6px 12px;
  border: 2px solid var(--ast-global-color-0);
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ast-global-color-0);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.custom-tag-list .custom-tag-item:hover {
  transform: scale(1.05);
  background-color: var(--ast-global-color-0);
  color: #fff;
}

/*******************************************************************************
 * 10. PARTAGE SOCIAL
 ******************************************************************************/

/* Conteneur du bloc de partage social */
.ast-post-social-sharing {
  padding: 20px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-align: center;
  margin: 30px 0;
}

/* Titre du bloc de partage */
.ast-social-sharing-heading {
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ast-global-color-2);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ast-global-color-0);
  display: inline-block;
}



/*******************************************************************************
 * 12. HEADER ET FOOTER
 ******************************************************************************/

/* Style du header */
.site-header {
    position: relative;
    z-index: 1;
}

/*******************************************************************************
 * 13. TABLEAUX
 ******************************************************************************/

/* Conteneur responsive pour les tableaux */
.table-responsive {
  overflow-x: auto;
  max-width: 100%;
  margin: 2em 0;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Style des tableaux amélioré */
.entry-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: none;
  margin: 0;
  background-color: white;
}

/* En-tête du tableau */
.entry-content thead th {
  background-color: var(--ast-global-color-0);
  color: white;
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 1.05em;
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Premier et dernier th avec des coins arrondis */
.entry-content thead th:first-child {
  border-top-left-radius: 8px;
}

.entry-content thead th:last-child {
  border-top-right-radius: 8px;
}

/* Cellules du tableau */
.entry-content td {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

/* Effet au survol des lignes */
.entry-content tbody tr:hover {
  background-color: rgba(var(--ast-global-color-0-rgb), 0.05);
}

/* Alternance de couleur pour les lignes */
.entry-content tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* Dernière ligne sans bordure inférieure */
.entry-content tbody tr:last-child td {
  border-bottom: none;
}

/* Dernière ligne avec des coins arrondis en bas */
.entry-content tbody tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}

.entry-content tbody tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}

/* Style pour les tableaux responsives dans Gutenberg */
.wp-block-table {
  overflow-x: auto;
  max-width: 100%;
}

/*******************************************************************************
 * 14. MAILLAGE INTERNE
 ******************************************************************************/

/* Style des boîtes de maillage interne */
.internal-link-box {
  display: flex;
  flex-wrap: wrap;
  margin: 25px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #eee;
  position: relative;
  background: #fff;
}

/* Étiquette de date */
.internal-link-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--ast-global-color-0);
  color: white;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 4px;
  z-index: 2;
  font-weight: 500;
}

/* Image au ratio 16:9 prenant 50% de la largeur */
.internal-link-thumb {
  width: 50%;
  position: relative;
}

.internal-link-thumb img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 16/9;
  border-radius: 0; /* Supprime le radius par défaut des images */
}

/* Titre et contenu */
.internal-link-title {
  width: 50%;
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.internal-link-title a {
  display: block;
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ast-global-color-3);
  line-height: 1.4;
}

.internal-link-title a:hover {
  color: var(--ast-global-color-0);
}

/* Nombre de commentaires */
.internal-link-comments {
  margin-top: 8px;
  display: flex;
  align-items: center;
  color: #777;
  font-size: 0.85em;
}

.internal-link-comments .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  margin-right: 5px;
}

/* Responsive pour mobile */
@media (max-width: 600px) {
  .internal-link-thumb,
  .internal-link-title {
    width: 100%;
  }
  
  .internal-link-thumb img {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  
  .internal-link-badge {
    top: 10px;
    right: 10px;
  }
}

/*******************************************************************************
 * 15. RESPONSIVE ET MEDIA QUERIES
 ******************************************************************************/

/* Styles spécifiques pour les tablettes et mobiles sont déjà définis dans d'autres sections */

/*******************************************************************************
 * 16. ANIMATIONS
 ******************************************************************************/

/* Animation de fondu pour le bandeau des commentaires */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animation pulsante pour l'indicateur live */
@keyframes pulse {
  0% {
    transform: scale(0.9);
    opacity: 1;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

.astra-child-authors {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
}

.author-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
}

.author-avatar {
    flex-shrink: 0;
    margin-right: 20px;
}

.author-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.author-info {
    flex-grow: 1;
}

.author-name {
    margin-top: 0;
    margin-bottom: 2px; /* Marge réduite entre le nom et la profession */
}

.author-name a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
}

.author-name a:hover {
    text-decoration: underline;
}

.author-profession {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.5;
    color: #666;
}

/* Desktop: 2 colonnes */
@media (min-width: 768px) {
    .author-item {
        width: calc(50% - 10px);
    }
}

/* Mobile: 1 colonne */
@media (max-width: 767px) {
    .author-item {
        width: 100%;
    }
}
/* Pour la colonne d'image mise en avant dans l'admin */
.column-featured_image {
    width: 10%;
    text-align: center;
}
.admin-featured-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 5px;
}
.featured-image-container {
    position: relative;
}
.featured-image-actions {
    display: none;
    margin-top: 5px;
}
.featured-image-container:hover .featured-image-actions {
    display: block;
}
.featured-image-actions a {
    margin: 0 5px;
    font-size: 12px;
}

/**
 * Styles pour la notification des commentaires
 * Uniquement visible sur les articles uniques
 */
.comments-notification {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 50px;
    padding: 10px 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.comments-notification.visible {
    transform: translateY(0);
    opacity: 1;
}

.comments-notification a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333333;
    font-weight: 600;
    font-size: 14px;
}

.comments-notification .comment-count {
    margin-right: 12px;
}

.comments-notification .live-indicator {
    position: relative;
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50%;
}

.comments-notification .live-indicator:before {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background-color: rgba(76, 175, 80, 0.4);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.4;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.7;
    }
}

/**
 * Styles pour la notification des commentaires
 * Uniquement visible sur les articles uniques
 */
.comments-notification {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 50px;
    padding: 10px 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
    pointer-events: none; /* Par défaut, désactiver les interactions */
}

.comments-notification.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto; /* Activer les interactions quand visible */
}

.comments-notification a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333333;
    font-weight: 600;
    font-size: 14px;
}

.comments-notification .comment-count {
    margin-right: 12px;
}

.comments-notification .live-indicator {
    position: relative;
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50%;
}

.comments-notification .live-indicator:before {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background-color: rgba(76, 175, 80, 0.4);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.4;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.7;
    }
}

.entry-content img,
.post-content img {
  max-width: 100% !important;
  height: auto !important;
}
