body {
    font-family: 'Mulish', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: rgb(255, 255, 255);
    margin: 0;
    padding: 0;
}

.article-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.article-header {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.article-title {
    font-size: 2.2rem;
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.article-meta {
    color: #7f8c8d;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    transition: transform 0.2s;
}

.article-content img:hover {
    transform: scale(1.02);
}

.article-content img[src*="uploads/"] {
    padding: 5px;
    background: #fff;
}

/* Для главного изображения статьи */
.article-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    margin: 20px 0;
    cursor: pointer;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.6;
}

.article-content p {
    margin: 0 0 15px 0;
}

.article-content ul,
.article-content ol {
    list-style: initial !important;
    /* Восстанавливает стандартные маркеры */
    margin: 15px 0;
    padding-left: 40px;
}

.article-content li {
    margin-bottom: 8px;
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    padding: 10px 20px;
    background: #0077bb;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.back-link:hover {
    background: rgb(0, 105, 165);
}

/* Lightbox стили */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.lightbox-prev,
.lightbox-next {
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    user-select: none;
}

.lightbox-prev {
    border-radius: 0 5px 5px 0;
}

.lightbox-next {
    border-radius: 5px 0 0 5px;
}

@media (max-width: 768px) {
    .article-container {
        margin: 20px;
        padding: 20px;
    }

    .article-title {
        font-size: 1.8rem;
    }

    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }

    .lightbox-close {
        top: -50px;
        right: -10px;
    }

    .lightbox-prev,
    .lightbox-next {
        padding: 15px;
        font-size: 25px;
    }
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.article-content table,
.article-content th,
.article-content td {
    border: 1px solid #ddd;
}

.article-content th {
    background-color: rgb(255, 255, 255);
    padding: 10px;
    text-align: left;
}

.article-content td {
    padding: 10px;
}

.article-content img {
    object-fit: cover;
    border-radius: 5px;
}

img.img-small {
    max-width: 100%;
    height: 150px;
    width: 150px;
    object-fit: cover;
    cursor: pointer;
}

img.img-original {
    max-width: 100%;
    height: auto;
    cursor: default;
    pointer-events: none !important;
}

img.img-original-clickable {
    max-width: 100%;
    height: auto;
    cursor: pointer;
}


.lightbox-close-bottom {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-zoom-controls {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1001;
}

.lightbox-zoom-in,
.lightbox-zoom-out,
.lightbox-reset {
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.lightbox-zoom-in:hover,
.lightbox-zoom-out:hover,
.lightbox-reset:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Анимация масштабирования */
.lightbox-img {
    transition: transform 0.3s ease;
    transform-origin: center center;
}

@media (max-width: 768px) {
    .lightbox-zoom-controls {
        bottom: 60px;
    }

    .lightbox-close-bottom {
        bottom: 10px;
        padding: 8px 15px;
        font-size: 14px;
    }
}

.gallery-container {
    margin: 20px 0;
}



.gallery-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.gallery-item {
    height: 150px;
    object-fit: cover;
    border-radius: 5px;

    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

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

.gallery-error {
    padding: 10px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #d32f2f;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .gallery-item {
        flex: 1 0 calc(33.333% - 10px);
        max-width: calc(33.333% - 10px);
    }
    video {
        width: 400px;
    }
}

@media (max-width: 480px) {
    .gallery-item {
        flex: 1 0 calc(50% - 10px);
        max-width: calc(50% - 10px);
    }
    video {
        width: 300px;
    }
}

@media (max-width: 992px) {

    img.img-small,
    img.img-original-clickable {
        width: 100%;
        max-width: none;
    }

}