.news-detail {
    max-width: 100%;
    padding: 0;
}

.back-link {
    display: inline-block;
    margin-bottom: 25px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--text-secondary);
}

.news-detail h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.3;
    color: var(--text-secondary);
    font-weight: 600;
}

.news-detail .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-secondary);
    font-size: 0.9rem;
    color: var(--text-muted);
    align-items: center;
}

.news-detail .meta > span,
.news-detail .meta > a,
.news-detail .meta .tags {
    padding: 4px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

.news-detail .meta > a {
    text-decoration: none;
    color: inherit;
}

.news-detail .meta > a:hover,
.news-detail .meta .tags a:hover {
    opacity: 0.8;
}

.news-detail .meta > span:first-child {
    font-weight: 500;
    background-color: var(--bg-hover);
}

/* Убираем стили со span внутри ссылок */
.news-detail .meta a > span {
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
}

.tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 !important;
    background-color: transparent !important;
    border: none !important;
}

.tags a {
    text-decoration: none;
    color: inherit;
    padding: 4px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    transition: opacity 0.3s ease;
    display: inline-block;
}

.tags a > span {
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
}

.news-detail .featured-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid var(--border-secondary);
    transition: opacity 0.3s ease;
}

.news-detail .featured-image:hover {
    opacity: 0.9;
}

.news-detail .content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.news-detail .content p {
    margin-bottom: 20px;
}

.additional-images {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-secondary);
}

.additional-images h3 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--text-secondary);
    font-weight: 600;
}

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

.gallery-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-secondary);
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease, border-color 0.3s ease;
}

.gallery-image:hover {
    transform: translateY(-4px);
    opacity: 0.9;
    border-color: var(--border-hover);
}

.clickable-image {
    cursor: zoom-in;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

[data-theme="dark"] .modal {
    background-color: rgba(0, 0, 0, 0.95);
}

[data-theme="light"] .modal {
    background-color: rgba(0, 0, 0, 0.85);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: var(--text-hover);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s ease;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--text-muted);
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
    border-radius: 4px;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
    text-align: center;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    max-width: 80%;
}

[data-theme="light"] .modal-caption {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
}

/* Адаптивность */
@media (max-width: 768px) {
    .news-detail h1 {
        font-size: 1.8rem;
    }

    .news-detail .content {
        font-size: 1rem;
    }

    .news-detail .featured-image {
        max-height: 400px;
    }

    .image-gallery {
        grid-template-columns: 1fr;
    }

    .gallery-image {
        height: 200px;
    }

    .additional-images h3 {
        font-size: 1.5rem;
    }

    .news-detail .meta {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 35px;
    }

    .modal-content {
        max-width: 95%;
        max-height: 85vh;
    }

    .modal-caption {
        font-size: 0.9rem;
        bottom: 10px;
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    .news-detail h1 {
        font-size: 1.5rem;
    }

    .news-detail .content {
        font-size: 0.95rem;
    }

    .news-detail .featured-image {
        max-height: 300px;
    }

    .additional-images h3 {
        font-size: 1.3rem;
    }
}