/* =========================
   Gallery
========================= */

.gallery-main {
    max-width: 1200px;

    margin: 0 auto;

    padding:
        60px
        40px
        100px;
}

.gallery-heading {
    margin-bottom: 40px;
}

.gallery-heading h1 {
    margin: 0 0 12px;

    font-size: 38px;
}


/* =========================
   写真一覧
========================= */

.gallery-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;
}

.gallery-card {
    overflow: hidden;

    background: var(--card);

    border: 1px solid var(--border);
    border-radius: 10px;

    cursor: pointer;

    transition:
        transform 0.2s,
        border-color 0.2s,
        background 0.2s;
}

.gallery-card:hover {
    transform: translateY(-3px);

    background: var(--card-hover);

    border-color:
        rgba(116, 223, 219, 0.45);
}

.gallery-card-image {
    position: relative;

    aspect-ratio: 16 / 10;

    overflow: hidden;

    background: #0c1014;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.35s;
}

.gallery-card:hover
.gallery-card-image img {
    transform: scale(1.04);
}

.gallery-card-info {
    padding: 16px 18px 18px;
}

.gallery-card-info h3 {
    margin: 0 0 4px;

    font-size: 16px;
}

.gallery-card-info p {
    margin: 0;

    color: var(--subtext);

    font-size: 12px;
}


/* =========================
   ライトボックス
========================= */

.gallery-lightbox {
    position: fixed;

    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px;

    background:
        rgba(5, 8, 10, 0.92);

    backdrop-filter: blur(8px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.2s,
        visibility 0.2s;

    z-index: 3000;
}

.gallery-lightbox.show {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    width: min(1100px, 85vw);

    max-height: 90vh;

    display: flex;
    flex-direction: column;

    background: var(--card);

    border: 1px solid var(--border);
    border-radius: 12px;

    overflow: hidden;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-content img {
    width: 100%;

    max-height: 72vh;

    object-fit: contain;

    background: #050708;
}

.lightbox-info {
    padding: 18px 22px 22px;
}

.lightbox-info h2 {
    margin: 0 0 5px;

    font-size: 20px;
}

.lightbox-info p {
    margin: 3px 0;

    color: var(--subtext);

    font-size: 13px;
}


/* =========================
   ボタン
========================= */

.lightbox-close {
    position: absolute;

    top: 25px;
    right: 25px;

    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--card);

    border: 1px solid var(--border);
    border-radius: 50%;

    color: var(--text);

    font-size: 23px;

    cursor: pointer;

    transition:
        background 0.2s,
        border-color 0.2s;
}

.lightbox-close:hover {
    background: var(--card-hover);

    border-color: var(--cyan);
}

.lightbox-nav {
    position: absolute;

    top: 50%;

    width: 50px;
    height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    transform: translateY(-50%);

    background: var(--card);

    border: 1px solid var(--border);
    border-radius: 50%;

    color: var(--cyan);

    font-size: 30px;

    cursor: pointer;

    transition:
        background 0.2s,
        border-color 0.2s,
        transform 0.2s;
}

.lightbox-nav:hover {
    background: var(--card-hover);

    border-color: var(--cyan);

    transform:
        translateY(-50%)
        scale(1.05);
}

.lightbox-prev {
    left: 25px;
}

.lightbox-next {
    right: 25px;
}


/* =========================
   スマホ
========================= */

@media (max-width: 900px) {

    .gallery-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 600px) {

    .gallery-main {
        padding:
            35px
            20px
            70px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-lightbox {
        padding: 15px;
    }

    .lightbox-content {
        width: 100%;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;

        font-size: 24px;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }

}