/* Shared fixes loaded after page styles, including Bootstrap. */
html { -webkit-text-size-adjust: 100%; }
body { background: #f8f9fa; }
img, video { max-width: 100%; }
video { height: auto; }
iframe { max-width: 100%; }
button, a, input, select, textarea { touch-action: manipulation; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #9b79cf; outline-offset: 3px; }
.language-switcher .dropdown { display: none; visibility: hidden; pointer-events: none; transform: none; transition: none; }
.language-switcher.is-open .dropdown { display: block; visibility: visible; pointer-events: auto; transform: none; }
@media (hover: hover) { .language-switcher:hover .dropdown { display: block; visibility: visible; pointer-events: auto; transform: none; } }
#menuToggle input:focus-visible ~ span { outline: 2px solid #9b79cf; outline-offset: 3px; }
#menuToggle span { pointer-events: none; }
#menuToggle { z-index: 30; }
#menu { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; }
#popupMessage, #popupMessageGive, [class^="popup"][id^="myPopup"] { max-width: calc(100vw - 24px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.carousel-inner img { display: block; width: 100% !important; height: auto; object-fit: contain; }
@media (max-width: 1023px) {
    .container .menu-item { gap: 12px; flex-wrap: wrap; padding-inline: 20px; }
    .main-about, .main-history, .main-history-second, .main-pastors, .main-future, .ministry-start, .ministry, .info, .vision-container { max-width: calc(100% - 40px); gap: 28px; }
    .text-h3, .text-history, .text-history-next, .text-history-3, .text-history-4, .text-ministries, .text-ministry, .text-group, .text-group-cross { max-width: 100%; }
}
@media (max-width: 767px) {
    .header320 { position: relative; z-index: 40; min-height: 120px; }
    .header320 .container320 { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 120px; padding: 16px 20px; }
    .header320 .logo { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); }
    .header320 .logo320 { margin: 0; }
    .header320 .logo img { width: 82px; height: auto; }
    .header320 .language-switcher .language320 { margin: 0; width: 44px; height: 44px; }
    .header320 .language320 svg { width: 44px; height: 44px; }
    .header320 .language-switcher .dropdown { left: 0; width: 160px; margin: 8px 0 0; padding: 8px 0; }
    .language-switcher .dropdown button { min-height: 44px; }
    #menuToggle { top: 52px; right: 24px; }
    #menuToggle input { width: 44px; height: 44px; top: -12px; }
    #menu { width: min(300px, calc(100vw - 24px)); margin-top: -44px; margin-right: -12px; padding: 68px 0 12px; border-radius: 18px; }
    #menu li { padding: 0; }
    #menu li a { display: block; min-height: 44px; padding: 12px 22px; font-size: 18px; }
    #menu .address320 { margin: 12px 0 0; font-size: 14px; line-height: 1.6; }
    #menu .address320 img { width: 26px; height: auto; }
    .main-screen320 { margin-top: 0; }
    .main-screen320 .centered-text320 { width: calc(100% - 32px); }
    .main-screen320 .main-title, .main-screen320 .main-title1 { width: auto; font-size: clamp(26px, 6.5vw, 40px) !important; overflow-wrap: anywhere; }
    .main-screen320 .title { font-size: clamp(12px, 3vw, 17px); }
    .main-screen320 .btn-full { padding: 14px 24px; min-height: 44px; max-width: 100%; }
    .advantages, .goals, .about-us, .FAQ, .faq, .map-container, .ministries, .future, .Gallery, .gallery, .forms-container { max-width: 100%; padding-inline: 20px; box-sizing: border-box; }
    .advantages-items { flex-wrap: wrap; gap: 28px; }
    .advantage-item { max-width: 100%; }
    .main-about, .main-history, .main-history-second, .main-pastors, .main-future, .ministry-start, .ministry, .info, .vision-container { flex-direction: column; width: calc(100% - 40px); max-width: none; gap: 24px; margin: 40px auto; }
    .main-history-second { display: none; }
    .main-history-second768 { max-width: calc(100% - 40px); margin: 40px auto; }
    .text-h3, .text-history, .text-history-next, .text-history-3, .text-history-4, .text-ministries, .text-ministry, .text-group, .text-group-cross, .about-us-text, .explication-text, .ministry-text, .mission-subtitle { width: auto; max-width: 100%; margin: 16px 0; text-align: left; line-height: 1.65; overflow-wrap: anywhere; }
    .photo-about, .photo-history, .photo-history-right, .photo-history-right768, .image-cross { margin: 0 auto; max-width: 100%; }
    .pastors, .ministries, .ministry-image { margin-top: 40px; }
    .pastor { flex-wrap: wrap; gap: 32px; }
    .pastors h2, .history h2, .ministries h2, .future-title, .cross-title, .cross-title-rus { width: auto; margin: 20px 0; text-align: center; overflow-wrap: anywhere; }
    .image-ministries { max-width: 100%; }
    .video-bambini, .video-heart { width: calc(100% - 40px); margin: 20px auto; }
    .footer-about-us { margin-top: 24px; }
    .footer-320, footer, .footer { width: 100%; margin-inline: 0; padding-inline: 0; box-sizing: border-box; }
    .god, .god-320 { margin: 32px 16px 24px; }
    .footer-container320 { padding: 24px 16px; gap: 16px; box-sizing: border-box; }
    .footer-container320 .mail, .footer-container320 .location { margin: 20px auto; flex-wrap: wrap; gap: 8px; }
    .footer-container320 a { overflow-wrap: anywhere; font-size: 16px; }
    .footer-end { padding: 14px 16px; overflow-wrap: anywhere; }
    .footer-container { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 24px 16px; }
    .footer-container > * { width: 100%; max-width: 360px; margin-inline: auto; }
    .footer-container > a, .footer-container .social, .footer-container .location, .footer-container .mail, .footer-container .prayer { min-height: 0; }
    .footer-container a { overflow-wrap: anywhere; }
    .events-page:not(.has-mobile-footer) footer, body.prayer-page footer { display: block; }
    .gallery-text, .mission-title, .heart { overflow-wrap: anywhere; }
    .advantages-list-slider, .events-list-slider { max-width: 100%; padding: 0; }
    .advantage-slider-item, .events-slider-item { margin-right: 0; padding: 20px; box-sizing: border-box; }
    .slick-list { max-width: 100%; }
    .donation { width: 100%; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'donate' 'bank' 'image'; gap: 24px; }
    .bank-details { width: 100%; box-sizing: border-box; padding: 22px; }
    .bank-details__row { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; }
    .give-title, .prayer-title, .media-title { margin: 32px 20px; font-size: 28px; text-align: center; overflow-wrap: anywhere; }
    #comments-container { width: calc(100% - 40px); max-width: 600px; margin: 24px auto; }
    #comment-form input, #comment-form textarea { width: 100%; box-sizing: border-box; font-size: 16px; }
    #button-request { min-height: 44px; max-width: 100%; }
    #popupMessage, #popupMessageGive, [class^="popup"][id^="myPopup"] { width: calc(100% - 32px); padding: 22px; }
    .popup-text, .myPopupUK-text { font-size: 15px; line-height: 1.6; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; animation-iteration-count: 1 !important; }
    .wow { visibility: visible !important; }
}

/* Rows placed directly in full-width gallery wrappers need contained gutters. */
.Gallery > .row, #Gallery > .row { margin-inline: 0; }
.vision-container { gap: 32px; }
.vision-container > * { min-width: 0; }
.vision-container .image-cross { flex: 1 1 50%; margin-left: 0; }
.vision-container .image-cross img { display: block; width: 100%; max-width: 100%; margin-left: 0; }
.vision-container > .text { flex: 1 1 50%; }
[data-close-popup] { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; fill: #6933dc; }
[class^="popup"][id^="myPopup"] { transform: translate(-50%, -50%); }
@media (max-width: 1023px) {
    .ministry { flex-wrap: wrap; }
    .ministry > * { min-width: 0; max-width: 100%; flex: 1 1 280px; }
}
@media (max-width: 767px) {
    .vision-container .image-cross, .vision-container > .text { flex: auto; width: 100%; }
    .vision-container .image-cross img { margin: 0; }
    .ministry > * { flex: auto; }
    .text-history-3768, .text-history-4768 { width: auto; margin: 20px 0; padding-top: 0; text-align: left; line-height: 1.65; }
}

@media (hover: none) {
    .language-switcher:not(.is-open) .dropdown { display: none; }
}

/* Accordion chevrons do not depend on missing image sprites. */
.ui-accordion .ui-accordion-header .ui-icon { background-image: none; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin-right: 12px; overflow: visible; }
.ui-accordion .ui-accordion-header-active .ui-icon { transform: rotate(45deg); }

/* Home: goals, about us and footer span the full container width on mobile. */
@media (max-width: 767px) {
    .goals, .about-us { padding-inline: 0; }
    .goals > h2, .about-us > h2, .about-us-text-button, .about-us > .justify-content-center, .about-us .map > h2, .about-us .map-text { padding-inline: 20px; box-sizing: border-box; }
    .about-us-image { display: block; width: 100%; }
}
