@font-face {
    font-family: 'Montserrat';
    src: url('/fonts/Montserrat-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

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

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
}

html {
    height: -webkit-fill-available;
}


.container {
    text-align: center;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
}

.language-switcher {
    position: fixed;
    top: env(safe-area-inset-top, 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 100%;
}

#languageDropdown {
    background-color: rgba(255, 0, 0, 0.2);
    backdrop-filter: blur(1px);
}


.image-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    align-items: center;
    /*padding: env(safe-area-inset-top, 15px) env(safe-area-inset-right, 15px)*/
    /*env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);*/
    /*padding: 15px;*/
}

.image-container picture {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.image-container img,
.image-container picture img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.image-container.cover-mode img,
.image-container.cover-mode picture img {
    object-fit: cover;
}

.no-image {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    font-size: 1.2rem;
    z-index: 100;
}

.lang-icon-wrapper {
    margin-left: auto;
    padding-bottom: 5px;
    padding-top: 5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}

.lang-icon {
    padding: 2px 5px;
    border: 1px solid #333333;
    border-radius: 6px;
    line-height: 1.5;
    font-size: 0.85rem;
}

.dropdown-toggle::after {
    margin-left: 1.255em !important;
}


@media (orientation: portrait) {
    .image-container img,
    .image-container picture img {
        object-fit: contain;
    }
}

@media (orientation: landscape) {
    .image-container img,
    .image-container picture img {
        object-fit: contain;
        max-width: 100%;
        max-height: 100%;
    }
}

@media (max-width: 320px) and (max-height: 568px) {
    .language-switcher {
        top: 30px;
    }
}

@media (min-height: 800px) and (max-width: 500px) {
    .image-container img,
    .image-container picture img {
        object-fit: contain;
    }
}

.error-content {
    text-align: center;
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
}

.error-code {
    font-size: 72px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 20px;
}

.language-text {
    margin: 12px 0;
    line-height: 1.6;
    font-size: 16px;
    color: #555;
    padding: 0 6px;
    /*background-color: #f8f9fa;*/
}

/* На мобильных — плотнее отступы между языками. */
@media (max-width: 576px) {
    .container {
        padding: 14px;
    }

    .language-text {
        margin: 8px 0;
    }
}

/* Страницы с длинным текстом (body-class "page-scroll"): разрешаем вертикальную
   прокрутку. margin: auto вместо align-items: center центрирует карточку,
   но не срезает её верх, когда контент выше вьюпорта. */
body.page-scroll {
    overflow-y: auto;
    align-items: flex-start;
    -webkit-overflow-scrolling: touch;
}

body.page-scroll .main {
    margin: auto;
    padding: 20px 0;
}
