.top-right {
    position: absolute;
    top: var(--theme-spacing-lg);
    right: var(--theme-spacing-md);
    z-index: 20;
}

.library-header {
    position: relative;
    display: grid;
    grid-template-areas: 'image' 'info';
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr;
    gap: var(--theme-spacing-md);
    align-items: center;
    justify-items: center;
    width: 100%;
    max-width: 100%;
    height: auto;
    padding: 2rem 1rem;

    :global(.item-image-placeholder) {
        width: 175px !important;
        height: 175px;
    }

    .image {
        width: 250px !important;
        height: 250px;
    }

    @container (min-width: $mantine-breakpoint-sm) {
        grid-template-areas: 'image info';
        grid-template-rows: auto;
        grid-template-columns: 225px minmax(0, 1fr);
        align-items: flex-end;
        justify-items: start;
        height: auto;
        min-height: 340px;
        padding: 5rem 2rem 2rem;

        .image {
            width: 225px !important;
            height: 225px;
        }

        :global(.item-image-placeholder) {
            width: 225px !important;
            height: 225px;
        }
    }

    @container (min-width: $mantine-breakpoint-lg) {
        grid-template-columns: 250px minmax(0, 1fr);

        .image {
            width: 250px !important;
            height: 250px;
        }

        :global(.item-image-placeholder) {
            width: 250px !important;
            height: 250px;
        }
    }

    &.compact {
        min-height: unset;
        padding: var(--theme-spacing-md) var(--theme-spacing-xs);

        :global(.item-image-placeholder) {
            width: 250px !important;
            height: 250px;
        }

        .image {
            width: 250px !important;
            height: 250px;
        }

        @container (min-width: $mantine-breakpoint-sm) {
            grid-template-columns: 200px minmax(0, 1fr);
            min-height: unset;
            padding: var(--theme-spacing-md) var(--theme-spacing-sm);

            .image {
                width: 200px !important;
                height: 200px;
            }

            :global(.item-image-placeholder) {
                width: 200px !important;
                height: 200px;
            }
        }

        @container (min-width: $mantine-breakpoint-lg) {
            grid-template-columns: 200px minmax(0, 1fr);
            padding: var(--theme-spacing-md) var(--theme-spacing-md);

            .image {
                width: 200px !important;
                height: 200px;
            }

            :global(.item-image-placeholder) {
                width: 200px !important;
                height: 200px;
            }
        }
    }
}

.image-section {
    position: relative;
    z-index: 15;
    display: flex;
    grid-area: image;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 8px rgb(0 0 0 / 50%));

    @container (min-width: $mantine-breakpoint-sm) {
        align-items: flex-end;
    }
}

.image-overlay {
    position: absolute;
    right: var(--theme-spacing-xs);
    bottom: var(--theme-spacing-xs);
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms ease;
}

.image-section:hover .image-overlay {
    pointer-events: auto;
    opacity: 1;
}

.metadata-section {
    z-index: 15;
    display: flex;
    flex-direction: column;
    grid-area: info;
    gap: var(--theme-spacing-sm);
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;

    @container (min-width: $mantine-breakpoint-sm) {
        align-items: flex-start;
        justify-content: flex-end;
        text-align: left;
    }
}

.image {
    object-fit: var(--theme-image-fit);
    border-radius: 5px;
}

.title {
    display: flex;
    margin: 0;
    font-size: clamp(1.75rem, 3dvw, 2.75rem);
    font-weight: 800;
    line-height: 1.2;
    word-break: keep-all;
    text-wrap: pretty;
}

.library-header-menu {
    display: flex;
    flex-direction: column;
    gap: var(--theme-spacing-sm);
    align-items: center;
    justify-content: center;
    width: 100%;

    @container (min-width: $mantine-breakpoint-sm) {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }
}
