/* TEYA — сертификаты и квалификация */

.teya-certificates {
    padding: 76px 24px;
    background: #f7f8fa;
}

.teya-certificates__container {
    max-width: 1180px;
    margin: 0 auto;
}

.teya-certificates h2 {
    margin: 0 0 14px;
    color: #17191d;
    font-size: clamp(28px, 3vw, 38px);
}

.teya-certificates__container > p {
    color: #60636a;
    margin: 0 0 36px;
    line-height: 1.7;
}

.teya-certificates__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.teya-certificates__card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-width: 0;
    padding: 14px 14px 22px;
    background: #fff;
    border: 1px solid #e4e5e8;
    border-radius: 18px;
    color: #17191d;
    font: inherit;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 8px 26px rgba(0,0,0,.045);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.teya-certificates__card:hover {
    transform: translateY(-5px);
    border-color: #f4c430;
    box-shadow: 0 14px 34px rgba(0,0,0,.10);
}

.teya-certificates__card:focus-visible {
    outline: 3px solid #f4c430;
    outline-offset: 3px;
}

.teya-certificates__image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 265px;
    padding: 14px;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fb;
}

.teya-certificates__image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .25s ease;
}

.teya-certificates__card:hover img {
    transform: scale(1.04);
}

.teya-certificates__name {
    display: block;
    margin: 20px 8px 8px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
}

.teya-certificates__view {
    display: block;
    margin-top: auto;
    padding-top: 10px;
    color: #8b6b00;
    font-size: 13px;
    font-weight: 700;
}

/* Окно просмотра */

.teya-certificate-modal[hidden] {
    display: none !important;
}

.teya-certificate-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12,14,18,.90);
}

.teya-certificate-modal__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 95vw;
    max-height: 94vh;
}

.teya-certificate-modal__image {
    display: block;
    max-width: 90vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 16px 50px rgba(0,0,0,.35);
}

.teya-certificate-modal__title {
    margin: 14px 0 0;
    color: #fff;
    font-size: 16px;
    text-align: center;
}

.teya-certificate-modal__close {
    position: absolute;
    top: -18px;
    right: -18px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #f4c430;
    color: #17191d;
    font-size: 30px;
    cursor: pointer;
}

@media (max-width: 850px) {
    .teya-certificates__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .teya-certificates {
        padding: 48px 16px;
    }

    .teya-certificates__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .teya-certificates__image-wrap {
        height: 300px;
    }

    .teya-certificate-modal {
        padding: 12px;
    }

    .teya-certificate-modal__close {
        top: -12px;
        right: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .teya-certificates__card,
    .teya-certificates__image-wrap img {
        transition: none;
    }
}