/* === گالری وسط‌چین با عرض ثابت 1080px === */
.pg-categories-items-box,
.pg-category-items-box {
    max-width: 1080px !important;   /* حداکثر عرض گالری */
    width: 100% !important;         /* واکنش‌گرایی */
    margin: 0 auto !important;      /* وسط‌چین کردن کل گالری */
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;  /* وسط‌چین کردن ستون‌ها */
    align-items: flex-start !important;
}

/* فاصله بین ستون‌ها و جعبه‌ها */
.pg-item-box,
.pg-category-box {
    flex: 0 0 25% !important;  /* هر آیتم 25% عرض می‌گیرد → 4 ستون در هر ردیف */
    max-width: 25% !important;
    box-sizing: border-box;     /* برای رعایت margin و padding */
}

/* واکنش‌گرایی تصاویر داخل ستون‌ها */
.pg-item-box-image img,
.pg-category-box-image img,
.pg-item-box-image svg,
.pg-category-box-image svg {
    width: 100% !important;        /* پر کردن عرض ستون */
    height: auto !important;       /* حفظ نسبت تصویر */
}

/* عنوان آیتم‌ها در پایین با پس‌زمینه شفاف */
.pg-item-box-title,
.pg-category-box-title {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    padding: 0.5em !important;
    color: #fff !important;
    font-weight: bold !important;
    font-size: 115% !important;
    background: rgba(0,0,0,0.5) !important;
    border-radius: 0 0 3px 3px !important;
}

/* وسط‌چین کردن کل ماژول داخل مقاله (برای اطمینان) */
div.phocagallery-wrapper,
div.phocagallery-wrapper * {
    text-align: center !important;
}

/* واکنش‌گرایی موبایل */
@media only screen and (max-width: 768px) {
    .pg-categories-items-box,
    .pg-category-items-box {
        justify-content: center !important;
        max-width: 100% !important;
    }
}
