﻿/* 🌿 Основний стиль сторінки новин */
.news-page {
    font-family: 'Segoe UI', sans-serif;
    color: #333;
    padding-top: 100px;
}

/* 🧱 Сітка карток новин */
.news-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* 📰 Картка новини */
.news-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    transition: transform .3s, box-shadow .3s;
}

    .news-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 8px 26px rgba(0, 0, 0, 0.1);
    }

/* 🖼️ Прев’ю фото у списку */
.news-thumb {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

/* 📄 Вміст картки */
.news-body {
    padding: 20px;
}

/* 🔗 Заголовок */
.news-title a {
    color: #422b16;
    text-decoration: none;
    font-weight: 600;
}

    .news-title a:hover {
        color: #7a5d38;
    }

/* 🔘 Кнопка "Читати далі" */
.read-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 18px;
    background: #e6d8b4;
    color: #3c2c15;
    font-weight: 600;
    border-radius: 20px;
    text-decoration: none;
    transition: background .3s;
}

    .read-btn:hover {
        background: #d1c095;
    }

/* ✨ Анімація появи */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: none;
    }
}

/* 📜 Сторінка новини */
.news-details {
    max-width: 850px;
    margin: 0 auto;
    padding-top: 100px;
    font-family: 'Segoe UI', sans-serif;
}

/* 🖼️ Головне зображення */
/* 🖼️ Головне фото — попередній перегляд з рамками */
.news-detail-img {
    display: block;
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain; /* зберігає пропорції */
    border-radius: 12px;
    margin: 0 auto 30px auto;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    background-color: #f9f9f9; /* легка підкладка */
    transition: transform .3s ease;
    cursor: pointer;
}

    .news-detail-img:hover {
        transform: scale(1.02);
    }


/* 📖 Основний текст */
.news-content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #2b2b2b;
}

/* 🖼️ Галерея додаткових фото */
.news-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    justify-items: center;
    margin-top: 20px;
}

    .news-gallery img {
        width: 100%;
        height: 190px;
        object-fit: cover;
        border-radius: 8px;
        box-shadow: 0 3px 8px rgba(0,0,0,0.1);
        cursor: pointer;
        transition: transform .25s ease;
    }

        .news-gallery img:hover {
            transform: scale(1.04);
        }

/* 🔙 Кнопка назад */
.back-btn {
    display: inline-block;
    background: #f2eee3;
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    color: #3c2c15;
    font-weight: 600;
    transition: .3s;
}

    .back-btn:hover {
        background: #e1d7c3;
    }

/* 🌌 Лайтбокс */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 9999;
}

    .lightbox.active {
        visibility: visible;
        opacity: 1;
    }

    .lightbox img {
        max-width: 90%;
        max-height: 90%;
        border-radius: 10px;
        box-shadow: 0 0 20px rgba(0,0,0,0.6);
        object-fit: contain;
    }

    /* 🔘 Кнопки */
    .lightbox .close-btn,
    .lightbox .prev-btn,
    .lightbox .next-btn {
        position: absolute;
        color: white;
        font-size: 2.5rem;
        cursor: pointer;
        user-select: none;
        transition: transform .2s;
    }

    .lightbox .close-btn {
        top: 25px;
        right: 40px;
    }

    .lightbox .prev-btn {
        left: 60px;
        top: 50%;
        transform: translateY(-50%);
    }

    .lightbox .next-btn {
        right: 60px;
        top: 50%;
        transform: translateY(-50%);
    }

        .lightbox .prev-btn:hover,
        .lightbox .next-btn:hover,
        .lightbox .close-btn:hover {
            transform: scale(1.2);
        }


/* 📱 Адаптація */
@media (max-width: 768px) {
    .news-detail-img {
        max-height: 300px;
        border-radius: 8px;
    }

    .news-gallery img {
        height: 150px;
    }
}
/* 🔧 Гарантуємо, що лайтбокс завжди поверх усіх елементів */
html, body {
    height: 100%;
    overflow: visible !important;
}

    /* Забороняємо прокрутку, коли відкрито лайтбокс */
    body.lightbox-open {
        overflow: hidden;
    }

/* Коректне позиціонування поверх усього */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 99999;
}

    .lightbox.active {
        visibility: visible;
        opacity: 1;
    }
