/* =========================================================================
   Дім Віри — базові стилі
   Палітра та типографіка повторюють чинний сайт:
   акцент #bc8c96, світлий фон #f5eff0, текст #514f4e,
   заголовки Lora, рукописний акцент Alex Brush, основний текст Roboto.
   ========================================================================= */

:root {
    --accent:        #bc8c96;
    --accent-dark:   #a9717d;
    --soft:          #f5eff0;
    --dark:          #333333;
    --text:          #514f4e;   /* акцентований текст (ліди) */
    --body:          #7e8184;   /* основний текст, як --the7-base-color */
    --footer-bg:     #bb8c96;   /* смуга копірайту, як #bottom-bar.solid-bg */
    --white:         #ffffff;
    --header-h:      74px;
    --radius:        8px;
    --container:     1200px;
    --ease:          .3s ease;
}

/* ---------- Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
    -webkit-text-size-adjust: 100%;
}

/* Базовий шрифт сайту — Lora 17px/30px, як у чинній темі. */
body {
    margin: 0;
    font-family: 'Lora', Helvetica, Arial, Verdana, sans-serif;
    font-size: 17px;
    line-height: 30px;
    color: var(--body);
    background: var(--white);
}

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; }

h1, h2, h3, h4 {
    font-family: 'Lora', Georgia, serif;
    font-weight: 500;
    margin: 0 0 .5em;
    color: var(--dark);
}

p { margin: 0 0 1em; }

.accent { color: var(--accent); }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 20px;
}

.container--narrow { max-width: 900px; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--white);
    padding: 10px 16px;
}

.skip-link:focus { left: 10px; top: 10px; }

/* Доступний лише для скрінрідерів */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ---------- Header ---------- */

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 60;
    height: var(--header-h);
    transition: background var(--ease), box-shadow var(--ease);
}

.site-header.is-stuck {
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 2px 14px rgba(0, 0, 0, .08);
}

/* Меню вирівняне по ширині основного контенту. */
.site-header__inner {
    height: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-nav { flex: 1 1 auto; min-width: 0; }

.site-nav__list {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Розмір і гарнітура пунктів меню — як на чинному сайті: 20px/24px Lora. */
.site-nav__link {
    position: relative;
    display: inline-block;
    padding: 4px 0;
    font-family: 'Lora', Helvetica, Arial, Verdana, sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 24px;
    text-transform: none;
    text-decoration: none;
    color: var(--white);
    transition: color var(--ease);
}

.site-header.is-stuck .site-nav__link { color: var(--text); }

.site-nav__link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transform: translateX(-50%);
    transition: width var(--ease);
}

.site-nav__link:hover::after,
.site-nav__link:focus-visible::after { width: 100%; }

.site-header__aside {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 20px;
    overflow: hidden;
    white-space: nowrap;
}

.lang-switch__item {
    padding: 6px 13px;
    font-size: 13px;
    letter-spacing: .04em;
    line-height: 1.2;
    text-decoration: none;
    color: var(--white);
    transition: background var(--ease), color var(--ease);
}

.lang-switch__item + .lang-switch__item {
    border-left: 1px solid rgba(255, 255, 255, .5);
}

.lang-switch__item:hover { background: rgba(255, 255, 255, .18); }

.lang-switch__item.is-active {
    background: var(--accent);
    color: var(--white);
    cursor: default;
}

/* Прилипла шапка на світлому тлі */
.site-header.is-stuck .lang-switch { border-color: rgba(81, 79, 78, .3); }
.site-header.is-stuck .lang-switch__item { color: var(--text); }
.site-header.is-stuck .lang-switch__item + .lang-switch__item { border-left-color: rgba(81, 79, 78, .3); }
.site-header.is-stuck .lang-switch__item:hover { background: rgba(188, 140, 150, .15); }
.site-header.is-stuck .lang-switch__item.is-active { background: var(--accent); color: var(--white); }

/* ---------- Burger + mobile menu ---------- */

.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, .12);
    cursor: pointer;
}

.burger span {
    display: block;
    width: 20px;
    height: 2px;
    margin-inline: auto;
    background: var(--white);
    transition: background var(--ease);
}

.site-header.is-stuck .burger { background: rgba(51, 51, 51, .08); }
.site-header.is-stuck .burger span { background: var(--dark); }

.mobile-menu {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 80;
    width: min(320px, 86vw);
    padding: 80px 28px 32px;
    background: var(--dark);
    transform: translateX(100%);
    transition: transform var(--ease);
    overflow-y: auto;
}

.mobile-menu[hidden] { display: block; }
.mobile-menu.is-open { transform: translateX(0); }

.mobile-menu__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-menu__list li + li { margin-top: 4px; }

.mobile-menu__list a {
    display: block;
    padding: 12px 0;
    font-family: 'Lora', Helvetica, Arial, Verdana, sans-serif;
    font-size: 20px;
    line-height: 24px;
    color: var(--white);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    transition: color var(--ease);
}

.mobile-menu__list a:hover { color: var(--accent); }

.mobile-menu__lang {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.mobile-menu__lang a {
    flex: 0 0 auto;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 20px;
    font-size: 14px;
    color: var(--white);
}

.mobile-menu__lang a.is-active {
    background: var(--accent);
    border-color: var(--accent);
}

.mobile-menu__close {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.mobile-menu__close span {
    position: absolute;
    left: 6px;
    top: 16px;
    width: 22px;
    height: 2px;
    background: var(--white);
}

.mobile-menu__close span:first-child { transform: rotate(45deg); }
.mobile-menu__close span:last-child  { transform: rotate(-45deg); }

.menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    transition: opacity var(--ease);
}

.menu-backdrop.is-visible { opacity: 1; }

body.is-locked { overflow: hidden; }

/* ---------- Sections ---------- */

.section { padding: 70px 0; }
.section--soft { background: var(--soft); }

.section__title {
    margin: 0 0 40px;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15;
    text-align: center;
}

.section__title--accent { color: var(--accent); margin-bottom: 50px; }

/* ---------- Hero ---------- */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--header-h) + 40px) 0 60px;
    background: var(--dark) var(--hero-bg) center / cover no-repeat;
    text-align: center;
    color: var(--white);
    overflow: hidden;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .25);
}

.hero__inner { position: relative; }

.hero__title {
    margin: 0 0 40px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.3;
    color: var(--white);
}

.hero__script {
    margin: 0 0 20px;
    font-family: 'Alex Brush', cursive;
    font-weight: 400;
    font-size: clamp(76px, 11vw, 150px);
    line-height: .95;
}

.hero__sub {
    margin: 0;
    font-size: clamp(20px, 2.4vw, 34px);
    line-height: 1.35;
}

/* ---------- Churches ---------- */

.churches { padding-top: 90px; }

.churches__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.church {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.church__photo {
    width: 200px;
    height: 200px;
    margin: 0 auto 24px;
    border-radius: 50%;
    object-fit: cover;
}

.church__name {
    margin: 0 0 16px;
    font-size: 20px;
    line-height: 1.25;
}

.church__address {
    display: block;
    margin-bottom: 18px;
    font-size: 17px;
    line-height: 1.35;
    text-decoration: underline;
    color: var(--accent);
    transition: color var(--ease);
}

.church__address:hover { color: var(--accent-dark); }

.church__divider {
    display: inline-flex;
    justify-content: center;
    margin-top: auto;
    color: rgba(188, 140, 150, .4);
}

/* ---------- About ---------- */

.about { text-align: center; }

.about__title {
    margin: 0 0 20px;
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15;
    color: var(--accent);
}

/* Лід — темніший і крупніший за основний текст. */
.about__lead {
    margin: 0 0 30px;
    font-size: 20px;
    line-height: 25px;
    color: var(--text);
}

.about__text {
    margin: 0 0 16px;
    font-size: 17px;
    line-height: 30px;
    color: var(--body);
}

/* ---------- Candles ---------- */

.candles__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px 24px;
}

.candle { text-align: center; }

.candle__icon {
    width: 250px;
    max-width: 100%;
    margin: 0 auto 15px;
}

.candle__title {
    margin: 0 0 20px;
    font-weight: 400;
    font-size: 30px;
    line-height: 1.1;
    color: var(--dark);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    padding: 10px 26px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--ease);
}

.btn--dark {
    background: var(--dark);
    border-color: var(--dark);
    color: var(--white);
}

.btn--dark:hover { background: #4d4d4d; border-color: #4d4d4d; }

/* Кнопка замовлення — оформлення .custom-popup-btn з чинного сайту. */
.order-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--white);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    transition: all var(--ease);
}

.order-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

.order-btn__icon { display: inline-flex; }

/* ---------- Candle modal ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    background: rgba(51, 51, 51, .8);
    overflow-y: auto;
    opacity: 0;
    transition: opacity .35s ease;
}

.modal[hidden] { display: none; }
.modal.is-open { opacity: 1; }

.modal__dialog {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: auto;
    background: var(--white);
    border: 2px solid var(--dark);
    transform: translateY(-12px);
    transition: transform .35s ease;
}

.modal.is-open .modal__dialog { transform: translateY(0); }

.modal__body { padding: 30px; }

.modal__title {
    margin: 0 0 20px;
    font-size: 26px;
    line-height: 1.25;
    color: var(--accent);
}

.modal__body p { margin: 0 0 14px; }
.modal__body p:last-child { margin: 24px 0 0; }

.modal__close {
    position: absolute;
    top: -22.5px;
    right: -22.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #000;
    color: var(--white);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: background var(--ease);
}

.modal__close:hover { background: var(--accent); }

/* ---------- Reviews ---------- */

.reviews__carousel { position: relative; padding-bottom: 70px; }

.reviews__track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.reviews__track::-webkit-scrollbar { display: none; }

.review {
    flex: 0 0 calc((100% - 60px) / 4);
    scroll-snap-align: start;
    padding: 0 10px 20px;
    text-align: center;
}

.review__photo {
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
    border-radius: 50%;
    object-fit: cover;
}

.review__name {
    margin: 0 0 6px;
    font-size: 25px;
    line-height: 1.2;
    color: var(--dark);
}

.review__text { margin: 0; }

.reviews__nav {
    position: absolute;
    left: 50%;
    bottom: 0;
    display: flex;
    gap: 30px;
    transform: translateX(-50%);
}

.reviews__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: rgba(188, 140, 150, .5);
    cursor: pointer;
    transition: color var(--ease);
}

.reviews__arrow:hover { color: var(--accent); }

/* ---------- CTA ---------- */

.cta { padding: 90px 0 20px; }

.cta__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 50px;
}

.cta__col { padding-bottom: 70px; }

.cta__title {
    margin: 0 0 20px;
    font-size: clamp(28px, 3.4vw, 40px);
    line-height: 1.12;
    color: var(--accent);
}

.cta__lead {
    font-size: 20px;
    line-height: 25px;
    color: var(--text);
}

.cta__accent {
    margin: 0;
    font-size: 20px;
    line-height: 25px;
}

/* Права колонка — простий текст із кнопкою, без підкладки (як в оригіналі). */
.cta__card p { margin: 0 0 16px; }
.cta__card .order-btn { margin-top: 14px; }

/* ---------- Contacts ---------- */

.contacts {
    position: relative;
    padding: 50px 0;
    background: var(--dark) var(--contacts-bg) center / cover no-repeat;
    color: var(--white);
    text-align: center;
}

.contacts__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 8, .5);
}

.contacts__inner { position: relative; padding-inline: 50px; }

.contacts__icon { display: inline-flex; color: var(--accent); }

.contacts__title {
    margin: 20px 0 10px;
    font-family: 'Alex Brush', cursive;
    font-size: 35px;
    line-height: 1.15;
}

.contacts__divider { margin: 0 0 20px; }

.contacts__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.contacts__item { margin: 0 0 44px; }
.contacts__item:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */

/* Смуга копірайту: фон #bb8c96, білий текст 14px/24px — як #bottom-bar.solid-bg. */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 20px 0;
    background: var(--footer-bg);
    color: var(--white);
    text-align: center;
    font-size: 14px;
    line-height: 24px;
}

.site-footer__text { margin: 0; }

/* ---------- Scroll to top ---------- */

.scroll-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--white);
    opacity: 0;
    visibility: hidden;
    transition: all var(--ease);
}

.scroll-top.is-visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--accent-dark); }

/* ---------- Popup (форма замовлення) ---------- */

.pum-overlay {
    position: fixed;
    inset: 0;
    z-index: 1999999999;
    background: rgba(0, 0, 0, .7);
    overflow-y: auto;
    opacity: 0;
    transition: opacity .35s ease;
}

.pum-overlay[hidden] { display: none; }
.pum-overlay.is-open { opacity: 1; }

.pum-container {
    position: relative;
    width: max-content;
    max-width: min(640px, calc(100vw - 20px));
    margin: 5px auto 3em;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.pum-content {
    max-height: none;
    background: transparent;
    line-height: 0;
}

.pum-content iframe {
    display: block;
    width: 350px;
    max-width: 100%;
    border: 0;
}

.pum-close {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 15px;
    background: transparent;
    color: #000;
    font-family: inherit;
    font-weight: 700;
    font-size: 20px;
    line-height: 20px;
    cursor: pointer;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .churches__grid,
    .candles__grid { grid-template-columns: repeat(2, 1fr); }
    .review { flex-basis: calc((100% - 40px) / 3); }
    .contacts__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1100px) {
    .site-nav { display: none; }
    .burger { display: flex; }
    .site-header__aside { margin-left: auto; }

    .cta__inner { grid-template-columns: 1fr; gap: 0; }
    .cta__col { padding-bottom: 30px; }
}

@media (max-width: 782px) {
    .review { flex-basis: calc((100% - 20px) / 2); }
}

@media (max-width: 600px) {
    .section { padding: 50px 0; }
    .churches__grid,
    .candles__grid { grid-template-columns: 1fr; }
    .review { flex-basis: 100%; }
    .contacts__grid { grid-template-columns: 1fr; }
    .contacts__inner { padding-inline: 0; }
    .contacts__item { margin-bottom: 24px; }
    .modal__body { padding: 24px 18px; }
    .modal__close { top: 6px; right: 6px; width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
