/* Основные стили галереи */
body.gallery-page {
    background: url('../img/autovysh-fon-2.jpg') no-repeat center center;
    background-size: cover;
    min-height: 100vh;
}

body.gallery-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgb(14 14 32), rgba(0, 0, 0, 20%));
    z-index: -1;
}

.gallery-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    color: white;
    min-height: calc(100vh - 200px);
}

.gallery-title {
    text-align: center;
    margin-bottom: 40px;
    color: #ffffff;
    font-size: 2.5em;
    text-shadow: 2px 2px 5px #000000;
    font-family: "Shantell Sans", cursive;
}

.gallery-description {
    text-align: center;
    margin-bottom: 40px;
    color: #ffffff;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    font-family: "Shantell Sans", cursive;
    font-size: 1.1em;
    text-shadow: 1px 1px 3px #000000;
}

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

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 4/3;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
    padding: 30px 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-overlay p {
    margin: 0;
    font-family: "Shantell Sans", cursive;
    font-size: 1.1em;
    text-shadow: 1px 1px 3px #000000;
}

/* Модальное окно для просмотра изображений */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    z-index: 1000;
    overflow: hidden;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    transition: opacity 0.3s ease;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    text-shadow: 2px 2px 5px #000000;
    transition: color 0.3s ease;
}

.close:hover {
    color: #f96332;
}

/* Кнопки навигации */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    padding: 15px;
    cursor: pointer;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #f96332;
}

/* Modern gallery refresh */
body.gallery-page,
.gallery-title,
.gallery-description,
.gallery-item-overlay p {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    letter-spacing: 0;
}

body.gallery-page::before {
    background: linear-gradient(135deg, rgba(17, 24, 32, 0.92), rgba(23, 47, 54, 0.76));
}

.gallery-title {
    font-weight: 900;
    line-height: 1.08;
    text-shadow: none;
}

.gallery-description {
    color: rgba(255, 255, 255, 0.84);
    text-shadow: none;
}

.gallery-item {
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.gallery-item:hover {
    transform: translateY(-4px);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
        padding: 0 10px;
    }

    .gallery-title {
        font-size: 2em;
        padding: 0 10px;
    }

    .gallery-description {
        font-size: 1em;
        padding: 0 15px;
    }

    .nav-btn {
        padding: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }
}

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

    .gallery-container {
        padding: 20px 10px;
    }
} 

@media (max-width: 768px) {
    .gallery-container {
        width: 100%;
        max-width: 100%;
        padding: 24px 14px 34px;
    }

    .gallery-title {
        margin-bottom: 12px;
        padding: 0;
        font-size: clamp(28px, 8vw, 34px);
        line-height: 1.1;
    }

    .gallery-description {
        max-width: 100%;
        margin-bottom: 22px;
        padding: 0;
        font-size: 15px;
        line-height: 1.5;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 0;
    }

    .gallery-item {
        min-height: 0;
        aspect-ratio: 4 / 3;
    }

    .gallery-item-overlay p {
        font-size: 14px;
        line-height: 1.35;
    }
}
