/* Styles pour le rendu du contenu modulaire de l'éditeur */

/* Variables CSS pour l'éditeur WYSIWYG */
:root {
    --text: #333333;
    --text-light: #666666;
    --text-dark: #000000;
}

/* Structure générale du contenu */
.content-section {
    margin: 2rem 0;
}

.content-columns {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.content-column {
    flex: 1;
    min-width: 300px;
    padding: 0 1rem;
}

/* Modules de contenu */
.content-module {
    margin: 0 0 1.5rem 0;
    padding: 0;
}

/* Surcharge pour les modules de texte - pas de décoration */
.content-module-text {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin: 1rem 0;
}

/* Style de l'article */
.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #333;
}

/* Forcer la couleur sur tous les paragraphes de l'article */
.article-content p {
    color: #333 !important;
    margin: 0 0 0.75rem 0 !important;
}

/* Module texte - Style simplifié sans décoration */
.content-module-text {
    background: transparent;
    border-left: none;
    box-shadow: none;
    padding: 0;
    margin: 1rem 0;
}

/* Forcer la couleur sur tous les paragraphes (priorité maximale) */
p {
    color: #333;
}

/* Surcharge spécifique pour les paragraphes avec var(--text) */
p[style*="var(--text)"] {
    color: #333 !important;
}

/* Surcharge pour tous les paragraphes dans le contenu de l'article */
.article-content p[style*="var(--text)"] {
    color: #333 !important;
    margin: 0 0 0.25rem 0 !important;
}

.text-container {
    margin: 0;
}

.text-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #333;
    width: 100%; /* Utiliser toute la largeur disponible */
    margin: 0; /* Pas de centrage */
}

.text-content h1,
.text-content h2,
.text-content h3,
.text-content h4,
.text-content h5,
.text-content h6 {
    color: #2c3e50;
    margin: 1.5rem 0 1rem 0;
    font-weight: 600;
}

.text-content h1 { font-size: 2rem; }
.text-content h2 { font-size: 1.8rem; }
.text-content h3 { font-size: 1.5rem; }
.text-content h4 { font-size: 1.3rem; }
.text-content h5 { font-size: 1.1rem; }
.text-content h6 { font-size: 1rem; }

.text-content p {
    margin: 0 0 -0.25rem 0 !important;
    text-align: justify !important;
    text-justify: inter-word !important;
    color: #333 !important;
}

.text-content ul,
.text-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.text-content li {
    margin: 0.5rem 0;
}

.text-content blockquote {
    border-left: 4px solid #007bff;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #f8f9fa;
    font-style: italic;
    color: #555;
}

.text-content a {
    color: #007bff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.text-content a:hover {
    border-bottom-color: #007bff;
}

/* Module image */
.content-module-image {
    text-align: left;
    background: #ffffff;
}

.image-container {
    margin: 0;
}

.image-content img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

/* Contrainte des images dans les colonnes */
.content-column img {
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Responsive des images */
@media (max-width: 768px) {
    .content-column img {
        max-width: 100%;
        width: 100%;
    }
}

.image-caption {
    margin-top: 1rem;
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
}

/* Module vidéo */
.content-module-video {
    text-align: center;
    background: #ffffff;
    margin: 1.5rem 0;
}

.video-container {
    margin: 0;
    text-align: center;
    display: inline-block;
}

/* Alignements des vidéos */
.video-container.align-left {
    text-align: left;
}

.video-container.align-center {
    text-align: center;
}

.video-container.align-right {
    text-align: right;
}

.video-content {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.video-content iframe,
.video-content video {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Styles pour les vidéos avec dimensions personnalisées */
.video-container[style*="width"] {
    display: inline-block;
    max-width: 100%;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.video-container[style*="width"] iframe,
.video-container[style*="width"] video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    border: none !important;
    border-radius: 8px;
}

/* Responsive pour les vidéos avec dimensions personnalisées */
@media (max-width: 768px) {
    .video-container[style*="width"] {
        width: 100% !important;
        height: auto !important;
    }
    
    .video-container[style*="width"] iframe,
    .video-container[style*="width"] video {
        width: 100% !important;
        height: auto !important;
    }
}

/* Titre et description de la vidéo */
.video-title {
    margin-top: 1rem;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.video-description {
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* Module galerie */
.content-module-gallery {
    background: #ffffff;
    width: 100%;
    max-width: 100%;
}

.gallery-container {
    margin: 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

/* Styles pour les sliders */
.gallery-slider {
    position: relative;
    width: 100%;
    max-width: 100%;
    max-height: 600px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

.slider-track {
    display: flex;
    transition: transform 0.3s ease;
    width: 100%;
}

.slider-slide {
    min-width: 100%;
    flex-shrink: 0;
}

.slider-slide img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 215, 0, 0.9); /* Jaune belge */
    color: #000;
    border: 2px solid #FF0000; /* Rouge belge */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.slider-nav:hover {
    background: rgba(255, 215, 0, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.slider-prev {
    left: 15px;
}

.slider-next {
    right: 15px;
}

.slider-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 215, 0, 0.9); /* Jaune belge */
    color: #000;
    border: 2px solid #FF0000; /* Rouge belge */
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Styles pour les carousels */
.gallery-carousel {
    position: relative;
    width: 100%;
    max-width: 100%;
    max-height: 600px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    width: 100%;
}

.carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 215, 0, 0.9); /* Jaune belge */
    color: #000;
    border: 2px solid #FF0000; /* Rouge belge */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.carousel-nav:hover {
    background: rgba(255, 215, 0, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

.carousel-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 215, 0, 0.9); /* Jaune belge */
    color: #000;
    border: 2px solid #FF0000; /* Rouge belge */
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Styles pour les galeries masonry */
.gallery-masonry {
    position: relative;
    margin: 1rem 0;
}

.gallery-masonry .gallery-item {
    position: absolute;
    width: calc(33.333% - 0.67rem);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.gallery-masonry .gallery-item img {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .gallery-masonry .gallery-item {
        width: calc(50% - 0.5rem);
    }
}

@media (max-width: 480px) {
    .gallery-masonry .gallery-item {
        width: 100%;
    }
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: translateY(-2px);
}

/* Hauteur fixe pour les grilles normales */
.gallery-grid .gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Hauteur automatique pour le masonry */
.gallery-masonry .gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Lightbox overlay pour la galerie */
.gallery-item {
    position: relative;
    cursor: pointer;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    cursor: pointer;
}

.lightbox-overlay:hover {
    opacity: 1;
}

.gallery-item:hover .lightbox-overlay {
    opacity: 1;
}

/* Icône de recherche dans le lightbox */
.lightbox-overlay::before {
    content: "🔍";
    font-size: 2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Modal lightbox */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Bouton de fermeture */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Module séparateur */
.content-module-separator {
    text-align: center;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.separator-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, #007bff, transparent);
    margin: 2rem 0;
}

/* Module tableau */
.content-module-table {
    background: #ffffff;
    overflow-x: auto;
}

.table-container {
    margin: 0;
}

.table-content {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.table-content th,
.table-content td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.table-content th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table-content tr:hover {
    background: #f8f9fa;
}

/* Module citation */
.content-module-quote {
    background: #f8f9fa;
    border-left: 4px solid #28a745;
}

.quote-container {
    margin: 0;
}

.quote-content {
    font-style: italic;
    font-size: 1.2rem;
    color: #495057;
    margin: 0;
}

.quote-author {
    text-align: right;
    margin-top: 1rem;
    font-weight: 600;
    color: #6c757d;
}

/* Module liste */
.content-module-list {
    background: #f8f9fa;
    border-left: 4px solid #ffc107;
}

.list-container {
    margin: 0;
}

.list-content ul,
.list-content ol {
    margin: 0;
    padding-left: 2rem;
}

.list-content li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

/* Responsive design */
@media (max-width: 768px) {
    .content-columns {
        flex-direction: column;
        gap: 1rem;
    }
    
    .content-column {
        min-width: auto;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .text-content h1 { font-size: 1.8rem; }
    .text-content h2 { font-size: 1.6rem; }
    .text-content h3 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .content-module {
        padding: 0.75rem;
        margin: 1rem 0;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .text-content {
        font-size: 1rem;
    }
}
