/* 1. Прячем всё лишнее (Иконки, цифры, копирайт) */
#phocagallery .pg-item-box-info svg,
#phocagallery .pg-item-box-info img,
#phocagallery .pg-cv-count,
#phocagallery small,
#phocagallery-poweredby,
.pg-poweredby,
div:has(> a[href*="phoca.cz"]),
#phocagallery .feed-link {
    display: none !important;
}

/* 2. Заголовок галереи (если он выводится компонентом) */
#phocagallery h1, 
#phocagallery h2 {
    font-family: 'Comfortaa', sans-serif !important;
    color: #5b3679 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 2.2rem !important;
    margin-bottom: 30px !important;
    border-bottom: none !important;
}

/* 3. Ломаем встроенный макет и строим сетку */
#phocagallery #pg-msnr-container {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 25px !important;
    margin: 0 !important;
    height: auto !important; /* Отключаем фиксированную высоту Masonry */
}

/* Снимаем ограничения с колонок */
#phocagallery #pg-msnr-container > div.pg-item-box {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important; /* Сбрасываем абсолютное позиционирование Masonry */
    left: auto !important;
    top: auto !important;
}

/* 4. Первая выставка (StarDust) - огромная */
@media (min-width: 992px) {
    #phocagallery #pg-msnr-container > div.pg-item-box:nth-child(1) {
        grid-column: span 2 !important;
        grid-row: span 2 !important;
    }
    #phocagallery #pg-msnr-container > div.pg-item-box:nth-child(1) .pg-item-box-info a {
        font-size: 1.8rem !important;
    }
}

/* Мобильный вид - 1 колонка */
@media (max-width: 991px) {
    #phocagallery #pg-msnr-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 25px !important;
    }
}

/* 5. Оформление самой карточки */
#phocagallery .pg-item-box, 
#phocagallery .pg-item-box > div {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#phocagallery .pg-item-box img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    border-radius: 15px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important;
    transition: transform 0.3s ease !important;
    margin-bottom: 10px !important;
}

#phocagallery .pg-item-box:hover img {
    transform: translateY(-5px) !important;
}

/* На скриншоте текст лежит внутри .pg-item-box-info */
#phocagallery .pg-item-box-info {
    text-align: left !important;
    margin-bottom: 5px !important;
    padding: 0 !important;
}

#phocagallery .pg-item-box-info a {
    color: #2C1F57 !important;
    font-family: 'Comfortaa', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.2rem !important;
    text-decoration: none !important;
}

#phocagallery .pg-item-box-info a:hover {
    color: #6a4991 !important;
}
