.case-study {
width: 100%;
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
color: #1e293b;
line-height: 1.6;
box-sizing: border-box;
}

.case-heading {
font-size: 1.7rem;
font-weight: 700;
margin: 0 0 1rem;
color: #0f172a;
letter-spacing: -0.02em;
}

.case-text p {
margin: 0 0 1rem;
}

.case-text p:last-of-type {
margin-bottom: 1.5rem;
}

/* Галерея */
.gallery-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
gap: 14px;
margin-bottom: 2.5rem;
}

.gallery-item {
position: relative;
border-radius: 18px;
overflow: hidden;
aspect-ratio: 4 / 3;
cursor: pointer;
transition: transform 0.25s ease, box-shadow 0.25s ease;
box-shadow: 0 6px 18px rgba(0,0,0,0.07);
}

.gallery-item:hover {
transform: translateY(-5px);
box-shadow: 0 14px 30px rgba(0,0,0,0.13);
}

.gallery-item img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
transition: transform 0.4s ease;
}

.gallery-item:hover img {
transform: scale(1.05);
}

.gallery-overlay {
position: absolute;
inset: 0;
background: rgba(0,0,0,0.25);
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transition: opacity 0.3s ease;
color: white;
font-size: 2rem;
}

.gallery-item:hover .gallery-overlay {
opacity: 1;
}

/* Модальное окно */
.lightbox-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-modal.active {
opacity: 1;
visibility: visible;
}

.lightbox-backdrop {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.85);
backdrop-filter: blur(6px);
}

.lightbox-content {
position: relative;
max-width: 90vw;
max-height: 85vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 2;
}

.lightbox-image {
max-width: 100%;
max-height: 70vh;
object-fit: contain;
border-radius: 20px;
box-shadow: 0 24px 48px rgba(0,0,0,0.4);
transition: opacity 0.25s ease;
}

.lightbox-caption {
margin-top: 1.2rem;
color: #fff;
font-size: 1rem;
background: rgba(255,255,255,0.12);
padding: 0.5rem 1.5rem;
border-radius: 40px;
backdrop-filter: blur(8px);
}

.lightbox-close {
position: absolute;
top: -20px;
right: -20px;
background: rgba(255,255,255,0.15);
border: none;
color: white;
width: 44px;
height: 44px;
border-radius: 50%;
font-size: 2rem;
line-height: 1;
cursor: pointer;
backdrop-filter: blur(10px);
transition: background 0.2s;
display: flex;
align-items: center;
justify-content: center;
z-index: 3;
}

.lightbox-close:hover {
background: rgba(255,255,255,0.3);
}

.lightbox-prev,
.lightbox-next {
position: absolute;
top: 50%;
transform: translateY(-50%);
background: rgba(255,255,255,0.12);
border: none;
color: white;
width: 46px;
height: 46px;
border-radius: 50%;
font-size: 2rem;
cursor: pointer;
backdrop-filter: blur(8px);
transition: background 0.2s;
display: flex;
align-items: center;
justify-content: center;
z-index: 3;
}

.lightbox-prev:hover,
.lightbox-next:hover {
background: rgba(255,255,255,0.3);
}

.lightbox-prev {
left: 20px;
}

.lightbox-next {
right: 20px;
}

@media (max-width: 640px) {
.gallery-grid {
grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
.lightbox-prev,
.lightbox-next {
width: 38px;
height: 38px;
font-size: 1.5rem;
}
}