/**
 * ========================================
 * COMMON.CSS - Styles communs à tous les templates de blog
 * PlaneteAfrique - Blog System
 * ========================================
 */

/* ========================================
   RESET & VARIABLES
   ======================================== */

:root {
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --text-color: #333;
    --text-light: #495057;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-dark: rgba(0, 0, 0, 0.3);
    --transition-speed: 0.3s;
    --bg-header: #dbb15d;
    --bg-main: #fef8ec;
    --text-color: #333;    
}
body.dark-mode {
    --bg-header: #2d2d2d;
    --bg-main: #1a1a1a;
    --text-color: #e0e0e0;
}
/* ========================================
   ONGLET D'OUVERTURE DU PANNEAU
   ======================================== */

.onglet {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    width: 50px;
    height: 60px;
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: -3px 0 10px var(--shadow-medium);
    z-index: 9997;
    transition: all var(--transition-speed) ease;
}

.onglet:hover {
    width: 55px;
    box-shadow: -5px 0 15px var(--shadow-dark);
}

.onglet img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
    transition: transform var(--transition-speed) ease;
}

.onglet:hover img {
    transform: scale(1.1);
}

/* Masquer l'onglet quand le panneau est ouvert */
.infos.open ~ .onglet {
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   SUPERPOSITION (OVERLAY)
   ======================================== */

.superposition {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    cursor: pointer;
    pointer-events: auto; /* ✅ AJOUTER */
}

/* ========================================
   PANNEAU LATÉRAL
   ======================================== */

.infos {
    position: fixed;
    top: 0;
    right: -599px;
    width: 599px;
    height: 100vh;
    background: var(--bg-light);
    box-shadow: -5px 0 20px var(--shadow-medium);
    transition: right var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000; /* ✅ Plus haut que la superposition */
    overflow: hidden;
    border-radius: 20px 0 0 20px;
    display: flex;
    flex-direction: column;
    pointer-events: auto; /* ✅ AJOUTER */
}

.infos.open {
    right: 0;
}

.panneau-content,
.panneau-header,
.close-panneau,
.items_partages,
.category-link {
    pointer-events: auto !important; /* ✅ S'assurer que tout est cliquable */
}

/* ========================================
   SUPERPOSITION (OVERLAY)
   ======================================== */

.superposition {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3 !important;
    cursor: pointer;
    pointer-events: auto; /* ✅ AJOUTER */
}

/* ========================================
   HEADER DU PANNEAU
   ======================================== */

.panneau-header {
    position: relative;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 2px 10px var(--shadow-light);
    z-index: 100;
    border-radius: 20px 0 0 0;
    margin: 0;
    display: flex;
  justify-content: space-around;
    align-items: center;
}

.panneau-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.close-panneau {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.close-panneau:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ========================================
   CONTENU DU PANNEAU (SCROLLABLE)
   ======================================== */

.panneau-content {
    padding: 20px;
    padding-bottom: 40px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.3) transparent;
}

/* Scrollbar personnalisée (Chrome/Safari) */
.panneau-content::-webkit-scrollbar {
    width: 6px;
}

.panneau-content::-webkit-scrollbar-track {
    background: transparent;
}

.panneau-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.panneau-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* ========================================
   SECTIONS DU PANNEAU
   ======================================== */

.panneau-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.panneau-section:last-child {
    border-bottom: none;
    margin-bottom: 20px;
    padding-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    margin-top: 5px;
}

.section-header img {
    width: 24px;
    height: 24px;
}

.section-header strong {
    font-size: 18px;
    color: var(--text-color);
}

/* ========================================
   CATÉGORIES
   ======================================== */

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--bg-white);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-light);
    transition: all var(--transition-speed) ease;
    border-left: 3px solid transparent;
}

.category-link:hover {
    background: #e9ecef;
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.category-name {
    font-weight: 500;
}

.category-count {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ========================================
   BOUTONS DE PARTAGE
   ======================================== */

.reseaux {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.items_partages {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
}

.items_partages:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.items_partages img {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
}

.items_partages p {
    margin: 0;
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.items_partages a {
    text-decoration: none;
    display: contents;
}

/* ========================================
   LIGHTBOX LIKE
   ======================================== */

.Like_lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.Like_lightbox.active {
    display: flex;
}

.Like_lightbox-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    height: 80vh;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px var(--shadow-dark);
    animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.Like_lightbox-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}


/* ========================================
   RESPONSIVE - TABLETTES
   ======================================== */

@media (max-width: 768px) {
    /* Panneau latéral */
    .infos {
        width: 85vw;
        right: -85vw;
        border-radius: 15px 0 0 15px;
    }
    
    .infos.open {
        right: 0;
    }
    
    /* Onglet */
    .onglet {
        width: 45px;
        height: 55px;
    }
    
    .onglet img {
        width: 20px;
        height: 20px;
    }
    
    /* Header */
    .panneau-header {
        padding: 15px;
        border-radius: 15px 0 0 0;
    }
    
    .panneau-header h3 {
        font-size: 18px;
    }
    
    .close-panneau {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    /* Contenu */
    .panneau-content {
        padding: 15px;
        padding-bottom: 30px;
    }
    
    /* Grille de partage - 2 colonnes */
    .reseaux {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .items_partages {
        padding: 12px;
    }
    
    .items_partages img {
        width: 28px;
        height: 28px;
    }
    
    .items_partages p {
        font-size: 12px;
    }
    
    /* Catégories */
    .category-link {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .category-count {
        font-size: 11px;
        padding: 2px 6px;
    }
    
    /* Lightbox */
    .Like_lightbox-content {
        width: 95%;
        height: 85vh;
        border-radius: 15px;
    }
    
    .close-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    /* Scroll arrow */
    .scroll-arrow {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .scroll-arrow::before {
        font-size: 20px;
    }
}

/* ========================================
   RESPONSIVE - MOBILES
   ======================================== */

@media (max-width: 480px) {
    .infos {
        width: 95vw;
        right: -95vw;
        border-radius: 10px 0 0 10px;
    }
    
    .panneau-header {
        border-radius: 10px 0 0 0;
        padding: 12px 15px;
    }
    
    .panneau-header h3 {
        font-size: 16px;
    }
    
    .panneau-content {
        padding: 10px;
        padding-bottom: 25px;
    }
    
    .section-header strong {
        font-size: 16px;
    }
    
    .onglet {
        width: 40px;
        height: 50px;
    }
    
    .onglet img {
        width: 18px;
        height: 18px;
    }
    
    .reseaux {
        gap: 8px;
    }
    
    .items_partages {
        padding: 10px;
    }
    
    .scroll-arrow {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    
    .scroll-arrow::before {
        font-size: 18px;
    }
}

/* ========================================
   UTILITAIRES
   ======================================== */

/* Bloquer le scroll du body quand le panneau est ouvert */
body.panneau-open {
    overflow: hidden;
}

/* Animation de fade in générique */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Classes utilitaires */
.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}



/* ========================================
   BOUTON DARK MODE DANS LE PANNEAU
   ======================================== */

.dark-mode-toggle-btn {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-right: 10px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(180deg);
}

/* Icônes soleil et lune */
.dark-mode-toggle-btn .sun-icon,
.dark-mode-toggle-btn .moon-icon {
    font-size: 18px;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Mode clair : afficher le soleil */
body:not(.dark-mode) .dark-mode-toggle-btn .sun-icon {
    opacity: 1;
    transform: scale(1);
}

body:not(.dark-mode) .dark-mode-toggle-btn .moon-icon {
    opacity: 0;
    transform: scale(0);
}

post_read_more {

    display: inline-block;
    border-radius: 4px;
    white-space: nowrap;
    padding: 0 10px;

}

.post_other_read_more {

    border-radius: 4px;
    white-space: nowrap;
    padding: 0 10px;
    float: right;
}

a:has(.post_other_read_more_small, .post_other_title_small) {
    text-decoration: none;
    font-size: 20px;
}


.post_other_title_small {
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--text-color);
    min-height: 50px;
    max-height: 50px;
}


/* Mode sombre : afficher la lune */
body.dark-mode .dark-mode-toggle-btn .sun-icon {
    opacity: 0;
    transform: scale(0);
}

body.dark-mode .dark-mode-toggle-btn .moon-icon {
    opacity: 1;
    transform: scale(1);
}

/* Responsive mobile */
@media (max-width: 768px) {
    .dark-mode-toggle-btn {
        width: 32px;
        height: 32px;
    }
    
    .dark-mode-toggle-btn .sun-icon,
    .dark-mode-toggle-btn .moon-icon {
        font-size: 16px;
    }
}

/* Affichage des statistiques (vues et commentaires) */
.post_date > div {
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
}

.post_other_date span {
    font-size: 0.9em;
    color: #666;
}

/* Mode sombre */
body.dark-mode .post_other_date span {
    color: #a0a0a0;
}

