/**
 * National Salary Insights - Financial Times Grade Article Styling
 * Design Philosophy: Clean, professional, data-driven journalism aesthetic
 * Matches main calculator design language - NO purple
 */

/* ==================== TYPOGRAPHY & BASE ==================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1d1d1f;
    background: #ffffff;
}

/* ==================== HERO SECTION ==================== */

.insights-hero-national {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    padding: clamp(3rem, 8vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem);
    border-bottom: 4px solid #3b82f6;
}

.insights-hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 1rem;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}

.hero-intro-ai {
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.6;
    max-width: 720px;
    margin: 0 auto 2.5rem;
    opacity: 0.9;
    font-weight: 400;
}

/* ==================== PREMIUM STAT CARDS ==================== */

.stats-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(1rem, 2vw, 1.5rem);
    max-width: 920px;
    margin: 0 auto 1.5rem;
}

.stat-card-national {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
    text-align: center;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 140px;
}

.stat-card-national:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(59, 130, 246, 0.5);
}

.stat-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
    margin-bottom: 0.5rem;
}

.stat-value-large {
    display: block;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    font-family: 'Georgia', 'Times New Roman', 'Playfair Display', serif;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 0.375rem;
    color: #ffffff;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* On white/light backgrounds, use blue */
.section-insights .stat-value-large,
.comparison-stat-main {
    color: #1d1d1f;
}

.stat-subtitle {
    display: block;
    font-size: 0.8125rem;
    opacity: 0.7;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Data Badge */
.data-badge-subtle {
    font-size: 0.8125rem;
    opacity: 0.75;
    margin: 1.5rem 0 2rem;
    font-weight: 400;
    text-align: center;
}

/* ==================== CTA BUTTONS ==================== */

.cta-button-premium {
    display: inline-block;
    padding: clamp(0.75rem, 1.5vw, 0.875rem) clamp(1.75rem, 3vw, 2.25rem);
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: clamp(0.9375rem, 1.5vw, 1rem);
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cta-button-premium:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.cta-button-large {
    padding: 1rem 2.5rem;
    font-size: 1.0625rem;
}

/* ==================== SECTION LAYOUT ==================== */

.insights-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 1.5rem);
}

.section-insights {
    padding: clamp(2.5rem, 6vw, 4rem) 0;
}

.section-gray {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.insights-section-title {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
    margin: 0 0 1.25rem;
    color: #1d1d1f;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #3b82f6;
}

/* ==================== AI COMMENTARY ==================== */

.ai-commentary {
    font-size: 1rem;
    line-height: 1.75;
    color: #1d1d1f;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: #f8f9fa;
    border-left: 4px solid #3b82f6;
    border-radius: 0 4px 4px 0;
}

.ai-commentary strong {
    font-weight: 600;
    color: #1d4ed8;
}

/* ==================== CHARTS ==================== */

.chart-wrapper {
    background: #ffffff;
    border-radius: 8px;
    padding: clamp(1.25rem, 2.5vw, 2rem);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    margin: 1.5rem 0;
    border: 1px solid #e9ecef;
}

/* ==================== TABLES ==================== */

.table-wrapper {
    overflow-x: auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    margin: 1.5rem 0;
    border: 1px solid #e9ecef;
}

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

.insights-table thead {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
}

.insights-table thead th {
    padding: 0.875rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid #3b82f6;
}

.insights-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s ease;
}

.insights-table tbody tr:hover {
    background: #f8f9fa;
}

.insights-table tbody tr:last-child {
    border-bottom: none;
}

.insights-table tbody td {
    padding: 0.875rem 1.25rem;
    color: #1d1d1f;
}

.rank-cell {
    font-weight: 700;
    color: #3b82f6;
}

.city-cell {
    font-weight: 600;
    color: #1d1d1f;
}

.ctc-cell {
    font-weight: 600;
    color: #10b981;
}

/* ==================== COMPARISON CARDS ==================== */

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.comparison-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.comparison-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #3b82f6;
}

.comparison-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1d4ed8;
    margin: 0 0 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

.comparison-stat-main {
    font-size: 2.25rem;
    font-weight: 600;
    font-family: 'Georgia', 'Times New Roman', 'Playfair Display', serif;
    letter-spacing: -0.01em;
    color: #1d1d1f;
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.comparison-stat-sub {
    font-size: 0.9375rem;
    color: #6b7280;
    margin-bottom: 0.875rem;
}

.comparison-detail {
    font-size: 0.8125rem;
    color: #6b7280;
    padding-top: 0.875rem;
    border-top: 1px solid #e9ecef;
}

/* ==================== PERCENTILE BARS ==================== */

.percentile-container {
    margin: 1.5rem 0;
}

.percentile-item {
    margin-bottom: 1.25rem;
}

.percentile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.percentile-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1d1d1f;
}

.percentile-value {
    font-size: 1rem;
    font-weight: 700;
    color: #3b82f6;
}

.percentile-bar {
    height: 28px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.percentile-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.75rem;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.8125rem;
    transition: width 1s ease;
}

/* ==================== KEY INSIGHTS LIST ==================== */

.insights-list-cards {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    display: grid;
    gap: 1rem;
}

.insight-card-hover {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #1d1d1f;
    transition: all 0.3s ease;
}

.insight-card-hover:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border-left-color: #1d4ed8;
}

.insight-card-hover strong {
    color: #1d4ed8;
    font-weight: 600;
}

/* ==================== FAQ ACCORDION ==================== */

.faq-container {
    margin: 1.5rem 0;
}

.faq-item {
    background: #ffffff;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: #3b82f6;
}

.faq-question-btn {
    width: 100%;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: #1d1d1f;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.faq-question-btn:hover {
    background: #f8f9fa;
}

.faq-chevron {
    flex-shrink: 0;
    margin-left: 1rem;
    transition: transform 0.3s ease;
    color: #3b82f6;
}

.faq-question-btn[aria-expanded="true"] .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer-hidden {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.faq-item.active .faq-answer-hidden {
    max-height: 1000px;
    padding: 0 1.25rem 1rem;
}

.faq-answer-hidden p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #4b5563;
    margin: 0;
}

/* ==================== CTA SECTION ==================== */

.section-cta {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    text-align: center;
    border-top: 4px solid #3b82f6;
}

.cta-title {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 700;
    margin: 0 0 0.75rem;
}

.cta-subtitle {
    font-size: 1rem;
    opacity: 0.85;
    margin: 0 0 1.75rem;
}

/* ==================== RELATED INSIGHTS ==================== */

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.related-card {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #3b82f6;
}

.related-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.related-excerpt {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* ==================== MOBILE RESPONSIVE ==================== */

@media (max-width: 768px) {
    .insights-hero-national {
        padding: 2.5rem 0 2rem;
    }

    .stats-grid-premium {
        grid-template-columns: 1fr;
    }

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

    .insights-table {
        font-size: 0.875rem;
    }

    .insights-table thead th,
    .insights-table tbody td {
        padding: 0.75rem 1rem;
    }

    .chart-wrapper {
        padding: 1rem;
    }

    .insights-container {
        max-width: 100%;
    }
}

@media (max-width: 420px) {
    .insights-hero-national {
        padding: 2rem 0 1.5rem;
    }

    .stat-card-national {
        min-height: 120px;
        padding: 1rem;
    }

    .stat-value-large {
        font-size: 1.5rem;
    }

    .section-insights {
        padding: 2rem 0;
    }

    .insights-section-title {
        font-size: 1.375rem;
    }

    .ai-commentary {
        padding: 1rem;
        font-size: 0.9375rem;
    }
}
