/* Галерея дипломов: миниатюры с лупой + лайтбокс (vanilla) */

.diploma-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.diploma-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    margin: 0;
    border: 1px solid #e8edf2;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.diploma-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.diploma-thumb:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 28px rgba(20, 40, 70, 0.14);
    border-color: #d8e0ea;
}
.diploma-thumb:focus-visible {
    outline: 3px solid #3a5a7c;
    outline-offset: 2px;
}

/* Лупа поверх миниатюры */
.diploma-thumb__loupe {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 40, 70, 0.0);
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
}
.diploma-thumb__loupe i {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    font-size: 1.1rem;
}
.diploma-thumb:hover .diploma-thumb__loupe,
.diploma-thumb:focus-visible .diploma-thumb__loupe {
    opacity: 1;
    background: rgba(20, 40, 70, 0.18);
}

/* ===== Лайтбокс ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox__img {
    max-width: 92vw;
    max-height: 86vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: #fff;
}
.lightbox__btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, 0.28); }
.lightbox__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lightbox__close { top: 18px; right: 18px; }
.lightbox__prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox__caption {
    position: absolute;
    left: 0; right: 0; bottom: 18px;
    text-align: center;
    color: #fff;
    font-size: 0.95rem;
    padding: 0 70px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}
.lightbox__counter {
    position: absolute;
    top: 22px;
    left: 22px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .lightbox__prev { left: 8px; }
    .lightbox__next { right: 8px; }
    .lightbox__caption { padding: 0 56px; }
}

@media (prefers-reduced-motion: reduce) {
    .diploma-thumb, .diploma-thumb__loupe, .lightbox__btn { transition: none; }
    .diploma-thumb:hover { transform: none; }
}
