/* Styles de base pour l'éditeur et le front */
.editor-styles-wrapper,
.entry-content {
    font-family: 'Inter', 'Roboto', sans-serif;
    font-size: 1.125rem;
    line-height: 1.9;
    color: #2D3748;
    max-width: 1140px;
    margin: 0 auto;
    padding: 2.5rem;
    background-color: #fff;
}

/* Bloc Paragraphe */
.editor-styles-wrapper p,
.entry-content p,
.editor-styles-wrapper .wp-block-paragraph,
.entry-content .wp-block-paragraph {
    margin-bottom: 2rem;
    color: #4A5568;
    font-size: 1.125rem;
    line-height: 1.5;
    letter-spacing: 0.015em;
}

.has-text-align-center {
    text-align: center;
}



/* Bloc Titres */
.editor-styles-wrapper h1, .editor-styles-wrapper h2, .editor-styles-wrapper h3,
.editor-styles-wrapper h4, .editor-styles-wrapper h5, .editor-styles-wrapper h6,
.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5, .entry-content h6,
.editor-styles-wrapper .wp-block-heading h1,
.editor-styles-wrapper .wp-block-heading h2,
.editor-styles-wrapper .wp-block-heading h3,
.editor-styles-wrapper .wp-block-heading h4,
.editor-styles-wrapper .wp-block-heading h5,
.editor-styles-wrapper .wp-block-heading h6,
.entry-content .wp-block-heading h1,
.entry-content .wp-block-heading h2,
.entry-content .wp-block-heading h3,
.entry-content .wp-block-heading h4,
.entry-content .wp-block-heading h5,
.entry-content .wp-block-heading h6 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.9;
    color: #222;
}

.editor-styles-wrapper h1,
.entry-content h1 { 
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid #D9534F;
    padding-bottom: 1rem;
}

.editor-styles-wrapper h2,
.entry-content h2 { 
    font-size: 2rem;
    color: #D9534F;
}

.editor-styles-wrapper h3,
.entry-content h3 { 
    font-size: 1.75rem;
    color: #667080;
}

.editor-styles-wrapper h4,
.entry-content h4 { 
    font-size: 1.5rem;
    color: #667080;
}

.editor-styles-wrapper h5,
.entry-content h5 { 
    font-size: 1.25rem;
    color: #667080;
}

.editor-styles-wrapper h6,
.entry-content h6 { 
    font-size: 1.1rem;
    color: #667080;
}

/* Bloc Image */
.editor-styles-wrapper .wp-block-image,
.entry-content .wp-block-image {
    margin: 2.5rem 0;
}

.editor-styles-wrapper .wp-block-image img,
.entry-content .wp-block-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.editor-styles-wrapper .wp-block-image figcaption,
.entry-content .wp-block-image figcaption {
    margin-top: 0.8rem;
    font-size: 0.9rem;
    color: #667080;
    text-align: center;
}

/* Bloc Galerie */
.editor-styles-wrapper .wp-block-gallery,
.entry-content .wp-block-gallery {
    margin: 3rem auto;
    padding: 0;
    max-width: 900px;
}

.editor-styles-wrapper .wp-block-gallery .blocks-gallery-grid,
.entry-content .wp-block-gallery .blocks-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 300px));
    gap: 4rem 6rem;
    margin: 0;
    padding: 0;
    list-style: none;
    position: relative;
    justify-content: center;
}

.editor-styles-wrapper .wp-block-gallery .blocks-gallery-item,
.entry-content .wp-block-gallery .blocks-gallery-item {
    position: relative;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
    width: 100%;
    height: auto;
    max-height: 225px;
}

.editor-styles-wrapper .wp-block-gallery .blocks-gallery-item:nth-child(n+3),
.entry-content .wp-block-gallery .blocks-gallery-item:nth-child(n+3) {
    position: relative;
}

.editor-styles-wrapper .wp-block-gallery .blocks-gallery-item:nth-child(n+3)::before,
.entry-content .wp-block-gallery .blocks-gallery-item:nth-child(n+3)::before {
    content: "";
    position: absolute;
    top: -2rem;
    left: -4rem;
    right: -4rem;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        #D9534F,
        transparent
    );
    opacity: 0.3;
}

.editor-styles-wrapper .wp-block-gallery .blocks-gallery-item figure,
.entry-content .wp-block-gallery .blocks-gallery-item figure {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-styles-wrapper .wp-block-gallery .blocks-gallery-item img,
.entry-content .wp-block-gallery .blocks-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.4s ease-out;
}

.editor-styles-wrapper .wp-block-gallery .blocks-gallery-item:hover img,
.entry-content .wp-block-gallery .blocks-gallery-item:hover img {
    transform: scale(1.04);
}

.editor-styles-wrapper .wp-block-gallery .blocks-gallery-item figcaption,
.entry-content .wp-block-gallery .blocks-gallery-item figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.5rem 1rem;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.6) 50%,
        transparent 100%);
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease-in-out;
}

.editor-styles-wrapper .wp-block-gallery .blocks-gallery-item:hover figcaption,
.entry-content .wp-block-gallery .blocks-gallery-item:hover figcaption {
    opacity: 1;
    transform: translateY(0);
}

/* Styles spécifiques pour les différentes colonnes */
@media (min-width: 768px) {
    .editor-styles-wrapper .wp-block-gallery.columns-2 .blocks-gallery-grid,
    .entry-content .wp-block-gallery.columns-2 .blocks-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .editor-styles-wrapper .wp-block-gallery.columns-3 .blocks-gallery-grid,
    .entry-content .wp-block-gallery.columns-3 .blocks-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .editor-styles-wrapper .wp-block-gallery.columns-4 .blocks-gallery-grid,
    .entry-content .wp-block-gallery.columns-4 .blocks-gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .editor-styles-wrapper .wp-block-gallery .blocks-gallery-grid,
    .entry-content .wp-block-gallery .blocks-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 280px));
        gap: 3rem 4rem;
    }
}

@media (max-width: 767px) {
    .editor-styles-wrapper .wp-block-gallery .blocks-gallery-grid,
    .entry-content .wp-block-gallery .blocks-gallery-grid {
        grid-template-columns: minmax(0, 350px);
        gap: 3rem;
    }

    .editor-styles-wrapper .wp-block-gallery .blocks-gallery-item,
    .entry-content .wp-block-gallery .blocks-gallery-item {
        max-height: 240px;
    }

    .editor-styles-wrapper .wp-block-gallery .blocks-gallery-item:not(:first-child)::before,
    .entry-content .wp-block-gallery .blocks-gallery-item:not(:first-child)::before {
        left: -2rem;
        right: -2rem;
    }
}

/* Alignements d'images */
.editor-styles-wrapper .aligncenter,
.entry-content .aligncenter {
    display: block;
    margin: 2.5rem auto;
    text-align: center;
}

.editor-styles-wrapper .alignleft,
.entry-content .alignleft {
    float: left;
    margin: 1rem 2rem 1rem 0;
    max-width: 50%;
}

.editor-styles-wrapper .alignright,
.entry-content .alignright {
    float: right;
    margin: 1rem 0 1rem 2rem;
    max-width: 50%;
}

/* Légendes d'images */
.editor-styles-wrapper .wp-caption,
.entry-content .wp-caption {
    max-width: 100%;
    margin: 2.5rem 0;
}

.editor-styles-wrapper .wp-caption-text,
.entry-content .wp-caption-text {
    margin-top: 0.8rem;
    font-size: 0.9rem;
    color: #667080;
    text-align: center;
    padding: 0.5rem;
    background-color: #f8f8f8;
    border-radius: 0 0 12px 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .editor-styles-wrapper,
    .entry-content {
        padding: 1.5rem;
    }

    .editor-styles-wrapper .alignleft,
    .editor-styles-wrapper .alignright,
    .entry-content .alignleft,
    .entry-content .alignright {
        float: none;
        margin: 2rem auto;
        max-width: 100%;
    }
    
    .editor-styles-wrapper .wp-block-gallery,
    .entry-content .wp-block-gallery {
        max-width: 100%;
    }

    .editor-styles-wrapper .wp-block-gallery .blocks-gallery-item,
    .entry-content .wp-block-gallery .blocks-gallery-item {
        max-height: 280px;
    }
}

/* Séparateurs */
.editor-styles-wrapper hr,
.editor-styles-wrapper .wp-block-separator,
.entry-content hr,
.entry-content .wp-block-separator {
    margin: 4rem auto;
    border: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #D9534F, transparent);
    width: 60%;
    opacity: 0.6;
    border-radius: 3px;
}

.editor-styles-wrapper .is-style-wide,
.entry-content .is-style-wide {
    max-width: 100%;
}

.editor-styles-wrapper .is-style-dots,
.entry-content .is-style-dots {
    border: none;
    text-align: center;
}

.editor-styles-wrapper .is-style-dots::before,
.entry-content .is-style-dots::before {
    content: "...";
    font-size: 2rem;
    letter-spacing: 1rem;
    color: #667080;
}

/* Bloc Citation */
.editor-styles-wrapper .wp-block-quote,
.entry-content .wp-block-quote,
.editor-styles-wrapper blockquote,
.entry-content blockquote {
    margin: 3rem 0;
    padding: 2rem;
    border-left: 4px solid #D9534F;
    background-color: rgba(244, 177, 94, 0.05);
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.editor-styles-wrapper .wp-block-quote cite,
.entry-content .wp-block-quote cite,
.editor-styles-wrapper blockquote cite,
.entry-content blockquote cite {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #667080;
    font-style: normal;
}

/* Bloc Liste */
.editor-styles-wrapper .wp-block-list,
.entry-content .wp-block-list,
.editor-styles-wrapper ul,
.editor-styles-wrapper ol,
.entry-content ul,
.entry-content ol {
    margin: 2.5rem 0;
    padding-left: 1.5rem;
}

.editor-styles-wrapper .wp-block-list li,
.entry-content .wp-block-list li,
.editor-styles-wrapper li,
.entry-content li {
    margin-bottom: 1rem;
    color: #4A5568;
    position: relative;
    padding-left: 1rem;
}

.editor-styles-wrapper ul li,
.entry-content ul li {
    list-style: none;
}

.editor-styles-wrapper ul li::before,
.entry-content ul li::before {
    content: "";
    position: absolute;
    left: -1rem;
    top: 0.75rem;
    width: 6px;
    height: 6px;
    background-color: #D9534F;
    border-radius: 50%;
}

/* Bloc Tableau */
.editor-styles-wrapper .wp-block-table,
.entry-content .wp-block-table,
.editor-styles-wrapper table,
.entry-content table {
    width: 100%;
    margin: 3rem 0;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.editor-styles-wrapper .wp-block-table td,
.editor-styles-wrapper .wp-block-table th,
.entry-content .wp-block-table td,
.entry-content .wp-block-table th,
.editor-styles-wrapper td,
.editor-styles-wrapper th,
.entry-content td,
.entry-content th {
    padding: 1rem;
    border: 1px solid #E7E7E7;
    text-align: left;
}

.editor-styles-wrapper th,
.entry-content th {
    background-color: #D9534F;
    color: #fff;
    font-weight: 700;
}

.editor-styles-wrapper tr:nth-child(even),
.entry-content tr:nth-child(even) {
    background-color: rgba(240, 240, 240, 0.3);
}

/* Liens */
.editor-styles-wrapper a,
.entry-content a {
    color: #E73C3F;
    text-decoration: none;
    border-bottom: 1px solid #D9534F;
    transition: all 0.3s ease;
}

.editor-styles-wrapper a:hover,
.entry-content a:hover {
    color: #d89c4e;
    border-bottom-color: #d89c4e;
}

/* Bloc Bouton */
.editor-styles-wrapper .wp-block-button,
.entry-content .wp-block-button {
    margin: 3rem 0;
}

.editor-styles-wrapper .wp-block-button__link,
.entry-content .wp-block-button__link {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 4px;
    background-color: #D9534F;
    color: #FFFFFF;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(244, 177, 94, 0.2);
}

.editor-styles-wrapper .wp-block-button__link:hover,
.entry-content .wp-block-button__link:hover {
    background-color: #d89c4e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 177, 94, 0.3);
}

.editor-styles-wrapper .is-style-outline .wp-block-button__link,
.entry-content .is-style-outline .wp-block-button__link {
    background-color: transparent;
    border: 2px solid #D9534F;
    color: #D9534F;
    box-shadow: none;
}

.editor-styles-wrapper .is-style-outline .wp-block-button__link:hover,
.entry-content .is-style-outline .wp-block-button__link:hover {
    background-color: #D9534F;
    color: #FFFFFF;
    transform: translateY(-2px);
}

/* Bloc Colonnes */
.editor-styles-wrapper .wp-block-columns,
.entry-content .wp-block-columns {
    display: grid;
    gap: 3rem;
    margin: 3rem 0;
}

@media (min-width: 768px) {
    .editor-styles-wrapper .wp-block-columns,
    .entry-content .wp-block-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Bloc Média et Texte */
.editor-styles-wrapper .wp-block-media-text,
.entry-content .wp-block-media-text {
    display: grid;
    gap: 3rem;
    margin: 3rem 0;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .editor-styles-wrapper .wp-block-media-text,
    .entry-content .wp-block-media-text {
        grid-template-columns: 1fr 1fr;
    }

    .editor-styles-wrapper .has-media-on-the-right .wp-block-media-text__content,
    .entry-content .has-media-on-the-right .wp-block-media-text__content {
        grid-column: 1;
        grid-row: 1;
    }

    .editor-styles-wrapper .has-media-on-the-right .wp-block-media-text__media,
    .entry-content .has-media-on-the-right .wp-block-media-text__media {
        grid-column: 2;
        grid-row: 1;
    }
}

/* Bloc Code */
.editor-styles-wrapper .wp-block-code,
.entry-content .wp-block-code,
.editor-styles-wrapper pre,
.entry-content pre {
    padding: 1.5rem;
    margin: 3rem 0;
    overflow-x: auto;
    border: 1px solid #E7E7E7;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background-color: #f8f8f8;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

/* Bloc Fichier */
.editor-styles-wrapper .wp-block-file,
.entry-content .wp-block-file {
    margin: 2rem 0;
}

.editor-styles-wrapper .wp-block-file .wp-block-file__button,
.entry-content .wp-block-file .wp-block-file__button {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #D9534F;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 4px;
    margin-left: 1rem;
}

/* Bloc Audio */
.editor-styles-wrapper .wp-block-audio,
.entry-content .wp-block-audio {
    margin: 2rem 0;
}

/* Bloc Vidéo */
.editor-styles-wrapper .wp-block-video,
.entry-content .wp-block-video {
    margin: 2rem 0;
}

.editor-styles-wrapper .wp-block-video video,
.entry-content .wp-block-video video {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* Bloc Embeds */
.editor-styles-wrapper .wp-block-embed,
.entry-content .wp-block-embed {
    margin: 2rem 0;
}

.editor-styles-wrapper .wp-block-embed iframe,
.entry-content .wp-block-embed iframe {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* Responsive */
@media (max-width: 768px) {
    .editor-styles-wrapper,
    .entry-content {
        padding: 1.5rem;
    }

    .editor-styles-wrapper .wp-block-columns,
    .entry-content .wp-block-columns {
        grid-template-columns: 1fr;
    }

    .editor-styles-wrapper .wp-block-media-text,
    .entry-content .wp-block-media-text {
        grid-template-columns: 1fr;
    }
}