/* =================================
   PAGE: HOME
================================= */

.home-categories {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 400px;
    gap: 15px;
    margin: 0 0 30px;
}

/* HERO */

.home-categories__item--hero {
    grid-column: 1 / -1;
    grid-row: span 2;
}

/* левая колонка */

.home-categories__item--wide {
    grid-column: span 7;
}

/* правая верхняя карточка */

.home-categories__item--tall {
    grid-column: span 5;
    grid-row: span 2;
}

/* правая нижняя карточка */

.home-categories__item--small {
    grid-column: span 5;
}

/* карточка */

.home-categories__item {
    position: relative;
    display: block;

    overflow: hidden;

    border: 1px solid #ddd;
    border-radius: 4px;

    text-decoration: none;

    box-shadow: 0 2px 6px rgba(0,0,0,.08);

    transition:
        transform .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;
}

/* изображение */

.home-categories__image {
    height: 100%;
}

.home-categories__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;

    transition: transform .4s ease;
}

/* затемнение */

.home-categories__image::after {
    content: "";
    position: absolute;
    inset: 0;

    background: linear-gradient(
        to top,
        rgba(0,0,0,.65),
        rgba(0,0,0,.10),
        rgba(0,0,0,0)
    );
}

/* текст */

.home-categories__title {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;

    z-index: 2;
}

.home-categories__title h3 {
    margin: 0;

    font-size: 22px;
    line-height: 1.2;

    color: #fff;
    text-transform: uppercase;

    text-shadow: 0 2px 6px rgba(0,0,0,.6);
}

/* hover */

.home-categories__item:hover {
    border-color: #00743C;
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0,0,0,.18);
}

.home-categories__item:hover img {
    transform: scale(1.08);
}

/* кнопки */

.home-categories__links {
    margin-top: 14px;
}

.home-categories__links .btn {
    background: rgba(255,255,255,.92);
    border: none;

    color: #333;
    font-weight: 600;

    padding: 6px 14px;
    margin-right: 8px;

    border-radius: 3px;

    box-shadow: 0 2px 6px rgba(0,0,0,.15);

    transition: all .2s ease;
}

.home-categories__links .btn:last-child {
    margin-right: 0;
}

.home-categories__links .btn:hover {
    background: #00743C;
    color: #fff;
}

/* адаптив */

@media (max-width: 992px) {

    .home-categories {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .home-categories__item--hero,
    .home-categories__item--wide,
    .home-categories__item--tall,
    .home-categories__item--small {
        grid-column: auto;
        grid-row: auto;
        min-height: 320px;
    }
}

@media (max-width: 576px) {

    .home-categories__item--hero,
    .home-categories__item--wide,
    .home-categories__item--tall,
    .home-categories__item--small {
        min-height: 220px;
    }

    .home-categories__title h3 {
        font-size: 18px;
    }

    .home-categories__links .btn {
        margin-bottom: 6px;
    }
}


/* =================================
   HOME PAGE: VIDEO GALLERY
================================= */

.home-videos {
    margin: 50px 0;
}

.home-videos__header {
    margin-bottom: 20px;
}

.home-videos__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.home-videos__card {
    position: relative;

    display: block;
    width: 100%;

    padding: 0;

    border: 1px solid #ddd;
    border-radius: 14px;

    background: #fff;

    overflow: hidden;

    cursor: pointer;
    text-align: left;

    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);

    transition:
        transform .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;
}

.home-videos__card:hover {
    border-color: #00743C;
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
}

.home-videos__preview {
    position: relative;

    display: block;

    width: 100%;
    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: #111;
}

.home-videos__preview-video {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    pointer-events: none;

    transition: transform .4s ease;
}

.home-videos__card:hover .home-videos__preview-video {
    transform: scale(1.04);
}

/* затемнение превью */

.home-videos__preview::after {
    content: "";

    position: absolute;
    inset: 0;

    background: linear-gradient(
        to top,
        rgba(0, 0, 0, .42),
        rgba(0, 0, 0, .04)
    );

    pointer-events: none;
}

/* кнопка play */

.home-videos__play {
    position: absolute;

    left: 50%;
    top: 50%;

    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 64px;
    height: 64px;

    border-radius: 50%;

    background: rgba(0, 116, 60, .94);

    box-shadow: 0 6px 20px rgba(0, 0, 0, .25);

    transform: translate(-50%, -50%);

    transition:
        transform .25s ease,
        background .25s ease;
}

.home-videos__card:hover .home-videos__play {
    background: #00743C;
    transform: translate(-50%, -50%) scale(1.08);
}

.home-videos__play-icon {
    display: block;

    width: 0;
    height: 0;

    margin-left: 4px;

    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 15px solid #fff;
}

/* название */

.home-videos__name {
    display: block;

    padding: 17px 18px 18px;

    font-size: 17px;
    line-height: 1.35;
    font-weight: 600;

    color: #222;
}

/* =================================
   VIDEO LIGHTBOX
================================= */

.home-videos__lightbox {
    position: fixed;
    inset: 0;

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    box-sizing: border-box;
}

.home-videos__lightbox[hidden] {
    display: none;
}

.home-videos__backdrop {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, .82);

    backdrop-filter: blur(5px);
}

.home-videos__dialog {
    position: relative;

    z-index: 2;

    width: min(1100px, 100%);

    max-height: calc(100vh - 60px);

    overflow: hidden;

    border-radius: 14px;

    background: #111;

    box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}

.home-videos__player {
    width: 100%;

    background: #000;
}

.home-videos__player-video {
    display: block;

    width: 100%;
    max-height: calc(100vh - 170px);

    background: #000;
}

.home-videos__lightbox-title {
    padding: 17px 55px 18px 20px;

    font-size: 17px;
    line-height: 1.4;
    font-weight: 600;

    color: #fff;

    background: #111;
}

.home-videos__close {
    position: absolute;

    top: 12px;
    right: 12px;

    z-index: 3;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: rgba(0, 0, 0, .55);
    color: #fff;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;
}

.home-videos__close:hover {
    background: #00743C;
    transform: scale(1.05);
}

.home-videos__close span {
    display: block;

    margin-top: -3px;

    font-size: 30px;
    line-height: 1;
    font-weight: 300;
}


/* =================================
   HOME PAGE: COMMON SECTIONS
================================= */

.home-section-title {
    margin: 0 0 20px;

    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;

    color: #222;
}


/* =================================
   HOME PAGE: ADVANTAGES
================================= */

.home-advantages {
    margin: 50px 0;
}

.home-advantages__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.home-advantages__item {
    position: relative;

    display: flex;
    gap: 18px;

    min-height: 170px;
    padding: 25px;

    box-sizing: border-box;

    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;

    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);

    transition:
        transform .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;
}

.home-advantages__item:hover {
    border-color: #00743C;
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
}

.home-advantages__number {
    flex: 0 0 auto;

    display: flex;
    align-items: flex-start;
    justify-content: center;

    width: 42px;
    height: 42px;

    padding-top: 10px;

    box-sizing: border-box;

    border-radius: 50%;

    background: #00743C;
    color: #fff;

    font-size: 13px;
    line-height: 1;
    font-weight: 700;
}

.home-advantages__content {
    min-width: 0;
}

.home-advantages__content h3 {
    margin: 2px 0 10px;

    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;

    color: #222;
}

.home-advantages__content p {
    margin: 0;

    font-size: 15px;
    line-height: 1.55;

    color: #666;
}


/* =================================
   HOME PAGE: ARTICLES
================================= */

.home-articles {
    margin: 50px 0 60px;
}

.home-articles__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.home-articles__item {
    position: relative;

    overflow: hidden;

    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;

    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);

    transition:
        transform .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;
}

.home-articles__item::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;

    width: 5px;

    background: #00743C;
}

.home-articles__item:hover {
    border-color: #00743C;
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
}

.home-articles__content {
    padding: 28px 30px 26px 35px;
}

.home-articles__label {
    display: inline-block;

    margin-bottom: 12px;

    font-size: 12px;
    line-height: 1;
    font-weight: 700;

    color: #00743C;

    text-transform: uppercase;
    letter-spacing: .08em;
}

.home-articles__content h3 {
    max-width: 1000px;

    margin: 0 0 20px;

    font-size: 20px;
    line-height: 1.4;
    font-weight: 600;
}

.home-articles__content h3 a {
    color: #222;
    text-decoration: none;

    transition: color .2s ease;
}

.home-articles__content h3 a:hover {
    color: #00743C;
}

.home-articles__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    font-size: 14px;
    line-height: 1;
    font-weight: 600;

    color: #00743C;
    text-decoration: none;

    transition:
        color .2s ease,
        gap .2s ease;
}

.home-articles__more:hover {
    color: #005c30;
    gap: 12px;
}

.home-articles__more span {
    font-size: 18px;
    line-height: 1;
}


/* =================================
   ADAPTIVE
================================= */

@media (max-width: 1200px) {

    .home-videos__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-advantages__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .home-videos {
        margin: 40px 0;
    }

    .home-videos__grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .home-videos__play {
        width: 58px;
        height: 58px;
    }

    .home-videos__lightbox {
        padding: 15px;
    }

    .home-videos__dialog {
        max-height: calc(100vh - 30px);
        border-radius: 10px;
    }

    .home-videos__player-video {
        max-height: calc(100vh - 130px);
    }

    .home-videos__lightbox-title {
        padding: 14px 50px 15px 16px;
        font-size: 15px;
    }

    .home-videos__close {
        width: 36px;
        height: 36px;
    }

    .home-advantages,
    .home-articles {
        margin: 40px 0;
    }

    .home-section-title {
        font-size: 24px;
    }

    .home-advantages__grid {
        grid-template-columns: 1fr;
    }

    .home-advantages__item {
        min-height: auto;
        padding: 22px;
    }

    .home-articles__content {
        padding: 24px 24px 24px 30px;
    }

    .home-articles__content h3 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {

    .home-section-title {
        font-size: 22px;
    }

    .home-videos__name {
        padding: 14px 15px 15px;
        font-size: 16px;
    }

    .home-videos__play {
        width: 52px;
        height: 52px;
    }

    .home-videos__play-icon {
        border-top-width: 8px;
        border-bottom-width: 8px;
        border-left-width: 12px;
    }

    .home-advantages__item {
        gap: 14px;
        padding: 18px;
    }

    .home-advantages__number {
        width: 38px;
        height: 38px;
        padding-top: 9px;
    }

    .home-advantages__content h3 {
        font-size: 17px;
    }

    .home-advantages__content p {
        font-size: 14px;
    }
}
