/* Gallery Grid Styles */
.gallery-grid {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 0;
}

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

.gallery-grid figure,
.gallery-grid .igd-block-image {
    margin: 0 !important;
}

.gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.gallery-grid img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.gallery-grid + p,
.gallery-grid + p + p {
    margin-top: 1rem;
}

/* Tek resimli galeri: yüksekliği serbest bırak, kesme olmaz */
.gallery-grid:has(> .igd-block-image:only-child) img {
    height: auto;
    object-fit: unset;
}

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

/* Tekil resim blokları */
figure.igd-block-image {
    margin: 1.5rem 0;
    padding: 0;
}

figure.igd-block-image a {
    display: block;
}

figure.igd-block-image img {
    max-width: 100% !important;
    max-height: 51rem !important;
    width: auto !important;
    height: auto !important;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

figure.igd-block-image img:hover {
    transform: scale(1.01);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}

/* Lightbox Styles */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10000;
}

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

.lightbox-close svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10000;
}

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

.lightbox-nav svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-family: inherit;
}

/* Content Image Styles */
.prose img {
    margin: 1.5rem 0;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.prose img:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.prose figure {
    margin: 2rem 0;
}

.prose figure img {
    max-width: 100%;
    height: auto;
    margin: 0;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
}
