/* 
 * Album Gallery Styles - High Priority
 * Force square grid layout for album galleries
 */

/* Clear any existing styles with ultra-high specificity */
html body .wp-site-blocks .entry-content .album-gallery .album-grid,
html body .single-photo .entry-content .album-gallery .album-grid,
html body .entry-content .album-gallery .album-grid,
.single-photo .entry-content .album-gallery .album-grid,
body .entry-content .album-gallery .album-grid,
.album-gallery .album-grid {
    display: grid !important;
    grid-template-columns: repeat(3, calc((100% - 30px) / 3)) !important; /* 860px - (15px × 2) = 830px, 830px ÷ 3 = 276.67px */
    gap: 15px !important;
    margin-bottom: 30px !important;
    width: 100% !important;
    /* max-width: 860px !important; */
    justify-content: start !important;
    align-content: start !important;
}

/* レスポンシブ: 小さい画面では2列 */
@media (max-width: 768px) {
    html body .wp-site-blocks .entry-content .album-gallery .album-grid,
    html body .single-photo .entry-content .album-gallery .album-grid,
    html body .entry-content .album-gallery .album-grid,
    .single-photo .entry-content .album-gallery .album-grid,
    body .entry-content .album-gallery .album-grid,
    .album-gallery .album-grid {
        grid-template-columns: repeat(2, calc((100% - 15px) / 2)) !important;
        gap: 15px !important;
    }
}

/* Force album items to be square */
html body .wp-site-blocks .entry-content .album-gallery .album-item,
html body .single-photo .entry-content .album-gallery .album-item,
html body .entry-content .album-gallery .album-item,
.single-photo .entry-content .album-gallery .album-item,
body .entry-content .album-gallery .album-item,
.album-gallery .album-item {
    position: relative !important;
    overflow: hidden !important;
    background: #f8f8f8 !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important; /* 正方形を維持 */
    cursor: zoom-in !important;
    transition: transform 0.5s ease !important;
    opacity: 0 !important; /* 初期状態で非表示 */
}

.album-gallery .album-item:hover {
    transform: scale(1.02) !important;
}

/* Force images to cover the container */
html body .wp-site-blocks .entry-content .album-gallery .album-item img,
html body .single-photo .entry-content .album-gallery .album-item img,
html body .entry-content .album-gallery .album-item img,
.single-photo .entry-content .album-gallery .album-item img,
body .entry-content .album-gallery .album-item img,
.album-gallery .album-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important; /* 画像も確実に表示 */
}

/* フェードイン効果を適用 */
html body .wp-site-blocks .entry-content .album-gallery .album-item.fade-element,
html body .single-photo .entry-content .album-gallery .album-item.fade-element,
html body .entry-content .album-gallery .album-item.fade-element,
.single-photo .entry-content .album-gallery .album-item.fade-element,
body .entry-content .album-gallery .album-item.fade-element,
.album-gallery .album-item.fade-element {
    opacity: 0 !important;
    transition: opacity 0.9s ease !important;
}

html body .wp-site-blocks .entry-content .album-gallery .album-item.fade-element.fade-in,
html body .single-photo .entry-content .album-gallery .album-item.fade-element.fade-in,
html body .entry-content .album-gallery .album-item.fade-element.fade-in,
.single-photo .entry-content .album-gallery .album-item.fade-element.fade-in,
body .entry-content .album-gallery .album-item.fade-element.fade-in,
.album-gallery .album-item.fade-element.fade-in {
    opacity: 1 !important;
}

.alubm-counter {
    display: none;
}