/* latin */
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url(../fonts/robotto.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 100;
    src: url(../fonts/material.woff2) format('woff2');
}
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}
body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background: #e0e0e0;
}
main {
    display: flex;
    justify-content: center;
    flex-direction: column;
}
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, min(180px, calc(50% - 10px)));
    justify-content: space-evenly;
    margin: auto;
    grid-gap: 10px;
    width: 100%;
    max-width: 1024px;
    list-style: none;
    padding: 20px 4px;
    box-sizing: border-box;
    h2 {
        margin: 4px 6px 6px;
        font-size: 14px;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        color: #222;
        font-weight: 100;
    }
    a {
        border-radius: 8px;
        overflow: hidden;
        position: relative;
        display: block;
        text-decoration: none;
        background-color: whitesmoke;
        content-visibility: auto;
        box-shadow: 3px 3px 5px rgba(90, 90, 90, 0.5), -3px -3px 5px rgba(255, 255, 255, 0.5);
    }
}
video {
    width: 100%;
    aspect-ratio: 180 / 135;
}
main .input-search {
    width: 200px;
    color: #666;
    margin: 32px auto  16px;
    border: 1px solid #b4b2b2;
    padding: 10px 20px;
    background: #f7f7f7;
    border-radius: 20px;
    box-shadow: 3px 3px 5px rgba(90, 90, 90, 0.5) inset, -3px -3px 5px rgba(255, 255, 255, 0.5) inset;
    outline: gray;
}
.nav-sort,
.nav-tags {
    padding: 6px 12px;
    border-radius: 20px;
    margin: 10px auto;
    box-shadow: 3px 3px 5px rgba(90, 90, 90, 0.5), -3px -3px 5px rgba(255, 255, 255, 0.5);
    font-size: 14px;
    width: min-content;
    ul {
        display: flex;
        gap: 14px;
        list-style: none;
        padding: 0;
        margin: 0;
    }
    a {
        display: block;
        padding: 6px 12px;
        font-size: 14px;
        color: #222;
        border: 1px solid #bbb;
        border-radius: 20px;
        position: relative;
        text-decoration: none;
    }
    .current {
        cursor: default;
        box-shadow: 3px 3px 5px rgba(90, 90, 90, 0.5) inset, -3px -3px 5px rgba(255, 255, 255, 0.5) inset;
    }
    
}
.nav-tags {
    max-width: 980px;
    width: calc(100% - 20px);
    box-sizing: border-box;
    display: flex;
    & > a {
        min-width: 50px;
        margin-left: 10px;
    }
    .tags {
        overflow-x: scroll;
        flex-wrap: nowrap;
        margin-inline: 16px;
        padding-inline: 12px;
        scroll-padding: 12px;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        scrollbar-width: none;
        &::-webkit-scrollbar { 
            display: none;  /* Safari and Chrome */
        }
        li {
            scroll-snap-align: start;
        }
    }
}
.page-tags {
    .nav-tags {
        box-shadow: none;
        box-sizing: content-box;
    }
    .tags {
        flex-wrap: wrap;
        margin-inline: 0;
        padding-inline: 0;
    }
}
.btn-slide-prev,
.btn-slide-next {
    display: block;
    min-width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #bbb;
    border-radius: 50%;
    margin-top: 2px;
    background: #e0e0e0;
    cursor: pointer;
    &:before {
        content: '';
        display: block;
        width: 100%;
        height: 100%;
        background: transparent url(../icons/chevron.svg) no-repeat right top;
    }
    &:after {
        content: '';
        display: block;
        height: 20px;
        width: 1px;
        background: #bbb;
        margin-left: 38px;
        margin-top: -21px;
        position: absolute;
    }
}
.btn-slide-next{
    &:before {
        rotate: 180deg;
    }
    &:after {
        margin-left: -12px;
    }
}
.pagination {
    display: flex;
    list-style: none;
    justify-content: center;
    gap: 16px;
    padding: 0;
    flex-wrap: wrap;
    li {
        &:empty:after {
            content: '...';
            line-height: 2.4;
        }
        a {
            display: flex;
            font-size: 14px;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            justify-content: center;
            align-items: center;
            text-decoration: none;
            color: #222;
            box-shadow: 3px 3px 5px rgba(90, 90, 90, 0.5), -3px -3px 5px rgba(255, 255, 255, 0.5);
            &[aria-current] {
                pointer-events: none;
                box-shadow: 3px 3px 5px rgba(90, 90, 90, 0.5) inset, -3px -3px 5px rgba(255, 255, 255, 0.5) inset;
            }
        }
    } 
}
.tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    a {
        background-repeat: no-repeat;
        background-size: 16px;
        background-position: 13px 7px;
        text-indent: 24px;
        width: max-content;
    }
    span {
        margin-left: .5em;
        &:before {
            content: "("
        }
        &:after {
            content: ")"
        }
    }
}
.nav-pagination {
    display: none;
}
input:placeholder-shown ~ .nav-pagination {
    display: block;
}
@view-transition {
    navigation: auto;
}
::view-transition-old(root) {
    animation: 0.4s ease-in both fade-out;
}
::view-transition-new(root) {
    animation: 0.4s ease-in both fade-in;
}
@keyframes fade-out {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}
@keyframes fade-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}