/* Quickbadge public gallery */
.qb-gallery-page {
    padding-bottom: 48px;
}

.qb-gallery-page .inner-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0 25px;
}

.qb-gallery-heading {
    width: 100%;
    max-width: 100%;
    margin: 0 0 28px;
    text-align: left;
}

.qb-gallery-heading h1 {
    text-align: left;
}

.qb-gallery-heading > p:last-child {
    margin: 0;
    color: #5d6270;
    font-size: 16px;
    line-height: 1.6;
}

.qb-gallery-eyebrow {
    margin: 0;
    color: #211f60;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.qb-gallery-section-eyebrow {
    margin: 42px 0 12px;
    text-align: center;
}

.qb-gallery-carousel {
    position: relative;
    padding: 0 52px;
}

.qb-gallery-carousel-viewport {
    overflow: hidden;
    touch-action: pan-y;
}

.qb-gallery-grid {
    display: flex;
    align-items: stretch;
    transition: transform .4s ease;
    will-change: transform;
}

.qb-gallery-card {
    flex: 0 0 calc((100% - 72px) / 4);
    overflow: hidden;
    margin: 0 24px 0 0;
    border: 1px solid #e4e5ea;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(24, 25, 40, .08);
}

@supports (gap: 24px) {
    .qb-gallery-grid {
        gap: 24px;
    }
    .qb-gallery-card {
        margin-right: 0;
    }
}

.qb-gallery-carousel-nav {
    position: absolute;
    z-index: 2;
    top: 50%;
    width: 42px;
    height: 58px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: #211f60;
    font-size: 24px;
    line-height: 58px;
    transform: translateY(-50%);
    cursor: pointer;
}

.qb-gallery-carousel-nav:hover,
.qb-gallery-carousel-nav:focus-visible {
    background: #f28b20;
    outline: none;
}

.qb-gallery-carousel-nav:disabled {
    opacity: .3;
    cursor: default;
}

.qb-gallery-carousel-prev {
    left: 0;
}

.qb-gallery-carousel-next {
    right: 0;
}

.qb-gallery-carousel-status {
    min-height: 20px;
    margin: 14px 0 0;
    color: #646873;
    text-align: center;
    font-size: 13px;
}

.qb-gallery-open {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #eef0f4;
    cursor: zoom-in;
}

.qb-gallery-open img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .25s ease;
}

.qb-gallery-open:hover img,
.qb-gallery-open:focus img {
    transform: scale(1.035);
}

.qb-gallery-open:focus-visible {
    outline: 3px solid #f28b20;
    outline-offset: -3px;
}

.qb-gallery-zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(33, 31, 96, .9);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s ease, transform .2s ease;
}

.qb-gallery-open:hover .qb-gallery-zoom,
.qb-gallery-open:focus .qb-gallery-zoom {
    opacity: 1;
    transform: translateY(0);
}

.qb-gallery-card-copy {
    padding: 16px 18px 18px;
}

.qb-gallery-card-copy h2 {
    margin: 0 0 6px;
    color: #211f60;
    font-size: 18px;
    line-height: 1.3;
}

.qb-gallery-card-copy p {
    margin: 0;
    color: #646873;
    font-size: 14px;
    line-height: 1.55;
}

.qb-gallery-empty {
    max-width: 660px;
    margin: 0 auto;
    padding: 42px 24px;
    border: 0;
    background: transparent;
    text-align: center;
}

.qb-gallery-empty h2 {
    margin-top: 0;
}

.qb-gallery-modal-open {
    overflow: hidden;
}

.qb-gallery-lightbox[hidden] {
    display: none;
}

.qb-gallery-lightbox {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.qb-gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 18, .9);
}

.qb-gallery-lightbox-dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    align-items: center;
    width: min(1100px, 100%);
    max-height: calc(100vh - 48px);
}

.qb-gallery-lightbox-dialog figure {
    min-width: 0;
    max-height: calc(100vh - 48px);
    margin: 0;
    overflow: auto;
    border-radius: 10px;
    background: #fff;
}

.qb-gallery-lightbox-dialog figure img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 170px);
    margin: auto;
    object-fit: contain;
    cursor: zoom-out;
}

.qb-gallery-lightbox-dialog figcaption {
    padding: 14px 18px 17px;
}

.qb-gallery-lightbox-dialog figcaption:empty,
.qb-gallery-lightbox-dialog figcaption.is-empty {
    display: none;
    padding: 0;
}

.qb-gallery-lightbox-dialog figcaption h2 {
    margin: 0 0 4px;
    color: #211f60;
    font-size: 19px;
}

.qb-gallery-lightbox-dialog figcaption p {
    margin: 0;
    color: #5d6270;
    line-height: 1.5;
}

.qb-gallery-lightbox-close,
.qb-gallery-lightbox-nav {
    border: 0;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    cursor: pointer;
}

.qb-gallery-lightbox-close:hover,
.qb-gallery-lightbox-nav:hover,
.qb-gallery-lightbox-close:focus-visible,
.qb-gallery-lightbox-nav:focus-visible {
    background: #f28b20;
    outline: none;
}

.qb-gallery-lightbox-close {
    position: absolute;
    z-index: 2;
    top: -15px;
    right: -15px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 29px;
    line-height: 1;
}

.qb-gallery-lightbox-nav {
    width: 42px;
    height: 54px;
    border-radius: 8px;
    font-size: 24px;
}

.qb-gallery-lightbox-prev {
    justify-self: start;
}

.qb-gallery-lightbox-next {
    justify-self: end;
}

/* Integrated gallery admin */
.qb-gallery-admin {
    max-width: 1180px;
}

.qb-gallery-admin-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.qb-gallery-admin-intro p {
    margin: 4px 0 0;
}

.qb-gallery-admin-preview {
    white-space: nowrap;
}

.qb-gallery-admin-message {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #b9d9bf;
    background: #eff9f1;
    color: #205c2c;
}

.qb-gallery-admin-message.error {
    border-color: #e5b8b8;
    background: #fff1f1;
    color: #8b2020;
}

.qb-gallery-upload-panel {
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid #dfe1e7;
    background: #f8f9fb;
}

.qb-gallery-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

.qb-gallery-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}

.qb-gallery-field input[type="text"],
.qb-gallery-field input[type="file"],
.qb-gallery-field textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
}

.qb-gallery-field textarea {
    min-height: 76px;
    resize: vertical;
}

.qb-gallery-field-wide {
    grid-column: 1 / -1;
}

.qb-gallery-admin-list {
    display: grid;
    gap: 16px;
}

.qb-gallery-admin-item {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #dfe1e7;
    background: #fff;
}

.qb-gallery-admin-thumb {
    width: 190px;
    min-height: 150px;
    background: #eef0f4;
}

.qb-gallery-admin-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 150px;
    object-fit: cover;
}

.qb-gallery-admin-form {
    padding: 15px 17px;
}

.qb-gallery-admin-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.qb-gallery-admin-actions form {
    display: inline;
    margin: 0;
}

.qb-gallery-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e9f6ec;
    color: #276533;
    font-size: 12px;
    font-weight: 700;
}

.qb-gallery-status.draft {
    background: #f0f0f2;
    color: #666;
}

@media (max-width: 991px) {
    .qb-gallery-grid {
        gap: 18px;
    }

    .qb-gallery-card {
        flex-basis: calc((100% - 36px) / 3);
    }
}

@media (max-width: 767px) {
    .qb-gallery-page {
        padding-bottom: 30px;
    }

    .qb-gallery-heading {
        margin: 0 0 24px;
        padding: 0;
    }

    .qb-gallery-heading > p:last-child {
        font-size: 15px;
    }

    .qb-gallery-eyebrow {
        text-align: center;
    }

    .qb-gallery-grid {
        gap: 16px;
    }

    .qb-gallery-card {
        flex-basis: calc((100% - 16px) / 2);
    }

    .qb-gallery-carousel {
        padding: 0 42px;
    }

    .qb-gallery-carousel-nav {
        width: 34px;
        height: 50px;
        font-size: 20px;
        line-height: 50px;
    }

    .qb-gallery-zoom {
        opacity: 1;
        transform: none;
    }

    .qb-gallery-lightbox {
        padding: 10px;
    }

    .qb-gallery-lightbox-dialog {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        max-height: calc(100vh - 20px);
    }

    .qb-gallery-lightbox-dialog figure {
        max-height: calc(100vh - 20px);
    }

    .qb-gallery-lightbox-dialog figure img {
        max-height: calc(100vh - 145px);
    }

    .qb-gallery-lightbox-close {
        top: 6px;
        right: 6px;
    }

    .qb-gallery-lightbox-nav {
        width: 36px;
        height: 48px;
    }

    .qb-gallery-admin-intro {
        display: block;
    }

    .qb-gallery-admin-preview {
        display: inline-block;
        margin-top: 12px;
    }

    .qb-gallery-upload-grid {
        grid-template-columns: 1fr;
    }

    .qb-gallery-field-wide {
        grid-column: auto;
    }

    .qb-gallery-admin-item {
        grid-template-columns: 1fr;
    }

    .qb-gallery-admin-thumb {
        width: 100%;
        min-height: 0;
    }

    .qb-gallery-admin-thumb img {
        min-height: 0;
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 559px) {
    .qb-gallery-card {
        flex-basis: 100%;
    }
}

