/* WGM Gallery Masonry Layout & Lightbox CSS */

/* マソンリーコンテナ */
.wgm-gallery-container {
    position: relative;
    width: 100%;
}

/* マソンリーアイテム */
.wgm-gallery-item {
    position: absolute;
    width: 300px;
    transition: all 0.4s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.wgm-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wgm-gallery-item:hover img {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* ズームオーバーレイ */
.wgm-gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0);
    border-radius: 8px;
    transition: background 0.3s ease;
    pointer-events: none;
}

.wgm-gallery-item:hover::after {
    background: rgba(0,0,0,0.1);
}

/* ズームアイコン */
.wgm-gallery-item .zoom-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.wgm-gallery-item:hover .zoom-overlay {
    opacity: 1;
}

.zoom-overlay svg {
    width: 30px;
    height: 30px;
    fill: #333;
}

/* ライトボックス */
.wgm-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wgm-lightbox.active {
    display: flex;
    opacity: 1;
}

.wgm-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wgm-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

.wgm-lightbox-info {
    color: white;
    margin-top: 20px;
    text-align: center;
    max-width: 800px;
}

.wgm-lightbox-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.wgm-lightbox-title a {
    color: #4a9eff;
    text-decoration: none;
}

.wgm-lightbox-title a:hover {
    text-decoration: underline;
}

.wgm-lightbox-caption {
    font-size: 14px;
    line-height: 1.6;
    color: #ccc;
}

/* 閉じるボタン */
.wgm-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.wgm-lightbox-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.wgm-lightbox-close::before,
.wgm-lightbox-close::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 2px;
    background: white;
}

.wgm-lightbox-close::before {
    transform: rotate(45deg);
}

.wgm-lightbox-close::after {
    transform: rotate(-45deg);
}

/* ナビゲーションボタン */
.wgm-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.wgm-lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}

.wgm-lightbox-nav.prev {
    left: 20px;
}

.wgm-lightbox-nav.next {
    right: 20px;
}

.wgm-lightbox-nav::before {
    content: '';
    width: 12px;
    height: 12px;
    border-top: 2px solid white;
    border-left: 2px solid white;
}

.wgm-lightbox-nav.prev::before {
    transform: rotate(-45deg);
    margin-left: 5px;
}

.wgm-lightbox-nav.next::before {
    transform: rotate(135deg);
    margin-right: 5px;
}

/* カウンター */
.wgm-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0,0,0,0.5);
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 10;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .wgm-gallery-item {
        width: calc(33.333% - 20px);
    }
}

@media (max-width: 768px) {
    .wgm-gallery-item {
        width: calc(50% - 20px);
    }
    
    .wgm-lightbox-nav,
    .wgm-lightbox-close {
        width: 40px;
        height: 40px;
    }

    .wgm-lightbox-title {
        font-size: 16px;
    }

    .wgm-lightbox-caption {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .wgm-gallery-item {
        width: 100%;
    }
    
    .wgm-lightbox-close,
    .wgm-lightbox-nav {
        width: 35px;
        height: 35px;
    }
}
