/* ========================================
   Сторінка новини
   ======================================== */

.news-detail-wrapper {
    padding: 40px 20px 80px;
    max-width: 960px;
    margin: 0 auto;
}

/* Назад */
.nd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
}

.nd-breadcrumb-sep {
    color: #b3c8de;
    font-size: 14px;
}

.nd-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0080cc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.nd-back-link:hover { color: #005fa3; }

/* --- Герой --- */
.nd-hero {
    width: 100%;
    height: 420px;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    margin-bottom: 40px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.nd-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.15) 60%, transparent 100%);
}

.nd-hero-content {
    position: absolute;
    bottom: 32px;
    left: 36px;
    right: 36px;
    color: #fff;
}

.nd-date {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 20px;
    padding: 3px 14px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.nd-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.4);
    margin: 0;
}

/* --- Текст --- */
.nd-content {
    font-size: 17px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 56px;
}

.nd-content h2 {
    font-size: 25px;
    color: #0077cc;
    border-left: 4px solid #0077cc;
    padding-left: 12px;
    margin: 36px 0 16px;
    font-weight: 700;
}

.nd-content h3 {
    font-size: 20px;
    color: #003366;
    margin: 28px 0 12px;
    font-weight: 600;
}

.nd-content p {
    margin-bottom: 16px;
}

.nd-content p.nd-lead {
    font-size: 19px;
    color: #0080cc;
    font-weight: 400;
    border-left: 4px solid #0080cc;
    padding-left: 14px;
    margin-bottom: 28px;
}

.nd-content ul,
.nd-content ol {
    padding-left: 28px;
    margin-bottom: 16px;
}

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

.nd-content strong {
    color: #003366;
}

.nd-content blockquote {
    border-left: 4px solid #2f80ed;
    padding: 14px 20px;
    margin: 28px 0;
    background: #f0f7ff;
    border-radius: 0 8px 8px 0;
    color: #1a3a5c;
    font-style: italic;
    font-size: 17px;
    line-height: 1.7;
}

.nd-content blockquote em {
    font-style: normal;
    color: #555;
    font-size: 14px;
}

@media (max-width: 768px) {
    .nd-content h2 { font-size: 20px; }
    .nd-content h3 { font-size: 18px; }
    .nd-content p.nd-lead { font-size: 16px; }
}

/* --- Галерея --- */
.nd-gallery-section {
    margin-top: 8px;
}

.nd-gallery-title {
    font-size: 24px;
    font-weight: 700;
    color: #0080cc !important;
    margin-bottom: 24px;
}

.nd-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.nd-gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    aspect-ratio: 4 / 3;
    background: #eee;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nd-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}

.nd-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

/* --- Приховані фото (>6) --- */
.nd-gallery-item--hidden {
    display: none;
}

.nd-gallery-item--hidden.nd-gallery-item--visible {
    display: block;
    animation: nd-fadein 0.3s ease;
}

@keyframes nd-fadein {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

/* --- Кнопка "Показати ще" --- */
.nd-gallery-more {
    text-align: center;
    margin-top: 20px;
}

.nd-gallery-more-btn {
    display: inline-block;
    padding: 10px 28px;
    background: transparent;
    color: #2f80ed;
    border: 2px solid #2f80ed;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.nd-gallery-more-btn:hover {
    background: #2f80ed;
    color: #fff;
}

.nd-gallery-more-btn.expanded {
    color: #888;
    border-color: #ccc;
}

.nd-gallery-more-btn.expanded:hover {
    background: #f5f5f5;
    color: #555;
}

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

.nd-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 13px;
    padding: 8px 12px;
    transform: translateY(100%);
    transition: transform 0.25s ease;
}

.nd-gallery-item:hover .nd-gallery-caption {
    transform: translateY(0);
}

/* --- Lightbox --- */
.nd-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.nd-lightbox.active {
    display: flex;
}

.nd-lightbox img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.nd-lightbox-caption {
    color: #ddd;
    font-size: 15px;
    text-align: center;
    max-width: 600px;
    margin: 0;
}

.nd-lightbox-close {
    position: fixed;
    top: 20px;
    right: 28px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s;
    padding: 0;
    z-index: 10;
}

.nd-lightbox-close:hover { opacity: 0.7; }

.nd-lightbox-prev,
.nd-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 52px;
    line-height: 1;
    cursor: pointer;
    padding: 8px 18px;
    border-radius: 6px;
    transition: background 0.2s;
    z-index: 10;
    user-select: none;
}
.nd-lightbox-prev { left: 16px; }
.nd-lightbox-next { right: 16px; }
.nd-lightbox-prev:hover,
.nd-lightbox-next:hover { background: rgba(255,255,255,0.25); }

.nd-lightbox-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    letter-spacing: 1px;
}

.nd-lightbox img {
    transition: opacity 0.15s ease;
}

/* --- Слайдер: кнопка і оверлей --- */
/* --- Responsive --- */
@media (max-width: 768px) {
    .nd-hero { height: 280px; }
    .nd-title { font-size: 22px; }
    .nd-hero-content { left: 20px; right: 20px; bottom: 20px; }
    .nd-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
