.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
    gap: 18px;
    justify-content: center;
}

.gallery-item-card {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.gallery-item-card h3 {
    margin: 10px 0 0;
    font-size: 1.06rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.gallery-list-media {
    width: 100%;
    height: 320px;
    object-fit: contain;
    object-position: center;
    background: #fff;
    border-radius: 12px;
    cursor: zoom-in;
}

.gallery-hover-preview {
    position: fixed;
    z-index: 1200;
    width: min(72vw, 920px);
    max-height: 82vh;
    border-radius: 14px;
    border: 1px solid #e0c9c9;
    background: #fff;
    box-shadow: 0 20px 46px rgba(20, 20, 20, 0.28);
    padding: 10px;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.gallery-hover-preview.is-visible {
    opacity: 1;
    transform: scale(1);
}

.gallery-hover-preview img {
    width: 100%;
    max-height: calc(82vh - 20px);
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: 10px;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(10, 10, 12, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.gallery-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

.gallery-lightbox-panel {
    position: relative;
    width: min(96vw, 1100px);
    max-height: 90vh;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e8d4d4;
    padding: 10px;
    box-shadow: 0 26px 54px rgba(0, 0, 0, 0.34);
}

.gallery-lightbox-panel img {
    width: 100%;
    max-height: calc(90vh - 20px);
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: 10px;
}

.gallery-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 38px;
    height: 38px;
    border: 1px solid #e7c9c9;
    border-radius: 999px;
    background: #fff;
    color: #7a1212;
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item-card {
        max-width: 100%;
    }

    .gallery-list-media {
        cursor: default;
    }

    .gallery-hover-preview {
        display: none;
    }

    .gallery-lightbox {
        padding: 12px;
    }

    .gallery-lightbox-panel {
        width: 100%;
        max-height: 92vh;
        padding: 8px;
        border-radius: 12px;
    }

    .gallery-lightbox-panel img {
        max-height: calc(92vh - 16px);
    }
}
