﻿/* =========================================================
   🌿 БАЗА ТА ЗАГАЛЬНИЙ ФОН
   ========================================================= */
html, body {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    font-family: 'Segoe UI', sans-serif;
    background: #fafafa url('/images/pattern-light.svg') repeat center center;
    color: #222;
    overflow-x: hidden;
}

:root {
    --header-h: 72px; /* Висота шапки для відступу зверху */
}

/* 🔹 Фонові декоративні шари (градієнт + візерунок) */
body::before {
    background: linear-gradient(180deg, #fafafa 0%, #fafafa 65%, #fff8d6 95%, #ffe8a0 100%);
}


body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: url('/images/pattern-light.svg') repeat center / 340px;
    opacity: 0.08;
}

/* 🔹 Відключення "fixed background" для мобільних (iOS Safari) */
@media (pointer: coarse) {
    body::before, body::after {
        position: absolute;
        background-attachment: scroll;
    }
}

/* =========================================================
   🎥 HERO: плавний zoom-in ефект + м’який паралакс
   ========================================================= */
.hero {
    position: relative;
    height: 105vh;
    min-height: 600px;
    overflow: hidden;
    z-index: 0;
    /* Фото */
    background-image: url('/images/church-banner.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center calc(35% + var(--hero-parallax, 0px));
    background-attachment: fixed;
    /* Плавність */
    transition: opacity 1s ease-out, background-position 0.2s ease-out;
    will-change: background-position, transform;
}

    /* 🔹 Темна підкладка поверх фото */
    .hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1;
        transition: background 2s ease-in-out;
    }

/* 🔹 Контент поверх */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff8d8;
    padding-top: calc(var(--header-h) + 20vh);
    animation: fadeIn 1.2s ease;
}

/* 🔹 Ключова анімація “дихання” */
@keyframes heroZoomIn {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
    }
}

/* 🔹 Активний стан — ефект Google Photos */
.hero.idle-zoom {
    animation: heroZoomIn 18s ease-in-out infinite;
}

    .hero.idle-zoom::before {
        background: rgba(0, 0, 0, 0.55); /* легке затемнення під час zoom */
    }

/* =========================================================
   📱 Адаптивність hero
   ========================================================= */
@media (max-width: 992px) {
    .hero {
        background-attachment: scroll;
        height: 80vh;
    }

    .hero-content {
        padding-top: calc(var(--header-h) + 14vh);
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }
}



/* =========================================================
   ✨ Ефекти прокрутки hero (м’який паралакс)
   ========================================================= */
@media (min-width: 993px) {
    .hero {
        background-attachment: fixed;
        transition: background-position 0.2s ease-out;
    }
}

/* =========================================================
   🔹 Відключення білої смуги під шапкою
   ========================================================= */
body.has-fixed-header {
    padding-top: 0 !important;
}



/* =========================================================
   🔹 HEADER (ФІКСОВАНА ШАПКА)
   ========================================================= */
#mainHeader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    padding: 14px 0;
    background: rgba(8,26,64,0.82);
    color: #fff;
    backdrop-filter: saturate(120%) blur(4px);
    -webkit-backdrop-filter: saturate(120%) blur(4px);
    transition: padding .22s ease, background-color .22s ease, box-shadow .22s ease;
}

    /* При скролі — зменшується */
    #mainHeader.shrink {
        padding: 6px 0;
        background: rgba(8,26,64,0.95);
        box-shadow: 0 6px 18px rgba(0,0,0,.18);
    }

    #mainHeader .navbar {
        padding: 0;
        margin: 0;
    }

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

    .navbar-brand img {
        width: 32px;
        height: 32px;
        transition: transform .22s ease;
    }

#mainHeader.shrink .navbar-brand img {
    transform: scale(0.88);
}

.navbar-brand .text-gold {
    color: #ffd85a;
    font-weight: 700;
    letter-spacing: .6px;
}

/* Меню навігації */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: .5rem;
}

    .navbar-nav .nav-link {
        color: rgba(255,255,255,.92) !important;
        padding: .5rem .9rem;
        border-radius: 10px;
        transition: background .2s ease, transform .2s ease;
        font-weight: 600;
    }

        .navbar-nav .nav-link:hover {
            background: rgba(255,255,255,.10);
            transform: translateY(-2px);
        }

/* Кнопка мобільного меню */
.navbar-toggler {
    border: none;
    background: rgba(255,255,255,0.12);
    width: 44px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 8px;
}

    .navbar-toggler .navbar-toggler-icon {
        filter: invert(1) brightness(1.2);
    }

/* Випадаюче меню на мобільному */
.navbar-collapse.show {
    background: rgba(8,26,64,0.96);
    border-radius: 8px;
    padding: .75rem 1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}



/* =========================================================
   ✨ КНОПКИ (основні стилі)
   ========================================================= */
.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Золота кнопка */
.btn-gold {
    background: linear-gradient(180deg, #fceabb 0%, #f8d25c 100%);
    border: 1px solid #e6b93f;
    color: #5a4400;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

    .btn-gold:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 18px rgba(226,172,52,0.12);
    }

/* Прозора золота кнопка */
.btn-gold-outline {
    background: transparent;
    border: 2px solid #d8b444;
    color: #7b661c;
}

    .btn-gold-outline:hover {
        background: rgba(255,248,220,0.18);
        transform: translateY(-2px);
    }

/* =========================================================
   📱 АДАПТИВНІСТЬ
   ========================================================= */
@media (max-width: 992px) {
    .navbar-nav {
        flex-direction: column;
        gap: .25rem;
        align-items: stretch;
    }

        .navbar-nav .nav-link {
            text-align: center;
            border-radius: 8px;
        }
}

/* =========================================================
   🏞️ PARALLAX (нижня секція з фоном)
   ========================================================= */
.parallax {
    position: relative;
    z-index: 0;
    min-height: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    overflow: hidden;
}

    /* Напівпрозорий темний шар поверх фото */
    .parallax::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 0;
    }

    /* Контейнер контенту поверх */
    .parallax .container {
        position: relative;
        z-index: 1;
    }

/* Вимикаємо "fixed" для iOS */
@supports (-webkit-overflow-scrolling: touch) {
    .parallax {
        background-attachment: scroll;
    }
}

/* =========================================================
   🌟 Анімації
   ========================================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}
/* =========================================================
   🩵 Фіксація поведінки hero при відкритті меню
   ========================================================= */
#mainHeader {
    z-index: 2000;
}

.hero {
    position: relative;
    z-index: 0;
}

.navbar-collapse.show {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 2500;
    /* фон і легка тінь */
    background: rgba(8, 26, 64, 0.96);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}
/* =========================================================
   🕊️ ВІДСТУП ПІД ШАПКУ — ТІЛЬКИ ДЛЯ СТОРІНОК НОВИН
   ========================================================= */
.news-page,
.news-details {
    padding-top: calc(var(--header-h) + 28px) !important;
}

body.news-active {
    scroll-padding-top: calc(var(--header-h) + 28px);
}


