/* =========================================================
   PORTFOLIO — ОСНОВНЫЕ НАСТРОЙКИ
========================================================= */

.portfolio-page {
    min-height: 100vh;
    background: #f5f6ff;
    color: #172963;
}


/* =========================================================
   HERO
   Только заголовок «Портфолио»
========================================================= */

.portfolio-hero {
    position: relative;
    overflow: hidden;

    padding: 58px 0 62px;

    text-align: center;

    background:
        radial-gradient(
            circle at 10% 30%,
            rgba(105, 75, 245, 0.14),
            transparent 30%
        ),
        radial-gradient(
            circle at 90% 70%,
            rgba(120, 92, 255, 0.12),
            transparent 32%
        ),
        linear-gradient(
            135deg,
            #eef3ff,
            #f8f6ff
        );

    border-bottom: 1px solid #dddfff;
}

.portfolio-hero .shell {
    display: flex;
    justify-content: center;
    align-items: center;
}

.portfolio-hero h1 {
    margin: 0;

    color: #172963;

    font-size: clamp(48px, 6vw, 76px);
    line-height: 1;
    font-weight: 900;
}


/* =========================================================
   ОСНОВНОЙ КОНТЕНТ
========================================================= */

.portfolio-content {
    padding-top: 45px;
    padding-bottom: 90px;
}


/* =========================================================
   ОБЩИЕ КАРТОЧКИ
========================================================= */

.card {
    background: #ffffff;

    border: 1px solid #e7e5fa;
    border-radius: 24px;

    box-shadow:
        0 18px 45px rgba(47, 42, 120, 0.08);
}


/* =========================================================
   ОСНОВНАЯ КАРТОЧКА УЧИТЕЛЯ
========================================================= */

.portfolio-profile {
    display: grid;

    grid-template-columns: 270px 1fr;

    gap: 45px;

    padding: 32px;

    align-items: center;
}


/* =========================================================
   ФОТО
========================================================= */

.portfolio-photo {
    width: 270px;
    height: 330px;

    overflow: hidden;

    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            #7659ee,
            #e8d1d0 48%,
            #263d6a 49%
        );

    box-shadow:
        0 18px 40px rgba(74, 57, 180, 0.18);
}


.portfolio-photo-placeholder {
    width: 100%;
    height: 100%;

    display: flex;

    flex-direction: column;

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

    text-align: center;

    color: #ffffff;

    background:
        linear-gradient(
            145deg,
            rgba(103, 78, 235, 0.32),
            rgba(255, 255, 255, 0.08)
        );
}


.portfolio-photo-placeholder span {
    width: 82px;
    height: 82px;

    display: flex;

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

    margin-bottom: 16px;

    border-radius: 50%;

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

    font-size: 40px;

    backdrop-filter: blur(8px);
}


.portfolio-photo-placeholder p {
    margin: 0;

    font-size: 18px;
    font-weight: 800;
}


/* =========================================================
   ПРАВАЯ ЧАСТЬ ПРОФИЛЯ
========================================================= */

.portfolio-profile-info {
    min-width: 0;
}


.section-label {
    color: #6548ed;

    font-size: 11px;
    font-weight: 900;

    letter-spacing: 4px;

    text-transform: uppercase;
}


.portfolio-profile-info h2 {
    margin: 9px 0 10px;

    color: #172963;

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

    font-weight: 900;
}


.empty-description {
    max-width: 720px;

    margin: 0 0 25px;

    color: #6d7ca5;

    font-size: 15px;

    line-height: 1.7;
}


/* =========================================================
   ИНФОРМАЦИЯ КАК РЕЗЮМЕ
========================================================= */

.info-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}


.info-item {
    min-height: 76px;

    display: flex;

    align-items: center;

    padding: 15px 18px;

    background:
        linear-gradient(
            135deg,
            #faf9ff,
            #f5f3ff
        );

    border: 1px solid #e6e2ff;

    border-radius: 15px;

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


.info-item:hover {
    transform: translateY(-2px);

    border-color: #c9beff;

    box-shadow:
        0 8px 22px rgba(91, 67, 237, 0.09);
}


.info-item small {
    display: block;

    margin-bottom: 6px;

    color: #8b96b6;

    font-size: 11px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.4px;
}


.info-item strong {
    display: block;

    color: #1b2b5c;

    font-size: 14px;

    line-height: 1.4;
}


/* =========================================================
   СЕКЦИИ
========================================================= */

.portfolio-section {
    margin-top: 58px;
}


.section-heading {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 25px;
}


.section-heading h2,
.portfolio-text-section h2 {
    margin: 8px 0 0;

    color: #172963;

    font-size: 32px;

    line-height: 1.2;

    font-weight: 900;
}


/* =========================================================
   ПОДЧЁРКИВАНИЕ
========================================================= */

.underline {
    display: block;

    width: 70px;
    height: 4px;

    margin: 10px 0 18px;

    border-radius: 20px;

    background:
        linear-gradient(
            90deg,
            #6847f2,
            #8c72ff
        );
}


/* =========================================================
   ПРОФЕССИОНАЛЬНЫЕ КАРТОЧКИ
========================================================= */

.portfolio-cards {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;
}


.portfolio-info-card {
    min-height: 170px;

    padding: 25px;

    display: flex;

    align-items: center;

    background: #ffffff;

    border: 1px solid #e7e5fa;

    border-radius: 20px;

    box-shadow:
        0 12px 30px rgba(48, 42, 120, 0.06);

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


.portfolio-info-card:hover {
    transform: translateY(-5px);

    border-color: #cfc5ff;

    box-shadow:
        0 18px 38px rgba(82, 61, 205, 0.12);
}


.portfolio-info-card h3 {
    margin: 0 0 10px;

    color: #1b2c61;

    font-size: 18px;

    line-height: 1.3;
}


.portfolio-info-card p {
    margin: 0;

    color: #7180a4;

    font-size: 14px;

    line-height: 1.65;
}


/* =========================================================
   ТЕКСТОВЫЕ СЕКЦИИ
========================================================= */

.portfolio-text-section {
    margin-top: 55px;

    padding: 35px;

    background: #ffffff;

    border: 1px solid #e7e5fa;

    border-radius: 24px;

    box-shadow:
        0 15px 40px rgba(46, 41, 115, 0.06);
}


.portfolio-text-section h2 {
    margin-top: 8px;
}


/* =========================================================
   ПУСТОЙ БЛОК
========================================================= */

.empty-content {
    min-height: 190px;

    margin-top: 25px;

    display: flex;

    flex-direction: column;

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

    padding: 35px;

    text-align: center;

    background:
        linear-gradient(
            135deg,
            #faf9ff,
            #f4f2ff
        );

    border: 2px dashed #d9d2ff;

    border-radius: 18px;
}


.empty-content h3 {
    margin: 0 0 8px;

    color: #243565;

    font-size: 19px;
}


.empty-content p {
    max-width: 650px;

    margin: 0;

    color: #7b88a8;

    font-size: 14px;

    line-height: 1.7;
}


/* =========================================================
   ДОСТИЖЕНИЯ
========================================================= */

.achievement-empty {
    padding: 30px;

    display: flex;

    align-items: center;

    background: #ffffff;

    border: 1px solid #e7e5fa;

    border-radius: 20px;

    box-shadow:
        0 12px 30px rgba(45, 41, 115, 0.06);
}


.achievement-empty h3 {
    margin: 0 0 8px;

    color: #1c2c5e;

    font-size: 19px;
}


.achievement-empty p {
    margin: 0;

    color: #7482a5;

    line-height: 1.6;
}


/* =========================================================
   МАТЕРИАЛЫ
========================================================= */

.portfolio-materials {
    margin-top: 55px;

    padding: 35px;

    background: #ffffff;

    border: 1px solid #e7e5fa;

    border-radius: 24px;

    box-shadow:
        0 15px 40px rgba(46, 41, 115, 0.06);
}


.materials-count {
    display: inline-flex;

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

    min-height: 36px;

    padding: 7px 15px;

    color: #6245ec;

    background: #f0edff;

    border-radius: 30px;

    font-size: 13px;

    font-weight: 800;
}


.files-empty {
    min-height: 220px;

    margin-top: 25px;

    display: flex;

    flex-direction: column;

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

    padding: 35px;

    text-align: center;

    border: 2px dashed #d8d1ff;

    border-radius: 20px;

    background:
        linear-gradient(
            135deg,
            #faf9ff,
            #f5f3ff
        );
}


.files-empty h3 {
    margin: 0 0 8px;

    color: #253564;

    font-size: 20px;
}


.files-empty p {
    margin: 0;

    color: #7b87a6;

    font-size: 14px;
}


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

.site-footer {
    color: #dce0ff;

    background:
        linear-gradient(
            145deg,
            #0b0a1c,
            #12102c 55%,
            #17133b
        );

    border-top: 1px solid #302b61;
}


.footer-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 50px;

    padding-top: 55px;
    padding-bottom: 45px;
}


.footer-column h3 {
    margin: 0 0 18px;

    color: #ffffff;

    font-size: 18px;
}


.footer-column p {
    margin: 8px 0;

    color: #aeb5da;

    font-size: 14px;

    line-height: 1.7;
}


.footer-links {
    display: grid;

    gap: 9px;
}


.footer-links a {
    width: fit-content;

    color: #b8bde0;

    text-decoration: none;

    font-size: 14px;

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


.footer-links a:hover {
    color: #8c70ff;

    transform: translateX(4px);
}


.footer-bottom {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding-top: 20px;
    padding-bottom: 20px;

    border-top: 1px solid #29264e;

    color: #777fa8;

    font-size: 13px;
}


/* =========================================================
   DARK THEME
========================================================= */


/* PAGE */

body.dark .portfolio-page,
body.dark-mode .portfolio-page,
body[data-theme="dark"] .portfolio-page,
html.dark .portfolio-page {
    background: #0d0b1c;

    color: #edf0ff;
}


/* HERO */

body.dark .portfolio-hero,
body.dark-mode .portfolio-hero,
body[data-theme="dark"] .portfolio-hero,
html.dark .portfolio-hero {
    background:
        radial-gradient(
            circle at 10% 20%,
            rgba(102, 73, 238, 0.20),
            transparent 32%
        ),
        radial-gradient(
            circle at 90% 50%,
            rgba(97, 70, 225, 0.16),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #11102b,
            #171434
        );

    border-color: #2c2851;
}


body.dark .portfolio-hero h1,
body.dark-mode .portfolio-hero h1,
body[data-theme="dark"] .portfolio-hero h1,
html.dark .portfolio-hero h1 {
    color: #ffffff;
}


/* MAIN CARDS */

body.dark .card,
body.dark .portfolio-info-card,
body.dark .portfolio-text-section,
body.dark .achievement-empty,
body.dark .portfolio-materials,

body.dark-mode .card,
body.dark-mode .portfolio-info-card,
body.dark-mode .portfolio-text-section,
body.dark-mode .achievement-empty,
body.dark-mode .portfolio-materials,

body[data-theme="dark"] .card,
body[data-theme="dark"] .portfolio-info-card,
body[data-theme="dark"] .portfolio-text-section,
body[data-theme="dark"] .achievement-empty,
body[data-theme="dark"] .portfolio-materials,

html.dark .card,
html.dark .portfolio-info-card,
html.dark .portfolio-text-section,
html.dark .achievement-empty,
html.dark .portfolio-materials {

    background:
        linear-gradient(
            145deg,
            #1a1837,
            #211e45
        );

    border-color: #353064;

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.18);
}


/* PROFILE TITLE */

body.dark .portfolio-profile-info h2,
body.dark .section-heading h2,
body.dark .portfolio-text-section h2,
body.dark .portfolio-info-card h3,
body.dark .achievement-empty h3,
body.dark .files-empty h3,

body.dark-mode .portfolio-profile-info h2,
body.dark-mode .section-heading h2,
body.dark-mode .portfolio-text-section h2,
body.dark-mode .portfolio-info-card h3,
body.dark-mode .achievement-empty h3,
body.dark-mode .files-empty h3,

body[data-theme="dark"] .portfolio-profile-info h2,
body[data-theme="dark"] .section-heading h2,
body[data-theme="dark"] .portfolio-text-section h2,
body[data-theme="dark"] .portfolio-info-card h3,
body[data-theme="dark"] .achievement-empty h3,
body[data-theme="dark"] .files-empty h3,

html.dark .portfolio-profile-info h2,
html.dark .section-heading h2,
html.dark .portfolio-text-section h2,
html.dark .portfolio-info-card h3,
html.dark .achievement-empty h3,
html.dark .files-empty h3 {

    color: #ffffff;
}


/* DESCRIPTION TEXT */

body.dark .empty-description,
body.dark .portfolio-info-card p,
body.dark .achievement-empty p,
body.dark .empty-content p,
body.dark .files-empty p,
body.dark .info-item small,

body.dark-mode .empty-description,
body.dark-mode .portfolio-info-card p,
body.dark-mode .achievement-empty p,
body.dark-mode .empty-content p,
body.dark-mode .files-empty p,
body.dark-mode .info-item small,

body[data-theme="dark"] .empty-description,
body[data-theme="dark"] .portfolio-info-card p,
body[data-theme="dark"] .achievement-empty p,
body[data-theme="dark"] .empty-content p,
body[data-theme="dark"] .files-empty p,
body[data-theme="dark"] .info-item small,

html.dark .empty-description,
html.dark .portfolio-info-card p,
html.dark .achievement-empty p,
html.dark .empty-content p,
html.dark .files-empty p,
html.dark .info-item small {

    color: #aab1d3;
}


/* INFO ITEMS */

body.dark .info-item,
body.dark-mode .info-item,
body[data-theme="dark"] .info-item,
html.dark .info-item {

    background:
        linear-gradient(
            135deg,
            #15132e,
            #1b1838
        );

    border-color: #34305c;
}


body.dark .info-item strong,
body.dark-mode .info-item strong,
body[data-theme="dark"] .info-item strong,
html.dark .info-item strong {

    color: #edf0ff;
}


body.dark .info-item:hover,
body.dark-mode .info-item:hover,
body[data-theme="dark"] .info-item:hover,
html.dark .info-item:hover {

    border-color: #51468b;
}


/* EMPTY BLOCKS */

body.dark .empty-content,
body.dark .files-empty,
body.dark-mode .empty-content,
body.dark-mode .files-empty,
body[data-theme="dark"] .empty-content,
body[data-theme="dark"] .files-empty,
html.dark .empty-content,
html.dark .files-empty {

    background:
        linear-gradient(
            145deg,
            #15132d,
            #1b1838
        );

    border-color: #40386f;
}


/* MATERIAL COUNT */

body.dark .materials-count,
body.dark-mode .materials-count,
body[data-theme="dark"] .materials-count,
html.dark .materials-count {

    background: #2b2557;

    color: #a894ff;
}


/* =========================================================
   АДАПТИВНОСТЬ
========================================================= */

@media (max-width: 1000px) {

    .portfolio-profile {
        grid-template-columns: 220px 1fr;

        gap: 28px;
    }


    .portfolio-photo {
        width: 220px;
        height: 285px;
    }


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


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

}


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

@media (max-width: 700px) {

    .portfolio-hero {
        padding: 45px 0 50px;
    }


    .portfolio-hero h1 {
        font-size: 48px;
    }


    .portfolio-content {
        padding-top: 28px;
        padding-bottom: 55px;
    }


    .portfolio-profile {
        grid-template-columns: 1fr;

        padding: 22px;
    }


    .portfolio-photo {
        width: 100%;

        max-width: 320px;

        height: 330px;

        margin: 0 auto;
    }


    .portfolio-profile-info h2 {
        font-size: 27px;
    }


    .info-grid {
        grid-template-columns: 1fr;
    }


    .portfolio-cards {
        grid-template-columns: 1fr;
    }


    .portfolio-text-section,
    .portfolio-materials {
        padding: 24px;
    }


    .section-heading {
        align-items: flex-start;

        flex-direction: column;
    }


    .footer-grid {
        grid-template-columns: 1fr;

        gap: 30px;

        padding-top: 40px;
    }


    .footer-bottom {
        flex-direction: column;

        align-items: flex-start;

        gap: 8px;
    }

}


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

@media (max-width: 450px) {

    .portfolio-hero {
        padding: 38px 0 42px;
    }


    .portfolio-hero h1 {
        font-size: 42px;
    }


    .portfolio-profile {
        padding: 18px;

        border-radius: 18px;
    }


    .portfolio-photo {
        height: 300px;
    }


    .portfolio-profile-info h2 {
        font-size: 24px;
    }


    .section-label {
        font-size: 10px;

        letter-spacing: 2px;
    }


    .section-heading h2,
    .portfolio-text-section h2 {
        font-size: 26px;
    }


    .portfolio-info-card {
        min-height: auto;

        padding: 20px;
    }


    .portfolio-text-section,
    .portfolio-materials {
        padding: 20px;

        border-radius: 18px;
    }


    .files-empty,
    .empty-content {
        min-height: 180px;

        padding: 25px 18px;
    }

}


/* =========================================================
   ДИНАМИЧЕСКИЕ МАТЕРИАЛЫ ИЗ АДМИН-ПАНЕЛИ
========================================================= */

/* Списки загружаемых материалов */
#portfolioMaterialsList,
#awardsList {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

/* Карточка документа, фотографии, награды */
.site-material-card {
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
}

.site-material-card h3 {
    margin: 0 0 10px;
    overflow-wrap: anywhere;
}

.site-material-card p {
    overflow-wrap: anywhere;
}

.site-material-card small {
    display: block;
    margin-top: 12px;
    color: #8993b2;
    font-size: 12px;
}

.site-material-card img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 14px;
    margin-bottom: 14px;
    background: rgba(110, 90, 200, 0.05);
}

.site-material-card a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.site-material-card a.btn:hover {
    transform: translateY(-2px);
}

/* JS скрывает пустые состояния, когда материалы уже загружены */
#portfolioMaterialsEmpty[hidden],
#awardsEmpty[hidden] {
    display: none !important;
}

/* Тёмная тема для динамических карточек */
body.dark .site-material-card,
body.dark-mode .site-material-card,
body[data-theme="dark"] .site-material-card,
html.dark .site-material-card {
    background: linear-gradient(145deg, #1a1837, #211e45);
    border-color: #353064;
}

body.dark .site-material-card small,
body.dark-mode .site-material-card small,
body[data-theme="dark"] .site-material-card small,
html.dark .site-material-card small {
    color: #aab1d3;
}

/* Планшеты */
@media (max-width: 1000px) {
    #portfolioMaterialsList,
    #awardsList {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Телефоны */
@media (max-width: 700px) {
    #portfolioMaterialsList,
    #awardsList {
        grid-template-columns: 1fr;
    }

    .site-material-card {
        padding: 20px;
    }
}
