:root {
    --card-padding: 10px;
    --filename-size: 24px;
}

html,
body {
    margin: 0;
}

body {
    background-color: #191919;
    font-family: Helvetica, Arial, sans-serif;
    text-shadow: 1px 1px 2px rgb(0, 0, 0);
    letter-spacing: .03rem;
    min-height: 100vh;
}

.card {
    position: relative;
    top: 0;
    left: 0;
    display: inline-block;
    margin: 0;
    padding: var(--card-padding);
    line-height: 0;
}

/* Allow optional maximum card dimensions via CSS variables. If not set,
   the fallback 'none' results in no constraint. */
.card {
    max-width: var(--card-max-width, none);
    max-height: var(--card-max-height, none);
}

/* Ensure media inside the card doesn't overflow the card's bounds. The
   explicit sizing logic still sets element widths; this ensures the visual
   card constraints are respected. */
.card-picture {
    max-width: 100%;
    max-height: 100%;
    height: auto;
}

.hidden {
    visibility: hidden;
    display: none;
}

.hide-filenames .card-text {
    visibility: hidden;
    display: none;
}

.card-text {
    font-size: var(--filename-size);
    color: whitesmoke;
}

.card-text {
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-weight: bold;
    text-wrap: nowrap;
}

/* When filenames are displayed below media, make the text flow as a normal block */
body.filenames-below .card-text {
    position: static;
    background-color: transparent;
    color: whitesmoke;
    font-weight: normal;
    padding-top: 6px;
    display: block;
}

.point-filter {
    image-rendering: pixelated;
}

#info-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgb(196, 196, 196);
    background-color: rgba(55, 55, 55, 0.9);
    padding: 0;
    border-radius: 10px;
    box-shadow: 0 4px -6px rgba(0, 0, 0, 0.1);
    max-width: 80%;
    color: rgb(255, 242, 225);
    text-align: center;
    line-height: 1.5;

    h2 {
        color: rgb(255, 249, 241);
    }
}

#info-box-top,
#info-box-bottom {
    padding: 10px 40px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#info-box-top:hover,
#info-box-bottom:hover {
    background-color: rgba(66, 66, 66, 0.9);
}

#info-box-top {
    border-bottom: 1px solid rgb(196, 196, 196);
    border-radius: 10px 10px 0 0;
    padding-bottom: 30px;
}

#info-box-bottom {
    border-radius: 0 0 10px 10px;
    padding-top: 10px;
    padding-bottom: 30px;
}

.center-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Make main area fill the viewport and scroll independently of the sidebar */
main {
    position: relative;
    min-height: 100vh;
    height: 100vh;
    overflow-y: auto;
    z-index: 0;
}

/* Collapse inline-block whitespace gaps inside the cards container without
   changing the font-size of the scrolling <main> element (preserves scroll
   delta behavior). */
#cards {
    font-size: 0;
}

body.hide-filenames .card-text{
    display: none;
    visibility: hidden;
}

/* When sidebar occupies space, shift the main content so it doesn't sit under the sidebar */
/* Only shift main content when the sidebar is both set to occupy space AND
   currently visible/open. This prevents the setting from interfering with
   closing the sidebar while keeping the checkbox persistent. */
body.sidebar-static.sidebar-visible main {
    margin-left: 330px;
}