/* ============================================
   MODERN IMAGES STYLES
   Style moderne pour toutes les images du site
   ============================================ */

/* Variables */
:root {
    --img-radius: 16px;
    --img-radius-lg: 24px;
    --img-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --img-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.16);
    --img-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   IMAGES DANS LES ARTICLES (Article Details)
   ============================================ */

/* Image bannière principale de l'article */
.article-banner-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
    border-radius: var(--img-radius-lg);
    overflow: hidden;
    box-shadow: var(--img-shadow);
    transition: var(--img-transition);
}

.article-banner-wrapper:hover {
    box-shadow: var(--img-shadow-hover);
    transform: translateY(-2px);
}

.article-banner-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: var(--img-transition);
}

.article-banner-wrapper:hover img {
    transform: scale(1.02);
}

/* Images à l'intérieur du contenu de l'article */
.article-content-image {
    position: relative;
    width: 100%;
    margin: 2rem 0;
    border-radius: var(--img-radius);
    overflow: hidden;
    box-shadow: var(--img-shadow);
    transition: var(--img-transition);
}

.article-content-image:hover {
    box-shadow: var(--img-shadow-hover);
    transform: translateY(-2px);
}

.article-content-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: var(--img-transition);
}

.article-content-image:hover img {
    transform: scale(1.03);
}

/* Caption optionnel pour les images */
.article-content-image figcaption {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
    text-align: center;
}

/* ============================================
   IMAGES DE LA UNE (Sidebar)
   ============================================ */

.laune-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: var(--img-radius);
    overflow: hidden;
    box-shadow: var(--img-shadow);
    transition: var(--img-transition);
    display: block;
}

.laune-wrapper:hover {
    box-shadow: var(--img-shadow-hover);
    transform: translateY(-4px);
}

.laune-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: var(--img-transition);
}

.laune-wrapper:hover img {
    transform: scale(1.05);
}

/* Badge "À la Une" */
.laune-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    z-index: 10;
}

/* Overlay pour meilleure lisibilité */
.laune-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    padding: 24px 16px;
    color: white;
    transition: var(--img-transition);
}

.laune-wrapper:hover .laune-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
}

.laune-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: white;
    line-height: 1.4;
}

/* ============================================
   PUBLICITÉS (Sidebar)
   ============================================ */

.publicite-wrapper {
    position: relative;
    width: 100%;
    margin: 1.5rem 0;
    border-radius: var(--img-radius);
    overflow: hidden;
    box-shadow: var(--img-shadow);
    transition: var(--img-transition);
    display: block;
}

.publicite-wrapper:hover {
    box-shadow: var(--img-shadow-hover);
    transform: translateY(-2px);
}

.publicite-wrapper::before {
    content: 'Publicité';
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    opacity: 0.7;
}

.publicite-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: var(--img-transition);
}

.publicite-wrapper:hover img {
    transform: scale(1.03);
}

/* Container pour la publicité avec padding */
.publicite-container {
    padding: 1.5rem 0;
}

/* ============================================
   UTILITAIRES POUR TOUTES LES IMAGES
   ============================================ */

/* Image en mode chargement */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Ratio d'aspect pour éviter le jump lors du chargement */
.img-ratio-16-9 {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    overflow: hidden;
}

.img-ratio-4-3 {
    position: relative;
    padding-bottom: 75%; /* 4:3 */
    overflow: hidden;
}

.img-ratio-1-1 {
    position: relative;
    padding-bottom: 100%; /* 1:1 */
    overflow: hidden;
}

.img-ratio-16-9 img,
.img-ratio-4-3 img,
.img-ratio-1-1 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   LIGHTBOX MODERNE (optionnel)
   ============================================ */

.image-lightbox-trigger {
    cursor: zoom-in;
    position: relative;
}

.image-lightbox-trigger::after {
    content: '\f00e'; /* FontAwesome search-plus icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    opacity: 0;
    transition: var(--img-transition);
    pointer-events: none;
}

.image-lightbox-trigger:hover::after {
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    :root {
        --img-radius: 12px;
        --img-radius-lg: 16px;
    }

    .article-banner-wrapper,
    .article-content-image {
        margin: 1.5rem 0;
    }

    .laune-badge {
        padding: 6px 12px;
        font-size: 0.625rem;
    }

    .laune-title {
        font-size: 0.875rem;
    }

    .publicite-wrapper::before {
        font-size: 0.5rem;
        padding: 3px 8px;
    }
}

/* ============================================
   ACCESSIBILITÉ
   ============================================ */

/* Focus visible pour navigation au clavier */
.article-banner-wrapper:focus-within,
.laune-wrapper:focus-within,
.publicite-wrapper:focus-within {
    outline: 3px solid #dc2626;
    outline-offset: 4px;
}

/* Réduire les animations pour ceux qui préfèrent */
@media (prefers-reduced-motion: reduce) {
    .article-banner-wrapper,
    .article-content-image,
    .laune-wrapper,
    .publicite-wrapper,
    .article-banner-wrapper img,
    .article-content-image img,
    .laune-wrapper img,
    .publicite-wrapper img {
        transition: none;
        transform: none !important;
    }

    @keyframes loading {
        0%, 100% {
            background-position: 0 0;
        }
    }
}

/* ============================================
   DARK MODE SUPPORT (optionnel)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .article-content-image figcaption {
        background: rgba(31, 41, 55, 0.95);
        color: #d1d5db;
    }

    .publicite-wrapper::before {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .article-banner-wrapper,
    .article-content-image,
    .laune-wrapper,
    .publicite-wrapper {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .laune-badge,
    .publicite-wrapper::before {
        display: none;
    }
}
