/* Home page: hero, photo strip, categories, news, partners.
   Values ported from the old Bitrix template (topSlideWrap, mainPhotos,
   production, mainNewsList, mainPartners).
   Lengths are in rem, 1rem = 16px; comments keep the original px values. */

/* --- Hero --- */

.home-hero {
    position: relative;
    width: 100%;
    max-width: 58.75rem; /* 940px */
    height: 25rem; /* 400px */
    margin: 0 auto 3.125rem; /* 50px */
}

.home-hero__panel {
    position: absolute;
    top: 0;
    height: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 200% auto;
}

.home-hero__panel--left {
    left: 0;
    width: 50%;
    background-position: left center;
}

.home-hero__panel--right {
    right: 0;
    width: 50%;
    background-position: right center;
}

.home-hero__panel--empty {
    background-color: #f3f6f9;
    background-position: center;
    background-size: 6rem auto; /* 96px */
}

.home-hero--resetting .home-hero__panel {
    transition: width 0.45s ease;
}

.home-hero__info {
    position: absolute;
    z-index: 10;
    width: 13.75rem; /* 220px */
}

.home-hero__info--left {
    top: 0;
    left: 0;
    text-align: right;
}

.home-hero__info--right {
    right: 0;
    bottom: 0;
    text-align: left;
}

.home-hero__title {
    margin: 0;
}

.home-hero__title img {
    padding-right: 0.625rem; /* 10px */
    vertical-align: middle;
}

/* Hero banner link, moved here from template_styles.css (.subTitleMain). */
.home-hero__link {
    color: #004f9f;
    font-size: 1.25rem; /* 20px */
    font-weight: 700;
    line-height: 1.25rem; /* 20px */
    text-transform: uppercase;
}

a.home-hero__link {
    border-bottom: 2px solid #004f9f;
    text-decoration: none;
}

a.home-hero__link:hover {
    color: #1780c3;
    border-bottom: 2px solid #1780c3;
}

.home-hero__description {
    width: 10rem; /* 160px */
    margin: 0;
    padding-left: 3.375rem; /* 54px */
    color: #383838;
    font-size: 0.8125rem; /* 13px */
    font-style: italic;
    line-height: 1.375rem; /* 22px */
}

.home-hero--single .home-hero__panel {
    right: auto;
    left: 0;
    width: 100%;
    background-position: center;
    background-size: 100% auto;
}

/* --- Photo strip --- */

.home-photos-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 150rem; /* 2400px */
    margin: 0 auto 2.5rem; /* 40px */
    overflow: hidden;
}

.home-photos {
    position: relative;
    flex: 1 1 0;
    width: 100%;
    max-width: 120rem; /* 1920px */
    min-width: 0;
    margin: 0;
    background: #e9e9e9;
}

.home-photo-edge {
    position: absolute;
    top: 0;
    display: block;
    width: 15rem; /* 240px */
    height: 11.6875rem; /* 187px */
    overflow: hidden;
}

.home-photo-edge--left {
    right: calc(50% + min(50%, 60rem)); /* 960px */
}

.home-photo-edge--right {
    left: calc(50% + min(50%, 60rem)); /* 960px */
}

.home-photo-edge::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.home-photo-edge--left::after {
    background-image: linear-gradient(to right, #fff, transparent);
}

.home-photo-edge--right::after {
    background-image: linear-gradient(to left, #fff, transparent);
}

.home-photos__viewport {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    outline: none;
}

.home-photos__viewport::-webkit-scrollbar {
    display: none;
}

.home-photo {
    position: relative;
    flex: 0 0 30rem; /* 480px */
    height: 11.6875rem; /* 187px */
    overflow: hidden;
    background: #d8d8d8;
    scroll-snap-align: start;
}

/* At 1920 the four 480px frames must fit even when the page scrollbar
   takes part of the viewport width; otherwise the last 15px look like
   an overflow and the slider arrows appear unnecessarily. Keep 25% so
   five or more photos still overflow and remain scrollable. */
@media (min-width: 120rem) { /* 1920px */
    .home-photo {
        flex: 0 0 25%;
    }
}

.home-photo img,
.home-photo-edge img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(1.6);
    transition: transform 0.4s ease;
    user-select: none;
}

.home-photo.is-moving img,
.home-photo-edge.is-moving img {
    transition: none;
}

/* --- Slider arrows (photo strip and partners) --- */

.home-photos__arrow,
.partners-block__arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.375rem; /* 38px */
    height: 2.375rem; /* 38px */
    margin-top: -1.1875rem; /* -19px */
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #004f9f;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.home-photos__arrow:hover,
.partners-block__arrow:hover {
    color: #fff;
    background: #004f9f;
}

.home-photos__arrow:disabled,
.partners-block__arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.home-photos__arrow[hidden],
.partners-block__arrow[hidden] {
    display: none;
}

.home-photos__arrow--prev {
    left: 0.75rem; /* 12px */
}

.home-photos__arrow--next {
    right: 0.75rem; /* 12px */
}

.home-photos__arrow--prev .slider-arrow-symbol {
    transform: translate(var(--arrow-home-photos-prev-x), var(--arrow-home-photos-prev-y));
}

.home-photos__arrow--next .slider-arrow-symbol {
    transform: translate(var(--arrow-home-photos-next-x), var(--arrow-home-photos-next-y));
}

/* --- Categories ---
   The category tiles are the shared catalog-tiles block; see catalog.css. */

.home-categories {
    padding: 2.5rem 0 0.625rem; /* 40px 0 10px */
}

/* --- News --- */

.home-article {
    /* The old home page ended with an empty clearfix line before the footer. */
    padding-bottom: 1.1375rem; /* ~18px */
}

.home-news {
    padding-top: 1.25rem; /* 20px */
}

.home-news__heading {
    margin-bottom: 0.4375rem; /* 7px */
}

.home-news__list {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    padding: 0.5rem 0 0; /* 8px 0 0 */
}

.home-news__all {
    margin-top: 1.5rem; /* 24px */
    margin-bottom: 2.625rem; /* 42px */
    text-align: center;
}

.home-news__all-link {
    color: #004f9f;
    font-size: 1rem; /* 16px */
    font-weight: 700;
    text-decoration: underline;
}

.home-news__all-link:hover {
    color: #0c54a0;
}

.home-news__item {
    flex: 0 0 auto;
    width: 18.75rem; /* 300px; + 2 x 10px padding = 320px */
    min-width: 0;
    padding: 0 0.625rem; /* 10px */
    overflow-wrap: anywhere;
}

.home-news__date {
    margin: 1.125rem 0; /* 18px */
    color: #26272a;
    font-size: 0.875rem; /* 14px */
    text-transform: lowercase;
}

.home-news__day {
    color: #1b61aa;
    font-size: 1.5rem; /* 24px */
    line-height: 1.25rem; /* 20px */
}

.home-news__title,
.home-news__title a {
    color: #26272a;
    font-size: 0.875rem; /* 14px */
    text-decoration: none;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.home-news__title a:hover {
    text-decoration: underline;
}

.home-news__preview {
    margin: 0.625rem 0 0; /* 10px */
    color: #7f7f7f;
    font-size: 0.8125rem; /* 13px */
    line-height: 1.125rem; /* 18px */
    overflow-wrap: anywhere;
}

/* --- Partners (hidden by moreland.show_partners) --- */

.partners-block {
    position: relative;
    margin: 0 1.5625rem 2.5rem; /* 0 25px 40px */
    padding: 1.875rem 0 1.75rem; /* 30px 0 28px */
}

.partners-block__viewport {
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
}

.partners-block__viewport::-webkit-scrollbar {
    display: none;
}

.partners-block__item {
    display: flex;
    flex: 0 0 20%;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 5.75rem; /* 92px */
    padding: 0 0.625rem; /* 10px */
    scroll-snap-align: start;
}

.partners-block__item img {
    width: auto;
    max-width: 8.75rem; /* 140px */
    height: auto;
    max-height: 5.75rem; /* 92px */
}

.partners-block__arrow--prev {
    left: -0.625rem; /* -10px */
}

.partners-block__arrow--next {
    right: -0.625rem; /* -10px */
}

.partners-block__arrow--prev .slider-arrow-symbol {
    transform: translate(var(--arrow-partners-prev-x), var(--arrow-partners-prev-y));
}

.partners-block__arrow--next .slider-arrow-symbol {
    transform: translate(var(--arrow-partners-next-x), var(--arrow-partners-next-y));
}

/* --- Responsive --- */

/* Old mobile.css hides .anim-container up to 960 px. The new hero uses its
   own class; keep the legacy selector explicit: visible from 681 px and
   hidden on phones. The photo strip has its own 960 px breakpoint below. */
@media (min-width: 42.5625rem) and (max-width: 60rem) { /* 681px–960px */
    .anim-container {
        display: block !important;
    }
}

@media (max-width: 59.9375rem) { /* 959px */
    .home-photos-stage {
        display: none;
    }
}

@media (max-width: 64rem) { /* 1024px */
    .partners-block__item {
        flex-basis: 25%;
    }
}

@media (max-width: 42.5rem) { /* 680px */
    .anim-container,
    .home-hero {
        display: none !important;
    }

    .home-article {
        display: flex;
        flex-direction: column;
    }

    .home-news {
        order: 1;
        padding-top: 0;
    }

    .home-categories {
        order: 2;
        padding: 0 0 1.25rem; /* 0 0 20px */
    }

    .home-news__item {
        box-sizing: border-box;
        width: 50%;
    }

    .partners-block {
        margin: 0 0.625rem 2.5rem; /* 0 10px 40px */
    }

    .partners-block__item {
        flex-basis: 50%;
    }
}

@media (max-width: 60rem) { /* 960px */
    .home-news {
        padding-right: 0.625rem; /* 10px */
        padding-left: 0.625rem; /* 10px */
    }

    .home-news__item {
        box-sizing: border-box;
        width: 50%;
    }
}

@media (max-width: 30rem) { /* 480px */
    .partners-block__item {
        flex-basis: 100%;
    }
}

@media (max-width: 25rem) { /* 400px */
    .home-news__item {
        width: 100%;
    }
}
