/* =========================================================
   CONȚINUT ARTICOL
   ========================================================= */

.article-content {
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
}


/* =========================================================
   IMAGINI INSERATE PRIN CKEDITOR
   ========================================================= */

.article-content figure.image {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 28px 0;
}

.article-content figure.image img {
    display: block;

    width: 100%;
    max-width: 100%;
    height: auto;

    object-fit: contain;

    border-radius: 12px;
}


/*
 * Protecție suplimentară pentru orice imagine
 * care ar putea fi inserată fără <figure>.
 */
.article-content img {
    max-width: 100% !important;
    height: auto !important;
}


/* =========================================================
   CAPTION IMAGINE
   ========================================================= */

.article-content figure.image figcaption {
    padding: 8px 12px;

    font-size: 14px;
    line-height: 1.5;

    text-align: center;

    color: #6c757d;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .article-content figure.image {
        margin: 20px 0;
    }

    .article-content figure.image img {
        width: 100%;
        max-width: 100%;
        height: auto;
        border-radius: 8px;
    }

}


/* =========================================================
   GALERIE AUTOMATĂ
   ========================================================= */

.article-gallery {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(220px, 1fr)
    );

    gap: 12px;
    margin: 28px 0;
}

.article-gallery figure.image {
    margin: 0;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.article-gallery figure.image img {
    width: 100%;
    height: 260px;

    object-fit: cover;

    cursor: zoom-in;

    border-radius: 12px;

    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

.article-gallery figure.image:hover img {
    transform: scale(1.025);
    opacity: 0.94;
}


/* Și imaginile individuale pot fi deschise */
.article-content figure.image img {
    cursor: zoom-in;
}


/* =========================================================
   LIGHTBOX / POPUP
   ========================================================= */

.article-lightbox {
    position: fixed;
    inset: 0;

    z-index: 999999;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 40px 80px;

    background: rgba(5, 12, 20, 0.94);

    backdrop-filter: blur(4px);
}

.article-lightbox.is-open {
    display: flex;
}

.article-lightbox-image {
    display: block;

    max-width: 92vw;
    max-height: 88vh;

    width: auto;
    height: auto;

    object-fit: contain;

    border-radius: 12px;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.5);
}


/* Buton închidere */

.article-lightbox-close {
    position: absolute;

    top: 18px;
    right: 24px;

    width: 48px;
    height: 48px;

    border: 0;
    border-radius: 50%;

    background: rgba(255,255,255,0.12);

    color: #fff;

    font-size: 34px;
    line-height: 1;

    cursor: pointer;

    transition: background 0.2s ease;
}

.article-lightbox-close:hover {
    background: rgba(255,255,255,0.22);
}


/* Navigare galerie */

.article-lightbox-prev,
.article-lightbox-next {
    position: absolute;

    top: 50%;

    transform: translateY(-50%);

    width: 54px;
    height: 54px;

    border: 0;
    border-radius: 50%;

    background: rgba(255,255,255,0.12);

    color: #fff;

    font-size: 34px;

    cursor: pointer;

    transition: background 0.2s ease;
}

.article-lightbox-prev:hover,
.article-lightbox-next:hover {
    background: rgba(255,255,255,0.22);
}

.article-lightbox-prev {
    left: 20px;
}

.article-lightbox-next {
    right: 20px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {

    .article-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin: 20px 0;
    }

    .article-gallery figure.image img {
        height: 180px;
    }

    .article-lightbox {
        padding: 55px 12px;
    }

    .article-lightbox-image {
        max-width: 96vw;
        max-height: 82vh;
    }

    .article-lightbox-prev,
    .article-lightbox-next {
        width: 42px;
        height: 42px;

        font-size: 28px;
    }

    .article-lightbox-prev {
        left: 6px;
    }

    .article-lightbox-next {
        right: 6px;
    }

    .article-lightbox-close {
        top: 8px;
        right: 8px;

        width: 42px;
        height: 42px;
    }
}


@media (max-width: 480px) {

    .article-gallery {
        grid-template-columns: 1fr;
    }

    .article-gallery figure.image img {
        height: auto;
        max-height: 380px;
    }

}