/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Serif Pro', serif;
    color: #333;
    background-color: #f9f7f2;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Шапка - КАК БЫЛО */
.header {
    background-color: rgba(255, 255, 255, 0.95);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(5px);
}

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

.logo {
    font-family: 'Source Serif Pro', serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: #222;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-size: 1.1rem;
    color: #555;
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover {
    color: #c62828;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #c62828;
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #555;
    cursor: pointer;
}

/* Главный экран - КАК БЫЛО с hero-bg.jpg */
.hero {
    height: 100vh;
    position: relative;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('img/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    color: white;
    margin-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 40px;
    opacity: 0.9;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    gap: 10px;
}

.btn-primary {
    background-color: #b71c1c;
    color: white;
}

.btn-primary:hover {
    background-color: #a11c1c;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-telegram {
    background-color: #4772c4;
    color: white;
}

.btn-telegram:hover {
    background-color: #36599c;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(198, 40, 40, 0.3);
}

/* Галерея */
.gallery {
    padding: 100px 0;
    background-color: #fff;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 15px;
    color: #222;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 60px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

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

.work-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.work-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* ИСПРАВЛЕНИЯ ДЛЯ ВЕРТИКАЛЬНЫХ ФОТО */
.work-image {
    position: relative;
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f1e8;
}

.work-main-img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.5s;
}

/* Специальные стили для вертикальных фото */
.work-main-img.vertical {
    width: auto;
    height: 100%;
    max-width: 80%;
}

.work-card:hover .work-main-img {
    transform: scale(1.05);
}

.work-more-photos {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.work-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.work-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #222;
}

.work-desc {
    margin-bottom: 0;
    flex-grow: 1;
}

.work-desc p {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #555;
}

/* Контакты */
.contacts {
    padding: 80px 0;
    background-color: #f5f1e8;
}

.contacts-text {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 50px;
    color: #555;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    text-decoration: none;
    color: white;
    transition: transform 0.3s, box-shadow 0.3s;
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.social-link i {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.social-link span {
    font-size: 1.1rem;
    font-weight: 600;
}

.telegram {
    background: linear-gradient(135deg, #2AABEE, #229ED9);
}

.facebook {
    background: linear-gradient(135deg, #3b5998, #2d4373);
}

.avito {
    background: linear-gradient(135deg, #FF5C00, #E65300);
}

.contacts-note {
    text-align: center;
    font-style: italic;
    color: #777;
    font-size: 1.1rem;
}

/* Подвал */
.footer {
    background-color: #222;
    color: #aaa;
    padding: 40px 0;
    text-align: center;
}

.footer-text {
    font-size: 1rem;
    margin-bottom: 10px;
}

.footer-subtext {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Лайтбокс - ИСПРАВЛЕННЫЙ */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 95vw;
    max-height: 95vh;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    overflow: hidden;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 1.2rem;
    font-family: 'Playfair Display', serif;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    z-index: 10;
}

/* Адаптивность */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 15px 0;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }
    
    .nav.active {
        display: flex;
    }
    
    .nav-link {
        padding: 10px 0;
        font-size: 1.2rem;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .hero {
        margin-top: 70px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1.1rem;
    }
    
    .works-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Адаптивность для вертикальных фото на мобильных */
    .work-image {
        height: 220px;
    }
    
    .work-main-img.vertical {
        max-width: 70%;
    }
    
    .social-links {
        gap: 20px;
    }
    
    .social-link {
        width: 120px;
        height: 120px;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .work-title {
        font-size: 1.3rem;
    }
    
    /* Адаптивность для вертикальных фото на маленьких экранах */
    .work-image {
        height: 200px;
    }
    
    .work-main-img.vertical {
        max-width: 65%;
    }
    
    .social-link {
        width: 100px;
        height: 100px;
    }
    
    .social-link i {
        font-size: 2rem;
    }
}

/* Анимации для плавного появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.work-card {
    animation: fadeIn 0.5s ease-out forwards;
}

.work-card:nth-child(1) { animation-delay: 0.1s; }
.work-card:nth-child(2) { animation-delay: 0.2s; }
.work-card:nth-child(3) { animation-delay: 0.3s; }
.work-card:nth-child(4) { animation-delay: 0.4s; }