/* ============================================
   МОДАЛЬНЫЕ ОКНА С ФОРМАМИ
   ============================================ */

/* Базовые стили для всех модальных окон */
.excursion-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}

.excursion-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: calc(40 / var(--device-size) * 100vw);
    width: 90%;
    max-width: 500px;
    border-radius: 30px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.excursion-modal h3 {
    margin-top: 0;
    margin-bottom: calc(20 / var(--device-size) * 100vw);
    font-size: calc(32 / var(--device-size) * 100vw);
    font-weight: 500;
    color: #002c42;
    text-align: center;
    padding-top:30px;
}

.excursion-modal-close {
    position: absolute;
    right: calc(15 / var(--device-size) * 100vw);
    top: calc(15 / var(--device-size) * 100vw);
    width: calc(38 / var(--device-size) * 100vw);
    height: calc(38 / var(--device-size) * 100vw);
    background-color: #002c42;
    border-radius: calc(12 / var(--device-size) * 100vw);
    cursor: pointer;
    transition: all 0.3s ease;
}

.excursion-modal-close:before,
.excursion-modal-close:after {
    content: "";
    position: absolute;
    top: calc(8 / var(--device-size) * 100vw);
    bottom: calc(8 / var(--device-size) * 100vw);
    left: calc(50% - 1 / var(--device-size) * 100vw);
    width: calc(2 / var(--device-size) * 100vw);
    background-color: #fff;
}

.excursion-modal-close:before {
    transform: rotate(45deg);
}

.excursion-modal-close:after {
    transform: rotate(-45deg);
}

.excursion-modal-close:hover {
    background-color: #a77e4a;
}

/* Поля формы */
.excursion-form__fields {
    margin-bottom: calc(20 / var(--device-size) * 100vw);
}

.excursion-form__field {
    width: 100%;
    margin-bottom: calc(20 / var(--device-size) * 100vw);
}

.excursion-form__field:last-child {
    margin-bottom: 0;
}

.excursion-form .field-text__input {
    width: 100%;
    padding: calc(13.5 / var(--device-size) * 100vw) calc(20 / var(--device-size) * 100vw);
    font-size: calc(14 / var(--device-size) * 100vw);
    font-family: Onest, sans-serif;
    border: 1px solid #dfdfdf;
    border-radius: calc(30 / var(--device-size) * 100vw);
    background-color: #fff;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    color: #393c45;
}

.excursion-form .field-text__input:focus {
    border-color: #a77e4a;
}

/* Кнопка */
.excursion-form__submit {
    margin: calc(25 / var(--device-size) * 100vw) 0 calc(20 / var(--device-size) * 100vw);
}

.excursion-form__submit .new-button {
    width: 100%;
    justify-content: center;
    padding: calc(16 / var(--device-size) * 100vw) calc(20 / var(--device-size) * 100vw);
    font-size: calc(16 / var(--device-size) * 100vw);
    border: 1px solid #002c42;
    background-color: #002c42;
    color: #fff;
    border-radius: calc(30 / var(--device-size) * 100vw);
    cursor: pointer;
    transition: 0.3s ease;
}

.excursion-form__submit .new-button:hover {
    background-color: #a77e4a;
    border-color: #a77e4a;
}

/* Согласие */
.agreement-text {
    font-size: calc(12 / var(--device-size) * 100vw);
    line-height: 1.4;
    color: #6f6f71;
    text-align: left;
    margin: 0;
}

.agreement-text a {
    color: #002c42;
    text-decoration: none;
}

.agreement-text a:hover {
    color: #a77e4a;
    text-decoration: underline;
}

/* Прелоудер */
#excursionLoader, #callbackLoader {
    text-align: center;
    padding: 40px 0;
    display: none;
}

#excursionLoader .loader-spinner,
#callbackLoader .loader-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border: 3px solid #dfdfdf;
    border-top: 3px solid #002c42;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#excursionLoader p,
#callbackLoader p {
    font-size: 16px;
    color: #6f6f71;
    margin: 0;
}

/* Сообщение об успехе */
#excursionSuccess, #callbackSuccess {
    text-align: center;
    padding: 40px 0;
    display: none;
}

#excursionSuccess svg circle,
#excursionSuccess svg path,
#callbackSuccess svg circle,
#callbackSuccess svg path {
    stroke: #002c42;
}

#excursionSuccess h3,
#callbackSuccess h3 {
    margin-top: 20px;
    font-size: 24px;
    font-weight: 500;
    color: #002c42;
    text-align: center;
}

#excursionSuccess p,
#callbackSuccess p {
    margin-top: 15px;
    font-size: 16px;
    color: #6f6f71;
}

/* Анимация для появления сообщения */
@keyframes successFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#excursionSuccess, #callbackSuccess {
    animation: successFadeIn 0.5s ease forwards;
}

/* Сообщение об ошибке */
.excursion-form .wpcf7-not-valid-tip {
    font-size: 12px;
    color: #dc3545;
    margin-top: 5px;
    text-align: left;
}

.excursion-form .wpcf7-response-output {
    margin: 20px 0 0;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.excursion-form .wpcf7-validation-errors {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Адаптив */
@media (max-width: 767px) {
    .excursion-modal-content {
        padding: calc(24 / var(--device-size) * 100vw);
        margin: 10% auto;
    }
    
    .excursion-modal h3 {
        font-size: calc(28 / var(--device-size) * 100vw);
        padding-right: calc(30 / var(--device-size) * 100vw);
    }
    
    .excursion-modal-close {
        width: calc(30 / var(--device-size) * 100vw);
        height: calc(30 / var(--device-size) * 100vw);
        top: calc(15 / var(--device-size) * 100vw);
        right: calc(15 / var(--device-size) * 100vw);
    }
    
    .excursion-form .field-text__input {
        padding: calc(10 / var(--device-size) * 100vw) calc(14 / var(--device-size) * 100vw);
        font-size: calc(12 / var(--device-size) * 100vw);
    }
    
    #excursionSuccess h3,
    #callbackSuccess h3 {
        font-size: 20px;
    }
    
    #excursionSuccess p,
    #callbackSuccess p {
        font-size: 14px;
    }
}

body.modal-open {
    overflow: hidden;
}
.form-success {
    text-align:center;
}

/* Стили для прелоудера и успеха inline-форм */
.form-loader-inline,
.form-success-inline {
    margin-top: 20px;
}

@media (max-width: 767px) {
    .subscribe-form-inline {
        flex-direction: column;
    }
    
    .subscribe-form__submit .new-button {
        width: 100%;
    }
}

.wrapp-button {
    padding:20px 0 0;
}
.wrapp-button .new-button {
    width: 100%;
}

/* Сетка новостей */
.news-sect__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: calc(20 / var(--device-size) * 100vw);
    align-items: stretch;
}

/* Карточка новости */
.card-news {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #dfdfdf;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    background-color: #fff;
}

.card-news:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Контейнер для изображения (и для заглушки) — единый размер */
.card-news__wrap-img {
    width: 100%;
    aspect-ratio: 16 / 9;  /* Соотношение сторон 16:9, можно подобрать под ваш дизайн */
    overflow: hidden;
    background-color: #f5f5f5; /* цвет заглушки */
}

/* Изображение внутри контейнера */
.card-news__wrap-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;   /* Заполняет контейнер, сохраняя пропорции, обрезая лишнее */
    display: block;
    transition: transform 0.5s ease;
}

/* Эффект увеличения при наведении */
.card-news:hover .card-news__wrap-img img {
    transform: scale(1.05);
}

/* Блок контента */
.card-news__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-news__caption {
    font-size: calc(18 / var(--device-size) * 100vw);
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: calc(10 / var(--device-size) * 100vw);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #002c42;
}

.card-news__date {
    font-size: calc(14 / var(--device-size) * 100vw);
    color: #6f6f71;
}

/* Адаптация для мобильных */
@media (max-width: 767px) {
    .news-sect__grid {
        grid-template-columns: 1fr;
        gap: calc(16 / var(--device-size) * 100vw);
    }
    
    .card-news__caption {
        font-size: calc(16 / var(--device-size) * 100vw);
    }
}
@media (max-width: 767px) {
    /* Скрываем блок изображения в карточках, у которых нет фото */
    .card-news--no-image .card-news__wrap-img {
        display: none;
    }
}

.infinite-scroll-loader {
    text-align: center;
    padding: 30px 0;
    margin: 20px 0;
}

.infinite-scroll-loader .loader-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border: 3px solid #dfdfdf;
    border-top-color: #002c42;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.article-page__wrap-img {
    height: auto!important;
}