/* Knowledge base, its teaser on item pages, and the market reports. */

/* --------------------------------------------------------------- page head */

.kb-head {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-block: 32px 8px;
}

.kb-head .lead {
    max-width: 62ch;
}

.kb-title {
    font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
    line-height: 1.05;
}

.kb-head__search {
    max-width: 680px;
    margin-top: 8px;
}

.kb-count {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.kb-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 0.875rem;
    color: var(--caption);
}

/* ---------------------------------------------------------- page and aside */

.kb-main {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-width: 0;
}

.kb-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .grid > .kb-aside {
        grid-column: 1 / -1;
    }
}

.kb-aside .card {
    padding: 20px;
}

.kb-aside .card p + p {
    margin-top: 12px;
}

.kb-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kb-aside__title {
    margin-bottom: 12px;
    font-size: 1.0625rem;
}

.kb-search {
    display: flex;
    gap: 8px;
}

.kb-search .input {
    flex: 1 1 auto;
    min-width: 0;
}

.kb-nav {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.kb-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: var(--radius-xs);
    color: var(--text);
    text-decoration: none;
}

.kb-nav a:hover {
    background: var(--muted-bg);
    color: var(--text);
}

.kb-nav a[aria-current="page"] {
    background: var(--tint);
    color: var(--deep);
    font-weight: 600;
}

.kb-nav__count {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--caption);
}

/* ------------------------------------------------------------------- cards */

.kb-cards {
    list-style: none;
    padding: 0;
}

.kb-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.kb-card__title {
    font-size: 1.25rem;
    line-height: 1.25;
}

.kb-card__title a {
    color: inherit;
    text-decoration: none;
}

.kb-card__title a:hover,
.kb-card.card--link:hover .kb-card__title {
    text-decoration: underline;
}

.kb-stack-tight {
    --stack-gap: 6px;
}

.kb-card__text {
    color: var(--text-2);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
    font-size: 0.875rem;
    color: var(--caption);
}

.kb-card__more {
    font-weight: 600;
    color: var(--deep);
}

.kb-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ----------------------------------------------------------------- article */

.kb-notice {
    max-width: 72ch;
}

.kb-prose {
    color: var(--text);
    font-size: 1.0625rem;
    max-width: 70ch;
    overflow-wrap: break-word;
}

.kb-prose h2 {
    font-size: 1.625rem;
    line-height: 1.15;
}

.kb-prose h3 {
    font-size: 1.25rem;
    line-height: 1.2;
}

.kb-prose ul,
.kb-prose ol {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}

.kb-prose img,
.kb-prose iframe,
.kb-prose video {
    max-width: 100%;
    border-radius: var(--radius-sm);
}

.kb-prose table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.kb-prose th,
.kb-prose td {
    padding: 8px 12px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.kb-prose blockquote {
    padding: 4px 0 4px 16px;
    border-left: 3px solid var(--accent);
    color: var(--text-2);
}

.kb-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.kb-share__title {
    font-weight: 600;
    margin-right: 4px;
}

/* ------------------------------------------------------------------ teaser */

.kb-teaser__list {
    list-style: none;
    padding: 0;
    margin: 4px 0 16px;
}

.kb-teaser__list li + li {
    border-top: 1px solid var(--line-soft);
}

.kb-teaser__link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    color: var(--text);
    text-decoration: none;
}

.kb-teaser__link:hover .kb-teaser__name {
    text-decoration: underline;
}

.kb-teaser__name {
    font-weight: 700;
    line-height: 1.35;
}

.kb-teaser__text {
    font-size: 0.875rem;
    color: var(--text-2);
}

/* ------------------------------------------------------------------ report */

.report-figure {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.report-figure__value {
    font-family: var(--font-display);
    font-weight: var(--display-weight);
    letter-spacing: var(--display-tracking);
    font-size: clamp(2rem, 1.6rem + 1.4vw, 2.75rem);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.report-figure__label {
    font-weight: 600;
}

.report-figure__note {
    font-size: 0.875rem;
    color: var(--caption);
}

.report-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.report-pair {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

@media (min-width: 1024px) {
    .report-pair {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.report-chart {
    position: relative;
    height: 360px;
}

.report-chart--round {
    height: 420px;
}

.report-table-wrap {
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.report-table caption {
    text-align: left;
}

.report-table th,
.report-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: middle;
}

.report-table thead th {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--caption);
    border-bottom-color: var(--line);
}

.report-table tbody th {
    font-weight: 600;
}

.report-table .is-num {
    text-align: right;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.report-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.report-bar__track {
    flex: 1 1 auto;
    max-width: 160px;
    height: 8px;
    border-radius: 999px;
    background: var(--muted-bg);
    overflow: hidden;
}

.report-bar__fill {
    display: block;
    height: 100%;
    width: var(--share, 0%);
    background: var(--accent);
    border-radius: inherit;
}

.report-province {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-province__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.report-province__name {
    font-size: 1.125rem;
}

.report-province .report-bar__track {
    max-width: none;
}

.report-province__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    font-size: 0.875rem;
    color: var(--caption);
}

.report-province__foot a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 600;
}

@media (max-width: 599px) {
    .report-bar__track {
        display: none;
    }

    .report-province .report-bar__track {
        display: block;
    }

    .report-chart {
        height: 300px;
    }

    .report-chart--round {
        height: 380px;
    }
}
