/* =========================================================
   LifeMagma - Universal Article Poster Fix
   File: /css/article-fix.css

   Fungsi:
   - Mencegah poster utama artikel terpotong di mobile
   - Mendukung template lama (.hero-image)
   - Mendukung template baru (.poster)
   - Tidak mengubah thumbnail homepage / kategori / archive
   ========================================================= */


/* =========================================================
   POSTER CONTAINER
   ========================================================= */

.article-hero .hero-image,
.hero-image-wrap .hero-image,
.article-hero .poster,
.hero-image-wrap .poster,
.article-featured-image,
.featured-image-wrap,
.article-poster {

    width: 100% !important;
    max-width: 100% !important;

    height: auto !important;
    min-height: 0 !important;

    aspect-ratio: auto !important;

    overflow: hidden;

    background: #141a24;

    border-radius: 24px;
}


/* =========================================================
   POSTER IMAGE
   ========================================================= */

.article-hero .hero-image img,
.hero-image-wrap .hero-image img,
.article-hero .poster img,
.hero-image-wrap .poster img,
.article-featured-image img,
.featured-image-wrap img,
.article-poster img {

    display: block !important;

    width: 100% !important;
    max-width: 100% !important;

    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    /* Hilangkan rasio paksa template lama */
    aspect-ratio: auto !important;

    /* Seluruh poster harus terlihat */
    object-fit: contain !important;
    object-position: center center !important;

    /* Mencegah style lama menggeser gambar */
    position: static !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    inset: auto !important;

    transform: none !important;

    margin: 0 !important;
}


/* =========================================================
   FIGURE WRAPPER
   ========================================================= */

.article-hero figure,
.hero-image-wrap figure,
.article-featured-image figure,
.featured-image-wrap figure,
.article-poster figure {

    display: block;

    width: 100%;
    max-width: 100%;

    margin-left: 0;
    margin-right: 0;
}


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

.article-hero figcaption,
.hero-image-wrap figcaption,
.article-featured-image figcaption,
.featured-image-wrap figcaption,
.article-poster figcaption,
.hero-caption,
.caption {

    margin-top: 10px;

    color: #858b92;

    font-size: 11px;
    line-height: 1.6;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .article-hero .hero-image,
    .hero-image-wrap .hero-image,
    .article-hero .poster,
    .hero-image-wrap .poster,
    .article-featured-image,
    .featured-image-wrap,
    .article-poster {

        border-radius: 18px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .article-hero .hero-image,
    .hero-image-wrap .hero-image,
    .article-hero .poster,
    .hero-image-wrap .poster,
    .article-featured-image,
    .featured-image-wrap,
    .article-poster {

        width: 100% !important;
        max-width: 100% !important;

        height: auto !important;

        aspect-ratio: auto !important;

        border-radius: 14px;

        overflow: hidden;
    }


    .article-hero .hero-image img,
    .hero-image-wrap .hero-image img,
    .article-hero .poster img,
    .hero-image-wrap .poster img,
    .article-featured-image img,
    .featured-image-wrap img,
    .article-poster img {

        display: block !important;

        width: 100% !important;
        max-width: 100% !important;

        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;

        aspect-ratio: auto !important;

        object-fit: contain !important;
        object-position: center center !important;

        position: static !important;

        transform: none !important;
    }


    .article-hero figcaption,
    .hero-image-wrap figcaption,
    .article-featured-image figcaption,
    .featured-image-wrap figcaption,
    .article-poster figcaption,
    .hero-caption,
    .caption {

        padding-left: 2px;
        padding-right: 2px;

        font-size: 10px;
        line-height: 1.55;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .article-hero .hero-image,
    .hero-image-wrap .hero-image,
    .article-hero .poster,
    .hero-image-wrap .poster,
    .article-featured-image,
    .featured-image-wrap,
    .article-poster {

        border-radius: 12px;
    }

}


/* =========================================================
   IMPORTANT
   =========================================================

   File ini sengaja TIDAK mengubah:

   .article-card img
   .card-image
   .article-image img
   .category-card img
   .related-card img

   Thumbnail homepage, kategori, related post dan /artikel/
   tetap boleh menggunakan:

       object-fit: cover;

   Fix ini hanya ditujukan untuk POSTER UTAMA
   di dalam halaman artikel.
   ========================================================= */
