/* Phoca Gallery 6.1.6: аккуратная сетка категорий «Наши работы» (STM-Stroy) */
.pg-categories-items-box {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
    justify-content: stretch;
    margin: 10px 0 30px;
}
.pg-category-box {
    margin: 0 !important;
    width: auto !important;
    float: none !important;
    position: relative;
    background: #fff !important;
    border: 1px solid #e3e6ea !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.pg-category-box:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}
.pg-category-box-image {
    height: 190px;
    margin: 0;
    overflow: hidden;
    background: #f4f6f8;
}
.pg-category-box-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.pg-category-box-info {
    position: static !important;
    background: #fff !important;
    color: #333 !important;
    text-shadow: none !important;
    padding: 10px 12px 12px;
    min-height: 64px;
}
.pg-category-box-title a {
    color: #1a5f8a;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}
.pg-category-box-title a:hover {
    color: #e8731c;
}
.pg-category-box-count {
    font-size: 12px;
    color: #888;
}
@media (max-width: 900px) {
    .pg-categories-items-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .pg-categories-items-box { grid-template-columns: 1fr; }
}

/* Подпись под фото: без серой подложки и градиентов темы Phoca */
.pg-category-box-info {
    background-image: none !important;
    background-color: #fff !important;
}
.pg-category-box-info::before,
.pg-category-box-info::after {
    content: none !important;
    display: none !important;
}

/* Серый слой темы Phoca над подписью: скрыть псевдоэлементы у фото и блока подписи */
.pg-category-box-image::before,
.pg-category-box-image::after,
.pg-category-box::before,
.pg-category-box::after {
    content: none !important;
    display: none !important;
}
.pg-category-box .pg-category-box-info,
.pg-category-box .pg-category-box-info * {
    background-color: transparent;
}
.pg-category-box .pg-category-box-info {
    background-color: #fff !important;
}

/* Заголовки категорий: тёмно-синие на белом (перебиваем белый цвет темы Phoca) */
#phocagallery .pg-category-box .pg-category-box-title a,
.pg-category-box .pg-category-box-title a {
    color: #1a5f8a !important;
    text-shadow: none !important;
}
#phocagallery .pg-category-box .pg-category-box-title a:hover,
.pg-category-box .pg-category-box-title a:hover {
    color: #e8731c !important;
}

/* ===== Страница объекта: сетка фото ===== */
.pg-photoswipe.pg-category-items-box,
.pg-photoswipe.pg-msnr-container {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
    margin: 12px 0 24px;
    float: none !important;
}
.pg-item-box {
    margin: 0 !important;
    width: auto !important;
    float: none !important;
    position: relative;
    background: #fff !important;
    border: 1px solid #e3e6ea !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.pg-item-box-image {
    height: 150px !important;
    margin: 0 !important;
    overflow: hidden;
    background: #f4f6f8;
    position: relative;
}
.pg-item-box-image img,
.pg-item-box-image .pg-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.pg-item-box-info {
    position: static !important;
    background: #fff !important;
    padding: 6px 8px 8px !important;
    min-height: 0 !important;
}
/* Название фото — мелко, под снимком, а не поверх него */
.pg-item-box-title,
.pg-item-box-title a {
    color: #333 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    font-weight: 400 !important;
    text-shadow: none !important;
    background: none !important;
    text-decoration: none;
}
/* Иконки лупы и скачивания — меньше и без тёмной подложки */
.pg-item-box-icons-box {
    position: absolute !important;
    top: 6px;
    right: 6px;
    left: auto !important;
    bottom: auto !important;
    background: none !important;
}
.pg-item-box-icons-box svg,
.pg-photoswipe-button svg {
    width: 16px !important;
    height: 16px !important;
}
.pg-photoswipe-button,
.pg-photoswipe-button-copy {
    background: rgba(255,255,255,0.85) !important;
    border-radius: 4px;
    margin-left: 4px;
}
/* Кнопка «назад»: была огромной серой плиткой */
.pg-top-icons,
.pg-category-categories-top-box,
.pg-category-categories-top-box .pg-item-box-image {
    background: transparent !important;
}
.pg-top-icons svg,
.pg-top-icons .ph-si {
    width: 28px !important;
    height: 28px !important;
}
.backh,
.backh2,
.backh3 {
    font-size: 14px;
}
@media (max-width: 900px) {
    .pg-photoswipe.pg-category-items-box,
    .pg-photoswipe.pg-msnr-container { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .pg-photoswipe.pg-category-items-box,
    .pg-photoswipe.pg-msnr-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Подпись фото: белая строка под снимком, без тёмной полосы на фото */
.pg-item-box figure {
    margin: 0 !important;
}
.pg-item-box figcaption {
    position: static !important;
    display: block !important;
    background: #fff !important;
    color: #333 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    padding: 6px 8px 8px !important;
    text-shadow: none !important;
}
.pg-item-box-image .pg-item-box-title.image,
.pg-item-box-image .ph-si-image {
    display: none !important;
}
/* Кнопка «назад»: маленькая, без серой плитки */
.pg-item-box .pg-svg-box {
    height: 150px !important;
    aspect-ratio: auto !important;
    max-width: none !important;
    background: #f4f6f8 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pg-item-box .pg-svg-box svg {
    width: 56px !important;
    height: 56px !important;
    color: #1a5f8a;
    fill: #1a5f8a;
}

/* Дубль подписи: оставляем одну (figcaption) */
.pg-item-box .pg-item-box-title {
    display: none !important;
}
