/* ========================================
   SINGLE RESEARCH POST
======================================== */

.tms-single {
    min-height: 70vh;
}


/* ========================================
   TITLE AREA
======================================== */

.tms-single-head {
    padding: 42px 0 30px;

    border-bottom: 1px solid var(--line);
}

.tms-single-head__inner {
    max-width: 900px;
}

.tms-single-kicker {
    margin: 0 0 13px;

    color: var(--blue);

    font-size: 11px;
    line-height: 1;
    font-weight: 800;

    letter-spacing: .12em;
}

.tms-single-head h1 {
    margin: 0;

    max-width: 900px;

    color: var(--ink);

    font-size: 32px;
    line-height: 1.28;
    font-weight: 750;

    letter-spacing: -.04em;

    word-break: keep-all;
}

.tms-single-meta {
    display: flex;
    flex-wrap: wrap;

    align-items: center;

    gap: 8px;

    margin-top: 17px;

    color: var(--muted);

    font-size: 13px;
}

.tms-single-meta a {
    color: var(--blue);
    font-weight: 650;
}


/* ========================================
   FEATURED IMAGE
======================================== */

.tms-single-featured {
    max-width: 1040px;

    margin: 34px auto 0;

    overflow: hidden;

    border-radius: 10px;
}

.tms-single-featured img {
    display: block;

    width: 100%;
    height: auto;
}


/* ========================================
   ARTICLE BODY
======================================== */

.tms-single-content-wrap {
    width: 100%;

    padding: 36px 16px 60px;
}

.tms-entry {
    width: 100%;
    max-width: 820px;

    margin: 0 auto;

    color: #263142;

    font-size: 16px;
    line-height: 1.85;

    word-break: keep-all;
    overflow-wrap: break-word;
}

.tms-entry > *:first-child {
    margin-top: 0;
}

.tms-entry p {
    margin-top: 0;
    margin-bottom: 1.45em;
}

.tms-entry ul,
.tms-entry ol {
    margin-top: 0;
    margin-bottom: 1.45em;

    padding-left: 1.4em;
}

.tms-entry li + li {
    margin-top: .45em;
}

.tms-entry a {
    color: var(--blue);

    text-decoration: underline;
    text-underline-offset: 3px;

    text-decoration-thickness: 1px;
}

.tms-entry strong {
    color: #172033;
}


/* ========================================
   HEADINGS
======================================== */

.tms-entry h2 {
    position: relative;

    margin: 2.25em 0 .85em;

    padding-left: 15px;

    color: var(--ink);

    font-size: 25px;
    line-height: 1.4;
    font-weight: 750;

    letter-spacing: -.035em;

    word-break: keep-all;
}

.tms-entry h2::before {
    content: "";

    position: absolute;

    left: 0;
    top: .18em;
    bottom: .18em;

    width: 4px;

    border-radius: 4px;

    background: var(--blue);
}

.tms-entry h3 {
    margin: 1.9em 0 .7em;

    padding-bottom: 9px;

    color: var(--ink);

    border-bottom: 1px solid var(--line);

    font-size: 20px;
    line-height: 1.45;
    font-weight: 700;

    letter-spacing: -.025em;

    word-break: keep-all;
}

.tms-entry h4 {
    margin: 1.7em 0 .6em;

    color: var(--ink);

    font-size: 17px;
    line-height: 1.5;
}


/* ========================================
   BLOCKQUOTE
======================================== */

.tms-entry blockquote {
    margin: 2em 0;

    padding: 18px 20px;

    border-left: 4px solid #b9c9ed;

    color: #475467;
    background: var(--soft);
}

.tms-entry blockquote p:last-child {
    margin-bottom: 0;
}


/* ========================================
   IMAGES / FIGURES
======================================== */

.tms-entry figure {
    margin-top: 2em;
    margin-bottom: 2em;
}

.tms-entry figcaption {
    margin-top: 8px;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.6;

    text-align: center;
}

.tms-entry .alignwide {
    width: min(
        1040px,
        calc(100vw - 32px)
    );

    max-width: none;

    margin-left: 50%;
    transform: translateX(-50%);
}


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

.tms-entry .wp-block-table {
    width: min(
        1000px,
        calc(100vw - 32px)
    );

    max-width: none;

    margin: 2em 0 2em 50%;

    overflow-x: auto;

    transform: translateX(-50%);

    -webkit-overflow-scrolling: touch;
}

.tms-entry .wp-block-table table {
    width: 100%;

    border-collapse: collapse;

    table-layout: auto;

    font-size: 14px;
    line-height: 1.55;
}

.tms-entry .wp-block-table th {
    padding: 12px 13px;

    border: 1px solid #d7dde7;

    color: #344054;
    background: #f5f7fa;

    font-weight: 700;
    text-align: left;

    white-space: nowrap;
}

.tms-entry .wp-block-table td {
    padding: 11px 13px;

    border: 1px solid #e1e5ec;

    vertical-align: top;
}

.tms-entry .wp-block-table tbody tr:nth-child(even) {
    background: #fbfcfd;
}


/*
 * Legacy TablePress safety.
 * TablePress is inactive on staging,
 * but this keeps old markup readable
 * if any survives.
 */
.tms-entry .tablepress {
    width: 100%;

    border-collapse: collapse;

    font-size: 14px;
}

.tms-entry .tablepress th,
.tms-entry .tablepress td {
    padding: 11px 13px;

    border: 1px solid #e1e5ec;
}


/* ========================================
   CODE / PRE
======================================== */

.tms-entry pre {
    max-width: 100%;

    padding: 18px;

    overflow-x: auto;

    border-radius: 8px;

    background: #101828;
    color: #f8fafc;

    font-size: 13px;
    line-height: 1.65;
}

.tms-entry code {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Consolas,
        monospace;
}


/* ========================================
   RELATED RESEARCH
======================================== */

.tms-related {
    padding: 44px 0 64px;

    border-top: 1px solid var(--line);

    background: #fbfcfe;
}

.tms-single-wide {
    width: 100%;
    max-width: 1240px;

    margin: 0 auto;

    padding-left: 16px;
    padding-right: 16px;
}

.tms-related__head p {
    margin: 0 0 10px;

    color: var(--blue);

    font-size: 11px;
    line-height: 1;
    font-weight: 800;

    letter-spacing: .12em;
}

.tms-related__head h2 {
    margin: 0;

    color: var(--ink);

    font-size: 24px;
    line-height: 1.3;

    letter-spacing: -.03em;
}

.tms-related__grid {
    display: grid;

    grid-template-columns: 1fr;

    gap: 26px;

    margin-top: 24px;
}

.tms-related-card {
    min-width: 0;
}

.tms-related-card__image {
    display: flex;

    width: 100%;
    aspect-ratio: 16 / 9;

    overflow: hidden;

    align-items: center;
    justify-content: center;

    border: 1px solid var(--line);
    border-radius: 8px;

    background: var(--soft);
}

.tms-related-card__image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.tms-related-card__image span {
    color: #98a2b3;

    font-size: 11px;
    font-weight: 750;

    letter-spacing: .1em;
}

.tms-related-card__body {
    padding-top: 12px;
}

.tms-related-card h3 {
    margin: 0;

    color: var(--ink);

    font-size: 16px;
    line-height: 1.5;
    font-weight: 700;

    letter-spacing: -.02em;

    word-break: keep-all;
}

.tms-related-card h3 a:hover {
    color: var(--blue);
}

.tms-related-card time {
    display: block;

    margin-top: 8px;

    color: #98a2b3;

    font-size: 12px;
}


/* ========================================
   TABLET
======================================== */

@media (min-width: 700px) {

    .tms-single-head {
        padding-top: 54px;
        padding-bottom: 38px;
    }

    .tms-single-head h1 {
        font-size: 40px;
    }

    .tms-single-content-wrap {
        padding-top: 46px;
        padding-bottom: 72px;
    }

    .tms-entry {
        font-size: 17px;
    }

    .tms-entry h2 {
        font-size: 28px;
    }

    .tms-entry h3 {
        font-size: 21px;
    }

    .tms-related__grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 30px 24px;
    }
}


/* ========================================
   DESKTOP
======================================== */

@media (min-width: 900px) {

    .tms-single-head {
        padding-top: 62px;
        padding-bottom: 44px;
    }

    .tms-single-head h1 {
        font-size: 46px;
        line-height: 1.22;
    }

    .tms-single-featured {
        margin-top: 42px;
    }

    .tms-single-content-wrap {
        padding-top: 52px;
        padding-bottom: 82px;
    }

    .tms-single-wide {
        padding-left: 32px;
        padding-right: 32px;
    }

    .tms-related {
        padding-top: 52px;
        padding-bottom: 74px;
    }

    .tms-related__grid {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));

        gap: 26px;
    }
}

/* === SINGLE TITLE / CONTENT AXIS ALIGN === */

.tms-single-head__inner {
    margin-left: auto;
    margin-right: auto;
}

/* === /SINGLE TITLE / CONTENT AXIS ALIGN === */



/* ==================================================
   TMS MOBILE TABLE V1
   Phone only. Desktop/tablet styling is untouched.
================================================== */

@media (max-width: 699px) {

    /*
     * Core WordPress tables:
     * preserve natural column width and scroll sideways.
     */
    .tms-entry .wp-block-table {
        display: block;

        width: calc(100vw - 32px);
        max-width: none;

        margin:
            1.8em 0
            1.8em 50%;

        overflow-x: auto;
        overflow-y: hidden;

        transform: translateX(-50%);

        white-space: nowrap;

        -webkit-overflow-scrolling: touch;
    }

    .tms-entry .wp-block-table table {
        width: max-content !important;
        min-width: 100% !important;

        table-layout: auto !important;

        border-collapse: collapse !important;

        font-size: 14px;
        line-height: 1.45;
    }

    /*
     * Restore the cleaner legacy table appearance.
     */
    .tms-entry .wp-block-table thead,
    .tms-entry .wp-block-table thead tr {
        border: none !important;
    }

    .tms-entry .wp-block-table thead th {
        padding: 10px 8px !important;

        border-top: none !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom:
            2px solid #4285f4 !important;

        background: #f2f7fc !important;

        color: #333 !important;

        text-align: center !important;
        vertical-align: middle !important;

        font-weight: 700 !important;

        white-space: nowrap !important;
    }

    .tms-entry .wp-block-table tbody td {
        padding: 9px 8px !important;

        border-left: none !important;
        border-right: none !important;
        border-bottom:
            1px solid #e0e0e0 !important;

        color: #555 !important;
        background: #fff;

        text-align: center !important;
        vertical-align: middle !important;

        white-space: nowrap;
        word-break: keep-all !important;
    }

    .tms-entry
    .wp-block-table
    tbody
    tr:nth-child(even) {
        background: transparent;
    }


    /*
     * Legacy TablePress safety.
     */
    .tms-entry .tablepress {
        display: block;

        width: 100% !important;

        overflow-x: auto;

        white-space: nowrap;

        -webkit-overflow-scrolling: touch;
    }

    .tms-entry .tablepress th,
    .tms-entry .tablepress td {
        padding: 10px 8px;

        font-size: 14px;

        white-space: nowrap;
    }
}

/* === /TMS MOBILE TABLE V1 === */


/* ==================================================
   TMS DESKTOP TABLE CLEAN V1
   Visual styling only.
   Existing desktop width/layout remains unchanged.
================================================== */

@media (min-width: 700px) {

    .tms-entry .wp-block-table table {
        border-collapse: collapse !important;
        border-top: 1px solid #eee !important;

        font-size: 14px;
        line-height: 1.5;

        table-layout: auto !important;
    }

    .tms-entry .wp-block-table thead,
    .tms-entry .wp-block-table thead tr {
        border: none !important;
    }

    .tms-entry .wp-block-table thead th {
        padding: 11px 9px !important;

        background: #f2f7fc !important;
        color: #333 !important;

        border-top: none !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom:
            2px solid #4285f4 !important;

        text-align: center !important;
        vertical-align: middle !important;

        font-weight: 700 !important;

        white-space: nowrap !important;
    }

    .tms-entry .wp-block-table tbody td {
        padding: 10px 9px !important;

        color: #555 !important;
        background: #fff;

        border-left: none !important;
        border-right: none !important;
        border-bottom:
            1px solid #e0e0e0 !important;

        text-align: center !important;
        vertical-align: middle !important;

        line-height: 1.5 !important;

        word-break: keep-all !important;
    }

    .tms-entry
    .wp-block-table
    tbody
    tr:nth-child(even) {
        background: transparent;
    }


    /* Legacy TablePress safety */

    .tms-entry .tablepress {
        border-collapse: collapse;
        border: 0;

        font-size: 14px;
    }

    .tms-entry .tablepress thead th {
        padding: 11px 9px;

        background: #f2f7fc;

        border: 0;
        border-bottom:
            2px solid #4285f4;

        color: #333;

        text-align: center;

        font-weight: 700;
    }

    .tms-entry .tablepress tbody td {
        padding: 10px 9px;

        border: 0;
        border-bottom:
            1px solid #e0e0e0;

        color: #555;

        text-align: center;
    }
}

/* === /TMS DESKTOP TABLE CLEAN V1 === */


/* ==================================================
   TMS TABLE CONTAINMENT V1
   Keep tables inside article width.
   Wide tables scroll horizontally on every device.
================================================== */

.tms-entry .wp-block-table {
    display: block;

    width: 100%;
    max-width: 100%;

    margin: 2em 0;

    overflow-x: auto;
    overflow-y: hidden;

    transform: none;

    -webkit-overflow-scrolling: touch;
}

.tms-entry .wp-block-table table {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;

    table-layout: auto !important;
}

/*
 * Headers stay readable.
 * Body cells can wrap on larger screens.
 */
.tms-entry .wp-block-table th {
    white-space: nowrap !important;
}

@media (min-width: 700px) {

    .tms-entry .wp-block-table td {
        white-space: normal;
    }
}

/*
 * Phone tables preserve column width
 * and use horizontal scrolling.
 */
@media (max-width: 699px) {

    .tms-entry .wp-block-table {
        width: 100%;
        max-width: 100%;

        margin: 1.8em 0;

        transform: none;
    }

    .tms-entry .wp-block-table td {
        white-space: nowrap;
    }
}

/* === /TMS TABLE CONTAINMENT V1 === */
