/* Gallery-specific additions to the MIRO documentation theme. */

/* Unlike documentation pages, the gallery has no "On this page" sidebar. */
.bd-main .bd-content .bd-article-container {
    max-width: 100%;
}

.gallery-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1rem;
}

.gallery-filter label {
    font-weight: 600;
    white-space: nowrap;
}

.gallery-filter .form-select {
    max-width: 20rem;
}

html[data-theme="dark"] .gallery-filter .form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-color: var(--pst-color-surface);
    border-color: var(--pst-color-border);
    color: var(--pst-color-text-base);
}

/* Align the cards with the text above them. */
#gallery .sd-container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.gallery-item[hidden] {
    display: none !important;
}

/* App cards */
.app-container {
    overflow: hidden;
}

.app-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 12rem;
    padding: 1rem;
    background-color: #fff;
    border-bottom: 1px solid var(--pst-color-border);
}

.app-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.bd-content .app-container .app-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.app-desc {
    color: var(--pst-color-text-base);
}

.bd-content .app-container .app-author {
    margin-top: 0.75rem;
    font-style: italic;
    color: var(--pst-color-text-muted);
}

.app-footer {
    display: flex;
    justify-content: flex-end;
}

/* The upvote button sits above the link that makes the whole card clickable. */
.btn-upvote {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--pst-color-border);
    border-radius: 1rem;
    background-color: var(--pst-color-surface);
    color: var(--pst-color-text-muted);
    font-size: 0.9rem;
}

.btn-upvote:hover:not(:disabled),
.btn-upvote:focus-visible {
    border-color: var(--pst-color-primary);
    color: var(--pst-color-primary);
}

.btn-upvote:disabled {
    opacity: 1;
}

.btn-upvote.is-voted {
    border-color: var(--pst-color-primary);
    color: var(--pst-color-primary);
}

/* Submit dialog */
.gallery-dialog {
    width: min(40rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 1.5rem;
    border: 1px solid var(--pst-color-border);
    border-radius: 0.5rem;
    background-color: var(--pst-color-background);
    color: var(--pst-color-text-base);
    box-shadow: 0 0.5rem 2rem rgb(0 0 0 / 0.3);
}

.gallery-dialog::backdrop {
    background-color: rgb(0 0 0 / 0.5);
}

.gallery-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.gallery-dialog__header h2 {
    margin: 0;
    font-size: 1.5rem;
}

html[data-theme="dark"] .gallery-dialog .form-control {
    background-color: var(--pst-color-surface);
    border-color: var(--pst-color-border);
    color: var(--pst-color-text-base);
}

html[data-theme="dark"] .gallery-dialog .form-control::file-selector-button {
    background-color: var(--pst-color-on-background);
    color: var(--pst-color-text-base);
}

html[data-theme="dark"] .gallery-dialog .form-control::placeholder {
    color: var(--pst-color-text-muted);
}

html[data-theme="dark"] .gallery-dialog .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.gallery-dialog__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

#newAppForm.is-submitting {
    opacity: 0.5;
}

/* Shown while an app is starting */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgb(0 0 0 / 0.5);
    color: var(--pst-color-primary);
}

#loading-screen[hidden] {
    display: none;
}

#loading-screen .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Cookie notice */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--pst-color-border);
    background-color: var(--pst-color-on-background);
    color: var(--pst-color-text-base);
    font-size: 0.875rem;
    box-shadow: 0 -0.25rem 1rem rgb(0 0 0 / 0.1);
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner__text {
    max-width: 50rem;
}

.cookie-banner p {
    margin: 0;
}

.cookie-banner summary {
    margin-top: 0.25rem;
    color: var(--pst-color-link);
    cursor: pointer;
}

.cookie-banner details p {
    max-height: 40vh;
    margin-top: 0.5rem;
    overflow-y: auto;
}

.cookie-banner__dismiss {
    flex-shrink: 0;
}

/* Keep the end of the page visible above the cookie notice. */
body:has(.cookie-banner:not([hidden])) .bd-footer-content {
    padding-bottom: 6rem;
}

@media (max-width: 575.98px) {
    .cookie-banner {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .app-logo-wrapper {
        height: 9rem;
    }
}
