/* ========================================
   ОСНОВНЫЕ СТИЛИ СТРАНИЦЫ
   ======================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #1e293b;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Секция */
.section {
    padding: 60px 0 80px;
    min-height: 100vh;
}

/* Кнопка назад */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: #2c6e9e;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: 500;
    margin-bottom: 40px;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.back-btn:hover {
    background: #2c6e9e;
    color: white;
    border-color: #2c6e9e;
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(44, 110, 158, 0.15);
}

/* Заголовок */
.section-title {
    font-size: 3rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 48px;
    border-left: 4px solid #2c6e9e;
    padding-left: 20px;
}

/* ========================================
   СЕТКА ГАЛЕРЕИ
   ======================================== */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 32px;
}

.gallery-item {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.15);
}

.gallery-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

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

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-overlay i {
    font-size: 2.5rem;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 16px;
    border-radius: 50%;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay i {
    transform: scale(1);
}

.info {
    padding: 20px;
    background: white;
}

.info p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #334155;
}

.info b {
    color: #1e293b;
    font-size: 1rem;
}

/* ========================================
   УНИКАЛЬНОЕ МОДАЛЬНОЕ ОКНО
   ======================================== */

.projects-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.projects-modal.show {
    display: flex;
}

.projects-modal-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.projects-modal-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.projects-modal-image {
    max-width: 65vw;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: transparent;
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Кнопка закрытия */
.projects-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 44px;
    height: 44px;
    background: #ff4444;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.projects-modal-close:hover {
    background: #ff0000;
    transform: scale(1.05);
}

/* Кнопки навигации */
.projects-modal-prev,
.projects-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: white;
    font-size: 1.4rem;
    z-index: 10;
}

.projects-modal-prev {
    left: -60px;
}

.projects-modal-next {
    right: -60px;
}

.projects-modal-prev:hover,
.projects-modal-next:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.05);
}

/* Подпись к изображению */
.projects-modal-caption {
    position: absolute;
    bottom: -70px;
    left: 0;
    right: 0;
    text-align: center;
}

.projects-modal-caption-text {
    display: inline-block;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    padding: 12px 24px;
    border-radius: 40px;
    color: white;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 90%;
}

.projects-modal-caption-text b {
    color: #ffaa44;
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */

@media (max-width: 768px) {
    .section {
        padding: 40px 0 60px;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 32px;
    }
    
    .gallery {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .projects-modal-prev,
    .projects-modal-next {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .projects-modal-prev {
        left: -20px;
    }
    
    .projects-modal-next {
        right: -20px;
    }
    
    .projects-modal-close {
        top: -45px;
        right: 0;
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .projects-modal-image {
        max-width: 95vw;
        max-height: 70vh;
    }
    
    .projects-modal-caption {
        bottom: -60px;
    }
    
    .projects-modal-caption-text {
        padding: 8px 16px;
        font-size: 0.8rem;
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .projects-modal-prev,
    .projects-modal-next {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .projects-modal-prev {
        left: -16px;
    }
    
    .projects-modal-next {
        right: -16px;
    }
    
    .projects-modal-close {
        top: -40px;
        width: 34px;
        height: 34px;
    }
}