/* public/css/blocks.css */

/* Base pour tous les blocs */
.content-block-wrapper {
    margin-bottom: 3rem;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bloc Texte */
.content-block-text {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-block-text h3 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 15px;
}

.content-block-text h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: #3498db;
}

.content-block-text .content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
}

/* Bloc Image */
.content-block-image {
    text-align: center;
    margin: 2rem 0;
}

.content-image {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

.content-image:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* Tailles d'images */
.image-very_very_small .content-image {
    max-width: 100px;
}

.image-very_small .content-image {
    max-width: 150px;
}

.image-small .content-image {
    max-width: 300px;
}

.image-medium .content-image {
    max-width: 600px;
}

.image-large .content-image {
    max-width: 900px;
}

.image-full .content-image {
    max-width: 100%;
}

/* Positions d'images */
.image-left {
    text-align: left;
}

.image-right {
    text-align: right;
}

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

/* Alignement des blocs */
.block-align-left {
    text-align: left;
}

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

.block-align-right {
    text-align: right;
}

/* Alignement spécifique pour les citations */
.block-align-left .content-block-quote,
.block-align-right .content-block-quote {
    margin-left: 0;
    margin-right: 0;
}

.block-align-left .content-block-quote {
    margin-right: auto;
}

.block-align-right .content-block-quote {
    margin-left: auto;
}

/* Bloc Image + Texte */
.content-block-image-text {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin: 3rem 0;
}

.content-block-image-text.image-top {
    flex-direction: column;
    text-align: center;
}

.content-block-image-text.image-left {
    flex-direction: row;
}

.content-block-image-text.image-right {
    flex-direction: row-reverse;
}

.content-block-image-text .content-wrapper {
    flex: 1;
}

.content-block-image-text h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Images flottantes pour le texte wrap */
.content-block-image-text .float-left {
    float: left;
    margin: 0 2rem 1rem 0;
    shape-outside: margin-box;
}

.content-block-image-text .float-right {
    float: right;
    margin: 0 0 1rem 2rem;
    shape-outside: margin-box;
}

/* Bloc Galerie */
.content-block-gallery {
    margin: 3rem 0;
}

.content-block-gallery h3 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 0 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    background: #f0f0f0;
    aspect-ratio: 1;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

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

/* Bloc Citation */
.content-block-quote {
    max-width: 700px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.content-block-quote::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 30px;
    font-size: 120px;
    color: rgba(52, 152, 219, 0.2);
    font-family: Georgia, serif;
}

.content-block-quote blockquote {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.8;
    color: #2c3e50;
    font-style: italic;
    position: relative;
    z-index: 1;
}

.content-block-quote cite {
    display: block;
    text-align: right;
    margin-top: 1.5rem;
    font-size: 1rem;
    color: #7f8c8d;
    font-style: normal;
}

.content-block-quote cite::before {
    content: '— ';
}

/* Bloc Bouton */
.content-block-button {
    text-align: center;
    margin: 3rem 0;
}

.content-block-button .btn {
    display: inline-block;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.content-block-button .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
}

.content-block-button .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.content-block-button .btn:hover::before {
    left: 100%;
}

/* Bloc Espace */
.content-block-spacer {
    clear: both;
}

/* Responsive */
@media (max-width: 768px) {
    .content-block-image-text {
        flex-direction: column !important;
        text-align: center;
    }

    .content-block-image-text .float-left,
    .content-block-image-text .float-right {
        float: none;
        margin: 0 auto 1rem;
        display: block;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .content-block-quote {
        padding: 1.5rem;
    }

    .content-block-quote::before {
        font-size: 80px;
        top: -10px;
        left: 20px;
    }

    .content-block-button .btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

/* Animation au scroll */
.content-block-wrapper {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.content-block-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mode édition - Indicateurs visuels */
.edit-mode .content-block-wrapper {
    position: relative;
    padding: 10px;
    border: 2px dashed #3498db;
    margin-bottom: 1rem;
}

.edit-mode .content-block-wrapper::before {
    content: attr(data-block-type);
    position: absolute;
    top: -10px;
    left: 10px;
    background: #3498db;
    color: white;
    padding: 2px 10px;
    font-size: 12px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* Styles pour la lightbox (déplacés depuis JavaScript) */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: background 0.3s ease;
}

.lightbox.active {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.lightbox.active .lightbox-content {
    opacity: 1;
    transform: scale(1);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.lightbox-close:hover {
    transform: scale(1.1);
}