/* Research pages (overview and the five sub-pages); every rule is scoped to .research-section. */
.research-section {
    --research-border: var(--border-color);
    --research-muted: var(--muted-color);
    --research-ink: var(--heading-color);
    --research-tint: var(--panel-color);
    --research-radius: 12px;
}

.research-section .research-block + .research-block {
    margin-top: 64px;
}

/* Shared section heading: a short accent bar above the title. */
.research-section .research-heading {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 600;
    color: var(--heading-color);
}

.research-section .research-heading::before {
    content: "";
    display: block;
    width: 36px;
    height: 3px;
    margin-bottom: 14px;
    border-radius: 2px;
    background: var(--accent-color);
}

.research-section .research-footnote {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 14px 0 0;
    color: var(--research-muted);
    font-size: 14px;
    line-height: 1.6;
}

.research-section .research-footnote .bi {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--subtle-color);
}

.research-section a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Introduction */
.research-section .research-lead {
    margin: 0;
    padding-left: 22px;
    border-left: 3px solid var(--accent-color);
    color: var(--research-ink);
    font-size: 20px;
    line-height: 1.6;
}

/* A single introductory paragraph: a comfortable reading width. */
.research-section .research-lead-single {
    max-width: 960px;
    font-size: 19px;
    line-height: 1.7;
}

/* Research Interests: five theme panels, two per row (the fifth stays half width), one column on phones. */
.research-section .research-theme-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.research-section .research-theme {
    display: flex;
    flex-direction: column;
    padding: 26px 28px;
    border: 1px solid var(--research-border);
    border-radius: var(--research-radius);
    background: #fff;
}

.research-section .research-theme-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.research-section .research-theme-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--research-tint);
    color: var(--accent-color);
    font-size: 19px;
}

.research-section .research-theme-title {
    margin: 0;
    color: var(--heading-color);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
}

.research-section .research-theme-text {
    margin: 0;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--research-border);
    color: var(--research-muted);
    font-size: 15.5px;
    line-height: 1.65;
}

/* Research topics as small chips; colours, border and weight: the shared informational pill (main.css). */
.research-section .research-theme-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.research-section .research-theme-topics li {
    padding: 5px 12px;
    font-size: 13.5px;
    line-height: 1.4;
}

/* Data panels: metrics table and chart share the same frame. */
.research-section .research-panel {
    background: #fff;
    border: 1px solid var(--research-border);
    border-radius: var(--research-radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.research-section .metrics-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.research-section .metrics-table thead th {
    padding: 14px 20px;
    background: var(--research-tint);
    border-bottom: 1px solid var(--research-border);
    color: var(--research-muted);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
}

.research-section .metrics-table thead th:first-child {
    border-top-left-radius: var(--research-radius);
    text-align: left;
    width: 28%;
}

.research-section .metrics-table thead th:last-child {
    border-top-right-radius: var(--research-radius);
}

.research-section .metrics-table tbody th,
.research-section .metrics-table tbody td {
    padding: 22px 20px;
    vertical-align: middle;
}

.research-section .metrics-table tbody tr + tr > * {
    border-top: 1px solid var(--research-border);
}

.research-section .metrics-table tbody th {
    text-align: left;
    font-weight: 600;
}

.research-section .metrics-source {
    font-size: 17px;
    text-decoration: none;
}

.research-section .metrics-source:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.research-section .metrics-source-updated {
    display: block;
    margin-top: 4px;
    color: var(--research-muted);
    font-size: 13px;
    font-weight: 400;
}

.research-section .metrics-table tbody td {
    text-align: center;
    color: var(--research-ink);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.research-section .metrics-table .metric-unknown {
    color: var(--subtle-color);
    font-weight: 400;
}

/* Citations chart */
.research-section .chart-panel {
    padding: 24px 24px 16px;
}

.research-section .chart-canvas {
    position: relative;
    height: 340px;
}

@media (max-width: 991.98px) {
    .research-section .research-lead { font-size: 19px; }
    .research-section .research-lead-single { font-size: 18px; }
    .research-section .research-theme-grid { gap: 18px; }
    .research-section .research-theme { padding: 22px; }
    .research-section .metrics-table thead th { padding: 12px 10px; }
    .research-section .metrics-table tbody th,
    .research-section .metrics-table tbody td { padding: 18px 10px; }
    .research-section .metrics-table tbody th { padding-left: 18px; }
    .research-section .metrics-table tbody td { font-size: 25px; }
    .research-section .chart-canvas { height: 300px; }
}

/* Narrow tablets and phones: one theme panel per row. */
@media (max-width: 767.98px) {
    .research-section .research-theme-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Phones: each source becomes a panel with a 2 x 2 grid of labelled values. */
@media (max-width: 575.98px) {
    .research-section .research-block + .research-block { margin-top: 48px; }
    .research-section .research-heading { font-size: 22px; }
    .research-section .research-lead { padding-left: 16px; font-size: 18px; }
    .research-section .research-lead-single { font-size: 17px; }
    .research-section .research-theme { padding: 20px; }
    .research-section .research-theme-title { font-size: 18px; }
    .research-section .research-theme-topics li { font-size: 13px; }

    .research-section .metrics-panel { border: 0; background: transparent; box-shadow: none; }
    .research-section .metrics-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    .research-section .metrics-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        margin-bottom: 14px;
        background: #fff;
        border: 1px solid var(--research-border);
        border-radius: var(--research-radius);
        overflow: hidden;
    }
    .research-section .metrics-table tbody tr + tr > * { border-top: 0; }
    .research-section .metrics-table tbody th {
        grid-column: 1 / -1;
        padding: 14px 16px;
        background: var(--research-tint);
        border-bottom: 1px solid var(--research-border);
    }
    .research-section .metrics-table tbody td {
        display: block;
        padding: 14px 8px;
        font-size: 25px;
    }
    .research-section .metrics-table tbody td::after {
        content: attr(data-label);
        display: block;
        margin-top: 3px;
        color: var(--research-muted);
        font-size: 13px;
        font-weight: 500;
        letter-spacing: 0;
    }
    .research-section .metrics-table tbody td:nth-of-type(n+3) { border-top: 1px solid var(--research-border); }
    .research-section .metrics-table tbody td:nth-of-type(odd) { border-right: 1px solid var(--research-border); }

    .research-section .chart-panel { padding: 16px 10px 10px; }
    .research-section .chart-canvas { height: 260px; }
}

/* Breadcrumb above the title of each sub-page: Research / Page. */
.research-section .research-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
    color: var(--research-muted);
    font-size: 14px;
}

.research-section .research-breadcrumb li + li::before {
    content: "/";
    margin-right: 6px;
    color: var(--subtle-color);
}

/* Overview: five panels linking to the sub-pages (3 + 2 on desktop, 2 + 2 + 1 on tablets, stacked on phones). */
.research-section .research-nav-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.research-section .research-nav-grid > li {
    grid-column: span 2;
}

.research-section .research-nav-grid > li:nth-child(n+4) {
    grid-column: span 3;
}

.research-section .research-nav-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    border: 1px solid var(--research-border);
    border-radius: var(--research-radius);
    background: #fff;
    color: var(--default-color);
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.research-section .research-nav-panel:hover,
.research-section .research-nav-panel:focus-visible {
    border-color: var(--accent-border-color);
    background: var(--research-tint);
    color: var(--default-color);
}

.research-section .research-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: var(--research-tint);
    color: var(--accent-color);
    font-size: 19px;
}

.research-section .research-nav-panel:hover .research-nav-icon,
.research-section .research-nav-panel:focus-visible .research-nav-icon {
    background: #fff;
}

.research-section .research-nav-title {
    margin: 0 0 6px;
    color: var(--heading-color);
    font-size: 19px;
    font-weight: 600;
}

.research-section .research-nav-text {
    margin: 0 0 18px;
    color: var(--research-muted);
    font-size: 15px;
    line-height: 1.6;
}

.research-section .research-nav-more {
    margin-top: auto;
    color: var(--accent-color);
    font-size: 14.5px;
    font-weight: 500;
}

.research-section .research-nav-more .bi {
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.research-section .research-nav-panel:hover .research-nav-more .bi {
    transform: translateX(3px);
}

/* A section whose content will be added later. */
.research-section .research-placeholder {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0;
    padding: 18px 20px;
    border: 1px dashed var(--research-border);
    border-radius: 10px;
    background: var(--research-tint);
    color: var(--research-muted);
    font-size: 15px;
}

.research-section .research-placeholder .bi {
    color: var(--subtle-color);
}

/* Research Networks & Maps: one section per map, each with a short description. */
.research-section .research-map-text {
    margin: -12px 0 16px;
    color: var(--research-muted);
    font-size: 15.5px;
}

/* An interactive map: a fixed-height frame, then its version and links. */
.research-section .research-map-frame {
    height: 650px;
    overflow: hidden;
    border: 1px solid var(--research-border);
    border-radius: var(--research-radius);
    background: #fff;
}

/* The page script snaps the frame to whole device pixels (offset and size); these are the defaults without it. */
.research-section .research-map-frame iframe {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.research-section .research-map-frame:fullscreen {
    height: 100vh;
    border: 0;
    border-radius: 0;
}

/* View Full Methodology: the colours of the home page's Curriculum Vitae button (#home .home-button-primary). */
.research-section .research-method-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    margin: 0 0 18px;
    padding: 0 14px;
    border: 1px solid var(--accent-border-color);
    border-radius: 8px;
    background: var(--accent-soft-color);
    color: var(--accent-color);
    font-size: 14.5px;
    font-weight: 500;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.research-section .research-method-button:hover,
.research-section .research-method-button:focus-visible {
    border-color: var(--accent-color);
    background: var(--accent-soft-strong-color);
}

.research-section .research-method-button:focus-visible,
.research-section .research-map-link:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.research-section .research-map-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    margin-top: 12px;
}

.research-section .research-map-version {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    color: var(--research-muted);
    font-size: 13.5px;
}

.research-section .research-map-version strong {
    font-weight: 600;
}

.research-section .research-map-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: 0;
}

.research-section .research-map-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-color);
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
}

.research-section .research-map-link[hidden] {
    display: none;
}

.research-section .research-map-link:hover {
    color: var(--accent-hover-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .research-section .research-method-button,
    .research-section .research-nav-panel,
    .research-section .research-nav-more .bi { transition: none; }
}

@media (max-width: 991.98px) {
    .research-section .research-map-frame { height: 530px; }
    .research-section .research-nav-grid > li,
    .research-section .research-nav-grid > li:nth-child(n+4) { grid-column: span 3; }
    .research-section .research-nav-grid > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 575.98px) {
    .research-section .research-nav-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .research-section .research-nav-grid > li,
    .research-section .research-nav-grid > li:nth-child(n+4),
    .research-section .research-nav-grid > li:last-child:nth-child(odd) { grid-column: auto; }
    .research-section .research-nav-panel { padding: 20px; }
    .research-section .research-map-frame { height: 430px; }
}

/* Methodology popup: the same dialog design as the publication abstracts (.paper-modal on Journal Papers). */
.research-modal {
    width: min(840px, 92vw);
    max-height: 85vh;
    padding: 0;
    border: 0;
    border-radius: 8px;
}

.research-modal::backdrop {
    background: rgba(0, 0, 0, 0.75);
}

.research-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border-color);
}

.research-modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.research-modal-heading {
    margin: 0 0 6px;
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.research-modal-close {
    border: 0;
    background: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.research-modal-close:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.research-modal-body {
    max-height: 65vh;
    padding: 24px 26px;
    overflow-y: auto;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

/* The methodology: each label above its text. */
.research-method-list {
    margin: 0;
}

.research-method-list dt {
    color: var(--heading-color);
    font-size: 15px;
    font-weight: 600;
}

.research-method-list dd {
    margin: 2px 0 16px;
    color: var(--default-color);
    font-size: 15.5px;
}

.research-method-list dd:last-child {
    margin-bottom: 0;
}

.research-method-examples {
    margin: 6px 0 0;
    padding-left: 20px;
}

.research-method-examples li + li {
    margin-top: 2px;
}

@media (max-width: 575.98px) {
    .research-modal-header { padding: 18px 20px; }
    .research-modal-body { padding: 20px; }
}
