@font-face {
    font-family: 'Scoutie Sans';
    src: url(ScoutieSans.woff2);
    font-style: normal;
}

@view-transition {
    navigation: auto;
}

:root {
    --items-per-row: 8;
}

@media screen and (max-width: 1400px) {
    :root {
        --items-per-row: 6;
    }
}

@media screen and (max-width: 992px) {
    :root {
        --items-per-row: 4;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --items-per-row: 2;
    }
}

@media screen and (max-width: 576px) {
    :root {
        --items-per-row: 2;
    }
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #222;
    font-family: 'Scoutie Sans';
}

h1, h2, h3, h4, h5, h6, p {
    color: #ddd;
    margin: 10px;
}

p {
    font-size: 20px;
    line-height: 1.2em;
}

p:not(:first-child) {
    padding-top: 0.8em;
}

h1 {
    font-size: 36px;
}

a {
    color: #34a0ff;
}

.listing-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    padding-top: 20px;
}

.listing-thumbnail {
    width: calc(100vw / var(--items-per-row));
    height: calc(100vw / var(--items-per-row));
    overflow: hidden;
    position: relative;
    transform: scale(0.98);
    transition-property: transform;
    transition-duration: 0.2s;
    transition-timing-function: ease-out;
    border-radius: 10px;

    img {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .caption {
        background-color: #0008;
        width: calc(100% - 20px);
        position: absolute;
        bottom: 0;
        margin: 0;
        padding: 5px 10px 5px 10px;
        overflow-wrap: anywhere;
    }

    .caption-hidden {
        bottom: calc(-100% + 0px);
        transition-property: bottom;
        transition-duration: 0.2s;
        transition-timing-function: ease-out;
    }
}

.listing-thumbnail:hover .caption-hidden {
    bottom: 0;
}

.listing-thumbnail:hover {
    transform: scale(0.95);
}

.top-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 1.5em;
    background-color: #333;
    border-bottom-style: solid;
    border-bottom-color: #888;
    padding: 5px;
    position: sticky;

    p {
        margin-left: 0.5em;
        margin-right: 0.5em;
        padding-top: 0;
    }

    a {
        margin: 0;
        display: inline-block;
        line-height: 0;
    }
}

.logo {
    height: 50px;
    margin: 5px;
}

.home {
    text-decoration: none;
    font-weight: bold;
    padding-left: 0.5em;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    flex-grow: 1;
    align-items: center;
}

.breadcrumb {
    min-width: 1em;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

::view-transition-old(content) {
    animation: fade-out 0.5s cubic-bezier(0.86, 0, 0.07, 1) forwards;
}

::view-transition-new(content) {
    animation: fade-in 0.5s cubic-bezier(0.86, 0, 0.07, 1) forwards;
}

@keyframes fade-in {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1.0);
    }
}

@keyframes fade-out {
    0% {
        transform: scale(1.0);
    }

    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

::view-transition-old(root) {
    animation: none;
}

::view-transition-new(root) {
    animation: none;
}

.view-container {
    background-color: black;
    min-width: 100%;
    min-height: 100%;
    view-transition-name: content;
}

.view {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.controls {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    z-index: 1;

    .top-controls {
        width: 100%;
        height: 50px;
        display: flex;
        justify-content: right;
    }
    
    .arrows {
        width: 100%;
        align-self: center;
        display: flex;
        justify-content: space-between;
    }

    .bottom-controls {
        height: 50px;
        overflow: hidden;
        p {
            font-size: 32px;
            color: #444;
            padding: 0;
            margin-top: 0;
            line-break: anywhere;
        }
    }
}

.icon-button {
    width: 50px;
    height: 50px;
    background-color: black;
    opacity: 0.5;
    border-radius: 10px;
    cursor: pointer;

    img {
        width: 100%;
        height: 100%;
    }
}

.icon-button:hover {
    filter: brightness(5);
}

.dir-info-container {
    padding: 1em;
}

.dir-info {
    padding: 1em;
    border-style: solid;
    border-color: #888;
    border-radius: 10px;
}

.dir-empty {
    width: 100%;
    text-align: center;
    font-size: 2em;
}
