/* ======================================================= */
/* ==================== ОСНОВНОЙ БЛОК ==================== */
/* ======================================================= */

.certificate-main-block{
    position: relative;

    width: 100%;
    padding: 70px 8% 100px;
    box-sizing: border-box;
    overflow: hidden;

    background: linear-gradient(
        180deg,
        #0a0a0a 0%,
        #1a1210 20%,
        rgb(70, 45, 20) 55%,
        rgb(120, 66, 20) 100%
    );
}

.certificate-main-block::before{
    content: "📜";

    position: absolute;
    top: 6%;
    right: 4%;
    z-index: 0;

    font-size: 220px;
    opacity: 0.06;
    pointer-events: none;
}


/* ======================================================= */
/* ======================== ЛОГОТИП ====================== */
/* ======================================================= */

.certificate-main-block-logo{
    position: relative;
    z-index: 1;

    display: block;

    width: auto;
    height: 145px;
    max-width: min(80vw, 430px);
    margin: 0 auto 34px;

    object-fit: contain;

    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.48));
}


/* ======================================================= */
/* ================== ЗАГОЛОВОК СТРАНИЦЫ ================ */
/* ======================================================= */

.certificate-main-block-intro{
    position: relative;
    z-index: 1;

    max-width: 790px;
    margin: 0 auto 52px;

    text-align: center;
}

.certificate-main-block-intro h1{
    margin: 0 0 18px;

    color: white;
    font-family: "Avenir-Bold", sans-serif;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.15;
    letter-spacing: 0.5px;
}

.certificate-main-block-intro h1::after{
    content: "";
    display: block;

    width: 82px;
    height: 4px;
    margin: 20px auto 0;

    border-radius: 999px;

    background: linear-gradient(
        90deg,
        rgb(223, 93, 5),
        rgb(245, 166, 35)
    );
}

.certificate-main-block-intro p{
    margin: 0;

    color: rgba(255, 255, 255, 0.78);
    font-family: "Avenir-Medium", sans-serif;
    font-size: 17px;
    line-height: 1.65;
}


/* ======================================================= */
/* =================== СЕТКА ДОКУМЕНТОВ ================= */
/* ======================================================= */

.certificate-main-block-first{
    position: relative;
    z-index: 1;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px;

    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

/*
    Третья карточка — патент «Аполло».
    На компьютере находится по центру второй строки.
*/
.certificate-card:nth-child(3){
    grid-column: 1 / -1;
    justify-self: center;

    width: calc(50% - 17px);
}


/* ======================================================= */
/* ================== КАРТОЧКА ДОКУМЕНТА ================ */
/* ======================================================= */

.certificate-card{
    display: flex;
    flex-direction: column;

    min-width: 0;
    padding: 24px;
    box-sizing: border-box;

    text-align: center;

    border: 1px solid rgba(223, 93, 5, 0.28);
    border-radius: 22px;

    background: rgba(255, 255, 255, 0.06);

    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.28);

    transition:
        transform 0.3s ease,
        border-color 0.3s ease,
        background-color 0.3s ease,
        box-shadow 0.3s ease;
}

.certificate-card:hover{
    transform: translateY(-8px);

    border-color: rgba(245, 166, 35, 0.72);
    background: rgba(255, 255, 255, 0.10);

    box-shadow: 0 22px 46px rgba(0, 0, 0, 0.38);
}


/* ======================================================= */
/* =================== ФОТО ДОКУМЕНТА =================== */
/* ======================================================= */

.img-c{
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;

    border-radius: 12px;

    background: rgba(0, 0, 0, 0.24);

    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.42);
}

.img-c img{
    display: block;

    width: 100%;
    height: 100%;

    /*
        Документ всегда отображается целиком:
        он не обрезается и не растягивается.
    */
    object-fit: contain;
    object-position: center;

    background: #fff;

    transition: transform 0.35s ease;
}

.certificate-card:hover .img-c img{
    transform: scale(1.025);
}


/* ======================================================= */
/* ================= НАЗВАНИЕ ДОКУМЕНТА ================= */
/* ======================================================= */

.certificate-card h2{
    margin: 20px 0 0;

    color: white;
    font-family: "Avenir-Bold", sans-serif;
    font-size: 21px;
    line-height: 1.3;
}


/* ======================================================= */
/* ======================== FOOTER ======================= */
/* ======================================================= */

.footer{
    background: linear-gradient(
        180deg,
        rgb(120, 66, 20) 0%,
        rgb(209, 106, 16) 100%
    );
}


/* ======================================================= */
/* ====================== ПЛАНШЕТЫ ======================= */
/* ======================================================= */

@media (max-width: 1024px){
    .certificate-main-block{
        padding: 60px 6% 80px;
    }

    .certificate-main-block::before{
        font-size: 170px;
    }

    .certificate-main-block-logo{
        height: 120px;
        margin-bottom: 30px;
    }

    .certificate-main-block-intro{
        margin-bottom: 44px;
    }

    .certificate-main-block-first{
        gap: 28px;
        max-width: 760px;
    }

    .certificate-card{
        padding: 20px;
    }

    .certificate-card:nth-child(3){
        width: calc(50% - 14px);
    }

    .certificate-card h2{
        font-size: 19px;
    }
}


/* ======================================================= */
/* ======================= ТЕЛЕФОНЫ ====================== */
/* ======================================================= */

@media (max-width: 768px){
    .certificate-main-block{
        padding: 52px 6% 70px;
    }

    .certificate-main-block::before{
        font-size: 140px;
    }

    .certificate-main-block-logo{
        height: 95px;
        max-width: 75vw;
        margin-bottom: 28px;
    }

    .certificate-main-block-intro{
        margin-bottom: 36px;
    }

    .certificate-main-block-intro h1{
        font-size: 32px;
    }

    .certificate-main-block-intro p{
        font-size: 16px;
    }

    .certificate-main-block-first{
        grid-template-columns: 1fr;
        gap: 26px;

        max-width: 390px;
    }

    /*
        На телефонах все три документа имеют одинаковую
        ширину и располагаются друг под другом.
    */
    .certificate-card:nth-child(3){
        grid-column: auto;
        justify-self: stretch;

        width: 100%;
    }

    .certificate-card{
        padding: 20px;
        border-radius: 20px;
    }

    .certificate-card h2{
        font-size: 19px;
    }
}


/* ======================================================= */
/* =================== ОБЫЧНЫЕ ТЕЛЕФОНЫ ================= */
/* ======================================================= */

@media (max-width: 480px){
    .certificate-main-block{
        padding: 40px 5% 50px;
    }

    .certificate-main-block::before{
        top: 3%;
        right: 2%;

        font-size: 100px;
    }

    .certificate-main-block-logo{
        height: 74px;
        max-width: 80vw;
        margin-bottom: 24px;
    }

    .certificate-main-block-intro{
        margin-bottom: 30px;
    }

    .certificate-main-block-intro h1{
        font-size: 27px;
    }

    .certificate-main-block-intro h1::after{
        width: 58px;
        height: 3px;
        margin-top: 16px;
    }

    .certificate-main-block-intro p{
        font-size: 14.5px;
        line-height: 1.6;
    }

    .certificate-main-block-first{
        gap: 20px;

        max-width: 320px;
    }

    .certificate-card{
        padding: 16px;
        border-radius: 16px;
    }

    .img-c{
        border-radius: 10px;
    }

    .certificate-card h2{
        margin-top: 16px;
        font-size: 17px;
    }
}


/* ======================================================= */
/* ================= УЗКИЕ ТЕЛЕФОНЫ ===================== */
/* ======================================================= */

@media (max-width: 360px){
    .certificate-main-block-logo{
        height: 60px;
    }

    .certificate-main-block-intro h1{
        font-size: 23px;
    }

    .certificate-card h2{
        font-size: 15px;
    }
}

/* ======================================================= */
/* =============== РАЗДЕЛЫ: ПАТЕНТЫ И ПРАВА ============= */
/* ======================================================= */

.certificate-category{
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 70px;
}

.certificate-category:last-child{
    margin-bottom: 0;
}

.certificate-category-title{
    position: relative;

    display: inline-block;

    margin: 0 0 34px;

    color: rgb(245, 166, 35);
    font-family: "Avenir-Bold", sans-serif;
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.2;
}

.certificate-category-title::after{
    content: "";

    position: absolute;
    bottom: -12px;
    left: 0;

    width: 74px;
    height: 4px;

    border-radius: 999px;

    background: linear-gradient(
        90deg,
        rgb(245, 166, 35),
        rgb(223, 93, 5)
    );
}

/* Один патент не растягивается на ширину всей сетки */
.certificate-grid-patents{
    justify-content: flex-start;
}

/* Для свидетельств сохраняется обычная сетка */
.certificate-grid-rights{
    justify-content: flex-start;
}

@media (max-width: 768px){
    .certificate-category{
        margin-bottom: 52px;
    }

    .certificate-category-title{
        margin-bottom: 27px;
    }
}

@media (max-width: 480px){
    .certificate-category{
        margin-bottom: 40px;
    }

    .certificate-category-title{
        font-size: 24px;
    }

    .certificate-category-title::after{
        bottom: -9px;

        width: 58px;
        height: 3px;
    }
}

/* ======================================================= */
/* ======== КАРТОЧКИ ПАТЕНТОВ И АВТОРСКИХ ПРАВ ========== */
/* ======================================================= */

/*
    В новом HTML названия документов находятся в <h3>,
    поэтому оформляем h2 и h3 одинаково.
*/
.certificate-card h2,
.certificate-card h3{
    position: relative;

    margin: 30px 0 2px;
    padding-top: 18px;

    color: #fff;
    font-family: "Avenir-Bold", sans-serif;
    font-size: clamp(18px, 2vw, 22px);
    font-weight: normal;
    line-height: 1.35;
    letter-spacing: 0.25px;

    text-align: center;

    transition:
        color 0.3s ease,
        transform 0.3s ease;
}

/*
    Тонкая декоративная линия между изображением
    и названием документа.
*/
.certificate-card h2::before,
.certificate-card h3::before{
    content: "";

    position: absolute;
    top: 0;
    left: 50%;

    width: 58px;
    height: 2px;

    border-radius: 99px;

    background: linear-gradient(
        90deg,
        rgb(223, 93, 5),
        rgb(245, 166, 35)
    );

    transform: translateX(-50%);
}

.certificate-card:hover h2,
.certificate-card:hover h3{
    color: rgb(255, 204, 111);

    transform: translateY(-2px);
}


/* ======================================================= */
/* ================= ЦЕНТРИРОВАНИЕ ПАТЕНТА ============== */
/* ======================================================= */

/*
    В разделе «Патенты» только одна карточка.
    Делаем сетку из одной колонки и центрируем карточку.
*/
.certificate-grid-patents{
    display: grid;
    grid-template-columns: minmax(0, 390px);
    justify-content: center;

    max-width: 390px;
    margin-right: auto;
    margin-left: auto;
}

/*
    Сбрасываем старое правило .certificate-card:nth-child(3),
    которое относилось к прежней структуре с тремя карточками.
*/
.certificate-grid-patents .certificate-card:nth-child(3){
    grid-column: auto;
    justify-self: stretch;

    width: 100%;
}

/*
    Карточка патента в новом HTML — первый ребёнок,
    поэтому центруем её без привязки к номеру.
*/
.certificate-grid-patents .certificate-card{
    width: 100%;
    justify-self: center;
}


/* ======================================================= */
/* ============= РАСПОЛОЖЕНИЕ АВТОРСКИХ СВИДЕТЕЛЬСТВ ==== */
/* ======================================================= */

.certificate-grid-rights{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: center;

    max-width: 860px;
}

.certificate-grid-rights .certificate-card{
    width: auto;
}


/* ======================================================= */
/* ====================== ПЛАНШЕТЫ ======================= */
/* ======================================================= */

@media (max-width: 1024px){
    .certificate-grid-patents{
        grid-template-columns: minmax(0, 350px);

        max-width: 350px;
    }

    .certificate-card h2,
    .certificate-card h3{
        margin-top: 27px;
        padding-top: 16px;

        font-size: 20px;
    }
}


/* ======================================================= */
/* ======================= ТЕЛЕФОНЫ ====================== */
/* ======================================================= */

@media (max-width: 768px){
    .certificate-grid-patents,
    .certificate-grid-rights{
        grid-template-columns: 1fr;

        width: 100%;
        max-width: 390px;
        margin-right: auto;
        margin-left: auto;
    }

    .certificate-card h2,
    .certificate-card h3{
        margin-top: 26px;
        padding-top: 15px;

        font-size: 19px;
    }
}


/* ======================================================= */
/* =================== ОБЫЧНЫЕ ТЕЛЕФОНЫ ================= */
/* ======================================================= */

@media (max-width: 480px){
    .certificate-grid-patents,
    .certificate-grid-rights{
        max-width: 320px;
    }

    .certificate-card h2,
    .certificate-card h3{
        margin-top: 22px;
        padding-top: 13px;

        font-size: 17px;
        line-height: 1.3;
    }

    .certificate-card h2::before,
    .certificate-card h3::before{
        width: 46px;
    }
}