/* ==========================================================================
   Церква Успіння Пресвятої Богородиці — стилі сайту
   Палітра та типографіка перенесені з попередньої версії.
   ========================================================================== */

/* --- Шрифти ------------------------------------------------------------- */

@font-face {
    font-family: 'Cormorant Infant';
    src: url('../fonts/CormorantInfant-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cormorant Infant';
    src: url('../fonts/CormorantInfant-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cormorant Infant';
    src: url('../fonts/CormorantInfant-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cormorant Infant';
    src: url('../fonts/CormorantInfant-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    /* Karla не має кирилиці — використовується для латиниці та цифр,
       кирилицю показує системний шрифт із переліку нижче. */
    font-family: 'Karla';
    src: url('../fonts/Karla-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* --- Змінні ------------------------------------------------------------- */

:root {
    --primary: #832732;
    --primary-dark: #6b1f28;
    --secondary: #201c15;
    --heading: #201c14;
    --text: #616161;
    --base: #f9f9f9;
    --section-bg: #f6f6f6;
    --white: #fff;

    --font-heading: 'Cormorant Infant', Georgia, 'Times New Roman', serif;
    --font-body: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;

    --content: 999px;
    --wide: 1170px;
    --gutter: 20px;
    --section-y: 60px;

    --title-lg: clamp(2.625rem, 2.375rem + 1.25vw, 3.875rem);
    --title-md: clamp(2.25rem, 2.05rem + 1vw, 3.25rem);
}

/* --- Базове ------------------------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--base);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    color: var(--heading);
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

p {
    margin: 0 0 1rem;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

hr {
    height: 1px;
    margin: 1.5rem 0;
    border: 0;
    background: rgb(32 28 21 / 12%);
}

blockquote {
    margin: 0;
}

.wrap {
    width: 100%;
    max-width: var(--wide);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

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

.skip-link:focus {
    left: 0;
}

:focus-visible {
    outline: 2px dotted var(--primary);
    outline-offset: 3px;
}

/* --- Кнопки ------------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 1rem 3.38rem;
    border: 0;
    border-radius: 5px;
    background: var(--secondary);
    color: var(--white);
    font: inherit;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn:hover,
.btn:focus {
    background: var(--primary);
    color: var(--white);
}

.btn--primary {
    background: var(--primary);
}

.btn--primary:hover,
.btn--primary:focus {
    background: var(--primary-dark);
}

.btn--lg {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: capitalize;
}

/* --- Заголовки секцій --------------------------------------------------- */

.section-head {
    margin-bottom: 1.5rem;
    text-align: center;
}

.eyebrow {
    margin: 0 0 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--primary);
    color: var(--primary);
    font-size: 22px;
    font-weight: 400;
}

.section-title {
    font-size: var(--title-md);
    font-weight: 700;
}

.section-title--upper {
    text-transform: uppercase;
}

/* --- Банер -------------------------------------------------------------- */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--section-y) var(--gutter);
    overflow: hidden;
    text-align: center;
}

.hero--home {
    min-height: 566px;
}

.hero--page {
    min-height: 350px;
    background: var(--secondary);
}

.hero__media {
    position: absolute;
    inset: 0;
}

.hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 60%);
}

.hero__body {
    position: relative;
    max-width: var(--content);
}

.hero__kicker {
    display: inline-block;
    margin: 0;
    padding: 10px 25px 9px;
    background: var(--primary);
    color: var(--white);
    font-size: 18px;
    font-weight: 400;
    text-transform: capitalize;
}

.hero__title {
    margin: 0;
    padding: 0 20px;
    color: var(--white);
    font-weight: 700;
    line-height: 1.1;
}

.hero--home .hero__title {
    display: block;
    max-width: var(--content);
    margin-inline: auto;
    padding-block: 6px;
    background: rgb(0 0 0 / 60%);
    font-size: var(--title-lg);
}

.hero--page .hero__title {
    font-size: clamp(1.75rem, 1.575rem + 0.875vw, 2.625rem);
    text-transform: uppercase;
}

.hero__subtitle {
    margin: 0.75rem 0 0;
    color: var(--white);
    font-size: 18px;
}

.hero__actions {
    margin: 1.5rem 0 0;
}

/* --- Блок «зображення + текст» ------------------------------------------ */

.feature {
    padding: var(--section-y) 0;
    background: var(--base);
}

.feature:nth-of-type(even) {
    background: var(--section-bg);
}

.feature__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
}

.feature__media {
    flex: 1 1 40%;
    min-width: 260px;
}

.feature__media img {
    display: block;
    width: 100%;
    border-radius: 4px;
}

.feature__text {
    flex: 1 1 55%;
    min-width: 280px;
}

.feature__actions {
    margin-top: 1.5rem;
    text-align: center;
}

/* --- Показники ---------------------------------------------------------- */

.counters {
    position: relative;
    padding: var(--section-y) var(--gutter);
    overflow: hidden;
}

.counters__media {
    position: absolute;
    inset: 0;
}

.counters__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.counters__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 60%);
}

.counters__grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.counter {
    text-align: center;
}

.counter__icon {
    display: block;
    margin: 0 auto 1rem;
}

.counter__label {
    margin: 0 0 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--primary);
    color: var(--white);
    font-size: clamp(1.75rem, 1.2rem + 1.6vw, 50px);
    font-weight: 400;
    line-height: 1.05;
}

.counter__value {
    margin: 0;
    color: var(--white);
    font-size: 22px;
}

/* --- Сітка послуг ------------------------------------------------------- */

.services {
    padding: var(--section-y) 0;
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 2rem;
}

.card {
    text-align: center;
}

/* Іконка послуги на круглій підкладці з градієнтом — як у попередній версії. */
.card__badge {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 112px;
    height: 112px;
    margin: 0 auto 1rem;
}

.card__badge::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--primary) 0%, rgb(131 39 50 / 0%) 92%);
}

.card__icon {
    position: relative;
    transform: translateY(10px);
}

.card__title {
    margin: 0 0 10px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 26px;
    font-weight: 400;
}

/* Коротка риска під назвою послуги. */
.card__title::after {
    content: '';
    display: block;
    width: 72%;
    margin: 10px auto 0;
    border-bottom: 1px solid var(--primary);
}

.card__text {
    margin: 0;
}

/* --- Текст внутрішньої сторінки ----------------------------------------- */

.page {
    padding: var(--section-y) 0;
}

.prose {
    max-width: var(--content);
    margin-inline: auto;
}

.prose h2 {
    margin: 0 0 0.75rem;
    font-size: 32px;
}

.prose h3 {
    margin: 1.5rem 0 0.5rem;
    font-size: 26px;
}

.prose > p {
    margin-bottom: 1.25rem;
}

.prose blockquote {
    margin: 2rem 0;
    padding: 1.5rem 1.75rem;
    border-left: 3px solid var(--primary);
    background: var(--section-bg);
}

.prose blockquote p:last-child {
    margin-bottom: 0;
}

.prose--center,
.prose--narrow {
    text-align: center;
}

/* Вужча центрована колонка — як на сторінці «Форма замовлення». */
.prose--narrow {
    max-width: 640px;
}

/* Кнопка оплати на сторінці «Форма замовлення». */
.prose > a[href^="https://donate.stripe.com"] {
    display: block;
    width: fit-content;
    margin: 1.5rem auto;
    padding: 1rem 3.38rem;
    border-radius: 5px;
    background: var(--secondary);
    color: var(--white);
    text-decoration: none;
}

.prose > a[href^="https://donate.stripe.com"]:hover {
    background: var(--primary);
}

/* --- Підвал ------------------------------------------------------------- */

.footer {
    background: var(--secondary);
    color: var(--white);
}

.footer a {
    color: var(--white);
    text-decoration: none;
}

.footer a:hover {
    color: var(--white);
    text-decoration: underline;
}

.footer__main {
    padding: var(--section-y) 0 40px;
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.footer__title {
    margin: 0 0 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--white);
    color: var(--white);
    /* У попередній версії ці підписи були звичайним текстом, не заголовками. */
    font-family: var(--font-body);
    font-size: 32px;
    font-weight: 400;
    line-height: 1.2;
}

.footer__contact {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0 0 20px;
}

.footer__contact img {
    flex: none;
    margin-top: 4px;
}

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

.footer__list li {
    margin-bottom: 20px;
}

.footer__list li::before {
    content: '>> ';
}

.footer__bar {
    padding: 20px 0;
    background: var(--primary);
    text-align: center;
}

.footer__bar p {
    margin: 0;
    color: var(--white);
}

.footer__bar-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    align-items: center;
    justify-content: center;
}

/* Перемикач мовних версій. */
.lang {
    display: flex;
    gap: 12px;
    align-items: center;
}

.lang a {
    color: var(--white);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lang span[aria-current] {
    color: rgb(255 255 255 / 65%);
}

/* --- Модальне вікно з формою -------------------------------------------- */

.modal[hidden] {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: max(52px, 5vh) var(--gutter) var(--gutter);
    overflow-y: auto;
}

.modal__overlay {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 70%);
}

/* Ні тла, ні рамок, ні відступів — на екрані видно лише саму форму. */
.modal__box {
    position: relative;
    width: auto;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: none;
}

/* Хрестик винесений над формою, щоб не перекривати її. */
.modal__close {
    position: absolute;
    top: -44px;
    right: 0;
    padding: 0 6px;
    border: 0;
    background: none;
    color: var(--white);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.modal__close:hover {
    opacity: 0.7;
}

.modal__content {
    display: flex;
    justify-content: center;
}

.modal__content iframe {
    display: block;
    max-width: 100%;
    border: 0;
    background: none;
}

/* Тіло не прокручується, поки відкрите вікно з формою. */
body.is-modal-open {
    overflow: hidden;
}

/* --- Адаптив ------------------------------------------------------------ */

@media (max-width: 900px) {
    .counters__grid,
    .footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .services__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 781px) {
    :root {
        --section-y: 40px;
    }

    .feature__inner {
        display: block;
    }

    .feature__media {
        margin-bottom: 1.5rem;
    }

    .feature__media img {
        max-width: 420px;
        margin-inline: auto;
    }

    .hero--home {
        min-height: 480px;
    }
}

@media (max-width: 560px) {
    .counters__grid,
    .footer__grid,
    .services__grid {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 1rem 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
