.educra-gallery-wrap {
    position: relative;
    margin: 25px 0;
    font-family: inherit;
}
.educra-gallery-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.educra-gallery-grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.educra-gallery-grid[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.educra-gallery-grid[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 640px) {
    .educra-gallery-grid,
    .educra-gallery-grid[data-cols] {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
@media (max-width: 420px) {
    .educra-gallery-grid,
    .educra-gallery-grid[data-cols] {
        grid-template-columns: 1fr;
    }
}

.educra-gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
    background-color: #f1f5f9;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s ease;
    display: block;
}
.educra-gallery-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}
.educra-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.educra-gallery-item:hover img {
    transform: scale(1.05);
}
.educra-gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.5) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 12px;
    pointer-events: none;
}
.educra-gallery-item:hover .educra-gallery-overlay {
    opacity: 1;
}
.educra-zoom-icon {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Modal Lightbox */
.educra-modal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(10, 15, 25, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.educra-modal-lightbox.educra-active {
    opacity: 1;
    pointer-events: auto;
}
.educra-modal-inner {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.educra-modal-img-wrap {
    position: relative;
    max-width: 100%;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.educra-modal-img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.educra-modal-caption {
    color: #f1f5f9;
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
    max-width: 600px;
    min-height: 20px;
}
.educra-modal-counter {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 4px;
}
.educra-modal-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(4px);
}
.educra-modal-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}
.educra-modal-close {
    top: 24px;
    right: 24px;
}
.educra-modal-prev {
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
}
.educra-modal-prev:hover {
    transform: translateY(-50%) scale(1.08);
}
.educra-modal-next {
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}
.educra-modal-next:hover {
    transform: translateY(-50%) scale(1.08);
}
@media (max-width: 640px) {
    .educra-modal-prev { left: 8px; width: 36px; height: 36px; }
    .educra-modal-next { right: 8px; width: 36px; height: 36px; }
    .educra-modal-close { top: 12px; right: 12px; width: 36px; height: 36px; }
}
body.educra-modal-open {
    overflow: hidden !important;
}
