@font-face {
    font-family: "DINPro";
    src: url('/fonts/DINPro/DINPro-Medium.woff') format('woff');
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

:root {
    --ec-page: #fafafa;
    --ec-surface: #fff;
    --ec-card: #f5f5f5;
    --ec-blue: #1b6cab;
    --ec-text: #161817;
    --ec-muted: #6c6d6c;
    --ec-soft: #f1f1f1;
    --ec-line: #e5e5e5;
    --ec-blue-line: #dee8f0;
    --ec-hero: #1d1f23;
}

.expert-community,
.expert-community button,
.expert-community input,
.expert-community select,
.expert-community textarea,
.expert-modal,
.expert-modal button {
    font-family: "DINPro", Arial, sans-serif;
}

.expert-community {
    min-height: 100vh;
    overflow: hidden;
    background: var(--ec-page);
    color: var(--ec-text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.expert-community__container,
.expert-community__hero-inner {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
}

.expert-community__hero {
    padding: 28px 0 16px;
    background: var(--ec-page);
}

.expert-community__hero-inner {
    display: grid;
    grid-template-columns: minmax(210px, 25%) minmax(0, 1fr);
    align-items: center;
    gap: 24px;
}

.expert-community__hero-copy {
    padding-right: 18px;
}

.expert-community__hero-copy h1,
.expert-community__hero-copy p,
.expert-community__hero-values {
    margin: 0;
}

.expert-community__hero-copy h1 {
    color: var(--ec-blue);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.28;
}

.expert-community__hero-copy p {
    max-width: 235px;
    margin-top: 24px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.expert-community__hero-visual {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 330px;
    aspect-ratio: 2.3 / 1;
    overflow: hidden;
    border-radius: 24px;
    background-color: var(--ec-hero);
    background-image: url('/images/expert-community/background-desktop.webp');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: var(--ec-surface);
}

.expert-community__hero-values,
.expert-community__hero-slogan {
    position: absolute;
    left: 20px;
    z-index: 1;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.25;
}

.expert-community__hero-values {
    top: 20px;
    white-space: pre-line;
}

.expert-community__hero-slogan {
    bottom: 20px;
    white-space: pre-line;
}

.expert-community__tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 24px 0 32px;
}

.expert-community__tabs button {
    min-width: 102px;
    padding: 10px 22px;
    border: 1px solid var(--ec-line);
    border-radius: 999px;
    background: var(--ec-surface);
    color: var(--ec-text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.expert-community__tabs button.is-active {
    border-color: var(--ec-blue);
    background: var(--ec-blue);
    color: var(--ec-surface);
}

.expert-community__catalog {
    padding: 0 0 100px;
}

.expert-community .expert-community__catalog h1 {
    margin: 0 0 16px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.08;
    color: var(--ec-text);
    text-align: center;
}

.expert-community__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.expert-card {
    min-width: 0;
    overflow: hidden;
    border: 0;
    border-radius: 24px;
    background: var(--ec-card);
}

.expert-card__photo-wrap {
    aspect-ratio: 1.88 / 1;
    overflow: hidden;
    border-radius: 23px 23px 0 0;
    background: #eceee5;
}

.expert-card__photo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 24%;
    transition: transform .3s ease;
}

.expert-card:hover .expert-card__photo {
    transform: scale(1.02);
}

.expert-card__body {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    padding: 14px 18px 16px;
}

.expert-card__status {
    align-self: flex-start;
    margin: 0 0 14px;
    padding: 5px 9px;
    border: 1px solid var(--ec-blue-line);
    border-radius: 6px;
    color: var(--ec-blue);
    font-size: 12px;
    line-height: 1.18;
}

.expert-card h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--ec-text);
}

.expert-card__specialization {
    margin: 10px 0 22px;
    color: var(--ec-muted);
    font-size: 15px;
    line-height: 1.28;
    white-space: pre-line;
}

.expert-card__more {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ec-text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.expert-card__arrow {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--ec-surface);
    transition: transform .2s ease, background .2s ease;
}

.expert-card__arrow img {
    width: 16px;
    height: 8px;
    display: block;
}

.expert-card__more:hover .expert-card__arrow {
    transform: translateX(3px);
    background: var(--ec-surface);
}

.expert-community__loading,
.expert-community__empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 36px;
    border-radius: 20px;
    background: var(--ec-soft);
    color: var(--ec-muted);
    text-align: center;
}

.expert-modal {
    position: fixed;
    z-index: 12000;
    inset: 0;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    padding: 20px 20px 20px 0;
    background: rgba(22, 24, 23, .48);
    color: var(--ec-text);
    font-family: "DINPro", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, visibility .24s ease;
}

.expert-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.expert-modal__dialog {
    position: relative;
    width: min(560px, calc(100% - 40px));
    height: auto;
    max-height: none;
    overflow-y: auto;
    border-radius: 24px;
    background: var(--ec-surface);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .18);
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.22, .61, .36, 1);
}

.expert-modal.is-open .expert-modal__dialog {
    transform: translateX(0);
}

.expert-modal__photo-column {
    height: auto;
    margin: 60px 20px 0;
    aspect-ratio: 2.27 / 1;
    overflow: hidden;
    border-radius: 20px;
    background: #eceee5;
}

.expert-modal__photo-column img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 24%;
}

.expert-modal__content {
    padding: 16px 20px 24px;
}

.expert-modal__content .expert-card__status {
    width: 100%;
    margin: 0 0 20px;
    padding: 7px 6px;
    border-color: var(--ec-blue-line);
    border-radius: 10px;
    background: transparent;
    font-size: 14px;
    line-height: 1.2;
}

.expert-modal__content h2 {
    margin: 0 0 6px;
    color: var(--ec-text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.expert-modal__city {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 20px;
    color: var(--ec-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
}

.expert-modal__city-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.expert-modal__credentials {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
    border: 0;
    color: var(--ec-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
}

.expert-modal__credentials li {
    padding: 0;
    border: 0;
}

.expert-modal__profile {
    margin-top: 18px;
}

.expert-modal__profile h3 {
    margin: 0 0 8px;
    color: var(--ec-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
}

.expert-modal__profile p {
    margin: 0;
    color: var(--ec-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    white-space: pre-line;
}

.expert-modal__close {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0 0 2px;
    border: 0;
    border-radius: 50%;
    background: var(--ec-surface);
    color: var(--ec-text);
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
    cursor: pointer;
}

body.expert-modal-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .expert-community__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .expert-community__container,
    .expert-community__hero-inner {
        width: calc(100% - 40px);
    }

    .expert-community__hero {
        padding: 20px 0 12px;
    }

    .expert-community__hero-inner {
        grid-template-columns: clamp(180px, 28vw, 240px) minmax(0, 1fr);
        gap: 20px;
    }

    .expert-community__hero-copy {
        min-width: 0;
        padding-right: 0;
    }

    .expert-community__hero-copy h1 {
        font-size: 16px;
    }

    .expert-community__hero-copy p {
        max-width: 220px;
        margin-top: 20px;
        font-size: 13px;
    }

    .expert-community__hero-visual {
        height: clamp(280px, 36vw, 350px);
        min-height: 0;
        aspect-ratio: auto;
        background-position: center;
        background-size: cover;
    }
}

@media (max-width: 640px) {
    .expert-community__container,
    .expert-community__hero-inner {
        width: calc(100% - 40px);
    }

    .expert-community__hero {
        padding: 20px 0 8px;
    }

    .expert-community__hero-inner {
        display: grid;
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .expert-community__hero-copy {
        width: 100%;
        padding: 0;
        text-align: center;
    }

    .expert-community__hero-copy h1 {
        font-size: clamp(12px, 2.4vw, 14px);
        line-height: 1.3;
    }

    .expert-community__hero-copy p {
        max-width: 290px;
        margin: 16px auto 0;
        font-size: clamp(10px, 2.1vw, 12px);
        line-height: 1.35;
    }

    .expert-community__hero-visual {
        min-height: 0;
        height: clamp(216px, 72vw, 360px);
        aspect-ratio: auto;
        border-radius: 24px;
        background-image: url('/images/expert-community/background-mobile.webp');
        background-position: center;
    }

    .expert-community__hero-values,
    .expert-community__hero-slogan {
        left: 13px;
        font-size: 12px;
        line-height: 1.25;
    }

    .expert-community__hero-values {
        top: 13px;
    }

    .expert-community__hero-slogan {
        bottom: 13px;
    }

    .expert-community__tabs {
        justify-content: flex-start;
        gap: 16px;
        padding: 24px 0 32px;
    }

    .expert-community__tabs button {
        min-width: 0;
        padding: 9px 15px;
        font-size: 12px;
    }

    .expert-community__catalog {
        padding-top: 0;
        padding-bottom: 70px;
    }

    .expert-community .expert-community__catalog h1 {
        margin-bottom: 16px;
        font-size: 26px;
        text-align: center;
    }

    .expert-community__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .expert-card {
        border-radius: 24px;
    }

    .expert-card__photo-wrap {
        border-radius: 24px 24px 0 0;
    }

    .expert-card__body {
        min-height: 200px;
        padding: 12px 14px 14px;
    }

    .expert-card h2 {
        font-size: 17px;
    }

    .expert-card__specialization {
        font-size: 14px;
    }

    .expert-modal {
        align-items: stretch;
        padding: 0;
    }

    .expert-modal__dialog {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0 0 20px 20px;
        box-shadow: none;
    }

    .expert-modal__photo-column {
        height: auto;
        min-height: 0;
        max-height: none;
        margin: 60px 20px 0;
        border-radius: 20px;
    }

    .expert-modal__content {
        padding: 16px 20px 24px;
    }

    .expert-modal__content h2 {
        margin: 0 0 6px;
        font-size: 16px;
    }

    .expert-modal__close {
        position: absolute;
        top: 12px;
        right: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .expert-card__photo,
    .expert-card__arrow,
    .expert-modal,
    .expert-modal__dialog {
        transition: none;
    }
}
