/* Original document previews and their stated scope. */
.cert-carousel-controls:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.cert-carousel-controls .btn {
    font-size: 0.8rem;
    white-space: nowrap;
}

.cert-carousel-range {
    flex: 1 1 auto;
    color: #64748b;
    font-size: 0.8rem;
    text-align: center;
}

.cert-track:focus-visible {
    outline: 3px solid #15803d;
    outline-offset: 3px;
}

#certifications .cert-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 24px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    margin: 0;
    padding: 8px 0 18px;
}

#certifications .cert-track > .col-6 {
    flex: 0 0 calc((100% - 24px) / 2);
    width: calc((100% - 24px) / 2);
    max-width: none;
    padding: 0;
    scroll-snap-align: start;
}

@media (min-width: 1200px) {
    #certifications .cert-track > .col-6 {
        flex-basis: calc((100% - 48px) / 3);
        width: calc((100% - 48px) / 3);
    }
}

#certifications .cert-card,
#m-certifications .m-cert-card {
    min-width: 0;
    overflow-wrap: anywhere;
}

#certifications .cert-preview-wrap,
#m-certifications .m-cert-img-wrap {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    font: inherit;
}

#certifications .cert-preview-wrap img {
    height: 250px;
    object-fit: contain;
}

#certifications .cert-preview-wrap:focus-visible,
#m-certifications .m-cert-img-wrap:focus-visible {
    outline: 3px solid #15803d;
    outline-offset: -3px;
}

#certifications .cert-preview-wrap:focus-visible .cert-overlay {
    opacity: 1;
    visibility: visible;
}

#certifications .cert-body,
#m-certifications .m-cert-body {
    min-width: 0;
}

#certifications .cert-desc {
    flex-grow: 0;
    margin-bottom: 8px;
}

.cert-document-number {
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 8px;
}

.cert-meta,
.cert-note,
.cert-scope-note {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.6;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.cert-note {
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.cert-scope-note {
    margin: 12px 0 0;
}

.cert-actions {
    margin-top: auto;
    padding-top: 12px;
}

.cert-actions .btn {
    white-space: normal;
}

#certModal .modal-body {
    background: #f8fafc;
}

#certModalImg {
    height: auto;
    max-width: 100%;
}

#certModalCaption {
    overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
    .mobile-mentor-lumia-app #m-certifications .m-lumia-title p {
        display: block;
        margin-top: 12px;
    }

    .mobile-mentor-lumia-app #m-certifications .m-cert-list {
        gap: 12px;
        padding: 0 16px 6px;
        scroll-padding-inline: 16px;
    }

    .mobile-mentor-lumia-app #m-certifications .m-cert-list > .col-6 {
        flex: 0 0 clamp(260px, 78vw, 340px);
        width: clamp(260px, 78vw, 340px) !important;
    }

    .mobile-mentor-lumia-app #m-certifications .m-cert-img-wrap {
        aspect-ratio: auto;
        height: 250px;
        padding: 12px;
        background: #f1f5f9;
    }

    .mobile-mentor-lumia-app #m-certifications .m-cert-img-wrap img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .mobile-mentor-lumia-app #m-certifications .m-cert-body {
        display: flex;
        padding: 14px;
    }

    .mobile-mentor-lumia-app #m-certifications .m-cert-body h4 {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .mobile-mentor-lumia-app #m-certifications .m-cert-std {
        display: inline-block;
        font-size: 11px;
        white-space: normal;
    }

    .mobile-mentor-lumia-app #m-certifications .m-cert-body p {
        font-size: 12px;
        line-height: 1.6;
        margin-bottom: 8px;
    }

    .mobile-mentor-lumia-app #m-certifications .m-cert-body .cert-document-number {
        color: #334155;
    }
}

@media (max-width: 575.98px) {
    .cert-carousel-controls:not([hidden]) {
        gap: 6px;
    }

    .cert-carousel-controls .btn,
    .cert-carousel-range {
        font-size: 0.75rem;
    }

    .cert-carousel-controls .btn {
        padding: 0.4rem 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cert-track {
        scroll-behavior: auto;
    }

    #certifications .cert-card,
    #certifications .cert-preview-wrap img,
    #certifications .cert-overlay {
        transition: none;
    }

    #certifications .cert-card:hover,
    #certifications .cert-card:hover .cert-preview-wrap img {
        transform: none;
    }
}
