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

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    min-height: 100vh;
    position: relative;
}

/* Фоновое изображение на всю страницу */
.page-with-bg {
    position: relative;
    min-height: 100vh;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/pamyat_bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

/* Контент поверх фона */
.content-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    background: rgba(10, 15, 28, 0.75);
    backdrop-filter: blur(8px);
    min-height: 100vh;
}

h1 {
    text-align: center;
    color: #ffefc0;
    font-size: 2.8rem;
    letter-spacing: 3px;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

.subtitle {
    text-align: center;
    color: #cbd5e1;
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255,215,150,0.3);
    display: inline-block;
    width: auto;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 0.5rem;
}

/* СЕТКА ГАЛЕРЕИ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    justify-items: center;
    align-items: start;
}

/* КАРТОЧКА МИНИАТЮРЫ */
.gallery-item {
    background: rgba(15, 20, 30, 0.8);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 350px;
    border: 1px solid rgba(255, 215, 150, 0.4);
    box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.4);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 215, 150, 0.8);
}

.gallery-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

.gallery-caption {
    padding: 0.8rem;
    text-align: center;
    color: #ffefc0;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.7);
    border-top: 1px solid rgba(255, 215, 150, 0.3);
    line-height: 1.4;
}

/* КНОПКА НА ГЛАВНУЮ */
.bottom-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-family: monospace;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: 1px solid rgba(255, 215, 150, 0.5);
}

.home-btn {
    background: rgba(15, 20, 30, 0.85);
    color: #ffecb3;
}

.home-btn:hover {
    background: #2c3e50;
    transform: translateY(-2px);
    border-color: #ffd966;
}

/* МОДАЛЬНОЕ ОКНО */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid #ffd966;
    transition: opacity 0.15s ease;
}

.modal-caption {
    margin-top: 0.8rem;
    color: #ffefc0;
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 1px 1px 3px black;
    max-width: 80vw;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

.modal-close {
    position: absolute;
    top: -35px;
    right: 0;
    color: #ffd966;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: #ffaa00;
}

/* СТРЕЛКИ НАВИГАЦИИ В МОДАЛЬНОМ ОКНЕ */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 2rem;
    color: #ffd966;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 215, 150, 0.5);
}

.modal-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
    color: #ffaa00;
    border-color: #ffaa00;
}

.modal-nav.prev {
    left: 20px;
}

.modal-nav.next {
    right: 20px;
}

/* Адаптив */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    .subtitle {
        font-size: 0.9rem;
    }
    .content-wrapper {
        padding: 1.5rem 1rem;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1rem;
    }
    .gallery-img {
        height: 180px;
    }
    .gallery-caption {
        font-size: 0.7rem;
        padding: 0.6rem;
    }
    .modal-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    .modal-nav.prev {
        left: 10px;
    }
    .modal-nav.next {
        right: 10px;
    }
    .bottom-buttons {
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 550px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 0.8rem;
    }
    .gallery-img {
        height: 150px;
    }
    .modal-caption {
        font-size: 0.75rem;
    }
}