/* ========== Общие стили (перенесены из inline) ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #121212;
    color: white;
    font-family: 'Segoe UI', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

header {
    background-color: #0a0a0a;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo img {
    width: 80px;
    height: 80px;
    border-radius: 10%;
}

.logo span {
    font-size: 25px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.2rem;
    color: white;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 30px;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.02));
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 40px;
    font-weight: bold;
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.back-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.back-link::before {
    content: "🏠 ";
    font-size: 1.2rem;
}

footer {
    background-color: #0a0a0a;
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid #333;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.footer-logo img {
    width: 80px;
    height: 80px;
    border-radius: 10%;
}

.footer-logo span {
    font-size: 25px;
    font-weight: bold;
}

.copyright {
    color: #888;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .gallery-item img {
        height: 240px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .back-link {
        font-size: 1rem;
    }
}

/* ========== Lightbox (современный, минималистичный) ========== */
:root {
    --lb-bg: rgba(6, 6, 6, 0.94);
    --lb-control: rgba(255, 255, 255, 0.85);
    --lb-control-hover: rgba(255, 255, 255, 1);
    --lb-radius: 12px;
    --lb-transition: 260ms cubic-bezier(.22, .9, .33, 1);
}

.lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--lb-transition);
    z-index: 2000;
}

.lightbox.visible {
    background: var(--lb-bg);
    opacity: 1;
    pointer-events: auto;
}

.lb-stage {
    max-width: 92%;
    max-height: 86%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    z-index: 2000;
}

.lb-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform-origin: center center;
    transition: transform var(--lb-transition), opacity var(--lb-transition);
    will-change: transform, opacity;
    background: #111;
    object-fit: contain;
}

.lb-caption {
    margin-top: 12px;
    color: #ddd;
    font-size: 0.95rem;
    text-align: center;
}

.lb-close {
    position: fixed;
    top: 20px;
    right: 20px;
    border: none;
    background: transparent;
    color: var(--lb-control);
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: color 140ms;
    z-index: 2100;
}

.lb-close:hover {
    color: var(--lb-control-hover);
}

/* кнопки навигации */
.lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2100;
    /* повысили z-index */
    pointer-events: auto;
    /* чтобы клики ловились */
}

.lb-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.lb-prev {
    left: 24px;
}

.lb-next {
    right: 24px;
}

.lb-counter {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: #bbb;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 6px 12px;
    border-radius: 999px;
    z-index: 2100;
}

/* mobile adjustments */
@media (max-width: 600px) {
    .lb-prev {
        left: 12px;
        width: 48px;
        height: 48px;
    }

    .lb-next {
        right: 12px;
        width: 48px;
        height: 48px;
    }
}