.gallery {
    /*background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%); */
    position: relative;
    overflow: hidden;
    padding: 80px 20px;
}

.gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /*background: */
    /*    radial-gradient(circle at 20% 80%, rgba(0, 255, 170, 0.1) 0%, transparent 50%), */
    /*    radial-gradient(circle at 80% 20%, rgba(0, 120, 255, 0.1) 0%, transparent 50%); */
    pointer-events: none;
}

.gallery-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
    min-height: 600px;
}

.gallery-page {
    display: none;
}

.gallery-page.active {
    display: contents;
}

.gallery-pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.gallery-nav-btn {
    background: linear-gradient(30deg, #667eea 0%, #764ba2 100%);
    border: 1px solid rgba(0, 255, 170, 0.3);
    color: #fff;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.gallery-nav-btn:hover:not(:disabled) {
    background: rgba(0, 255, 170, 0.2);
    border-color: rgba(0, 255, 170, 0.6);
    transform: translateY(-2px);
}

.gallery-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gallery-page-info {
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Orbitron', sans-serif;
    font-size: 1em;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 170, 0.2);
}
    
.gallery-card {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 255, 170, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    max-height: 450px;
    display: flex;
    flex-direction: column;
}
    
.gallery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(0, 255, 170, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-card:hover::before {
    opacity: 1;
}

.gallery-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(0, 255, 170, 0.4);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 255, 170, 0.2);
}
    
.gallery-card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    flex-shrink: 0;
}
    
.gallery-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-card-image img {
    transform: scale(1.1);
}

.gallery-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-card:hover .gallery-card-overlay {
    opacity: 1;
}
    
.gallery-card-content {
    padding: 25px;
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
    
.gallery-card-date {
    color: #00ffaa;
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
    
.gallery-card-date i {
    font-size: 0.8em;
}
    
.gallery-card-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.4em;
    color: #fff;
    margin-bottom: 15px;
    line-height: 1.3;
    font-weight: 400;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
}

.gallery-card-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    flex: 1;
}

.gallery-card-text {
    flex: 1;
}
    
.gallery-card-read-more {
    color: #00ffaa;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.gallery-card-read-more i {
    transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-card-read-more i {
    transform: translateX(5px);
}

.news-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.news-modal.show {
    opacity: 1;
}

.news-modal-content {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 2% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.7);
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 255, 170, 0.3);
}

.news-modal.show .news-modal-content {
    transform: scale(1);
}

.news-modal-header {
    position: relative;
    height: 300px;
    overflow: hidden;
    border-radius: 15px 15px 0 0;
}

.news-modal-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-modal-header-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 40px 30px 30px;
}

.news-modal-date {
    color: #00ffaa;
    font-size: 0.9em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-modal-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 2em;
    font-weight: 400;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.news-modal-body {
    padding: 30px;
}

.news-modal-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 25px;
}

.news-modal-content-text {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    font-size: 1em;
}

.news-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.news-modal-close:hover {
    background: rgba(255, 0, 0, 0.7);
    transform: scale(1.1);
}
    
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
    
@media (max-width: 768px) {
    .gallery-card {
        height: 420px;
    }
     .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .gallery-card-content {
        padding: 20px;
    }
    
    .gallery-pagination-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .gallery-nav-btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }
    
    .news-modal-content {
        margin: 5% auto;
        width: 95%;
    }
    
    .news-modal-title {
        font-size: 1.5em;
    }
    
    .news-modal-body {
        padding: 20px;
    }

    .gallery-pagination-controls {
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
    }

    .gallery-nav-btn .btn-text {
        display: none;
    }

    .gallery-page-info {
        font-size: 0.9em;
        padding: 8px 12px;
    }

    .gallery-nav-btn {
        padding: 10px;
        border-radius: 50%;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }

    .gallery-nav-btn i {
        font-size: 1.2em;
    }
}

.share-btn-main {
    font-family: 'Unbounded', sans-serif;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center; gap: 5px;
    font-size: 14px;
}

.spoiler {
    position: relative;
    display: inline;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.spoiler.hidden {
    background: rgba(255, 255, 255, 0.2);
    color: transparent;
    border-radius: 4px;
    padding: 2px 4px;
    backdrop-filter: blur(8px);
    animation: spoilerPulse 2s infinite;
}

.spoiler.hidden::after {
    content: "Нажмите, чтобы показать";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
}

.spoiler.revealed::after {
    content: "Нажмите, чтобы скрыть";
    position: absolute;
    top: -20px;
    left: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spoiler.revealed:hover::after {
    opacity: 1;
}

.spoiler.revealed {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 4px;
    animation: spoilerReveal 0.5s ease;
}

@keyframes spoilerPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes spoilerReveal {
    0% { 
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.02);
    }
    100% { 
        background: rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
}

.instruction {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}