* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #111;
    color: #fff;
    font-family: 'Times New Roman', Times, serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Back link */
.gallery-back {
    position: fixed;
    top: 20px;
    left: 24px;
    color: #ccc;
    text-decoration: none;
    font-size: 1rem;
    z-index: 10;
    transition: color 0.2s ease;
}

.gallery-back:hover {
    color: #fff;
}

/* Main gallery container */
.gallery-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    padding: 60px 20px 30px;
}

/* Photo wrapper */
.gallery-photo {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

.gallery-photo img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-photo img.loaded {
    opacity: 1;
}

/* Caption */
.gallery-caption {
    font-size: 1.15rem;
    text-align: center;
    color: #e0e0e0;
    margin-bottom: 24px;
    min-height: 1.5em;
    padding: 0 20px;
    line-height: 1.5;
}

/* Navigation row */
.gallery-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.gallery-nav button {
    background: #fff;
    border: 3px solid #333;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.gallery-nav button:hover {
    background: #ddd;
    transform: scale(1.05);
}

.gallery-nav button:active {
    transform: scale(0.95);
}

.gallery-nav button svg {
    width: 28px;
    height: 28px;
    fill: #222;
}

/* Counter */
.gallery-counter {
    font-size: 1.1rem;
    color: #bbb;
    letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 600px) {
    .gallery-container {
        padding: 50px 10px 20px;
    }

    .gallery-nav button {
        width: 48px;
        height: 48px;
    }

    .gallery-caption {
        font-size: 1rem;
    }
}