/* ========================================
   BLOC IMAGE - Base
   ======================================== */

/* .block-image {
    margin: 2rem 0;
} */

.block-image .image-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.block-image img.block-image {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ========================================
   ADMIN - Input avec unité
   ======================================== */

.obwp-input-with-unit {
    display: flex;
    gap: 0;
}

.obwp-input-with-unit input[type="number"] {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.obwp-input-with-unit select {
    width: 70px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background-color: #f9fafb;
}

/* Alignements */
.block-image--align-center .image-wrapper {
    align-items: center;
    text-align: center;
}

.block-image--align-left .image-wrapper {
    align-items: flex-start;
    text-align: left;
}

.block-image--align-right .image-wrapper {
    align-items: flex-end;
    text-align: right;
}

/* ========================================
   LAYOUTS
   ======================================== */

/* Layout Default */
.block-image--default img {
    border-radius: 4px;
}

/* Layout Rounded */
.block-image--rounded img {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Layout Circular */
.block-image--circular img {
    border-radius: 50%;
    aspect-ratio: 1;
    object-fit: cover;
}

/* ========================================
   CAPTION
   ======================================== */

.image-caption {
    font-size: 0.7rem;
    color: #ffffffc5;
    font-style: italic;
    margin: 0;

    position: absolute;
    bottom: 5px;
    right: 10px;
}

/* ========================================
   LIEN
   ======================================== */

.image-link {
    display: inline-block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-link:hover {
    transform: scale(1.02);
}

.image-link:hover img {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ========================================
   PLACEHOLDER
   ======================================== */

.image-placeholder {
    padding: 3rem;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

/* ========================================
   LIGHTBOX
   ======================================== */

.image-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    cursor: default;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s ease;
}

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

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .block-image {
        margin: 1.5rem 0;
    }
    
    /* Force l'alignement centré sur mobile */
    .block-image--align-left .image-wrapper,
    .block-image--align-right .image-wrapper {
        align-items: center;
        text-align: center;
    }
}
