* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #111;
    color: #fff;
}

.gallery {
    width: 100%;
}

/* Full-screen opening slideshow area */
.slideshow-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #111;
}

.slideshow {
    position: relative;
    width: 100%;
    height: calc(100vh - 80px);
    min-height: 650px;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #000;
}

.slideshow img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Text-based first slide */
.blurb-slide {
    width: 100%;
    height: 100%;
    padding: 100px 16vw;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(circle at top left, #34506c, transparent 42%),
        radial-gradient(circle at bottom right, #35294d, transparent 40%),
        #18212b;
}

.blurb-content {
    width: 100%;
    max-width: 1000px;

    white-space: pre-wrap;
    overflow-wrap: anywhere;

    color: #fff;
    font-size: clamp(24px, 3vw, 48px);
    line-height: 1.45;
    text-align: center;
}

/* Previous / next buttons */
.slide-button {
    position: absolute;
    top: 50%;
    z-index: 5;

    width: 70px;
    height: 120px;

    border: none;
    transform: translateY(-50%);

    background: rgba(0, 0, 0, 0.45);
    color: #fff;

    font-size: 58px;
    cursor: pointer;

    transition: background 0.2s ease;
}

.slide-button:hover {
    background: rgba(0, 0, 0, 0.85);
}

.previous {
    left: 0;
}

.next {
    right: 0;
}

/* Play / pause button */
.play-pause {
    position: absolute;
    z-index: 6;
    left: 50%;
    bottom: 20px;

    width: 48px;
    height: 48px;

    border: none;
    border-radius: 50%;
    transform: translateX(-50%);

    background: rgba(0, 0, 0, 0.65);
    color: #fff;

    font-size: 20px;
    line-height: 1;
    cursor: pointer;

    transition: background 0.2s ease, transform 0.2s ease;
}

.play-pause:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateX(-50%) scale(1.08);
}

/* Filename / slide title at lower edge */
.caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 4;

    min-height: 95px;
    padding: 18px 100px 82px;

    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.78),
        rgba(0, 0, 0, 0)
    );

    color: #fff;
    text-align: center;
    font-size: 16px;
    overflow-wrap: anywhere;
}

/* Slide count */
.counter {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 6;

    padding: 8px 12px;
    border-radius: 5px;

    background: rgba(0, 0, 0, 0.6);
    color: #fff;

    font-size: 15px;
}

/* Link below slideshow */
.scroll-down {
    min-height: 80px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background: #171717;
    color: #fff;

    text-decoration: none;
    font-size: 14px;
    letter-spacing: 0.04em;

    transition: background 0.2s ease;
}

.scroll-down:hover {
    background: #252525;
}

.scroll-down span {
    margin-top: 4px;
    font-size: 24px;
}

/* Thumbnail gallery */
.thumbnail-section {
    min-height: 100vh;
    padding: 45px 35px 70px;
    background: #f2f2f2;
}

.thumbnails {
    max-width: 1600px;
    margin: 0 auto;

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.thumbnail {
    aspect-ratio: 1 / 1;
    overflow: hidden;

    padding: 4px;
    border: 4px solid transparent;
    border-radius: 8px;

    background: #fff;
    cursor: pointer;

    transition: transform 0.15s ease, border-color 0.15s ease;
}

.thumbnail:hover {
    border-color: #777;
    transform: scale(1.03);
}

.thumbnail.active {
    border-color: #1976d2;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    display: block;

    object-fit: cover;
    border-radius: 3px;
}

/* First thumbnail: welcome card */
.blurb-thumbnail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 12px;

    background:
        radial-gradient(circle at top left, #527a9f, transparent 55%),
        #283849;
    color: #fff;
}

.blurb-thumbnail-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #fff;
    border-radius: 50%;

    font-family: Georgia, serif;
    font-size: 28px;
    font-weight: bold;
}

.blurb-thumbnail-text {
    font-size: 16px;
    font-weight: bold;
}

/* Empty folder display */
.empty-message {
    max-width: 700px;
    margin: 100px auto;
    padding: 35px;

    border-radius: 10px;
    background: #fff;
    color: #222;

    text-align: center;
}

/* Tablet */
@media (max-width: 800px) {
    .slideshow {
        height: calc(100vh - 70px);
        min-height: 450px;
    }

    .blurb-slide {
        padding: 80px 12vw;
    }

    .slide-button {
        width: 52px;
        height: 85px;
        font-size: 42px;
    }

    .caption {
        padding: 16px 65px 72px;
        font-size: 14px;
    }

    .play-pause {
        bottom: 14px;
        width: 42px;
        height: 42px;
        font-size: 17px;
    }

    .thumbnail-section {
        padding: 25px 15px 50px;
    }

    .thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
}

/* Phone */
@media (max-width: 500px) {
    .slideshow {
        min-height: 350px;
    }

    .blurb-slide {
        padding: 70px 11vw;
    }

    .slide-button {
        width: 44px;
        height: 70px;
        font-size: 34px;
    }

    .counter {
        top: 12px;
        right: 12px;
        font-size: 13px;
    }

    .caption {
        padding: 14px 55px 68px;
        font-size: 13px;
    }
}