.certificates-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 28px 24px;
}

.certificates-grid > li {
    flex: 0 0 calc(25% - 18px);
    max-width: calc(25% - 18px);
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.certificate-card {
    display: block;
    text-align: center;
    color: inherit;
    text-decoration: none !important;
    cursor: zoom-in;
}

.certificate-card__image {
    display: block;
    background: #fff;
    border: 1px solid #E5E7EB;
    padding: 12px;
    line-height: 0;
}

.certificate-card__image img {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: contain;
    border-radius: 0 !important;
}

.certificate-card__title {
    display: block;
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #555;
}

.certificate-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.certificate-lightbox[hidden] {
    display: none !important;
}

.certificate-lightbox__dialog {
    max-width: 920px;
    width: 100%;
    text-align: center;
    color: #fff;
}

.certificate-lightbox__dialog img {
    max-width: 100%;
    max-height: 78vh;
    height: auto;
    background: #fff;
    padding: 10px;
}

.certificate-lightbox__dialog h3 {
    margin: 16px 0 8px;
    color: #fff;
}

.certificate-lightbox__dialog p {
    margin: 0;
    color: #ddd;
}

.certificate-lightbox__close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 1023px) {
    .certificates-grid > li {
        flex: 0 0 calc(50% - 12px);
        max-width: calc(50% - 12px);
    }
}

@media (max-width: 580px) {
    .certificates-grid > li {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .certificate-card__image img {
        height: 220px;
    }
}
