/* ------------------------- */
/* Анимации */
/* ------------------------- */

.fade-in {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Мягкое появление блоков контента */
.article-block {
    opacity: 0;
    transform: translateY(8px);
    animation: fadeBlock 0.5s ease forwards;
}

@keyframes fadeBlock {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ------------------------- */
/* Основной контейнер статьи */
/* ------------------------- */

.article-single {
    max-width: 860px;
    margin: 140px auto 70px;
    background: #ffffff;
    padding: 42px 48px;
    border-radius: 22px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
    animation: fadeInUp .7s ease forwards;
}




/* ------------------------- */
/* Кнопка "Назад" */
/* ------------------------- */

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 20px;
    color: #3182f6;
    text-decoration: none;
    font-weight: 500;
    transition: 0.25s ease;
}

.back-btn:hover {
    opacity: 0.75;
    transform: translateX(-3px);
}


/* ------------------------- */
/* Заголовок статьи */
/* ------------------------- */

.single-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #0f172a;
    line-height: 1.25;
}

/* Дата публикации */
.single-date {
    color: #6b7280;
    margin-bottom: 26px;
    font-size: 15px;
}


/* ------------------------- */
/* Обложка */
/* ------------------------- */

.single-cover {
    width: 100%;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    transition: transform .3s ease;
}

.single-cover:hover {
    transform: scale(1.015);
}

.single-cover.no-img {
    height: 260px;
    background: linear-gradient(130deg, #dcefff 0%, #eef6ff 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #305a7a;
    font-size: 18px;
    font-weight: 500;
    border-radius: 16px;
}


/* ------------------------- */
/* Контент статьи */
/* ------------------------- */

.single-content {
    font-size: 19px;
    line-height: 1.78;
    color: #1f2937;
}

/* Параграфы */
.single-content p {
    margin-bottom: 18px;
}

/* Заголовки внутри статьи */
.single-content h2,
.block-heading {
    font-size: 26px;
    margin: 32px 0 12px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.single-content h3 {
    font-size: 22px;
    margin: 28px 0 10px;
    font-weight: 600;
    color: #1e293b;
}

/* Списки */
.single-content ul,
.single-content ol {
    padding-left: 22px;
    margin-bottom: 20px;
}

.single-content li {
    margin-left: 25px;
    margin-bottom: 8px;
}

/* Цитаты */
.single-content blockquote {
    margin: 24px 0;
    padding: 18px 22px;
    background: #f8fbff;
    border-left: 4px solid #3a8bff;
    border-radius: 8px;
    color: #334155;
    font-style: italic;
}

/* Изображения внутри контента */
.single-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 8px 22px rgba(0,0,0,0.1);
}

/* Ссылки */
.single-content a {
    color: #2563eb;
    text-decoration: none;
    border-bottom: 1px dashed rgba(37, 99, 235, .5);
    transition: 0.2s;
}

.single-content a:hover {
    opacity: 0.75;
    border-bottom-color: transparent;
}


/* Разделы внутри статьи */
.article-block {
    margin-bottom: 38px;
    padding-bottom: 22px;
    border-bottom: 1px solid #eef2f7;
}

.block-image {
    width: 100%;
    max-width: 900px;
    margin: 20px 0;
    border-radius: 12px;
    display: block;
}




/* === РЕАКЦИИ === */



.article-reactions {
    margin-top: 35px;
    font-family: "Inter", sans-serif;
}

.article-reactions h3 {
    margin-bottom: 14px;
    font-size: 20px;
    font-weight: 700;
    color: #222;
}

.reactions-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex-direction: row;
    margin-top: 20px;
    margin-bottom: 25px;
}

/* ===== Кнопка-реакция ===== */
.reaction-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 10px 14px;
    border: none;
    border-radius: 16px;

    background: linear-gradient(135deg, #f1f1f1, #dddddd);
    box-shadow: 0 2px 6px rgb(0 0 0 / 8%);
    
    cursor: pointer;
    transition: transform .25s cubic-bezier(.22,1,.36,1), 
                box-shadow .25s ease, 
                background .3s ease;
}

/* Иконка */
.reaction-btn .emoji {
    font-size: 20px;
}

/* Количество */
.reaction-count {
    background: #ff5d73;
    color: #fff;
    padding: 4px 6px;
    border-radius: 12px;
    font-size: 14px;
    min-width: 22px;
    text-align: center;

    transition: transform .25s cubic-bezier(.22,1,.36,1);
}

/* Hover эффект */
.reaction-btn:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 14px rgb(0 0 0 / 12%);
    background: linear-gradient(135deg, #d8d8e6, #d8d8e6);
}

/* Click – пружинка */
.reaction-btn:active {
    transform: scale(1.18);
}

/* Анимация увеличения цифры */
.reaction-btn.react-added .reaction-count {
    animation: pop 0.35s ease;
}

@keyframes pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.45); }
    100% { transform: scale(1); }
}

/* === Активная реакция === */
.reaction-btn.active {
    background: linear-gradient(135deg, #ff758c, #ff7eb3);
    /* box-shadow: 0 4px 12px rgba(255, 93, 115, 0.4), 0 0 0 4px rgba(255, 93, 115, 0.15); */
    transform: scale(1.05);
    color: #fff;
    transition: transform 0.25s cubic-bezier(.22,1,.36,1), 
                box-shadow 0.25s ease, 
                background 0.3s ease, 
                color 0.3s ease;
}

/* Гладкий глоу при наведении на активную */
.reaction-btn.active:hover {
    transform: scale(1.1);
}

/* Анимация цифры при активации */
.reaction-btn.active .reaction-count {
    animation: popActive 0.35s ease;
}

@keyframes popActive {
    0% { transform: scale(1); }
    50% { transform: scale(1.6); }
    100% { transform: scale(1); }
}

/* Немного увеличим emoji для активной реакции */
.reaction-btn.active .emoji {
    font-size: 20px;
    transition: font-size 0.25s ease;
}



/* ------------------------- */
/* Блок «не найдено» */
/* ------------------------- */

.not-found-block {
    text-align: center;
    margin-top: 140px;
}

.back-btn.big {
    font-size: 20px;
}

/* БЛОК КОДА */

.code-block {
    background: #171717;
    color: #dcdcdc;
    padding: 18px 20px;
    border-radius: 10px;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 14px;
    overflow-x: auto;
    line-height: 1.5;
    border-left: 4px solid #ff8100;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-block::-webkit-scrollbar {
    height: 6px;
}
.code-block::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

/* ОТКРЫТОЕ ФОТО */

/* затемнённый фон */
.image-viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* сам контейнер с картинкой */
.image-viewer-overlay img {
    max-width: 90%;
    max-height: 90%;
    transition: transform 0.2s ease;
    cursor: grab;
}

/* плавное появление */
.image-viewer-overlay.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0 }
    to   { opacity: 1 }
}


/* КАРУСЕЛЬ ИЗОБРАЖЕНИЙ */

.image-carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 950px;
    margin: 25px auto;
    overflow: hidden;
}

/* Лента */
.image-carousel {
    display: flex;
    transition: transform 0.4s ease;
}

/* Слайд фиксированного размера */
.carousel-slide {
    min-width: 100%;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0001120a;
    border-radius: 16px;
}

/* Картинка в центре и сохраняет пропорции */
.carousel-slide img {
    max-width: 100%;
    max-height: 90%;
    object-fit: contain;          /* Сохраняем оригинальный размер, не растягиваем */
    display: block;
}

/* ===== Кнопки листания ===== */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 48%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: #fff;
    border: none;
    width: 36px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.25s ease;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(0,0,0,0.45);
}

.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

/* Подпись */
.carousel-caption {
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.5;
    color: #444;
    text-align: center;
}


.article-single, 
.single-content, 
.single-content h2, 
.single-content h3, 
.single-content p, 
.single-content li, 
.single-content blockquote, 
.single-content a {
    font-family: 'Inter', sans-serif;
}


@media (max-width: 768px) {

    .container {
        padding: 0 4px;
    }

    .article-single {
        padding: 26px 24px;
        margin: 20px 0px 0px
    }

    .single-title {
        font-size: 24px;
    }

    .single-content h2, .block-heading {
        font-size: 20px;
        margin: 12px 0 12px;
    }

    .single-content {
        font-size: 14px;
    }
    .single-content li {
        margin-left: 15px;
    }

    .reaction-btn {
        padding: 6px 6px;
        gap: 4px;
        border-radius: 6px;

    }

    .reaction-btn .emoji {
        font-size: 16px;
    }

    .reaction-count {
        padding: 4px 4px;
        font-size: 12px;
    }
}



