.certs-head {
    margin-bottom: clamp(24px, 4vw, 44px);
}

.certs-head .overline {
    margin-bottom: 12px;
}

.certs-head-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 16px 40px;
    align-items: start;
}

.certs-head-row h2 {
    margin: 0;
}

.certs-head-row .lead {
    margin: 0;
    max-width: 36ch;
}

.certs-more {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.certs-row,
.cert-grid {
    display: grid;
    grid-template-columns: repeat(var(--cert-count, 2), minmax(0, 1fr));
    gap: 22px;
}

.cert-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    min-height: 0;
}

.card.cert-card:hover {
    transform: none;
}

.cert-card h3 {
    margin: 0 0 16px;
    font-size: clamp(1.2rem, 1.8vw, 1.45rem);
}

.cert-issuer {
    margin: -8px 0 16px;
    color: var(--gray-700);
}

.cert-preview {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    overflow: hidden;
    background: #efeee9;
    border: 1px solid rgba(17, 19, 21, 0.06);
    margin-bottom: 18px;
}

.cert-preview iframe,
.cert-preview img {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
    background: #f7f5f0;
    object-fit: cover;
    object-position: top center;
}

.cert-preview iframe {
    object-fit: unset;
    transform: scale(1.02);
    transform-origin: top center;
}

.cert-actions {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: auto;
}

.cert-actions .btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
}

.cert-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(7, 8, 8, 0.86);
    display: grid;
    place-items: center;
    padding: 24px;
}

.cert-modal[hidden] {
    display: none;
}

.cert-modal-inner {
    width: min(960px, 100%);
    height: min(80vh, 820px);
    background: #111;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
}

.cert-modal iframe,
.cert-modal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111;
    border: 0;
}

.cert-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    border: 0;
    background: var(--alfa-orange);
    color: var(--charcoal);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 860px) {
    .certs-head-row,
    .certs-row,
    .cert-grid {
        grid-template-columns: 1fr;
    }

    .certs-head-row .lead {
        max-width: 52ch;
    }

    .cert-actions {
        flex-direction: column;
    }

    .cert-actions .btn {
        width: 100%;
    }
}
