/* 50132 / Сайт - Доработка - В блоке новостей на Главной переделать выдачу новостных блоков, переделать верстку, реализовать категории новостей / ртм_AndreyAA / Начало */

.CUSTOM_NEWS {
    background: #011f3f;
}

#rtm_custom_home_news {
	position: relative;
    padding: 20px 0px 45px 0px;
}

#rtm_custom_home_news:before {
    content: "";
    display: block;
    left: 0;
    top: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url(/local/aspro_max_custom/images/trademark/trademark-gray.svg);
    mix-blend-mode: screen;
    filter: invert(1);
    background-size: min(60%, 1000px) auto;
    background-position: 50% 50%;
    opacity: 0.18;
    pointer-events: none;
    background-repeat: no-repeat;
}

#rtm_custom_home_news:after {
    content: "";
    display: block;
    left: 0;
    top: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(180deg, #13395d00 70%, #13395d70 85%, #13395de3 95%, #13395d 100%) !important;
    pointer-events: none;
    z-index: 2;
}

#rtm_custom_home_news .rtm_custom_home_news-in:before {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    mix-blend-mode: lighten;
    background-size: cover;
    background-position: 50% 96%;
    pointer-events: none;
    z-index: 1;
    background-repeat: no-repeat;
    background: url(/local/aspro_max_custom/images/home/news-bg.jpg);
    background-size: cover;
    filter: grayscale(1);
    opacity: 0.18;
    background-position: 50% 50%;
}

#rtm_custom_home_news .rtm_custom_home_news-in:after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #05294a, #1f426700 30%);
    opacity: 1;
    pointer-events: none;
    z-index: 3;
}

.rtm_custom_home_news {
	max-width: 1420px;
	width: 100%;
    margin: 0 auto;
    padding: 0 30px;
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
}

.rtm_custom-home-news-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 0;
	color: #fff;
}

.rtm_custom-home-news-title {
	color: #fff;
}

.rtm_custom-home-news-btn {
	background: #ededed !important;
    border: none !important;
    color: #113963 !important;
    font-size: 0.9em;
}

.rtm_custom_home_news-content {
	position: relative;
	display: flex;
	align-items: center;
}

/* Обертка для списка новостей - ограничивает ширину и обеспечивает прокрутку */
.rtm_home_news-list-wrapper {
	flex: 1;
	overflow: hidden;
	min-width: 0; /* Позволяет flex-элементу сжиматься */
    text-align: right;
    width: 100%;
}

/* Слайдер по умолчанию для rtm_slider=1 */
.rtm_custom_home_news-content[rtm_slider="1"] .rtm_home_news-list {
    display: inline-flex;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE/Edge */
	gap: 20px;
	padding: 0;
	margin: 0;
	flex-shrink: 0; /* Не сжимается, может расширяться */    flex-shrink: 0;
    width: max-content;
    max-width: 100%;
    text-align: left;
}

.rtm_custom_home_news-content[rtm_slider="1"] .rtm_home_news-list::-webkit-scrollbar {
	display: none; /* Chrome/Safari */
}

.rtm_custom_home_news-content[rtm_slider="1"] .rtm_home_news-item {
	flex: 0 0 auto;
}

/* Обычная сетка для rtm_slider=0 на ПК */
.rtm_custom_home_news-content[rtm_slider="0"] .rtm_home_news-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 20px;
}

.rtm_home_news-list {
	flex-shrink: 0; /* Не сжимается, может расширяться */
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 20px;
}

/* Кнопки навигации слайдера */
.rtm_home_news-list-left_more_bt,
.rtm_home_news-list-right_more_bt {
	cursor: pointer;
	user-select: none;
	display: flex;
	align-items: center;
	justify-content: center;
    width: 50px;
    height: 50px;
	background-repeat: no-repeat;
    background-position: 50% 50%;
    background-size: contain;
    border-radius: 8px;
	color: transparent; /* скрываем текстовую стрелку, используем иконку */
	font-size: 0;
	transition: opacity 0.3s ease, background 0.3s ease;
	z-index: 10;
	flex-shrink: 0;
    opacity: 0.95;
}

.rtm_home_news-list-left_more_bt:hover,
.rtm_home_news-list-right_more_bt:hover {
    opacity: 1;
}

.rtm_home_news-list-left_more_bt.rtm_disabled,
.rtm_home_news-list-right_more_bt.rtm_disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none;
}

/* Кнопка слева */
.rtm_home_news-list-left_more_bt {
	background-image: url('../icons/arrow_left.svg');
	margin-right: 10px;
}

/* Кнопка справа - на ПК absolute, на мобильной relative */
.rtm_home_news-list-right_more_bt {
	background-image: url('../icons/arrow_right.svg');
	margin-left: 10px;
}

.rtm_home_news-item {
    display: flex;
    flex-direction: column;
    text-align: left !important;
    min-width: 100px;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    text-decoration: none;
    color: inherit;
    transition: transform 0.8s ease;
    position: relative;
    background-color: #2d6fb340 !important;
    backdrop-filter: blur(8px);
    overflow: unset;
    user-select: none;
    -webkit-user-drag: none;
    width: 325px;
}

.rtm_home_news-item::before {
	content: "";
	display: block;
	padding-top: 75%;
}

.rtm_home_news-item::after {
    content: "";
    position: absolute;
    top: 0px;
    left: -1px;
	width: 100%;
	height: 100%;
    width: calc(100% + 2px);
    height: calc(100% + 1px);
    background-image: linear-gradient(0deg, #173d67eb 25%, #16385dbf 40%, #0c549f29 70%);
    z-index: 1;
    pointer-events: none;
    border-radius: 20px;
}

.rtm_home_news-item:hover {
    transition: transform 0.3s ease;
    transform: translate(-1px, -2px);
}

.rtm_home_news-item-picture img {
	display: block;
	width: 100%;
	height: auto;
}

.rtm_home_news-item-content {
	padding: 14px 16px 16px;
	position: absolute;
	left: 0;
	width: 100%;
	bottom: 0px;
	z-index: 2;
}

.rtm_home_news-item-date {
    line-height: 1.3;
    margin-bottom: 6px;
    opacity: .7;
    color: #fff;
    font-size: 13px !important;
}

.rtm_home_news-item--pinned .rtm_home_news-item-date .date::after {
	content: "";
    background-image: url(/local/aspro_max_custom/icons/g/400_200_20/keep.svg) !important;
    display: inline-block;
    font-size: 13px;
    position: relative;
    width: 17px !important;
    height: 17px !important;
    text-align: center;
    opacity: 0.45;
    line-height: 1;
    background-size: auto 100%;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    margin: -1px 0 0 0.4rem;
    vertical-align: text-top;
}

.rtm_home_news-item-title {
    color: #7690b1;
    transition-duration: 0.25s;
    font-family: 'font-main-thin', 'font-main', Montserrat, sans-serif, Arial !important;
    font-size: 103%;
    line-height: 1.3;
}

.rtm_home_news-item-preview {
	font-size: 13px;
	line-height: 1.5;
	color: #555555;
}

.rtm_home_news-item--pinned .rtm_home_news-item-title {
	position: relative;
	padding-right: 40px;
}


.rtm_home_news-empty {
	font-size: 13px;
	color: #888888;
}

/* Навигация / кнопка "Загрузить еще" */

.rtm_custom-home-news-nav_wrapper {
	text-align: center;
}

#rtm_custom-home-news-more_bt {
	align-items: center;
	justify-content: center;
	cursor: pointer;
    background: #ededed;
    border: none !important;
    color: #113963 !important;
    font-size: 13px;
    margin-top: 45px;
}

/* Скрытие кнопки через класс (не меняя display) */
#rtm_custom-home-news-more_bt.rtm_custom-home-news-more_bt--hidden {
	visibility: hidden;
	opacity: 0;
	height: 0;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

/* ----- MEDIA ----- */

/* ----- Media Min ----- */

/* На ПК обе кнопки - absolute за пределами контентной области */
@media (min-width: 1551px) {
	/* Кнопка слева - absolute слева */
	.rtm_home_news-list-left_more_bt {
		position: absolute;
		left: -50px;
		top: 50%;
		transform: translateY(-50%);
		margin-right: 0;
	}

	/* Кнопка справа - absolute справа */
	.rtm_home_news-list-right_more_bt {
		position: absolute;
		right: -50px;
		top: 50%;
		transform: translateY(-50%);
		margin-left: 0;
	}

	/* Для блока с rtm_slider="0" на ПК кнопки скрыты (это сетка, не слайдер) */
	.rtm_custom_home_news-content[rtm_slider="0"] .rtm_home_news-list-left_more_bt,
	.rtm_custom_home_news-content[rtm_slider="0"] .rtm_home_news-list-right_more_bt {
		display: none !important;
	}

	/* Кнопка слева на ПК видна только когда слайдер прокручен */
	.rtm_custom_home_news-content[rtm_slider="1"] .rtm_home_news-list-left_more_bt {
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.3s ease;
	}

	.rtm_custom_home_news-content[rtm_slider="1"].rtm_scrolled .rtm_home_news-list-left_more_bt {
		opacity: 1;
		pointer-events: auto;
	}

	/* Кнопка справа на ПК скрывается если нечего подгружать и слайдер прокручен до конца */
	.rtm_custom_home_news-content[rtm_slider="1"]:not(.rtm_has_more) .rtm_home_news-list-right_more_bt {
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.3s ease;
	}

	/* Кнопка справа видна если есть что подгружать */
	.rtm_custom_home_news-content[rtm_slider="1"].rtm_has_more .rtm_home_news-list-right_more_bt {
		opacity: 1;
		pointer-events: auto;
	}
}

/* ----- Media Max ----- */

@media (max-width: 1550px) {

    .rtm_custom_home_news {
        padding-left: 72px;
        padding-right: 72px;
        max-width: unset;
    }

    .rtm_custom_home_news-content[rtm_slider="0"] .rtm_home_news-item {
        width: auto;
    }

    .rtm_custom-home-news-header {
        padding-left: 60px;
        padding-right: 60px;
    }

	.rtm_home_news-list {
		grid-template-columns: 1fr;
	}

    .rtm_custom-home-news-nav_wrapper {
        text-align: center;
        padding-top: 30px;
    }

	.rtm_home_news-list-right_more_bt {
		position: relative;
		right: auto;
		top: auto;
		transform: none;
		margin-left: 10px;
	}

	/* Кнопка слева в мобильной версии видна всегда, но неактивна если не прокручена */
	.rtm_custom_home_news-content[rtm_slider="1"] .rtm_home_news-list-left_more_bt,
	.rtm_custom_home_news-content[rtm_slider="0"] .rtm_home_news-list-left_more_bt {
		opacity: 0.3;
		pointer-events: auto;
	}

	.rtm_custom_home_news-content[rtm_slider="1"].rtm_scrolled .rtm_home_news-list-left_more_bt,
	.rtm_custom_home_news-content[rtm_slider="0"].rtm_scrolled .rtm_home_news-list-left_more_bt {
		opacity: 1;
	}

	.rtm_custom_home_news-content[rtm_slider="1"] .rtm_home_news-list-left_more_bt.rtm_disabled,
	.rtm_custom_home_news-content[rtm_slider="0"] .rtm_home_news-list-left_more_bt.rtm_disabled {
		opacity: 0.3;
		cursor: not-allowed;
		pointer-events: none;
	}

	/* Кнопка справа в мобильной версии неактивна если нечего подгружать и слайдер прокручен до конца */
	.rtm_custom_home_news-content[rtm_slider="1"]:not(.rtm_has_more) .rtm_home_news-list-right_more_bt,
	.rtm_custom_home_news-content[rtm_slider="0"]:not(.rtm_has_more) .rtm_home_news-list-right_more_bt {
		opacity: 0.3;
		cursor: not-allowed;
		pointer-events: none;
	}

	/* В мобильной версии блок с rtm_slider=0 становится слайдером */
	.rtm_custom_home_news-content[rtm_slider="0"] .rtm_home_news-list {
		display: flex;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-behavior: smooth;
		scrollbar-width: none;
		-ms-overflow-style: none;
		gap: 20px;
		padding: 0;
		margin: 0;
		flex-shrink: 0; /* Не сжимается, может расширяться */
		min-width: 100%; /* Минимальная ширина равна ширине обертки */
	}

	.rtm_custom_home_news-content[rtm_slider="0"] .rtm_home_news-list::-webkit-scrollbar {
		display: none;
	}

	.rtm_custom_home_news-content[rtm_slider="0"] .rtm_home_news-item {
		flex: 0 0 auto;
        width: 325px;
	}

	/* Когда custom-home-news-content-all становится слайдером - скрываем кнопку "Загрузить еще" */
	.custom-home-news-content-all[rtm_slider="0"] ~ .rtm_custom-home-news-nav_wrapper #rtm_custom-home-news-more_bt {
		display: none !important;
	}
}

@media (max-width: 1300px) {

    .rtm_custom_home_news {
        padding-left: 15px;
        padding-right: 15px;
    }
    .rtm_custom-home-news-header {
        padding-left: 30px;
        padding-right: 30px;
    }
    .rtm_home_news-list-left_more_bt, .rtm_home_news-list-right_more_bt {
        width: 35px;
    }
    .rtm_home_news-list-left_more_bt {
        margin: 0 2px 0 -10px;
    }
    .rtm_home_news-list-right_more_bt {
        margin: 0 -10px 0 2px;
    }
}

/* 50132 / Сайт - Доработка - В блоке новостей на Главной переделать выдачу новостных блоков, переделать верстку, реализовать категории новостей / ртм_AndreyAA / Конец */
