@import url(modules/preference_&_search.css);

:root {
    scrollbar-gutter: stable;
    --smt-bg: rgb(from var(--surface-color) r g b / .6);
    --ef-menu: cubic-bezier(0.19, 1, 0.22, 1);
}

.dec_bra {

    &::before, &::after {
        display: inline-block;
        white-space: pre;
        transition: opacity .3s, translate .3s;
    }

    &::before {
        --_dir: -1;
        content: '[ ';
    }

    &::after {
        --_dir: 1;
        content: ' ]';
    }
}

.dec_meta {
    line-height: 1;
    font-family: var(--ff-monospace);
}

.dec_link {
    color: inherit;

    &::before, &::after {
        opacity: .6;
    }

    &:hover {
        text-decoration: none;
        opacity: 1;

        &::before, &::after {
            opacity: 1;
            translate: calc(var(--_dir) * .5rem) 0;
        }
    }
}

@media (width < 768px) {

    .dec_meta, .info__wrapper {
        font-size: .8rem;
    }

    .d-md {
        display: none !important;
    }
}

backdrop {
    --blur: calc(2vh + 2vw);
}

code {
    font-family: var(--ff-monospace);
}

[data-code-lang] {
    font-family: var(--ff-monospace);
    position: relative;
    font-weight: 400;

    .header {
        .multiline & {
            position: sticky;
            top: 0;
            backdrop-filter: blur(1rem);
            z-index: 2;
        }

        .lang {
            text-transform: uppercase;
        }
    }

    .copy {
        &::before {
            content: '[ COPY ]' !important;
        }

        &.copied::before {
            content: '[ COPIED ]' !important;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

[data-pref-motion="false"] {
    *, ::before, ::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

.inventory__section {

    .inventory__layout {

        .header__wrapper {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            gap: 1rem 2rem;

            .sec__heading {
                margin: 0;
            }

            p {
                max-width: 45ch;
            }

            margin-bottom: 1rem;
        }

        .item__wrapper {
            grid-template-rows: repeat(4, max-content);

            .item {
                --padding: .75rem;
                border: 1px solid;
                grid-row: span 4;
                display: grid;
                grid-template-rows: subgrid;
                gap: 0;

                .thumbnail {
                    position: relative;
                    border-bottom: 1px solid;

                    .img {
                        aspect-ratio: 16 / 9;
                        object-fit: cover;
                        width: 100%;
                    }

                    &.preview {
                        &::after {
                            content: '';
                            position: absolute;
                            inset: 0;
                            background-image: url(/assets/image/base/tra.avif);
                            transition: background-image .3s;
                            background-size: cover;
                        }

                        &:hover {
                            &::after {
                                transition-delay: .3s;
                                background-image: var(--preview);
                            }
                        }
                    }
                }

                .title {
                    margin: 0;
                    padding: var(--padding);
                }

                .tag__wrapper {
                    display: flex;
                    flex-wrap: wrap;
                    gap: .5rem;
                    border-block: 1px solid;
                    padding: var(--padding);

                    .tag {
                        display: block;
                        color: inherit;
                        font-family: var(--ff-monospace);
                        font-size: .8rem;
                        padding: .25rem .5rem;
                        background-color: var(--surface-color-2);
                    }
                }

                .action__wrapper {
                    padding: var(--padding);

                    .action__btn {
                        --padding-y: 1.5rem;
                        display: block;
                        font-family: var(--ff-monospace);
                        background-color: var(--surface-color);
                    }
                }
            }
        }

        .info__wrapper {
            &:last-child {
                @media (width >=768px) {
                    display: grid !important;
                    grid-template-columns: 1fr max-content 1fr;

                    > :last-child {
                        justify-self: end;
                    }
                }
            }
        }
    }
}