* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background: #efefef;
    color: #1e293b;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 16px;
}

/* Навигация назад */
.nav-back {
    margin-bottom: 20px;
}

.back-link {
    display: inline-block;
    color: #0f1724;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 6px 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.back-link:hover {
    color: #3399ff;
    border-bottom-color: #3399ff;
}

/* Карточка ресурса */
.resource-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 30px;
}

/* Шапка карточки: аватар + информация */
.resource-card__header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.resource-card__avatar {
    flex: 0 0 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-img {
    width: 220px;
    height: 220px;
    border-radius: 5%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.avatar-channel {
    display: flex;
    width: 100%;
    margin-top: 1rem;
    text-align: center;
    justify-content: flex-start;
    gap: 0.5rem;
    align-items: center;
}

.channel-label {
    display: block;
    color: #5e6f88;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.channel-link {
    color: #3399ff;
    text-decoration: none;
    font-weight: 600;
    word-break: break-word;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.channel-link:hover {
    text-decoration: underline;
}

.resource-card__info {
    flex: 1;
    min-width: 280px;
}

.resource-card__title {
    font-size: 2rem;
    font-weight: 700;
    color: #0f1724;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.title-keywords {
    font-size: 1.2rem;
    font-weight: 400;
    color: #5e6f88;
    display: block;
    margin-top: 4px;
}

.resource-description {
    margin-top: 20px;
}

.info-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: #0f1724;
    margin: 0 0 6px 0;
    padding-bottom: 4px;
    border-bottom: 2px solid #3399ff;
    display: inline-block;
}

.resource-description p {
    margin: 10px 0 0;
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.6;
}

.resource-description.seo p {
    color: #0f1724;
}

/* Блок метрик */
.resource-card__metrics {
    background: #f8fafc;
    border-radius: 16px;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

.metrics-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #333e51;
    padding: 0.4rem 1rem;
    border-radius: 10px;
    justify-content: center;
}

.metric-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ebebeb;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: #2793ff;
    line-height: 1;
}

/* Категории и регионы */
.resource-card__classifiers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.classifier-block {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
}

.classifier-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f1724;
    margin: 0 0 16px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #3399ff;
}

.tag-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #fff;
    color: #0f1724;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.9rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.tag:hover {
    border-color: #3399ff;
    color: #3399ff;
}

.text-muted {
    color: #5e6f88;
    font-size: 0.95rem;
    margin: 0;
}

.region-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.region-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #edf2f7;
}

.region-item:last-child {
    border-bottom: none;
}

.region-name {
    font-weight: 500;
    color: #0f1724;
}

.region-count {
    font-size: 0.9rem;
    color: #3399ff;
    font-weight: 500;
}

/* Похожие базы */
.similar-resources {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

.similar-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #0f1724;
    margin: 0 0 20px 0;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.similar-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.similar-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.similar-link {
    text-decoration: none;
}

.similar-name {
    display: block;
    font-weight: 600;
    color: #0f1724;
    margin-bottom: 8px;
    font-size: 1rem;
    line-height: 1.4;
}

.similar-stats {
    display: flex;
    gap: 16px;
    color: #5e6f88;
    font-size: 0.9rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.more-link {
    display: inline-block;
    color: #3399ff;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.more-link:hover {
    border-bottom-color: #3399ff;
}

/* Панель действий */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.6rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background: #3399ff;
    color: #fff;
    box-shadow: 0 4px 12px rgba(51, 153, 255, 0.3);
}

.btn-primary:hover {
    background: #007fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(51, 153, 255, 0.4);
}

.btn-outline {
    background: transparent;
    color: #007fff;
    border: 2px solid #3399ff;
}

.btn-outline:hover {
    transform: translateY(-3px);
    border-color: #0071e1;
    color: #005fbf;
    background: #007fff0a;
}

.contact-channels {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f1724;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 30px;
    background: #f8fafc;
    transition: background 0.2s, color 0.2s;
}

.contact-link:hover {
    background: #3399ff;
    color: #fff;
}

.contact-link img {
    width: 20px;
    height: 20px;
    filter: brightness(0);
    transition: filter 0.2s;
}

.contact-link:hover img {
    filter: brightness(0) invert(1);
}

/* FAQ секция */
.faq-section {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.faq-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f1724;
    margin: 0 0 24px 0;
}

.faq-item {
    border-bottom: 1px solid #e2e8f0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 18px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #0f1724;
    transition: color 0.2s;
}

.faq-question:hover {
    color: #3399ff;
}

.faq-question span {
    flex: 1;
    padding-right: 16px;
}

.faq-icon {
    flex-shrink: 0;
    color: #3399ff;
    transition: transform 0.3s;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.2s;
    padding: 0 0 0 0;
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.6;
}

.faq-question[aria-expanded="true"] + .faq-answer {
    max-height: 500px; /* Достаточно для длинного ответа */
    padding: 0 0 18px 0;
}

.faq-answer p {
    margin: 0;
}

/* Адаптивность */
@media (max-width: 768px) {

    .container {
        margin: 0px auto;
    }
    .nav-back {
        margin-bottom: 0px;
    }

    .avatar-img {
        width: 100%;
        height: 100%;
    }
    .avatar-channel {
        justify-content: center;
    }

    .resource-card {
        padding: 20px;
    }

    .resource-card__header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .resource-card__title {
        font-size: 1.2rem;
        text-align: left;
    }
    .resource-description {
        text-align: left;
    }
    .resource-description.seo p {
        text-align: justify;
    }
    .metric-item {
       padding: 0.2rem 0.8rem; 
    }

    .title-keywords {
        font-size: 1rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .resource-card__classifiers {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .similar-grid {
        grid-template-columns: 1fr;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons {
        justify-content: center;
    }

    .contact-channels {
        justify-content: center;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .faq-section {
        margin-bottom: 3rem;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}