:root {
    --primary: #d52b1e;
    --primary-light: #ff3333;
    --accent: #d52b1e;
    --positive: #27ae60;
    --negative: #c0392b;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #dee2e6;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --canadian-red: #d52b1e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ── Header ── */
header {
    background: var(--primary);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.logo-img {
    height: 65px;
    width: auto;
}

.logo-text {
    color: white;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    padding: 8px 12px;
    border-radius: 4px;
}

nav a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

nav a.active {
    color: white;
    background: rgba(255,255,255,0.15);
}

/* ── Main Container ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ── Hero / Summary Banner ── */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #2471a3 100%);
    color: white;
    padding: 40px 0;
    margin-bottom: 32px;
}

.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.hero h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.hero p {
    font-size: 16px;
    opacity: 0.9;
    max-width: 700px;
}

.hero .update-date {
    font-size: 13px;
    opacity: 0.7;
    margin-top: 12px;
}

/* ── Summary Cards ── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.summary-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.summary-card.social { border-left-color: #7d3c98; }
.summary-card.demographic { border-left-color: #1e8449; }

.summary-card .label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-align: center;
}

.summary-card .value {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #1a5276;
    text-align: center;
}

.summary-card .detail {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    text-align: center;
}

.summary-card .detail.positive { color: var(--positive); }
.summary-card .detail.negative { color: var(--negative); }
.summary-card .detail.neutral { color: var(--text-light); }

.summary-card .period {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
    text-align: center;
}

/* ── Category Section ── */
.category-section {
    margin-bottom: 32px;
}

.category-header {
    font-size: 18px;
    font-weight: 700;
    padding-bottom: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* ── Indicator Table ── */
.indicator-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.indicator-table th {
    background: #f1f3f5;
    padding: 10px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

.indicator-table td {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.indicator-table tr {
    cursor: pointer;
    transition: background 0.15s;
}

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

.indicator-table .name-cell {
    font-weight: 600;
    color: #8b4513;
}

.indicator-table .name-cell a {
    color: inherit;
    text-decoration: none;
}

.indicator-table .name-cell a:hover {
    text-decoration: underline;
}

.indicator-table .value-cell {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.indicator-table .positive { color: var(--positive); }
.indicator-table .negative { color: var(--negative); }

.indicator-table .period-cell {
    color: var(--text-light);
    font-size: 13px;
}

.indicator-table .freq-cell {
    color: var(--text-light);
    font-size: 13px;
}

.sparkline-cell {
    width: 100px;
    padding: 8px 16px;
}

/* ── Indicator Detail Page ── */
.breadcrumb {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.breadcrumb a {
    color: var(--primary-light);
    text-decoration: none;
}

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

.indicator-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.indicator-title h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.indicator-title .subtitle {
    font-size: 14px;
    color: var(--text-light);
}

.indicator-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.stat-box {
    text-align: center;
    padding: 12px 20px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-width: 120px;
}

.stat-box .stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-box .stat-value {
    font-size: 24px;
    font-weight: 700;
}

.stat-box .stat-value.positive { color: var(--positive); }
.stat-box .stat-value.negative { color: var(--negative); }

/* ── Chart Container ── */
.chart-container {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.chart-container h2 {
    font-size: 16px;
    margin-bottom: 16px;
}

.chart-wrapper {
    position: relative;
    height: 350px;
}

/* ── Methodology Section ── */
.methodology {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.methodology h2 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--primary);
}

.methodology p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.methodology .meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.methodology .meta-item {
    font-size: 13px;
}

.methodology .meta-item strong {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

/* ── Footer ── */
footer {
    background: var(--text);
    color: rgba(255,255,255,0.7);
    padding: 24px;
    text-align: center;
    font-size: 13px;
    margin-top: 48px;
}

footer a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}

/* ── About Page ── */
.about-content {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 32px;
    box-shadow: var(--shadow);
    max-width: 800px;
}

.about-content h2 {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 12px;
    margin-top: 24px;
}

.about-content h2:first-child { margin-top: 0; }

.about-content p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.about-content ul {
    margin: 8px 0 16px 24px;
    font-size: 14px;
    line-height: 1.7;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; gap: 8px; }
    nav a { margin-left: 12px; }
    .hero h1 { font-size: 22px; }
    .summary-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
    .indicator-header { flex-direction: column; }
    .indicator-stats { width: 100%; }
    .stat-box { flex: 1; }
    .indicator-table { font-size: 13px; }
    .indicator-table th, .indicator-table td { padding: 8px 10px; }
}

@media (max-width: 480px) {
    .summary-grid { grid-template-columns: 1fr; }
    .minister-metrics { grid-template-columns: 1fr; }
}

/* ── Ministers Page ── */
.minister-row {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.minister-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.minister-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    flex-shrink: 0;
}

.minister-info h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text);
}

.minister-info .minister-title {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.minister-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.metric-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s;
    border-left: 4px solid var(--primary);
    display: block;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.metric-card .metric-name {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-align: center;
}

.metric-card .metric-value {
    font-size: 26px;
    font-weight: 700;
    color: #1a5276;
    margin-bottom: 4px;
    text-align: center;
}

.metric-card .metric-detail {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    text-align: center;
}

.metric-card .metric-detail.positive { color: var(--positive); }
.metric-card .metric-detail.negative { color: var(--negative); }
.metric-card .metric-detail.neutral { color: var(--text-light); }

.metric-card .metric-meta {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
    text-align: center;
}

.rating-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rating-badge.high { background: #d4edda; color: #155724; }
.rating-badge.moderate-high { background: #d1ecf1; color: #0c5460; }
.rating-badge.moderate { background: #fff3cd; color: #856404; }

@media (max-width: 768px) {
    .minister-metrics { grid-template-columns: 1fr; }
    .minister-header { flex-direction: column; text-align: center; }
    .minister-photo { width: 64px; height: 64px; }
}
