/**
 * FIIT Index — Shared Analysis Article Styles
 * =============================================
 * Reusable foundation for all analysis articles.
 * Each article adds only its unique visual styles inline.
 *
 * Provides: article page layout (single-col & 2-col w/ TOC), header/eyebrow,
 * metadata, sections, typography, summary cards, key-findings cards,
 * callout/highlight boxes, filter bars, sort controls, empty states, responsive.
 */

/* ============================================
   ARTICLE PAGE LAYOUT
   ============================================ */

/* Single-column default (like co-investment) */
.article-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.25rem 2rem 3rem;
}

/* Two-column variant with sidebar TOC — add class "article-page--toc" */
.article-page--toc {
    max-width: 1060px;
    padding: 2.5rem 2rem 5rem;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3.5rem;
    align-items: start;
}

/* ── Table of Contents Sidebar ── */
.article-toc {
    position: sticky;
    top: 20px;
}

.toc-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #888;
    text-decoration: none;
    padding: 0.35rem 0.5rem;
    border-radius: 5px;
    transition: all 0.15s;
    margin-bottom: 1.5rem;
}

.toc-back:hover {
    color: #5a3d7a;
    background: #f5f5f5;
}

.toc-back svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.toc-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #aaa;
    margin-bottom: 0.85rem;
    padding-left: 0.5rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}

.toc-list li {
    margin-bottom: 2px;
}

.toc-list a {
    display: block;
    padding: 0.38rem 0.6rem;
    font-size: 0.82rem;
    color: #777;
    text-decoration: none;
    border-radius: 5px;
    border-left: 2px solid transparent;
    transition: all 0.15s;
    line-height: 1.4;
}

.toc-list a:hover {
    color: #1a1a1a;
    background: #f5f5f5;
}

.toc-list a.toc-active {
    color: #5a3d7a;
    font-weight: 600;
    border-left-color: #5a3d7a;
    background: #f3effa;
}

/* ============================================
   ARTICLE BODY CONTAINER
   ============================================ */
.article-body {
    min-width: 0;
}

/* ============================================
   ARTICLE HEADER
   ============================================ */
.article-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #eee;
}

.article-page--toc .article-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
}

/* Breadcrumb (co-investment style) */
.article-breadcrumb {
    font-size: 0.72rem;
    color: #999;
    margin-bottom: 0.6rem;
}

.article-breadcrumb a {
    color: #6B5CA5;
    text-decoration: none;
}

.article-breadcrumb a:hover {
    text-decoration: underline;
}

/* Eyebrow (100-interest style) */
.article-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 1rem;
}

.article-eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Title — uses system sans-serif to match the rest of the site */
.article-title,
.article-header h1 {
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.article-header h1 {
    font-size: 1.5rem;
    line-height: 1.25;
}

.article-title {
    font-size: 1.75rem;
    margin-bottom: 0.85rem;
}

/* Subtitle — matches .subtitle in styles.css */
.article-subtitle,
.article-header .article-subtitle {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.55;
}

.article-page--toc .article-subtitle {
    font-size: 0.9375rem;
    color: #555;
    line-height: 1.6;
    max-width: 600px;
    margin-bottom: 1.4rem;
}

/* Metadata */
.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.72rem;
    color: #999;
    flex-wrap: wrap;
}

.article-page--toc .article-meta {
    gap: 1.5rem;
    font-size: 0.8rem;
}

.article-meta .meta-tag {
    background: #ede9fe;
    color: #5a3d7a;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.article-meta-item svg {
    width: 13px;
    height: 13px;
    color: #bbb;
}

/* ============================================
   ARTICLE SECTIONS & TYPOGRAPHY
   ============================================ */
.article-section {
    margin-bottom: 2rem;
}

.article-page--toc .article-section {
    margin-bottom: 3rem;
    scroll-margin-top: 80px;
}

.article-section h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.75rem;
}

.article-page--toc .article-section h2 {
    font-size: 1.25rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.6rem;
    border-bottom: 1.5px solid #f0e8f8;
}

.article-section p,
.article-body p {
    font-size: 0.9375rem;
    color: #444;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-page--toc .article-section p {
    font-size: 0.9375rem;
    line-height: 1.65;
}

.article-section p strong,
.article-body p strong {
    color: #1a1a1a;
    font-weight: 600;
}

/* ============================================
   SUMMARY / KEY-FINDINGS CARDS
   ============================================ */

/* 4-col summary cards (100-interest style) */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.summary-card {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 1.25rem 1.25rem 1.1rem;
}

.summary-card-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
    margin-bottom: 0.35rem;
    font-variant-numeric: tabular-nums;
}

.summary-card-label {
    font-size: 0.77rem;
    color: #888;
    line-height: 1.4;
}

/* 3-col key findings cards (co-investment style) */
.key-findings {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.finding-card {
    background: white;
    border: 1px solid #ede9fe;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.finding-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #5a3d7a;
}

.finding-value span {
    font-size: 0.7rem;
    font-weight: 400;
    color: #999;
}

.finding-label {
    font-size: 0.68rem;
    color: #888;
    margin-top: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ============================================
   CALLOUT / NOTES BOXES
   ============================================ */

/* Orange-bordered notes box */
.article-notes {
    background: #fdf8f0;
    border-left: 3px solid #e67e22;
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}

.article-notes-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #e67e22;
    margin-bottom: 0.5rem;
}

.article-notes ul {
    margin: 0;
    padding: 0 0 0 1.1rem;
    font-size: 0.875rem;
    color: #666;
    line-height: 1.6;
}

.article-notes ul li {
    margin-bottom: 0.3rem;
}

/* Accent-colored highlight/quote box */
.article-highlight {
    border-left: 3px solid currentColor;
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
    color: #555;
    line-height: 1.6;
    font-style: italic;
}

.article-highlight strong {
    font-style: normal;
}

/* ============================================
   FILTER BAR (pill/button style)
   ============================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.78rem;
    color: #888;
}

.filter-btn {
    font-size: 0.78rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
    background: #5a3d7a;
    border-color: #5a3d7a;
    color: #fff;
}

/* ============================================
   MULTI-SELECT WIDGET
   ============================================ */
.article-filters {
    background: #faf8ff;
    border: 1px solid #d4d0e0;
    border-left: 3px solid #6B5CA5;
    border-radius: 0 10px 10px 0;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: 0 2px 8px rgba(90,61,122,0.08);
}

.filter-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #5a3d7a;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    padding-top: 0.35rem;
}

.filter-group .ms-wrap {
    flex: 1;
    position: relative;
}

.ms-trigger {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-height: 30px;
    padding: 0.2rem 0.4rem;
    background: white;
    border: 1px solid #d4d0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    color: #666;
}

.ms-trigger:focus-within {
    border-color: #6B5CA5;
    box-shadow: 0 0 0 3px rgba(107,92,165,0.1);
}

.ms-trigger .ms-placeholder {
    color: #aaa;
    font-size: 0.78rem;
}

.ms-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.1rem 0.35rem;
    background: #ede9fe;
    color: #5a3d7a;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.ms-pill .ms-pill-x {
    cursor: pointer;
    font-size: 0.65rem;
    color: #999;
    margin-left: 0.1rem;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ms-pill .ms-pill-x:hover {
    background: #fee2e2;
    color: #dc2626;
}

.ms-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d4d0e0;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 50;
    max-height: 220px;
    overflow-y: auto;
}

.ms-dropdown.open {
    display: block;
}

.ms-dropdown input {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 0.78rem;
    outline: none;
}

.ms-dropdown .ms-option {
    padding: 0.3rem 0.5rem;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.ms-dropdown .ms-option:hover {
    background: #f8f7fa;
}

.ms-dropdown .ms-option.selected {
    background: #ede9fe;
    color: #5a3d7a;
    font-weight: 500;
}

.ms-dropdown .ms-option .ms-check {
    width: 14px;
    height: 14px;
    border: 1px solid #ccc;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.6rem;
}

.ms-dropdown .ms-option.selected .ms-check {
    background: #5a3d7a;
    border-color: #5a3d7a;
    color: white;
}

.filter-active-note {
    font-size: 0.72rem;
    color: #6B5CA5;
    font-weight: 500;
}

.filter-bar-bottom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-reset-btn {
    font-size: 0.72rem;
    color: #999;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-reset-btn:hover {
    border-color: #dc2626;
    color: #dc2626;
}

/* ============================================
   SORT CONTROLS
   ============================================ */
.sort-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.78rem;
    color: #888;
}

.sort-select {
    font-size: 0.78rem;
    font-family: inherit;
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #444;
    cursor: pointer;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #aaa;
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 780px) {
    /* TOC layout collapses to single column */
    .article-page--toc {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem 1rem 3rem;
    }

    .article-toc {
        position: static;
        display: none;
    }

    .article-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 768px) {
    .article-header h1 {
        font-size: 1.25rem;
    }

    .key-findings {
        grid-template-columns: 1fr;
    }

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

    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }
}
