/* EDsmart Data - Data Page Styles */
/* Clean, data-first styling for data exploration pages */

/* Page Header - NOT sticky */
.page-header {
    margin-bottom: calc(var(--spacing-unit) * 6);
    padding-bottom: calc(var(--spacing-unit) * 4);
    border-bottom: 1px solid var(--border);
    position: static !important; /* Explicitly not sticky - override any other rules */
    top: auto !important;
    z-index: auto !important;
}

.page-header h1 {
    margin-bottom: calc(var(--spacing-unit) * 3);
    color: var(--color-primary);
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: calc(var(--spacing-unit) * 3);
    line-height: 1.6;
}

.meta-info {
    display: flex;
    gap: calc(var(--spacing-unit) * 4);
    font-size: 1rem;
    color: var(--text-meta);
    flex-wrap: wrap;
}

.meta-info a {
    color: var(--color-link);
    font-weight: 600;
    text-decoration: none;
}

.meta-info a:hover {
    text-decoration: underline;
}

/* -----------------------------------------------------------------------------
   Wide content & tables — mobile first (stay inside article / container)
   ----------------------------------------------------------------------------- */
article .introduction,
article .chart-section,
article .data-table-section,
article .analysis-insights,
article details.sources,
article .page-toc,
article .ranking-table-section,
article .ranking-tables,
article .data-table-downloads,
article .data-table-section,
article .table-responsive-wrapper,
article .tldr-section,
article .faq-section,
article .editorial-disclaimer {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.table-wrapper,
.table-container,
.table-responsive-wrapper,
.ranking-table-container,
.ranking-table-wrapper {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* Career profiles: intro line above related degree links */
.related-degrees .related-degrees-lead {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: calc(var(--spacing-unit) * 2);
    line-height: 1.6;
}

/* Career profiles: related degree program links */
.related-degrees .related-degrees-list {
    margin: 0;
    padding-left: 1.25rem;
    max-width: 42rem;
}
.related-degrees .related-degrees-list li {
    margin-bottom: calc(var(--spacing-unit) * 2);
}
.related-degrees .related-degrees-list a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.related-degrees .related-degrees-list a:hover {
    text-decoration: underline;
}

/* Data transparency — illustrative charts & source limits (see docs/DATA_INTEGRITY_AUDIT.md) */
.editorial-disclaimer {
    margin: calc(var(--spacing-unit) * 4) 0;
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 4);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.editorial-disclaimer strong {
    color: var(--color-primary);
    font-weight: 600;
}

.editorial-disclaimer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.editorial-disclaimer a:hover {
    text-decoration: underline;
}

/* Reports hub + Rankings hub: card grids (imported HTML + block Query Loop) */
article .reports-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

article .reports-link-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    background: var(--surface);
}

article .reports-link-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}

article .reports-link-card h3 a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

article .reports-link-card h3 a:hover {
    text-decoration: underline;
}

article .reports-link-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.wp-block-query.reports-link-grid .wp-block-post-template.is-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.wp-block-query.reports-link-grid .reports-link-card.wp-block-group {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    background: var(--surface);
}

.wp-block-query.reports-link-grid .reports-link-card .wp-block-post-title {
    margin-bottom: 0.5rem;
}

.wp-block-query.reports-link-grid .reports-link-card .wp-block-post-title a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
}

.wp-block-query.reports-link-grid .reports-link-card .wp-block-post-title a:hover {
    text-decoration: underline;
}

.wp-block-query.reports-link-grid .reports-link-card .wp-block-post-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* TL;DR / Executive Summary */
.tldr-section {
    background: linear-gradient(135deg, var(--primary) 0%, #152A52 100%);
    color: #FFFFFF !important; /* Explicit white for accessibility */
    padding: calc(var(--spacing-unit) * 5);
    margin: calc(var(--spacing-unit) * 6) 0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(10, 28, 74, 0.15);
}

.tldr-section * {
    color: #FFFFFF !important; /* Force all child elements to be white */
}

.tldr-content {
    color: #FFFFFF !important;
}

.tldr-content h2 {
    margin-top: 0;
    margin-bottom: calc(var(--spacing-unit) * 3);
    font-size: 1.5rem;
    color: #FFFFFF !important; /* Explicit white for accessibility */
    font-family: var(--font-heading);
}

.tldr-text {
    font-size: 1.15rem;
    line-height: 1.7;
    margin: 0;
    font-weight: 500;
    color: #FFFFFF !important; /* Explicit white for accessibility */
}

.tldr-section a {
    color: #9CF0FF !important;
    text-decoration: underline;
}

.tldr-section a:hover {
    color: #FFFFFF !important;
}

/* Batch Download Controls */
.batch-downloads {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: calc(var(--spacing-unit) * 4);
    margin: calc(var(--spacing-unit) * 6) 0;
}

.download-controls {
    display: flex;
    gap: calc(var(--spacing-unit) * 3);
    flex-wrap: wrap;
    align-items: center;
}

.btn-download-all,
.btn-export-data {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 5);
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    font-family: var(--font-body);
}

.btn-download-all:hover,
.btn-export-data:hover {
    background-color: var(--primary-hover, #0d2a66);
    color: #FFFFFF !important; /* Ensure white text on hover */
    transform: translateY(-1px);
}

.btn-download-all:active,
.btn-export-data:active {
    transform: translateY(0);
}

.btn-download-all span,
.btn-export-data span {
    font-size: 1.2rem;
}

/* Insight Structure - Insight → Evidence → Why it matters */
.insight-takeaway,
.insight-evidence,
.insight-implication {
    margin-bottom: calc(var(--spacing-unit) * 3);
    padding: calc(var(--spacing-unit) * 3);
    background-color: var(--surface-alt);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
}

.insight-takeaway {
    border-left-color: var(--primary);
    background-color: rgba(10, 28, 74, 0.05);
}

.insight-evidence {
    border-left-color: var(--color-aqua);
    background-color: rgba(0, 179, 198, 0.05);
}

.insight-implication {
    border-left-color: var(--color-aqua);
    background-color: rgba(0, 179, 198, 0.05);
}

.insight-takeaway strong,
.insight-evidence strong,
.insight-implication strong {
    display: block;
    margin-bottom: calc(var(--spacing-unit) * 1);
    color: var(--primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-evidence strong {
    color: var(--color-aqua);
}

.insight-implication strong {
    color: var(--color-aqua);
}

/* Limitations Section */
.limitations-section {
    margin: calc(var(--spacing-unit) * 6) 0;
    padding: calc(var(--spacing-unit) * 5);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid #FFB020;
    border-radius: 10px;
}

.limitations-section h2 {
    margin-top: 0;
    margin-bottom: calc(var(--spacing-unit) * 4);
    color: var(--text-primary);
}

.limitations-section ul {
    list-style: none;
    padding-left: 0;
}

.limitations-section li {
    padding: calc(var(--spacing-unit) * 2) 0;
    padding-left: calc(var(--spacing-unit) * 4);
    position: relative;
    line-height: 1.7;
    color: var(--text-primary);
}

.limitations-section li::before {
    content: '⚠';
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* Enhanced Methodology */
.methodology-content h3 {
    margin-top: calc(var(--spacing-unit) * 4);
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-size: 1.25rem;
    color: var(--primary);
    font-family: var(--font-heading);
}

.methodology-content h3:first-child {
    margin-top: 0;
}

.methodology-content ul {
    margin-left: calc(var(--spacing-unit) * 4);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.methodology-content li {
    margin-bottom: calc(var(--spacing-unit) * 2);
    line-height: 1.6;
}

/* Key Facts Box */
.key-facts {
    background: linear-gradient(135deg, var(--color-aqua-soft) 0%, #F8FAFC 100%);
    border: 1px solid var(--border);
    border-left: 4px solid var(--color-aqua);
    padding: calc(var(--spacing-unit) * 4);
    margin: calc(var(--spacing-unit) * 6) 0;
    border-radius: 12px;
}

.key-facts h2 {
    margin-top: 0;
    font-size: 1.5rem;
    margin-bottom: calc(var(--spacing-unit) * 3);
    color: var(--color-primary);
}

.key-facts ul {
    list-style: none;
    padding-left: 0;
}

.key-facts li {
    padding: calc(var(--spacing-unit) * 2) 0;
    padding-left: calc(var(--spacing-unit) * 3);
    position: relative;
    line-height: 1.6;
    border-bottom: 1px solid rgba(10, 28, 74, 0.08);
}

.key-facts li:last-child {
    border-bottom: none;
}

.key-facts li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
}

.key-facts strong {
    color: var(--primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Key Statistics Boxes */
.key-statistics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
    margin: calc(var(--spacing-unit) * 4) 0;
}

.stat-box {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: calc(var(--spacing-unit) * 4);
    text-align: center;
}

.stat-value {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: calc(var(--spacing-unit) * 1);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Chart Section */
.chart-section {
    margin: calc(var(--spacing-unit) * 8) 0;
    max-width: 100%;
    min-width: 0;
}

.chart-section h2 {
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
}

.chart-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: calc(var(--spacing-unit) * 4);
    font-weight: 400;
    line-height: 1.5;
}

/* Chart layout: mobile first single column; side-by-side from large tablet up */
.chart-section-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 3);
    align-items: start;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
}

@media (min-width: 1024px) {
    .chart-section-content {
        grid-template-columns: 1fr 3fr;
        gap: calc(var(--spacing-unit) * 4);
    }
}

.chart-section-content > .chart-section-right:only-child,
.chart-section-content > .chart-section-left:only-child {
    grid-column: 1 / -1;
}

.chart-section-left,
.chart-section-right {
    min-width: 0;
    max-width: 100%;
}

/* Bar figures live in the right column; keep them inside the article like deep-dive chart cells */
.chart-section-right:has(.ranking-bar-chart) {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

/* Ranking pages — CSS-only horizontal bars (no Chart.js) */
.ranking-bar-chart {
    margin: 0;
    padding: calc(var(--spacing-unit) * 3);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

.ranking-bar-chart .ranking-bar-row {
    margin-bottom: calc(var(--spacing-unit) * 3);
    min-width: 0;
}

.ranking-bar-chart .ranking-bar-row:last-child {
    margin-bottom: 0;
}

.ranking-bar-chart .ranking-bar-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin-bottom: calc(var(--spacing-unit) * 1);
    font-size: 0.95rem;
    color: var(--text-primary);
    min-width: 0;
}

.ranking-bar-chart .ranking-bar-meta > span {
    flex: 1 1 10rem;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.ranking-bar-chart .ranking-bar-meta > strong {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    color: var(--color-primary);
    font-size: 1.05rem;
    white-space: nowrap;
}

.ranking-bar-chart .ranking-bar-track {
    position: relative;
    height: 1.25rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
}

.ranking-bar-chart .ranking-bar-fill {
    display: block;
    height: 100%;
    /* Prefer inline style="width:NN%" on markup — WordPress may strip custom properties (--*) in saved HTML. */
    width: 50%;
    max-width: 100%;
    min-width: 0.25rem;
    border-radius: 6px 0 0 6px;
    background: linear-gradient(90deg, var(--color-primary, #0a1c4a), #1a3a7a);
}

.ranking-bar-chart + .chart-note,
.chart-section-right .ranking-bar-chart + p.chart-note {
    margin-top: calc(var(--spacing-unit) * 2);
}

.chart-container {
    position: relative;
    height: 450px;
    min-height: 450px;
    max-width: 100%;
    min-width: 0;
    margin: 0 0 calc(var(--spacing-unit) * 3) 0;
    padding: calc(var(--spacing-unit) * 4);
    background-color: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    overflow-y: visible;
}

/* Special handling for doughnut/pie charts - taller container to prevent title overlap */
.chart-container:has(canvas[data-chart-type="doughnut"]),
.chart-container:has(canvas[data-chart-type="pie"]) {
    height: 750px;
    min-height: 750px;
    padding-top: calc(var(--spacing-unit) * 4);
    padding-left: calc(var(--spacing-unit) * 4);
    padding-right: calc(var(--spacing-unit) * 4);
    overflow: visible;
}

/* Chart Actions (Export buttons) - In right section below chart */
.chart-section-right .chart-actions {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
    margin-top: calc(var(--spacing-unit) * 3);
    padding: 0;
}

.btn-export {
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

/* Full width buttons in left section */
.chart-section-left .btn-export {
    width: 100%;
    text-align: center;
}

.btn-export:hover {
    background-color: rgba(0, 179, 198, 0.08);
    border-color: var(--color-aqua);
}

.chart-container canvas {
    max-height: 100%;
    width: 100% !important;
    height: 100% !important;
}

.chart-container.chart-container--horizontal-bar {
    height: 420px;
    min-height: 360px;
    max-width: 100%;
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
}

.chart-container.chart-container--horizontal-bar canvas {
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    max-height: none;
}

.chart-container + .table-filter-toolbar {
    margin-top: calc(var(--spacing-unit) * 2);
}

/* Special handling for doughnut/pie charts to prevent stretching */
.chart-container:has(canvas[data-chart-type="doughnut"]) canvas,
.chart-container:has(canvas[data-chart-type="pie"]) canvas {
    max-width: 90%;
    max-height: 90%;
    width: auto !important;
    height: auto !important;
    aspect-ratio: 1;
    margin: auto;
}

/* Mobile optimization for donut charts */
@media (max-width: 768px) {
    .chart-container:has(canvas[data-chart-type="doughnut"]) canvas,
    .chart-container:has(canvas[data-chart-type="pie"]) canvas {
        max-width: 90%;
        max-height: 90%;
    }
}

.chart-note {
    font-size: 0.875rem;
    color: var(--text-meta);
    font-style: normal;
    margin-top: 0;
    margin-bottom: calc(var(--spacing-unit) * 3);
    line-height: 1.5;
    padding: 0;
}

/* Chart Insight Block - Individual insight for each chart (Left 1/4) */
.chart-section-left {
    /* 25% width - insight block */
    position: sticky;
    top: calc(var(--spacing-unit) * 4);
    align-self: start;
}

/* Chart Container - Chart, note, and export buttons (Right 3/4) */
.chart-section-right {
    /* 75% width - chart container and note */
}

.chart-insight {
    padding: calc(var(--spacing-unit) * 4);
    background-color: var(--surface-alt);
    border-left: 3px solid var(--primary);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 1rem;
    color: var(--text-secondary);
}

.chart-insight h3 {
    margin-top: 0;
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-aqua);
}

.chart-insight p {
    margin: 0;
    line-height: 1.7;
    color: var(--text-secondary);
    font-size: 1rem;
}

.chart-insight strong {
    color: var(--primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Insights & Analysis Section - For comprehensive analysis at end */
.insights-section {
    margin: calc(var(--spacing-unit) * 8) 0;
    padding: calc(var(--spacing-unit) * 5);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.insights-section h2 {
    margin-top: 0;
    margin-bottom: calc(var(--spacing-unit) * 4);
    font-size: 1.75rem;
    color: var(--text-primary);
}

.insight-block {
    margin-bottom: calc(var(--spacing-unit) * 4);
    padding-bottom: calc(var(--spacing-unit) * 4);
    border-bottom: 1px solid var(--border-light);
}

.insight-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.insight-block h3 {
    margin-top: 0;
    margin-bottom: calc(var(--spacing-unit) * 3);
    font-size: 1.25rem;
    color: var(--primary);
}

.insight-block p {
    margin: 0;
    line-height: 1.7;
    color: var(--text-primary);
}

.insight-block strong {
    color: var(--primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Data Table - Spreadsheet-like, sticky headers */
.data-table-section {
    margin: calc(var(--spacing-unit) * 8) 0;
}

.table-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: calc(var(--spacing-unit) * 4);
    line-height: 1.6;
}

.table-controls {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 3);
    flex-wrap: wrap;
}

.table-controls input,
.table-controls select {
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--surface);
    font-family: var(--font-body);
    transition: border-color 0.2s ease;
}

.table-controls input:focus,
.table-controls select:focus {
    outline: none;
    border-color: var(--primary);
}

.table-controls input {
    flex: 1;
    min-width: 200px;
}

.table-wrapper {
    overflow-x: auto;
    margin: calc(var(--spacing-unit) * 3) 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums; /* Tabular numerals for all data */
    background-color: var(--surface);
    font-size: 1rem;
}

.data-table thead {
    background: linear-gradient(180deg, #122456 0%, var(--color-primary) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    text-align: left;
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 4);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #FFFFFF;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.data-table td {
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 4);
    border-bottom: 1px solid var(--border-light);
    font-variant-numeric: tabular-nums;
}

/* Rankings / narrative tables: constrain width to article column; wrap long copy */
.table-responsive-wrapper .data-table,
.filterable-table.table-responsive-wrapper .data-table {
    table-layout: fixed;
    width: 100%;
    max-width: 100%;
}

.table-responsive-wrapper .data-table th,
.filterable-table.table-responsive-wrapper .data-table th {
    white-space: normal;
    vertical-align: bottom;
    hyphens: auto;
}

.table-responsive-wrapper .data-table td,
.filterable-table.table-responsive-wrapper .data-table td {
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: normal;
}

/* Prefer slightly wider narrative column on wide viewports */
@media (min-width: 900px) {
    .table-responsive-wrapper .data-table th:last-child,
    .table-responsive-wrapper .data-table td:last-child {
        width: 32%;
    }
}

.data-table tbody tr:hover {
    background-color: var(--background);
}

.data-table tbody tr:nth-child(even) {
    background-color: rgba(238, 242, 248, 0.7);
}

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

.table-note {
    font-size: 1rem;
    color: var(--text-meta);
    margin-top: calc(var(--spacing-unit) * 3);
    line-height: 1.5;
}

/* Methodology Section */
.methodology {
    margin: calc(var(--spacing-unit) * 6) 0;
    padding: calc(var(--spacing-unit) * 5);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.methodology h2 {
    margin-top: 0;
}

.methodology h3 {
    margin-top: calc(var(--spacing-unit) * 4);
    font-size: 1.25rem;
}

.methodology ul {
    margin-left: calc(var(--spacing-unit) * 4);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.methodology li {
    margin-bottom: calc(var(--spacing-unit) * 2);
    line-height: 1.6;
}

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

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

/* FAQ Section */
.faq-section {
    margin: calc(var(--spacing-unit) * 6) 0;
    padding: calc(var(--spacing-unit) * 5);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.faq-section h2 {
    margin-top: 0;
    margin-bottom: calc(var(--spacing-unit) * 4);
    font-size: 1.75rem;
    color: var(--text-primary);
}

.faq-item {
    margin-bottom: calc(var(--spacing-unit) * 4);
    padding-bottom: calc(var(--spacing-unit) * 4);
    border-bottom: 1px solid var(--border-light);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h3 {
    margin-top: 0;
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 600;
}

.faq-item p {
    margin: 0;
    line-height: 1.7;
    color: var(--text-primary);
    font-size: 1rem;
}

.faq-item strong {
    color: var(--primary);
    font-weight: 600;
}

/* FAQ: details/summary blocks (data pages) + topic group headings */
section.faq {
    margin: calc(var(--spacing-unit) * 6) 0;
}

section.faq > h2 {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

section.faq .faq-subheading {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: calc(var(--spacing-unit) * 4) 0 calc(var(--spacing-unit) * 2);
    font-family: var(--font-heading, Montserrat, "Montserrat", sans-serif);
}

section.faq .faq-subheading:first-of-type {
    margin-top: calc(var(--spacing-unit) * 1);
}

section.faq details {
    margin-bottom: calc(var(--spacing-unit) * 2);
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--surface);
    overflow: hidden;
}

section.faq details summary {
    cursor: pointer;
    list-style: none;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
}

section.faq details summary::-webkit-details-marker {
    display: none;
}

section.faq .faq-answer {
    padding: 0 calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 3);
    border-top: 1px solid var(--border-light, #e8ecf2);
}

section.faq .faq-answer p {
    margin: 0;
    line-height: 1.65;
    color: var(--text-primary);
}

/* Table of Contents - Horizontal Scrolling Ticker */
.page-toc {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: calc(var(--spacing-unit) * 3) 0;
    margin: calc(var(--spacing-unit) * 6) 0;
    position: sticky;
    top: 80px; /* Account for site header height */
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.page-toc-scroll {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: calc(var(--spacing-unit) * 2);
    padding: 0 calc(var(--spacing-unit) * 4);
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    -webkit-overflow-scrolling: touch;
}

/* Spacing between TOC pills if flex `gap` is stripped (e.g. aggressive CSS optimization) */
.page-toc-scroll > a:not(:last-child) {
    margin-inline-end: 0.5rem;
}

.page-toc-scroll::-webkit-scrollbar {
    height: 6px;
}

.page-toc-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.page-toc-scroll::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 3px;
}

.page-toc-scroll::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

.page-toc a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    display: inline-block;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid transparent;
    position: relative;
}

.page-toc a {
    position: relative;
}

.page-toc a::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 24px;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
    z-index: 1;
}

.page-toc a:hover {
    color: var(--color-primary);
    background-color: var(--color-aqua-soft);
}

.page-toc a:hover::after {
    width: 0;
}

.page-toc a.active {
    color: #FFFFFF !important;
    font-weight: 600;
    background: linear-gradient(135deg, var(--color-primary) 0%, #152A52 100%);
    border-color: transparent;
}

.page-toc a.active::after {
    display: none;
    width: 0 !important;
}

@keyframes underlineExpand {
    from {
        width: 0;
    }
    to {
        width: calc(100% - 48px);
    }
}

/* Sources Section - Collapsible */
.sources {
    margin: calc(var(--spacing-unit) * 6) 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--surface);
    padding: calc(var(--spacing-unit) * 4);
}

.sources summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
    outline: none;
}

.sources summary::-webkit-details-marker {
    display: none;
}

.sources summary::marker {
    display: none;
}

.sources summary::before {
    content: '▶';
    display: inline-block;
    margin-right: calc(var(--spacing-unit) * 2);
    color: var(--primary);
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    vertical-align: middle;
}

.sources[open] summary::before {
    transform: rotate(90deg);
}

.sources summary h2 {
    display: inline-block;
    margin: 0;
    font-size: 1.5rem;
    font-family: var(--font-heading);
    color: var(--text-primary);
    vertical-align: middle;
}

.sources summary:hover h2 {
    color: var(--primary);
}

.sources-content {
    margin-top: calc(var(--spacing-unit) * 4);
    padding-top: calc(var(--spacing-unit) * 4);
    border-top: 1px solid var(--border-light);
}

.sources ul {
    list-style: none;
    padding-left: 0;
}

.sources li {
    margin-bottom: calc(var(--spacing-unit) * 3);
    padding-left: calc(var(--spacing-unit) * 4);
    position: relative;
    line-height: 1.6;
}

.sources li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.sources strong {
    display: block;
    margin-bottom: calc(var(--spacing-unit) * 1);
    color: var(--text-primary);
    font-weight: 600;
}

/* Related Pages */
.related-pages {
    margin: calc(var(--spacing-unit) * 6) 0;
    padding: calc(var(--spacing-unit) * 4);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.related-pages h2 {
    margin-top: 0;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.related-pages ul {
    list-style: none;
    padding-left: 0;
}

.related-pages li {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.related-pages a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.related-pages a:hover {
    text-decoration: underline;
}

/* Download CTA */
.download-cta {
    margin: calc(var(--spacing-unit) * 6) 0;
    padding: calc(var(--spacing-unit) * 5);
    background: linear-gradient(135deg, var(--color-aqua-soft) 0%, #FFFFFF 100%);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    text-align: center;
}

.download-cta h2 {
    margin-top: 0;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.btn-download {
    display: inline-block;
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 6);
    background-color: var(--primary);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin: calc(var(--spacing-unit) * 2) 0;
    transition: background-color 0.2s ease;
    font-family: var(--font-body);
}

.btn-download:hover,
.btn-download:focus-visible {
    background-color: var(--primary-hover);
    color: #ffffff !important;
    text-decoration: none;
}

article .download-cta a.btn-download,
.entry-content .download-cta a.btn-download,
.wp-block-html .download-cta a.btn-download {
    color: #ffffff !important;
    text-decoration: none;
}

article .download-cta a.btn-download:hover,
article .download-cta a.btn-download:focus-visible,
.entry-content .download-cta a.btn-download:hover,
.entry-content .download-cta a.btn-download:focus-visible,
.wp-block-html .download-cta a.btn-download:hover,
.wp-block-html .download-cta a.btn-download:focus-visible {
    color: #ffffff !important;
    text-decoration: none;
}

.download-note {
    font-size: 1rem;
    color: var(--text-meta);
    margin-top: calc(var(--spacing-unit) * 3);
}

/* Responsive */
@media (max-width: 1024px) {
    .chart-section-left {
        position: static;
    }
}

@media (max-width: 768px) {
    .chart-container {
        height: 350px;
        min-height: 350px;
        padding: calc(var(--spacing-unit) * 3);
    }
    
    .chart-container:has(canvas[data-chart-type="doughnut"]),
    .chart-container:has(canvas[data-chart-type="pie"]) {
        height: 600px;
        min-height: 600px;
        padding-top: calc(var(--spacing-unit) * 4);
    }
    
    .chart-container:has(canvas[data-chart-type="doughnut"]) canvas,
    .chart-container:has(canvas[data-chart-type="pie"]) canvas {
        max-width: 85%;
        max-height: 85%;
    }
    
    .chart-section h2 {
        font-size: 1.25rem;
    }
    
    .chart-section-right .chart-actions {
        flex-direction: row;
    }
    
    .chart-section-right .btn-export {
        width: auto;
        flex: 1;
    }
    
    .table-controls {
        flex-direction: column;
    }
    
    .table-controls input {
        width: 100%;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 2);
    }
}

/* Stats Grid for Degree Profiles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.stat-item {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(10, 28, 74, 0.04);
    padding: calc(var(--spacing-unit) * 4);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-value {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: calc(var(--spacing-unit) * 1);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.stat-change {
    font-size: 0.85rem;
    color: var(--color-aqua);
    font-weight: 600;
    font-style: normal;
}

@media (max-width: 768px) {
    .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 4);
}
    
    .stat-value {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: calc(var(--spacing-unit) * 1);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
}

/* Ranking Tables for Degree Profiles — mobile first: one column, then auto-fit */
.ranking-tables {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 4);
    margin: calc(var(--spacing-unit) * 6) 0;
    max-width: 100%;
    min-width: 0;
}

@media (min-width: 640px) {
    .ranking-tables {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
        gap: calc(var(--spacing-unit) * 6);
    }
}

.ranking-table-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: calc(var(--spacing-unit) * 4);
}

.ranking-table-section h3 {
    margin-top: 0;
    margin-bottom: calc(var(--spacing-unit) * 3);
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

.ranking-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Wide benchmark tables (hub + data pages): scroll inside article, never overflow layout */
.ranking-table-container {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin: calc(var(--spacing-unit) * 3) 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--surface);
}

.ranking-table-container.filterable-table {
    /* table-filter.js may inject controls; keep scroll on the block that wraps the table */
    display: block;
}

.ranking-table-container .ranking-table th,
.ranking-table-container .ranking-table td {
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 2);
}

.ranking-table-container .ranking-table {
    width: max-content;
    min-width: 100%;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
    font-size: 1rem;
    min-width: 100%;
}

.ranking-table thead {
    background-color: var(--surface-alt);
    border-bottom: 2px solid var(--border);
}

.ranking-table th {
    text-align: left;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ranking-table td {
    padding: calc(var(--spacing-unit) * 3);
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.ranking-table tbody tr:hover {
    background-color: var(--background);
}

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

.ranking-table .rank {
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    width: 40px;
}

.ranking-table .school-name {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 200px;
}

.ranking-table .school-state {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ranking-table .value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    white-space: nowrap;
}

.ranking-table .value-currency::before {
    content: '$';
}

/* Table Filtering + sortable headers */
.table-filter-toolbar {
    margin-bottom: calc(var(--spacing-unit) * 3);
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
    max-width: 100%;
    min-width: 0;
}

.table-filter-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: calc(var(--spacing-unit) * 2);
    max-width: 100%;
    min-width: 0;
}

.table-filter-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
    max-width: 100%;
    min-width: 0;
}

.table-filter-search-row .table-filter-input {
    flex: 1 1 12rem;
    min-width: 0;
}

.ranking-table thead th.table-col-sortable,
.data-table thead th.table-col-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: calc(var(--spacing-unit) * 4);
}

.ranking-table thead th.table-col-sortable:hover,
.data-table thead th.table-col-sortable:hover {
    color: var(--color-primary);
}

.ranking-table thead th.table-col-sortable--asc::after,
.data-table thead th.table-col-sortable--asc::after {
    content: ' \2191';
    font-weight: 700;
    opacity: 0.85;
}

.ranking-table thead th.table-col-sortable--desc::after,
.data-table thead th.table-col-sortable--desc::after {
    content: ' \2193';
    font-weight: 700;
    opacity: 0.85;
}

.table-filter-container {
    margin-bottom: calc(var(--spacing-unit) * 3);
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
    flex-wrap: wrap;
}

.table-filter-input {
    flex: 1;
    min-width: 200px;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Open Sans', sans-serif;
    color: var(--text-primary);
    background-color: var(--surface);
}

.table-filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 28, 74, 0.1);
}

.table-preset-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.table-filter-select {
    min-width: 12rem;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Open Sans', sans-serif;
    color: var(--text-primary);
    background-color: var(--surface);
}

.table-filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 28, 74, 0.1);
}

.table-filter-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Analysis & insights — before Sources on Data / deep-dive pages */
.analysis-insights {
    margin-top: calc(var(--spacing-unit) * 8);
    margin-left: auto;
    margin-right: auto;
    padding-top: calc(var(--spacing-unit) * 5);
    border-top: 1px solid var(--border);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.analysis-insights h2 {
    font-size: 1.35rem;
    color: var(--color-primary);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.analysis-insights-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.analysis-insights-text:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .ranking-table-section {
        padding: calc(var(--spacing-unit) * 3);
    }
    
    .ranking-table {
        font-size: 0.875rem;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: calc(var(--spacing-unit) * 2);
    }
    
    .ranking-table .school-name {
        min-width: 0;
    }
    
    .table-filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-filter-input,
    .table-filter-select {
        width: 100%;
        min-width: 0;
    }
    
    /* Card-style rows: benchmark + degree tables (needs data-label on cells / row header) */
    .ranking-table-wrapper,
    .ranking-table-container {
        display: block;
    }
    
    .ranking-table,
    .ranking-table thead,
    .ranking-table tbody,
    .ranking-table th,
    .ranking-table td,
    .ranking-table tr {
        display: block;
    }
    
    .ranking-table thead {
        display: none;
    }
    
    .ranking-table tr {
        border: 1px solid var(--border);
        border-radius: 8px;
        margin-bottom: calc(var(--spacing-unit) * 2);
        padding: calc(var(--spacing-unit) * 2);
        background: var(--surface);
    }
    
    .ranking-table td,
    .ranking-table tbody th {
        border: none;
        padding: calc(var(--spacing-unit) * 1) 0;
        text-align: left !important;
        position: relative;
        padding-left: 40%;
    }
    
    .ranking-table td::before,
    .ranking-table tbody th::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 35%;
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.85rem;
        text-transform: uppercase;
    }
    
    .ranking-table tbody th::before {
        text-align: left;
    }
    
    .ranking-table .rank {
        width: auto;
    }
}

/* -----------------------------------------------------------------------------
   Ranking detail pages — school cards at all breakpoints (table kept for
   a11y, filters, sort; thead visually hidden; data-label on td from
   edsmart-table-filter-v3.js). Wide viewports: 2- then 3-column card grid.
   ----------------------------------------------------------------------------- */
body.single-ed_ranking .table-responsive-wrapper.filterable-table,
body.post-type-ed_ranking.single .table-responsive-wrapper.filterable-table,
.ed-page-ranking .table-responsive-wrapper.filterable-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: visible;
    -webkit-overflow-scrolling: auto;
    overscroll-behavior-x: contain;
}

body.single-ed_ranking .table-responsive-wrapper.filterable-table table.data-table,
body.post-type-ed_ranking.single .table-responsive-wrapper.filterable-table table.data-table,
.ed-page-ranking .table-responsive-wrapper.filterable-table table.data-table {
    table-layout: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

body.single-ed_ranking .table-responsive-wrapper table.data-table thead,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table thead,
.ed-page-ranking .table-responsive-wrapper table.data-table thead {
    display: none;
}

body.single-ed_ranking .table-responsive-wrapper table.data-table tbody,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody,
.ed-page-ranking .table-responsive-wrapper table.data-table tbody {
    display: block;
}

@media (min-width: 900px) {
    body.single-ed_ranking .table-responsive-wrapper table.data-table tbody,
    body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody,
    .ed-page-ranking .table-responsive-wrapper table.data-table tbody {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: calc(var(--spacing-unit) * 3);
        align-items: stretch;
    }
}

@media (min-width: 1280px) {
    body.single-ed_ranking .table-responsive-wrapper table.data-table tbody,
    body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody,
    .ed-page-ranking .table-responsive-wrapper table.data-table tbody {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

body.single-ed_ranking .table-responsive-wrapper table.data-table tbody tr,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody tr,
.ed-page-ranking .table-responsive-wrapper table.data-table tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 4);
    background: var(--surface);
    box-shadow: 0 2px 14px rgba(10, 28, 74, 0.07);
}

@media (min-width: 900px) {
    body.single-ed_ranking .table-responsive-wrapper table.data-table tbody tr,
    body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody tr,
    .ed-page-ranking .table-responsive-wrapper table.data-table tbody tr {
        margin-bottom: 0;
        min-height: 100%;
        box-sizing: border-box;
    }
}

body.single-ed_ranking .table-responsive-wrapper table.data-table tbody tr:nth-child(even),
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody tr:nth-child(even),
.ed-page-ranking .table-responsive-wrapper table.data-table tbody tr:nth-child(even) {
    background: var(--surface);
}

body.single-ed_ranking .table-responsive-wrapper table.data-table tbody tr:last-child,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody tr:last-child,
.ed-page-ranking .table-responsive-wrapper table.data-table tbody tr:last-child {
    margin-bottom: 0;
}

body.single-ed_ranking .table-responsive-wrapper table.data-table td,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table td,
.ed-page-ranking .table-responsive-wrapper table.data-table td {
    display: block;
    border: none;
    padding: calc(var(--spacing-unit) * 1.5) 0 calc(var(--spacing-unit) * 1.5) 42%;
    text-align: left !important;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.45;
    width: auto;
    max-width: none;
    vertical-align: top;
}

body.single-ed_ranking .table-responsive-wrapper table.data-table td[data-label]::before,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table td[data-label]::before,
.ed-page-ranking .table-responsive-wrapper table.data-table td[data-label]::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    top: calc(var(--spacing-unit) * 1.5);
    width: 38%;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    line-height: 1.35;
    overflow-wrap: anywhere;
    hyphens: auto;
}

/* Spotlight school cards (seven columns): rank + institution as card header */
body.single-ed_ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(1),
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(1),
.ed-page-ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(1) {
    padding-left: 0;
    padding-top: 0;
    font-family: var(--font-primary, "Manrope", system-ui, sans-serif);
    font-size: 1.65rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--color-primary);
    line-height: 1.1;
}

body.single-ed_ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(1)::before,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(1)::before,
.ed-page-ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(1)::before {
    content: none;
}

body.single-ed_ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(2),
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(2),
.ed-page-ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(2) {
    padding-left: 0;
    padding-top: calc(var(--spacing-unit) * 1);
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: calc(var(--spacing-unit) * 2);
    padding-bottom: calc(var(--spacing-unit) * 2);
    border-bottom: 1px solid var(--border-light);
}

body.single-ed_ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(2) a,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(2) a,
.ed-page-ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(2) a {
    color: var(--color-link, var(--primary));
    text-decoration: none;
}

body.single-ed_ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(2) a:hover,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(2) a:hover,
.ed-page-ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(2) a:hover {
    text-decoration: underline;
}

body.single-ed_ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(2)::before,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(2)::before,
.ed-page-ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:nth-child(2)::before {
    content: none;
}

/* Long editorial column (seven-column spotlight tables) */
body.single-ed_ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:last-child,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:last-child,
.ed-page-ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:last-child {
    padding-left: 0;
    margin-top: calc(var(--spacing-unit) * 2);
    padding-top: calc(var(--spacing-unit) * 2);
    border-top: 1px solid var(--border-light);
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

body.single-ed_ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:last-child::before,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:last-child::before,
.ed-page-ranking .table-responsive-wrapper table.data-table tbody tr:has(> td:nth-child(7)) > td:last-child::before {
    position: static;
    display: block;
    width: 100%;
    margin-bottom: calc(var(--spacing-unit) * 1);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

body.single-ed_ranking .table-responsive-wrapper table.data-table tr.no-results-row td,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tr.no-results-row td,
.ed-page-ranking .table-responsive-wrapper table.data-table tr.no-results-row td {
    padding-left: 0;
    text-align: center !important;
}

body.single-ed_ranking .table-responsive-wrapper table.data-table tr.no-results-row td::before,
body.post-type-ed_ranking.single .table-responsive-wrapper table.data-table tr.no-results-row td::before,
.ed-page-ranking .table-responsive-wrapper table.data-table tr.no-results-row td::before {
    content: none;
    display: none;
}

body.single-ed_ranking .table-filter-toolbar,
body.post-type-ed_ranking.single .table-filter-toolbar,
.ed-page-ranking .table-filter-toolbar {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

@media (max-width: 768px) {
    body.single-ed_ranking .table-filter-input,
    body.single-ed_ranking .table-filter-select,
    body.post-type-ed_ranking.single .table-filter-input,
    body.post-type-ed_ranking.single .table-filter-select,
    .ed-page-ranking .table-filter-input,
    .ed-page-ranking .table-filter-select {
        min-height: 44px;
        font-size: 1rem;
    }
}
