/* Цветовая палитра храма: белый, бирюзовый, небесно-голубой */

:root {
    --teal: #1a8a8a;
    --teal-dark: #0d6b6b;
    --teal-light: #2cb5b5;
    --sky: #5b9bd5;
    --sky-light: #8bb8e2;
    --sky-dark: #2f7ab8;
    --white: #ffffff;
    --cream: #f9fafb;
    --gray-light: #e8eef0;
    --text-dark: #1a3a3a;
    --text-medium: #3d5c5c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: Georgia, 'Times New Roman', serif;
    background: var(--cream);
    color: var(--text-dark);
    line-height: 1.8;
    font-size: 18px;
    overflow-x: hidden;
    -webkit-tap-highlight-color: rgba(91, 155, 213, 0.2);
}

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

/* Контент */
main {
    min-height: calc(100vh - 160px);
}

section {
    padding: 50px 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--teal-dark);
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
}

h3 {
    font-size: 1.25rem;
    color: var(--teal);
    margin: 0 0 18px;
    font-weight: 700;
    text-align: center;
}

/* Hero: Church.jpg целиком (обрезка в файле), без CSS-обрезки и полей */
.hero {
    position: relative;
    width: 100%;
    padding: 0;
    margin: 0;
    background: var(--teal-dark);
}

.hero-image {
    display: block;
    width: 100%;
    height: auto;
}

.hero-blessing {
    position: absolute;
    top: clamp(2px, 0.6vw, 8px);
    left: 0;
    width: 100%;
    text-align: center;
    color: var(--white);
    font-size: clamp(0.95rem, 1.9vw, 1.2rem);
    font-weight: 600;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.8), 0 0 10px rgba(0,0,0,0.5);
    z-index: 2;
    padding: 0 15px;
    opacity: 0.95;
    line-height: 1.25;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 clamp(15px, 4vw, 50px) clamp(8px, 1.5vw, 20px);
    background: linear-gradient(to bottom,
                                transparent 55%,
                                rgba(0, 0, 0, 0.55) 100%);
    pointer-events: none;
}

.hero-quote {
    color: var(--white);
    font-size: clamp(1.15rem, 3.2vw, 2rem);
    font-style: italic;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0,0,0,1),
                 -1px -1px 3px rgba(0,0,0,1),
                 1px -1px 3px rgba(0,0,0,1),
                 -1px 1px 3px rgba(0,0,0,1),
                 0 0 15px rgba(0,0,0,0.8);
    font-weight: 600;
    margin: 0;
    max-width: 900px;
    line-height: 1.4;
}

/* Контакты */
.contact-section {
    background: var(--gray-light);
}

.contact-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-widget {
    min-width: 0;
    width: 100%;
}

.contact-widget .pravmir-calendar-widget {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 30px 25px;
    background: var(--cream);
    border: none;
    border-top: 5px solid var(--sky);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    color: var(--text-dark);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.6;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 1.5em;
    row-gap: 0.5em;
    align-items: start;
}

.contact-widget .pw-title {
    grid-column: 1 / -1;
    min-width: 0;
    font-size: 1.15rem;
    font-family: inherit;
    font-weight: 700;
    color: var(--teal-dark);
    line-height: 1.4;
    margin-bottom: 0.25em;
}

.contact-widget .pw-saints-header {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    margin-bottom: 0.5em;
    font: italic 1.05rem Georgia, 'Times New Roman', serif;
    color: var(--text-medium);
    overflow-wrap: break-word;
}

.contact-widget .pw-saints {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
    overflow-wrap: break-word;
}

.contact-widget .pw-day-icon {
    grid-column: 2;
    grid-row: 2 / 4;
    margin: 0;
    flex-shrink: 0;
    align-self: stretch;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    min-height: 0;
}

.contact-widget .pw-day-icon a {
    display: flex;
    height: 100%;
    align-items: stretch;
}

.contact-widget .pw-day-icon img {
    display: block;
    height: 100%;
    width: auto;
    max-width: min(220px, 35vw);
    object-fit: contain;
    object-position: center right;
    border-radius: 6px;
    margin-left: auto;
}

.contact-widget .pw-saints-item {
    margin-bottom: 0.6em;
}

.contact-widget .pw-saints-item a {
    color: var(--sky-dark);
    text-decoration: none;
    font-weight: 700;
    overflow-wrap: anywhere;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.contact-widget .pw-saints-item a:hover {
    color: var(--sky);
    border-bottom-color: var(--sky);
}

.contact-card {
    background: var(--cream);
    padding: 30px 35px;
    border-radius: 12px;
    border-top: 5px solid var(--sky);
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.contact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px 18px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
    font-size: 1.1rem;
}

.contact-row:last-child {
    border-bottom: none;
}

.contact-label {
    font-weight: 700;
    color: var(--text-medium);
    min-width: 120px;
}

.contact-phones {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-phone-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.contact-note {
    font-size: 1.1rem;
    color: var(--text-medium);
    font-style: italic;
}

.contact-link {
    color: var(--sky-dark);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 2px solid var(--sky-light);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-link:hover {
    color: var(--sky);
    border-bottom-color: var(--sky);
}

/* Телефоны: sans + табличные цифры — без «прыгающего» вида Georgia */
.contact-phone-item .contact-link {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

/* Расписание */
.schedule-section {
    background: var(--gray-light);
}

.schedule-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
}

/* Пожертвования */
.donations-section {
    background: var(--gray-light);
}

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

@media (min-width: 768px) {
    .donations-grid {
        grid-template-columns: 280px 1fr;
    }
}

.qr-section {
    text-align: center;
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.qr-pay-link {
    display: block;
    width: fit-content;
    margin: 0 auto;
    border-radius: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.qr-pay-link:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 4px;
}

.qr-pay-link:active {
    transform: scale(0.98);
}

.qr-section img {
    display: block;
    max-width: 100%;
    width: 220px;
    margin: 0 auto;
    border: 4px solid var(--teal);
    border-radius: 10px;
}

.sbp-pay-button {
    display: none;
    margin-top: 18px;
    padding: 14px 22px;
    min-height: 48px;
    width: 100%;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: var(--white);
    text-decoration: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    font-style: normal;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(13, 107, 107, 0.35);
    transition: background 0.15s ease, transform 0.15s ease;
}

.sbp-pay-button:hover,
.sbp-pay-button:focus-visible {
    background: linear-gradient(135deg, var(--teal-light) 0%, var(--teal) 100%);
    color: var(--white);
}

.sbp-pay-button:active {
    transform: scale(0.98);
}

.qr-section p {
    margin-top: 15px;
    font-style: italic;
    color: var(--text-medium);
    text-align: center;
}

.qr-hint-desktop {
    display: block;
}

.qr-hint-mobile {
    display: none;
}

@media (max-width: 767px) {
    .sbp-pay-button {
        display: block;
    }

    .qr-hint-desktop {
        display: none;
    }

    .qr-hint-mobile {
        display: block;
    }
}

.bank-details {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.detail-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 700;
    color: var(--text-medium);
    flex: 0 0 auto;
    white-space: nowrap;
}

.detail-value {
    color: var(--text-dark);
    text-align: right;
    flex: 0 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Футер */
footer {
    background: var(--teal-dark);
    color: var(--white);
    text-align: center;
    padding: 25px 20px;
}

footer p {
    margin: 6px 0;
    opacity: 0.9;
}

/* Планшеты и мобильные */
@media (max-width: 768px) {
    body {
        font-size: 17px;
        line-height: 1.7;
    }

    section {
        padding: 35px 15px;
    }

    /* Hero на мобильных: благословение — отдельный баннер над картинкой,
       чтобы текст не наезжал на цитату «Приидите, обретохом…» */
    .hero-blessing {
        position: static;
        display: block;
        background: var(--teal-dark);
        padding: 12px 16px;
        font-size: 1rem;
        line-height: 1.35;
        text-shadow: none;
        opacity: 1;
    }

    .hero-overlay {
        padding: 0 14px 14px;
        background: linear-gradient(to bottom,
                                    transparent 40%,
                                    rgba(0, 0, 0, 0.6) 100%);
    }

    .hero-quote {
        font-size: clamp(1.15rem, 4.2vw, 1.6rem);
    }

    .contact-card,
    .contact-widget .pravmir-calendar-widget {
        padding: 22px 20px;
    }

    .contact-widget .pravmir-calendar-widget {
        grid-template-columns: 1fr;
    }

    .contact-widget .pw-title,
    .contact-widget .pw-saints-header,
    .contact-widget .pw-saints,
    .contact-widget .pw-day-icon {
        grid-column: 1;
        grid-row: auto;
    }

    .contact-widget .pw-day-icon {
        display: block;
        margin: 1em 0;
        text-align: center;
    }

    .contact-widget .pw-day-icon a {
        display: inline;
        height: auto;
    }

    .contact-widget .pw-day-icon img {
        height: auto;
        max-height: 180px;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        object-fit: contain;
        object-position: center;
    }

    .contact-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        font-size: 1.05rem;
    }

    .contact-label {
        min-width: 0;
    }

    .contact-note {
        font-size: 1rem;
    }

    .bank-details {
        padding: 22px 20px;
    }

    .detail-row {
        flex-direction: column;
        gap: 4px;
    }

    .detail-value {
        text-align: left;
        word-break: break-word;
    }
}

/* Маленькие телефоны */
@media (max-width: 420px) {
    section {
        padding: 28px 12px;
    }

    .hero-blessing {
        font-size: 0.92rem;
        padding: 10px 12px;
        line-height: 1.3;
    }

    .hero-quote {
        font-size: 1.1rem;
        line-height: 1.35;
    }

    .contact-card,
    .contact-widget .pravmir-calendar-widget,
    .bank-details {
        padding: 18px 16px;
    }

    .qr-section {
        padding: 18px 14px;
    }

    .qr-section img {
        width: 100%;
        max-width: 240px;
    }

    h2 {
        margin-bottom: 22px;
    }

    footer {
        padding: 20px 14px;
    }
}

/* Альбомная ориентация телефонов: hero не должен распухать в высоту */
@media (max-height: 480px) and (orientation: landscape) {
    .hero-blessing {
        font-size: 0.85rem;
        padding: 4px 12px;
        line-height: 1.2;
    }
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
}

::-webkit-scrollbar-thumb {
    background: var(--teal);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--teal-dark);
}
