/* enhancements.css — mobile bars, drawer, author card, quick actions, arabic pagination, books grid */

/* ===== AMÉLIORATIONS MODE SOMBRE SELON LES BONNES PRATIQUES UX ===== */

/* Mode sombre pour les cartes d'articles */
[data-theme="dark"] .post-card, 
body.m-dark .post-card {
  background: var(--dark-bg-secondary);
  border: 1px solid #333333;
  color: var(--dark-text-primary);
}

/* Mode sombre pour les cartes d'auteurs */
[data-theme="dark"] .author-card,
body.m-dark .author-card,
[data-theme="dark"] .m-author-card,
body.m-dark .m-author-card {
  background: var(--dark-bg-secondary);
  border: 1px solid #333333;
  color: var(--dark-text-primary);
}

/* Mode sombre pour les tags */
[data-theme="dark"] .tag-pill,
body.m-dark .tag-pill {
  background: var(--dark-bg-elevated);
  color: var(--dark-text-secondary);
  border: 1px solid #444444;
}

[data-theme="dark"] .tag-pill:hover,
body.m-dark .tag-pill:hover {
  background: var(--accent-green);
  color: var(--dark-bg-primary);
}

/* Mode sombre pour les liens */
[data-theme="dark"] a,
body.m-dark a {
  color: var(--accent-green);
}

[data-theme="dark"] a:hover,
body.m-dark a:hover {
  color: var(--accent-green-hover);
}

/* Mode sombre pour les métadonnées */
[data-theme="dark"] .post-card-meta,
body.m-dark .post-card-meta,
[data-theme="dark"] .meta,
body.m-dark .meta,
[data-theme="dark"] .m-meta,
body.m-dark .m-meta {
  color: var(--dark-text-muted);
}

/* Mode sombre pour la pagination */
[data-theme="dark"] .pagination-ar a,
body.m-dark .pagination-ar a {
  background: var(--accent-green);
  color: var(--dark-bg-primary);
}

[data-theme="dark"] .pagination-ar a:hover,
body.m-dark .pagination-ar a:hover {
  background: var(--accent-green-hover);
}

[data-theme="dark"] .pagination-ar span,
body.m-dark .pagination-ar span {
  color: var(--accent-green);
}

/* Mode sombre pour les bordures et séparateurs */
[data-theme="dark"] .m-topbar,
body.m-dark .m-topbar {
  background: var(--dark-bg-secondary);
  border-bottom: 1px solid #333333;
}

/* Mode sombre pour les boutons et éléments interactifs */
[data-theme="dark"] button,
body.m-dark button,
[data-theme="dark"] .btn,
body.m-dark .btn {
  background: var(--dark-bg-elevated);
  color: var(--dark-text-primary);
  border: 1px solid #444444;
}

[data-theme="dark"] button:hover,
body.m-dark button:hover,
[data-theme="dark"] .btn:hover,
body.m-dark .btn:hover {
  background: var(--accent-green);
  color: var(--dark-bg-primary);
}

/* Mode sombre pour les éléments dorés (éléments importants) */
[data-theme="dark"] .featured,
body.m-dark .featured,
[data-theme="dark"] .highlight,
body.m-dark .highlight,
[data-theme="dark"] .important,
body.m-dark .important {
  color: var(--accent-gold);
}

[data-theme="dark"] .featured:hover,
body.m-dark .featured:hover,
[data-theme="dark"] .highlight:hover,
body.m-dark .highlight:hover {
  color: var(--accent-gold-hover);
}

/* Mode sombre pour améliorer le contraste des images */
[data-theme="dark"] img,
body.m-dark img {
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

[data-theme="dark"] img:hover,
body.m-dark img:hover {
  opacity: 1;
}

/* Mode sombre pour les formulaires */
[data-theme="dark"] input,
body.m-dark input,
[data-theme="dark"] textarea,
body.m-dark textarea,
[data-theme="dark"] select,
body.m-dark select {
  background: var(--dark-bg-elevated);
  color: var(--dark-text-primary);
  border: 1px solid #444444;
}

[data-theme="dark"] input:focus,
body.m-dark input:focus,
[data-theme="dark"] textarea:focus,
body.m-dark textarea:focus,
[data-theme="dark"] select:focus,
body.m-dark select:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(78, 169, 159, 0.2);
}

/* ===== FIN AMÉLIORATIONS MODE SOMBRE ===== */
:root {
  /* Couleur principale du titre (basée sur la couleur du logo/accent) */
  --article-title-color: #1E3985; /* Bleu principal du thème */
  --article-title-hover: #19306F; /* Bleu plus foncé au survol */
}

/* Mode sombre : couleurs adaptées pour une meilleure lisibilité selon les bonnes pratiques UX */
[data-theme="dark"], body.m-dark {
  /* Couleurs principales basées sur l'article Medium sur les alternatives au noir pur */
  --dark-bg-primary: #121212; /* Charcoal Gray - Alternative au noir pur pour réduire la fatigue oculaire */
  --dark-bg-secondary: #1e1e1e; /* Dark Slate Gray - Pour les cartes et conteneurs */
  --dark-bg-elevated: #252525; /* Outer Space - Pour les éléments en relief */
  --dark-text-primary: #e8e8e8; /* Blanc cassé pour réduire l'effet de halo */
  --dark-text-secondary: #b8b8b8; /* Gris clair pour les textes secondaires */
  --dark-text-muted: #888888; /* Gris moyen pour les métadonnées */
  
  /* Couleurs d'accent conservées : vert et doré comme demandé */
  --accent-green: #4ea99f; /* Vert principal conservé */
  --accent-green-hover: #5cbab0; /* Vert au survol */
  --accent-gold: #d4af37; /* Doré pour les éléments importants */
  --accent-gold-hover: #e6c547; /* Doré au survol */
  
  /* Couleurs de titre adaptées */
  --article-title-color: var(--accent-green); 
  --article-title-hover: var(--accent-green-hover);
  
  /* Application des couleurs de base */
  background: var(--dark-bg-primary);
  color: var(--dark-text-primary);
}
.post-header-grid{
  display:grid;
  grid-template-columns: 320px 1fr;
  grid-template-areas: "media meta";
  gap: 1rem 1.25rem;
  align-items:start;
  margin: 1rem 0 1.25rem;
}
.post-header-media{ grid-area: media; }
.post-header-media img{
  display:block; width:100%; height:auto;
  border-radius:12px; object-fit:cover;
}
.post-header-meta{ grid-area: meta; }

.m-author-card{ display:flex; align-items:center; gap:.75rem; padding:.75rem;
  border:1px solid #e7e3da; border-radius:12px; background:#fff; }
.m-author-card .m-avatar{ width:56px; height:56px; border-radius:50%; object-fit:cover; }
.m-author-card .m-meta{ line-height:1.35; }
.m-author-card .m-sub{ font-size:.9rem; opacity:.8; }

@media (max-width: 768px){
  .post-header-grid{
    grid-template-columns: 1fr;
    grid-template-areas:
      "media"
      "meta";
  }
  .post-header-media{ max-width: 520px; margin-inline:auto; }
}


/* ===== authors grid ===== */
.authors-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
  gap:1rem;
  margin:1rem 0 2rem;
}
.author-card{
  border:1px solid #e7e3da;
  border-radius:12px;
  background:#fff;
  overflow:hidden;
  text-align:center;
  transition:transform .12s ease, box-shadow .12s ease;
}
.author-card a{ display:block; padding:.85rem; color:inherit; text-decoration:none; }
.author-card img{ width:88px; height:88px; border-radius:50%; object-fit:cover; display:block; margin:.25rem auto .5rem; }
.author-card .avatar-fallback{ display:inline-grid; place-items:center; width:88px; height:88px; border-radius:50%; background:#f3f2ed; font-weight:700; }
.author-card .name{ font-weight:700; margin:.25rem 0; }
.author-card .meta{ font-size:.85rem; color:#666; }
.author-card:hover{ transform:translateY(-2px); box-shadow:0 6px 16px rgba(0,0,0,.06); }
/* Translation overlay */
#translation-overlay{position:fixed;inset:0;z-index:9999;direction:rtl}
#translation-overlay .m-tr-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.35)}
#translation-overlay .m-tr-panel{
  position:absolute;inset:auto 0 0 0; max-height:85vh; background:#fff; border-radius:16px 16px 0 0;
  box-shadow:0 -10px 30px rgba(0,0,0,.15); display:flex; flex-direction:column
}
@media (min-width: 900px){
  #translation-overlay .m-tr-panel{inset:5vh 10vw auto 10vw; border-radius:16px}
}
#translation-overlay .m-tr-head{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;border-bottom:1px solid #eee}
#translation-overlay .m-tr-body{padding:0}
#translation-overlay .m-tr-scroller{padding:1rem; max-height:70vh; overflow:auto}
.m-translate{position:relative;display:inline-block}
.m-translate .m-translate-menu{
  position:absolute; right:0; top:100%; background:#fff; border:1px solid #ddd; border-radius:8px; padding:.25rem; min-width:140px;
  box-shadow:0 8px 24px rgba(0,0,0,.12)
}
.m-translate .m-item{display:block; width:100%; text-align:right; background:none; border:0; padding:.5rem .75rem; cursor:pointer}
.m-translate .m-item:hover{background:#f6f6f6}
/* Koenig wide/full */
.kg-width-wide{ max-width:1200px; margin-inline:auto; }
.kg-width-full{ width:100vw; margin-inline-start:50%; transform:translateX(-50%); }
.kg-image-card img{ display:block; max-width:100%; height:auto; }
:root { --m-primary: #0b3b2e; --m-pill: #f3f2ed; --m-border: #e7e3da; }
body.m-dark { background:#0f1115; color:#f2f2f2; }
.m-hide-desktop { display:none; }
@media (max-width: 767px){
  .m-hide-mobile{ display:none !important;}
  .m-show-mobile{ display:flex !important;}
  .m-topbar{ position:sticky; top:0; z-index:999; display:flex; align-items:center; justify-content:space-between; padding:.5rem .75rem; background:var(--m-pill); border-bottom:1px solid var(--m-border); }
  .m-topbar .m-logo{ display:flex; align-items:center; gap:.5rem; justify-content:center; flex:1; }
  .m-topbar .m-left, .m-topbar .m-right{ width:2.25rem; display:flex; align-items:center; justify-content:center; }
/* Mobile navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-base);
    border-top: 1px solid var(--color-border);
    z-index: 1000;
    padding: 10px 0;
}

/* Post Navigation Styles */
.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--ghost-accent-color);
    border-radius: 8px;
    gap: 1rem;
}

.post-navigation a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.post-navigation a:hover {
    opacity: 0.8;
}

.post-navigation .nav-prev {
    text-align: left;
}

.post-navigation .nav-next {
    text-align: right;
}

/* Post Tags Styles */
.post-tags-section {
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--color-border);
}

.tags-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary-text);
    margin-bottom: 1rem;
    text-align: right;
}

.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
}

.tag-pill {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--color-secondary-text);
    color: var(--color-base);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tag-pill:hover {
    background: var(--ghost-accent-color);
    color: white;
    transform: translateY(-2px);
}

/* Dark mode support for navigation and tags */
.dark-mode .post-navigation {
    background: var(--ghost-accent-color);
}

.dark-mode .tag-pill {
    background: var(--color-secondary-text-dark);
    color: var(--color-base-dark);
}

.dark-mode .tag-pill:hover {
    background: var(--ghost-accent-color);
    color: white;
}

/* Share buttons styles */
.m-share-mini {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    direction: rtl;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
    position: relative;
}

.m-share-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    color: white !important;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Couleurs spécifiques par plateforme */
.m-share-btn.facebook {
    background: #1877f2 !important;
}

.m-share-btn.facebook:hover {
    background: #166fe5 !important;
}

.m-share-btn.twitter {
    background: #1da1f2 !important;
}

.m-share-btn.twitter:hover {
    background: #0d8bd9 !important;
}

.m-share-btn.linkedin {
    background: #0077b5 !important;
}

.m-share-btn.linkedin:hover {
    background: #005885 !important;
}

.m-share-btn.whatsapp {
    background: #25d366 !important;
}

.m-share-btn.whatsapp:hover {
    background: #128c7e !important;
}

.m-share-btn.telegram {
    background: #0088cc !important;
}

.m-share-btn.telegram:hover {
    background: #006ba6 !important;
}

.m-share-btn.email {
    background: #ea4335 !important;
}

.m-share-btn.email:hover {
    background: #d73527 !important;
}

.m-share-btn.copy-link {
    background: #6c757d !important;
}

.m-share-btn.copy-link:hover {
    background: #545b62 !important;
}

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

.m-share-btn i {
    font-size: 1rem;
}

/* Tooltip pour la copie */
.copy-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(50%);
    background: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    margin-bottom: 0.5rem;
}

.copy-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #28a745;
}

.copy-tooltip.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .m-share-mini {
        gap: 0.3rem;
        padding: 0.8rem;
        justify-content: center;
    }
    
    .m-share-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .m-share-btn span {
        display: none;
    }
    
    .m-share-btn i {
        font-size: 1.1rem;
    }
}

/* Pagination Arabic styles - Version moderne avec numéros */
.pagination-ar {
    display: flex !important;
    justify-content: center;
    align-items: center;
    margin: 3rem 0 2rem;
    padding: 1rem;
    direction: ltr; /* Pour l'ordre des numéros */
    gap: 0.5rem;
}

/* Pagination Articles - Style moderne avec numéros */
.pagination-articles {
    background: transparent;
    border: none;
    padding: 2rem 1rem;
    justify-content: center;
    gap: 1rem;
}

.pagination-articles .pagination-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 1rem;
}

.pagination-articles .pagination-current {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    background: #f8f9fa;
    border: 2px solid #28a745;
    color: #28a745;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
}

.pagination-articles .current-page,
.pagination-articles .total-pages {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #28a745;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0 4px;
}

.pagination-articles .pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 80px;
}

.pagination-articles .pagination-btn:hover:not(.disabled) {
    border-color: #28a745;
    background: #28a745;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.pagination-articles .pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #e0e0e0;
    background: #f8f9fa;
    color: #999;
}

.pagination-info {
    text-align: center;
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid #e9ecef;
}

/* Mode sombre */
body.m-dark .pagination-articles .pagination-current {
    background: #2d3748;
    border-color: #28a745;
    color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

body.m-dark .pagination-articles .current-page,
body.m-dark .pagination-articles .total-pages {
    background: #28a745;
    color: white;
}

body.m-dark .pagination-articles .pagination-btn {
    border-color: #444;
    background: #2d3748;
    color: #cbd5e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.m-dark .pagination-articles .pagination-btn:hover:not(.disabled) {
    border-color: #28a745;
    background: #28a745;
    color: white;
}

body.m-dark .pagination-articles .pagination-btn.disabled {
    opacity: 0.4;
    border-color: #444;
    background: #1a202c;
    color: #4a5568;
}

body.m-dark .pagination-info {
    color: #cbd5e0;
    background: #2d3748;
    border-color: #444;
}

/* Responsive */
@media (max-width: 768px) {
    .pagination-articles {
        padding: 1rem 0.5rem;
        gap: 0.5rem;
    }
    
    .pagination-articles .pagination-numbers {
        margin: 0 0.5rem;
    }
    
    .pagination-articles .pagination-current {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .pagination-articles .current-page,
    .pagination-articles .total-pages {
        min-width: 20px;
        height: 20px;
        font-size: 0.75rem;
    }
    
    .pagination-articles .pagination-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        min-width: 70px;
    }
    
    .pagination-info {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Styles pour les autres paginations (livres, auteurs) - garder l'ancien style */
.pagination-books,
.pagination-authors {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    direction: rtl;
    border: 1px solid #e9ecef;
}

.pagination-books a,
.pagination-authors a {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: white !important;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination-books .page-info,
.pagination-authors .page-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.pagination-books .page-xofy,
.pagination-authors .page-xofy {
    font-weight: 600;
    font-size: 1rem;
}

.pagination-books .page-details,
.pagination-authors .page-details {
    font-size: 0.85rem;
    color: #666;
}

/* Pagination Livres */
.pagination-books {
    border-left: 4px solid #fd7e14;
}

.pagination-books a {
    background: #fd7e14 !important;
}

.pagination-books a:hover {
    background: #e8610e !important;
    transform: translateY(-2px);
}

.pagination-books .page-xofy {
    color: #fd7e14;
}

/* Pagination Auteurs */
.pagination-authors {
    border-left: 4px solid #6f42c1;
}

.pagination-authors a {
    background: #6f42c1 !important;
}

.pagination-authors a:hover {
    background: #5a359a !important;
    transform: translateY(-2px);
}

.pagination-authors .page-xofy {
    color: #6f42c1;
}

.pagination-progress-ar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.pagination-progress-ar span {
    display: block;
    height: 100%;
    transition: width 0.3s ease;
}

/* Couleurs de progression par type */
.pagination-articles + .pagination-progress-ar span {
    background: #28a745;
}

.pagination-books + .pagination-progress-ar span {
    background: #fd7e14;
}

.pagination-authors + .pagination-progress-ar span {
    background: #6f42c1;
}

/* Responsive */
@media (max-width: 768px) {
    .pagination-ar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .pagination-ar a {
        text-align: center;
        min-width: 120px;
    }
}

/* Mobile responsive for navigation and tags */
@media (max-width: 768px) {
    .post-navigation {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .post-navigation .nav-prev,
    .post-navigation .nav-next {
        text-align: center;
    }
    
    .post-card-tags {
        justify-content: center;
    }
    
    .tag-pill {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}
  .m-bottombar a{ text-align:center; font-size:.75rem; text-decoration:none; color:inherit; padding:.35rem .5rem; border-radius:.75rem; }
  .m-bottombar i{ display:block; font-size:1.1rem; margin-bottom:.15rem;}
  .m-drawer{ position:fixed; top:0; bottom:0; right:0; width:84vw; max-width:420px; background:#fff; box-shadow: -2px 0 16px rgba(0,0,0,.15); transform:translateX(100%); transition:transform .25s ease; z-index:1000; overflow:auto; }
  .m-drawer.open{ transform:translateX(0); }
  .m-drawer .m-head{ position:sticky; top:0; background:#fff; border-bottom:1px solid var(--m-border); padding:.75rem 1rem; font-weight:700; }
  .m-drawer .m-sec{ padding:.75rem 1rem; }
  .m-overlay{ position:fixed; inset:0; background:rgba(0,0,0,.25); opacity:0; pointer-events:none; transition:opacity .2s; z-index:999;}
  .m-overlay.show{ opacity:1; pointer-events:auto;}
}
/* Author card */
.m-author-card{ display:flex; align-items:center; gap:1rem; padding:1rem; border:1px solid var(--m-border); background:#fff; border-radius:12px; margin:.75rem 0; }
.m-author-card .m-avatar{ width:66px; height:66px; border-radius:50%; overflow:hidden; }
.m-author-card .m-meta{ flex:1; }
.m-author-card .m-actions{ display:flex; gap:.5rem; }
.m-quick-actions{ display:flex; gap:.5rem; margin:.5rem 0 1rem; }
.m-pill{ background:var(--m-pill); padding:.25rem .6rem; border-radius:999px; border:1px solid var(--m-border); font-size:.85rem; }
/* Arabic pagination */
.m-pagination{ display:flex; align-items:center; justify-content:center; gap:.75rem; margin:1.25rem 0; }
.m-progress{ height:6px; background:var(--m-border); border-radius:999px; overflow:hidden; }
.m-progress > span{ display:block; height:6px; background:var(--m-primary); width:0;}
/* Books grid */
.m-books-filters{ display:flex; flex-wrap:wrap; gap:.5rem; margin:0 0 1rem 0; }
.m-books-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap:1rem; }
.m-book{ border:1px solid var(--m-border); border-radius:12px; padding:.5rem; background:#fff; position:relative; overflow:hidden;}
.m-book .cover{ aspect-ratio:3/4; border-radius:8px; background:#f6f5f2; display:flex; align-items:center; justify-content:center; overflow:hidden;}
.m-book .title{ font-weight:700; margin:.5rem 0 .25rem;}
.m-book .author{ font-size:.9rem; color:#666; margin-bottom:.25rem;}
.m-book .price{ font-size:.85rem; color:#333;}
.m-book .hover{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; gap:.75rem; opacity:0; background:rgba(255,255,255,.85); transition:opacity .15s;}
.m-book:hover .hover{ opacity:1;}
/* Hide mobile bottom bar on tablets/desktop */
@media (min-width: 768px){ .m-bottombar { display:none !important; } }

/* ===== Audio reader container ===== */
.audio-reader-container {
  margin: 1rem 0;
  text-align: center;
}

/* ===== post header grid - Section auteur + Image côte à côte ===== */
.post-header-grid{
  display:grid;
  grid-template-columns: minmax(220px,320px) 1fr; /* image | auteur */
  gap:1rem;
  align-items:start;
  margin:.75rem 0 1.25rem;
}
.post-header-grid .phg-media{ grid-column:1; }
.post-header-grid .phg-meta{  grid-column:2; }

/* Image à gauche */
.post-header-grid .phg-media .phg-cover{
  width:100%; aspect-ratio:16/9; border-radius:12px; overflow:hidden;
  border:1px solid #e7e3da; background:#f6f5f2;
}
.post-header-grid .phg-media img{ 
  width:100%; height:100%; object-fit:cover; display:block; 
}

/* Section auteur à droite */
.post-header-grid .phg-meta{
  display:flex; flex-direction:column; gap:.5rem;
  border:1px solid #e7e3da; border-radius:12px; background:#fff; 
  padding:.75rem .9rem;
}
.phg-meta .author-row{ 
  display:flex; align-items:center; gap:.8rem; 
}
.phg-meta .author-row img{ 
  width:85px; height:85px; border-radius:50%; object-fit:cover; 
  border:2px solid #e7e3da; transition:all .2s ease;
}
.phg-meta .author-row img:hover{ 
  border-color:#1E3985; transform:scale(1.05); 
  box-shadow:0 4px 12px rgba(30,57,133,.2);
}
.phg-meta .a-label{ 
  font-size:.85rem; color:#1E3985; font-weight:600; 
  margin-bottom:.25rem;
}
.phg-meta .author-row .a-name{ font-weight:700; font-size:1.1rem; }
.phg-meta .author-row .a-name a{ color:#1E3985; text-decoration:none; }
.phg-meta .author-row .a-name a:hover{ text-decoration:underline; }
.phg-meta .a-meta-line{ font-size:.9rem; color:#666; font-weight:600; margin-top:.25rem; }
.phg-meta .a-actions{ 
  display:flex; gap:.4rem; margin-top:.6rem; flex-wrap:wrap;
}
.phg-meta .a-actions .pill{
  background:#f8f9fa; color:#1E3985; border-radius:6px;
  padding:.3rem .6rem; font-size:.75rem; text-decoration:none; font-weight:600;
  transition:all .2s ease; cursor:pointer; display:inline-block;
  border:1px solid #e9ecef;
}
.phg-meta .a-actions .pill:hover{
  background:#1E3985; color:#fff; transform:translateY(-1px);
  box-shadow:0 3px 8px rgba(30,57,133,.25);
}

.post-header-grid .phg-meta{
  display:flex; flex-direction:column; gap:.5rem;
  border:1px solid #e7e3da; border-radius:12px; background:#fff; padding:.75rem .9rem;
}
.phg-meta .author-row{ 
  display:flex; align-items:center; gap:.8rem; 
}
.phg-meta .author-row img{ 
  width:80px; height:80px; border-radius:50%; object-fit:cover; 
  border:2px solid #e7e3da; transition:all .2s ease;
}
.phg-meta .author-row img:hover{ 
  border-color:#1E3985; transform:scale(1.05); 
  box-shadow:0 4px 12px rgba(30,57,133,.2);
}
.phg-meta .a-label{ 
  font-size:.85rem; color:#1E3985; font-weight:600; 
  margin-bottom:.25rem;
}
.phg-meta .author-row .a-name{ font-weight:700; font-size:1.2rem; }
.phg-meta .author-row .a-name a{ color:#1E3985; text-decoration:none; }
.phg-meta .author-row .a-name a:hover{ text-decoration:underline; }
.phg-meta .a-meta-line{ font-size:.9rem; color:#666; font-weight:600; margin-top:.25rem; }
.phg-meta .a-actions{ 
  display:flex; gap:.4rem; margin-top:.6rem; flex-wrap:wrap;
}
.phg-meta .a-actions .pill{
  background:#f8f9fa; color:#1E3985; border-radius:6px;
  padding:.3rem .6rem; font-size:.75rem; text-decoration:none; font-weight:600;
  transition:all .2s ease; cursor:pointer; display:inline-block;
  border:1px solid #e9ecef; /* Style plus subtil */
}
.phg-meta .a-actions .pill:hover{
  background:#1E3985; color:#fff; transform:translateY(-1px);
  box-shadow:0 3px 8px rgba(30,57,133,.25);
}

@media (max-width: 767px){
  .post-header-grid{ 
    grid-template-columns:1fr; 
    gap:.5rem;
  }
  .post-header-grid .phg-media{ 
    grid-column:1; order:1;
  }
  .post-header-grid .phg-meta{  
    grid-column:1; order:2;
    padding:.5rem;
  }
  .phg-meta .author-row{
    flex-direction:column; text-align:center; gap:.5rem;
  }
  .phg-meta .author-row img{
    width:70px; height:70px;
  }
  .phg-meta .a-actions{
    justify-content:center; gap:.3rem;
  }
  .phg-meta .a-actions .pill{
    font-size:.7rem; padding:.25rem .5rem;
  }
}


/* ===== Books page ===== */
.books-header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin:.5rem 0 1rem}
.books-title{font-weight:800}
.books-filters{display:flex;flex-wrap:wrap;gap:.5rem}
.filter-pill{border:1px solid #e7e3da;background:#f7f6f2;border-radius:999px;padding:.35rem .7rem;font-size:.9rem;cursor:pointer}
.filter-pill[aria-pressed="true"]{background:#1E3985;color:#fff;border-color:#1E3985}

.books-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:1rem}
.book-card{position:relative;border:1px solid #e7e3da;border-radius:12px;background:#fff;overflow:hidden;transition:transform .12s ease, box-shadow .12s ease}
.book-card:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.06)}
.book-card .cover{display:block;aspect-ratio:3/4;background:#f6f5f2}
.book-card .cover img{width:100%;height:100%;object-fit:cover;display:block}
.book-card .meta{padding:.6rem .7rem}
.book-card .title{font-weight:800;margin:0 0 .25rem}
.book-card .title a{text-decoration:none;color:inherit}
.book-card .author{font-size:.9rem;color:#666;margin-bottom:.35rem}
.book-card .badges{display:flex;gap:.35rem;flex-wrap:wrap}
.badge{font-size:.75rem;border:1px solid #e7e3da;background:#f7f6f2;border-radius:999px;padding:.15rem .5rem}
.badge.free{background:#e9f7ec;border-color:#ccead3}
.badge.pdf{background:#eef3ff;border-color:#d5e1ff}
.badge.lang{background:#faf4e6;border-color:#f0e2c4}

.book-card .hover{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:.8rem;opacity:0;background:rgba(255,255,255,.85);transition:opacity .15s}
.book-card:hover .hover{opacity:1}
.book-card .action{width:42px;height:42px;display:grid;place-items:center;border-radius:50%;border:1px solid #e7e3da;background:#fff;color:#111;text-decoration:none;font-size:1.05rem}

.gh-pagination{margin:1rem 0}
.pagination-ar{display:flex;align-items:center;justify-content:center;gap:.75rem;margin-bottom:1rem}
.pagination-ar a{
  background:#f7f6f2;
  border:1px solid #e7e3da;
  border-radius:8px;
  padding:.5rem .75rem;
  text-decoration:none;
  color:#333;
  font-weight:600;
  transition:all .2s ease;
}
.pagination-ar a:hover{
  background:#1E3985;
  color:#fff;
  border-color:#1E3985;
}
.pagination-ar .page-xofy{
  background:#1E3985;
  color:#fff;
  border-radius:8px;
  padding:.5rem .75rem;
  font-weight:600;
  min-width:140px;
  text-align:center;
}
.pagination-progress-ar{height:8px;background:#e7e3da;border-radius:999px;overflow:hidden;margin:.5rem auto 1.5rem;width:min(560px,80%)}
.pagination-progress-ar>span{display:block;height:8px;background:linear-gradient(90deg,#1E3985,#2a4a9e);border-radius:999px;transition:width .3s ease}


/* ===== Authors page ===== */
.authors-header{display:flex;align-items:center;gap:.75rem;justify-content:space-between;margin:1rem 0}
.authors-title{font-weight:800;margin:0}
.authors-filter{padding:.45rem .6rem;border:1px solid #e7e3da;border-radius:10px;background:#fff}

.authors-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:1rem;margin:1rem 0}
.author-card{display:flex;gap:.75rem;align-items:center;border:1px solid #e7e3da;background:#fff;border-radius:12px;padding:.65rem .75rem}
.author-card .avatar{width:56px;height:56px;border-radius:50%;overflow:hidden;display:block;flex:0 0 56px}
.author-card .avatar img{width:100%;height:100%;object-fit:cover;display:block}
.avatar-fallback{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;background:#f1efe8;color:#222;font-weight:800}
.ameta{flex:1}
.aname{font-weight:800;margin:0 0 .2rem}
.aname a{text-decoration:none;color:inherit}
.astats{display:flex;flex-wrap:wrap;gap:.35rem;margin:.2rem 0 .4rem}
.badge{font-size:.8rem;border:1px solid #e7e3da;background:#f7f6f2;border-radius:999px;padding:.15rem .5rem}
.badge.free{background:#e9f7ec;border-color:#ccead3}
.badge.pdf{background:#eef3ff;border-color:#d5e1ff}
.badge.lang{background:#faf4e6;border-color:#f0e2c4}

.alink{font-size:.85rem;color:#1E3985;text-decoration:none}
.alink:hover{text-decoration:underline}
.authors-note{margin:1rem 0;color:#666;font-size:.9rem}

/* ===== Author page (author.hbs) ===== */
.author-hero{
  display:grid; grid-template-columns: 80px 1fr; gap:1rem;
  align-items:center; padding:1rem; border:1px solid #e7e3da;
  background:#fff; border-radius:12px; margin:1rem 0;
}
.a-avatar{width:80px;height:80px;border-radius:50%;overflow:hidden}
.a-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.avatar-fallback{width:80px;height:80px;border-radius:50%;display:grid;place-items:center;background:#f1efe8;font-weight:800}
.a-name{margin:.1rem 0 .35rem;font-weight:800}
.a-bio{margin:0 0 .5rem;color:#555}
.a-meta{display:flex;flex-wrap:wrap;gap:.35rem .5rem}
.badge{font-size:.8rem;border:1px solid #e7e3da;background:#f7f6f2;border-radius:999px;padding:.15rem .5rem}
.alink{color:#1E3985;text-decoration:none}
.alink:hover{text-decoration:underline}

.post-feed{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:1rem;margin:1rem 0}
.post-card{
  border:1px solid #e7e3da;
  background:#fff;
  border-radius:12px;
  padding:.75rem;
  display: grid;
  grid-template-columns: 1fr 200px;
  grid-template-areas: 
    "content image"
    "tags image";
  gap: 1rem;
  align-items: start;
}

.post-card-content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.post-card-image-link {
  grid-area: image;
  align-self: start;
}

.post-card-image{
  width: 100%;
  height: 120px;
  max-width: 200px;
  max-height: 180px;
  border-radius:10px;
  object-fit: cover;
  display: block;
}

.post-card-tags {
  grid-area: tags;
}

/* Version mobile : retour à la disposition verticale */
@media (max-width: 768px) {
  .post-card {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "image"
      "content"
      "tags";
  }
  
  .post-card-image {
    max-width: 100%;
    height: 200px;
  }
}
/* ===== STYLES DES TITRES D'ARTICLES (MODIFICATION FACILE) ===== */
.post-card-title{
  font-size:1.05rem;
  margin:.5rem 0 .25rem;
  /* Couleur du titre basée sur les couleurs du logo/thème */
  color: var(--article-title-color);
  font-weight: 700;
}

.post-card-title a {
  /* Lien du titre : hérite la couleur personnalisée */
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-card-title a:hover {
  /* Effet au survol : couleur légèrement différente */
  color: var(--article-title-hover);
  text-decoration: none;
}
.post-card-meta{color:#666;font-size:.9rem;margin-bottom:.35rem}
.post-card-excerpt{color:#555;font-size:.95rem;line-height:1.5;margin-top:.5rem}
.tag-pill{display:inline-block;margin:.15rem;border:1px solid #e7e3da;background:#f7f6f2;border-radius:999px;padding:.1rem .45rem;font-size:.7rem}

/* ===== Dark theme support ===== */
[data-theme="dark"] .m-author-card,
body.m-dark .m-author-card{
  border-color: #333842;
  background: #1c1e23;
}
[data-theme="dark"] .m-author-card .m-sub,
body.m-dark .m-author-card .m-sub{
  color: #aaa;
}
[data-theme="dark"] .m-pill,
body.m-dark .m-pill{
  background: #22252a;
  border-color: #333842;
}
[data-theme="dark"] .post-header-grid .phg-meta,
body.m-dark .post-header-grid .phg-meta{
  border-color: #333842;
  background: #1c1e23;
}
[data-theme="dark"] .phg-meta .a-stats,
body.m-dark .phg-meta .a-stats{
  color: #aaa;
}
[data-theme="dark"] .phg-meta .a-actions .pill,
body.m-dark .phg-meta .a-actions .pill{
  background: #22252a;
  border-color: #333842;
}
[data-theme="dark"] .filter-pill,
body.m-dark .filter-pill{
  border-color: #333842;
  background: #22252a;
  color: #f2f2f2;
}
[data-theme="dark"] .book-card,
body.m-dark .book-card{
  border-color: #333842;
  background: #1c1e23;
}
[data-theme="dark"] .badge,
body.m-dark .badge{
  border-color: #333842;
  background: #22252a;
  color: #f2f2f2;
}
[data-theme="dark"] .author-card,
body.m-dark .author-card{
  border-color: #333842;
  background: #1c1e23;
}
[data-theme="dark"] .astats,
body.m-dark .astats{
  color: #aaa;
}
[data-theme="dark"] .alink,
body.m-dark .alink{
  color: #4ea99f;
}
[data-theme="dark"] .author-hero,
body.m-dark .author-hero{
  border-color: #333842;
  background: #1c1e23;
}
[data-theme="dark"] .a-bio,
body.m-dark .a-bio{
  color: #aaa;
}
[data-theme="dark"] .post-card,
body.m-dark .post-card{
  border-color: #333842;
  background: #1c1e23;
}
[data-theme="dark"] .post-card-meta,
body.m-dark .post-card-meta{
  color: #aaa;
}
[data-theme="dark"] .post-card-excerpt,
body.m-dark .post-card-excerpt{
  color: #bbb;
}

/* Dark theme pagination */
[data-theme="dark"] .pagination-ar a,
body.m-dark .pagination-ar a{
  background: #22252a;
  border-color: #333842;
  color: #f2f2f2;
}
[data-theme="dark"] .pagination-ar a:hover,
body.m-dark .pagination-ar a:hover{
  background: #4ea99f;
  border-color: #4ea99f;
}
[data-theme="dark"] .pagination-progress-ar,
body.m-dark .pagination-progress-ar{
  background: #333842;
}

/* Styles pour les actions relocalisées */
.m-quick-actions-relocated{
  display: flex;
  gap: .75rem;
  margin: 1rem 0;
  justify-content: center;
}
.m-quick-actions-relocated .m-pill{
  background: #f8f9fa;
  border: 1px solid #e7e3da;
  border-radius: 8px;
  padding: .5rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  color: #1E3985;
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
}
.m-quick-actions-relocated .m-pill:hover{
  background: #1E3985;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30,57,133,.2);
}

/* Mode sombre pour le header grid */
[data-theme="dark"] .phg-meta .a-label,
body.m-dark .phg-meta .a-label{
  color: #4ea99f;
}
[data-theme="dark"] .phg-meta .author-row .a-name a,
body.m-dark .phg-meta .author-row .a-name a{
  color: #4ea99f;
}
[data-theme="dark"] .phg-meta .a-meta-line,
body.m-dark .phg-meta .a-meta-line{
  color: #aaa;
}
[data-theme="dark"] .phg-meta .a-actions .pill,
body.m-dark .phg-meta .a-actions .pill{
  background: #22252a;
  border-color: #333842;
  color: #4ea99f;
}
[data-theme="dark"] .phg-meta .a-actions .pill:hover,
body.m-dark .phg-meta .a-actions .pill:hover{
  background: #4ea99f;
  color: #fff;
}

/* Mode sombre pour les actions relocalisées */
[data-theme="dark"] .m-quick-actions-relocated .m-pill,
body.m-dark .m-quick-actions-relocated .m-pill{
  background: #22252a;
  border-color: #333842;
  color: #4ea99f;
}
[data-theme="dark"] .m-quick-actions-relocated .m-pill:hover,
body.m-dark .m-quick-actions-relocated .m-pill:hover{
  background: #4ea99f;
  color: #fff;
}

/* ===== POST EXCERPT PREVIEW FOR PAYWALL ===== */
.post-excerpt-preview {
  position: relative;
  margin-bottom: 0;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #374151;
}

.post-excerpt-preview p {
  margin-bottom: 20px;
}

.excerpt-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, #ffffff);
  pointer-events: none;
}

/* Dark mode for excerpt preview */
@media (prefers-color-scheme: dark) {
  .post-excerpt-preview {
    color: #d1d5db;
  }
  
  .excerpt-fade {
    background: linear-gradient(transparent, #111827);
  }
}

[data-theme="dark"] .post-excerpt-preview,
body.m-dark .post-excerpt-preview {
  color: #d1d5db;
}

[data-theme="dark"] .excerpt-fade,
body.m-dark .excerpt-fade {
  background: linear-gradient(transparent, #111827);
}

/* ===== AUTHOR PAGE POSTS GRID (2 COLUMNS) ===== */
.author-posts-feed {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.author-posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.author-post-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid #f1f5f9;
}

.author-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  border-color: #e2e8f0;
}

.author-post-image-link {
  display: block;
  text-decoration: none;
}

.author-post-image-container,
.author-post-image-placeholder {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.author-post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.author-post-card:hover .author-post-image {
  transform: scale(1.05);
}

.author-post-image-placeholder {
  color: #94a3b8;
  font-size: 2.5rem;
}

.author-post-content {
  padding: 24px;
}

.author-post-title {
  margin: 0 0 12px;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
}

.author-post-title a {
  color: #1e40af;
  text-decoration: none;
  transition: color 0.3s ease;
}

.author-post-title a:hover {
  color: #2b2bb2;
}

.author-post-meta {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-post-excerpt {
  color: #4b5563;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 16px;
}

.author-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.author-post-tags .tag-pill {
  background: #f1f5f9;
  color: #475569;
  padding: 4px 10px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.author-post-tags .tag-pill:hover {
  background: #e2e8f0;
  color: #334155;
}

/* Dark mode for author posts */
@media (prefers-color-scheme: dark) {
  .author-post-card {
    background: #1f2937;
    border-color: #374151;
  }
  
  .author-post-card:hover {
    border-color: #4b5563;
  }
  
  .author-post-image-container,
  .author-post-image-placeholder {
    background: #111827;
  }
  
  .author-post-image-placeholder {
    color: #6b7280;
  }
  
  .author-post-title a {
    color: #60a5fa;
  }
  
  .author-post-title a:hover {
    color: #93c5fd;
  }
  
  .author-post-meta {
    color: #9ca3af;
  }
  
  .author-post-excerpt {
    color: #d1d5db;
  }
  
  .author-post-tags .tag-pill {
    background: #374151;
    color: #d1d5db;
  }
  
  .author-post-tags .tag-pill:hover {
    background: #4b5563;
    color: #f3f4f6;
  }
}

[data-theme="dark"] .author-post-card,
body.m-dark .author-post-card {
  background: #1f2937;
  border-color: #374151;
}

[data-theme="dark"] .author-post-card:hover,
body.m-dark .author-post-card:hover {
  border-color: #4b5563;
}

[data-theme="dark"] .author-post-image-container,
[data-theme="dark"] .author-post-image-placeholder,
body.m-dark .author-post-image-container,
body.m-dark .author-post-image-placeholder {
  background: #111827;
}

[data-theme="dark"] .author-post-image-placeholder,
body.m-dark .author-post-image-placeholder {
  color: #6b7280;
}

[data-theme="dark"] .author-post-title a,
body.m-dark .author-post-title a {
  color: #60a5fa;
}

[data-theme="dark"] .author-post-title a:hover,
body.m-dark .author-post-title a:hover {
  color: #93c5fd;
}

[data-theme="dark"] .author-post-meta,
body.m-dark .author-post-meta {
  color: #9ca3af;
}

[data-theme="dark"] .author-post-excerpt,
body.m-dark .author-post-excerpt {
  color: #d1d5db;
}

[data-theme="dark"] .author-post-tags .tag-pill,
body.m-dark .author-post-tags .tag-pill {
  background: #374151;
  color: #d1d5db;
}

[data-theme="dark"] .author-post-tags .tag-pill:hover,
body.m-dark .author-post-tags .tag-pill:hover {
  background: #4b5563;
  color: #f3f4f6;
}

/* Responsive design for author posts */
@media (max-width: 768px) {
  .author-posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .author-post-image-container,
  .author-post-image-placeholder {
    height: 180px;
  }
  
  .author-post-content {
    padding: 20px;
  }
  
  .author-post-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .author-posts-feed {
    padding: 0 15px;
  }
  
  .author-post-image-container,
  .author-post-image-placeholder {
    height: 160px;
  }
  
  .author-post-content {
    padding: 16px;
  }
}

/* =========================
   ERROR HANDLING STYLES
   ========================= */

/* Styles pour les champs en erreur */
.field-error,
input.field-error,
textarea.field-error,
select.field-error {
  border: 2px solid #ef4444 !important;
  background-color: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
  border-color: #ef4444;
  background-color: #fef2f2;
}

.form-group.has-error label {
  color: #dc2626;
}

/* Messages d'erreur */
.error-message {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
  font-weight: 500;
  line-height: 1.4;
}

.error-message.show {
  display: block;
}

.error-message:before {
  content: "⚠️ ";
  margin-left: 0.25rem;
}

/* Messages d'erreur globaux */
.global-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 0;
  text-align: center;
  position: relative;
  z-index: 1000;
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.global-success {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0c4a6e;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 0;
  text-align: center;
  position: relative;
  z-index: 1000;
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.error-content,
.success-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.error-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.5rem;
  cursor: pointer;
  margin-right: auto;
  padding: 0;
  line-height: 1;
}

.error-close:hover {
  opacity: 0.7;
}

.error-icon,
.success-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Animation d'apparition des erreurs */
.global-error,
.global-success {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Mode sombre pour les erreurs */
body.m-dark .field-error,
body.m-dark input.field-error,
body.m-dark textarea.field-error,
body.m-dark select.field-error {
  border-color: #f87171 !important;
  background-color: #431a1a !important;
}

body.m-dark .form-group.has-error input,
body.m-dark .form-group.has-error textarea,
body.m-dark .form-group.has-error select {
  border-color: #f87171;
  background-color: #431a1a;
}

body.m-dark .error-message {
  color: #fca5a5;
}

body.m-dark .global-error {
  background: #431a1a;
  border-color: #991b1b;
  color: #fca5a5;
}

body.m-dark .global-success {
  background: #164e63;
  border-color: #0891b2;
  color: #7dd3fc;
}

/* Responsive pour les erreurs */
@media (max-width: 768px) {
  .global-error,
  .global-success {
    font-size: 0.875rem;
    padding: 0.75rem;
    margin: 0 1rem;
    border-radius: 0.375rem;
  }
  
  .error-content,
  .success-content {
    flex-direction: column;
    text-align: center;
    gap: 0.25rem;
  }
  
  .error-close {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    margin: 0;
  }
  
  .error-message {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .global-error,
  .global-success {
    margin: 0 0.5rem;
    padding: 0.5rem;
    font-size: 0.8rem;
  }
  
  .error-icon,
  .success-icon {
    font-size: 1rem;
  }
}

/* ===== NOUVELLE INTERFACE D'AUTHENTIFICATION v7.9.18 ===== */

/* Zone d'authentification dans le header */
.auth-buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  margin-right: 1rem;
}

.signup-btn {
  background: linear-gradient(135deg, #1E3985 0%, #19306F 100%) !important;
  color: white !important;
  border: none !important;
  padding: 0.75rem 1.25rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 8px rgba(30, 57, 133, 0.2) !important;
}

.signup-btn:hover {
  background: linear-gradient(135deg, #19306F 0%, #1E3985 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(30, 57, 133, 0.3) !important;
}

.login-link {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.login-prompt {
  color: #666;
  font-size: 0.8rem;
}

.signin-link {
  color: #1E3985 !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  padding: 0.25rem 0.5rem !important;
  border-radius: 4px !important;
  transition: all 0.2s ease !important;
}

.signin-link:hover {
  background: rgba(30, 57, 133, 0.1) !important;
  color: #19306F !important;
}

/* Zone membre connecté */
.member-area {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.welcome-message {
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, rgba(30, 57, 133, 0.1) 0%, rgba(25, 48, 111, 0.15) 100%);
  border-radius: 6px;
  border: 1px solid rgba(30, 57, 133, 0.2);
}

.welcome-text {
  color: #1E3985;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Dropdown membre */
.member-dropdown {
  position: relative;
}

.member-toggle {
  background: #1E3985 !important;
  color: white !important;
  border: none !important;
  padding: 0.6rem 0.75rem !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  width: 40px !important;
  height: 40px !important;
  justify-content: center !important;
}

.member-toggle:hover {
  background: #19306F !important;
  transform: scale(1.05) !important;
}

.member-toggle[aria-expanded="true"] {
  background: #19306F !important;
}

.member-toggle[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.member-icon {
  font-size: 1.1rem;
}

.dropdown-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
  display: none; /* Masqué par défaut car on utilise l'icône circulaire */
}

.member-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.member-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.member-menu-item {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: 0.75rem 1rem !important;
  color: #333 !important;
  text-decoration: none !important;
  font-size: 0.9rem !important;
  transition: all 0.2s ease !important;
  border-bottom: 1px solid #f5f5f5;
}

.member-menu-item:last-child {
  border-bottom: none;
}

.member-menu-item:hover {
  background: #f8f9fa !important;
  color: #1E3985 !important;
}

.member-menu-item.upgrade {
  background: rgba(255, 193, 7, 0.1) !important;
  color: #e68900 !important;
}

.member-menu-item.upgrade:hover {
  background: rgba(255, 193, 7, 0.2) !important;
}

.member-menu-item.signout {
  color: #dc3545 !important;
}

.member-menu-item.signout:hover {
  background: rgba(220, 53, 69, 0.1) !important;
  color: #c82333 !important;
}

.menu-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.menu-divider {
  margin: 0.5rem 0;
  border: none;
  border-top: 1px solid #e0e0e0;
}

/* Responsive mobile */
@media (max-width: 768px) {
  .auth-buttons {
    margin-right: 0;
    align-items: center;
    gap: 0.75rem;
  }
  
  .signup-btn {
    padding: 0.6rem 1rem !important;
    font-size: 0.9rem !important;
  }
  
  .login-link {
    align-items: center;
    text-align: center;
  }
  
  .member-area {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .welcome-message {
    padding: 0.4rem 0.6rem;
  }
  
  .welcome-text {
    font-size: 0.9rem;
  }
  
  .member-menu {
    right: -20px;
    min-width: 180px;
  }
}

@media (max-width: 480px) {
  .auth-buttons {
    width: 100%;
  }
  
  .signup-btn {
    width: 100%;
    text-align: center;
  }
  
  .member-area {
    width: 100%;
  }
  
  .welcome-message {
    text-align: center;
    width: 100%;
  }
}

/* ===== PAGE CONTACT REDESIGN v7.9.18 ===== */

/* En-tête de page Contact */
.contact-header {
  margin-bottom: 2rem;
}

.page-hero {
  text-align: center;
  padding: 2rem 0;
  background: linear-gradient(135deg, rgba(30, 57, 133, 0.05) 0%, rgba(25, 48, 111, 0.1) 100%);
  border-radius: 12px;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1E3985;
  margin: 0 0 1rem;
  text-align: center;
}

.page-subtitle {
  font-size: 1.1rem;
  color: #666;
  margin: 0;
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.contact-main {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* Sections */
.contact-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: #1E3985;
  margin: 0 0 0.5rem;
}

.section-description {
  color: #666;
  font-size: 1rem;
  margin: 0;
  line-height: 1.5;
}

/* Grille des méthodes de contact */
.contact-methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.contact-method-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.contact-method-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1E3985 0%, #19306F 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.contact-method-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(30, 57, 133, 0.15);
  border-color: #1E3985;
}

.contact-method-card:hover::before {
  transform: scaleX(1);
}

.method-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.email-method .method-icon {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.whatsapp-method .method-icon {
  background: rgba(37, 211, 102, 0.1);
  color: #25d366;
}

.phone-method .method-icon {
  background: rgba(30, 57, 133, 0.1);
  color: #1E3985;
}

.contact-method-card:hover .method-icon {
  transform: scale(1.1);
}

.method-content {
  flex: 1;
  min-width: 0;
}

.method-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 0.25rem;
}

.method-description {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.method-action {
  font-size: 0.85rem;
  color: #1E3985;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.contact-method-card:hover .method-action {
  opacity: 1;
}

/* Formulaire de contact */
.contact-form-container {
  max-width: 600px;
  margin: 0 auto;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
  padding: 0.875rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
  direction: rtl;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #1E3985;
  box-shadow: 0 0 0 3px rgba(30, 57, 133, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #1E3985 0%, #19306F 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(30, 57, 133, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 57, 133, 0.4);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #666;
  font-size: 0.85rem;
  text-align: center;
}

/* Messages d'alerte */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-top: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 2px solid;
}

.alert-success {
  background: rgba(34, 197, 94, 0.05);
  border-color: #22c55e;
  color: #15803d;
}

.alert-error {
  background: rgba(239, 68, 68, 0.05);
  border-color: #ef4444;
  color: #dc2626;
}

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.alert-content h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.alert-content p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Section invitation */
.invitation-section {
  background: linear-gradient(135deg, #1E3985 0%, #19306F 100%);
  color: white;
  border-radius: 12px;
  padding: 2rem;
}

/* Mode sombre */
[data-theme="dark"], body.m-dark {
  .contact-section {
    background: #1a1a1a;
    border-color: #333;
  }
  
  .page-hero {
    background: linear-gradient(135deg, rgba(30, 57, 133, 0.1) 0%, rgba(25, 48, 111, 0.15) 100%);
  }
  
  .page-title {
    color: #4ea99f;
  }
  
  .section-title {
    color: #4ea99f;
  }
  
  .page-subtitle,
  .section-description {
    color: #ccc;
  }
  
  .contact-method-card {
    background: #1a1a1a;
    border-color: #333;
    color: #f2f2f2;
  }
  
  .contact-method-card:hover {
    border-color: #4ea99f;
  }
  
  .method-title {
    color: #f2f2f2;
  }
  
  .method-description {
    color: #ccc;
  }
  
  .method-action {
    color: #4ea99f;
  }
  
  .form-label {
    color: #f2f2f2;
  }
  
  .form-input,
  .form-select,
  .form-textarea {
    background: #1a1a1a;
    border-color: #333;
    color: #f2f2f2;
  }
  
  .form-input:focus,
  .form-select:focus,
  .form-textarea:focus {
    border-color: #4ea99f;
    box-shadow: 0 0 0 3px rgba(78, 169, 159, 0.1);
  }
  
  .privacy-note {
    color: #ccc;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .page-title {
    font-size: 2rem;
  }
  
  .page-subtitle {
    font-size: 1rem;
  }
  
  .contact-methods-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .contact-section {
    padding: 1.5rem;
  }
  
  .contact-method-card {
    padding: 1.25rem;
  }
  
  .method-icon {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .page-hero {
    padding: 1.5rem 1rem;
  }
  
  .contact-section {
    padding: 1rem;
  }
  
  .contact-form-container {
    width: 100%;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}