/* Keep the column headings, cells and surrounding policy text in normal document flow. */
.lps-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    margin-block: 1em;
}
.lps-table-scroll:focus-visible {
    outline: 2px solid #1a3a7c;
    outline-offset: 2px;
}
.lps-table-scroll > table {
    margin-block: 0;
}
.trial-table:has(> .lps-table-scroll) {
    overflow: visible;
}

/* Full justification creates large gaps between words in narrow editorial columns. */
@media (max-width: 1100px) {
    .who_we_are_txt p,
    .philosophy_txt p,
    .personal-injury-txt p,
    .term_condition p {
        text-align: start;
    }
}
.entry-content .lps-table-scroll .main-tab-area th {
    color: white;
}

.term_condition .et_pb_text_inner > h1.lps-policy-title {
    color: #353334;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.3;
    padding: 0 0 10px;
    margin: 0;
}

.philosophy_txt:has(.lps-benefit-list) .et_pb_text_inner {
    container-type: inline-size;
}
.philosophy_txt ul.lps-benefit-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem 1rem;
    margin: 1rem 0;
    padding: 0;
}
.philosophy_txt ul.lps-benefit-list li {
    float: none;
    width: auto;
    min-height: 25px;
    margin: 0;
}
.philosophy_txt .lps-benefit-list h4 {
    margin: 0;
    padding: 0;
    line-height: 1.35;
}
@container (min-width: 25rem) {
    .philosophy_txt ul.lps-benefit-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Let the enquiry card contain its button when the columns stack. */
@media (max-width: 767px) {
    .et_pb_section .check_now .et_pb_code_inner {
        padding-bottom: 16px;
    }
    .et_pb_section .check_now a {
        position: static;
        display: block;
        margin: 12px auto 0;
    }
}

/* A following sidebar starts at the bottom edge of the card on desktop. */
@media (min-width: 768px) {
    .et_pb_section .check_now:has(+ .sidebar_links_box) .et_pb_code_inner {
        padding-bottom: 16px;
    }
    .et_pb_section .check_now:has(+ .sidebar_links_box) a {
        position: static;
        display: block;
        margin: 12px auto 0;
    }
}

/* The short FAQ link sits between the practice directory and contact strip. */
.et_pb_section.lps-injury-faq {
    padding: 0;
    text-align: center;
}
.et_pb_section.lps-injury-faq .et_pb_row {
    padding: 12px 0 24px;
}
.lps-injury-faq a {
    display: inline-block;
    padding: 10px 4px;
    color: #193876;
    font-weight: 600;
    text-decoration: underline;
}

/* When a service sidebar stacks below the article, use the available width
   for related links and make the whole row tappable. */
@media (max-width: 980px) {
    .sidebar_links_box {
        container: lps-related-links / inline-size;
    }
    @container lps-related-links (min-width: 34rem) {
        .sidebar_links_box ul {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 2px 12px;
        }
        .sidebar_links_box ul li {
            margin: 0;
            padding: 0;
        }
        .sidebar_links_box ul li::before {
            top: 50%;
            transform: translateY(-50%);
            pointer-events: none;
        }
        .sidebar_links_box ul li > a {
            display: flex;
            align-items: center;
            min-height: 44px;
            height: 100%;
            padding: 4px 6px 4px 25px;
            line-height: 1.4;
        }
    }
}

@media (min-width: 981px) and (max-width: 1100px) {
    /* Divi switches back to a narrow sidebar at 981px. Keep enough room for
       the service directory or enquiry beside these shorter articles. */
    .et_pb_row.lps-tablet-service-row {
        display: grid;
        width: 90% !important;
        grid-template-columns: minmax(0, 55fr) minmax(0, 41fr);
        gap: 4%;
        align-items: start;
    }
    .et_pb_row.lps-tablet-wide-sidebar {
        grid-template-columns: minmax(0, 45fr) minmax(0, 51fr);
    }
    .et_pb_row.lps-tablet-wide-article {
        grid-template-columns: minmax(0, 60fr) minmax(0, 36fr);
    }
    .et_pb_row.lps-tablet-service-row > .et_pb_column {
        width: auto !important;
        margin: 0 !important;
    }
    .lps-tablet-service-row::after {
        display: none;
    }
    .lps-tablet-service-row .sidebar_links_box ul {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 10px;
    }
    .lps-tablet-service-row .sidebar_links_box li > a {
        display: block;
        min-height: 24px;
    }
    .lps-tablet-service-row .category_frm {
        container: lps-service-enquiry / inline-size;
    }
}
/* Keep the exit above the decorative banner on short landscape screens. */
@media (max-width: 980px) and (max-height: 500px) and (orientation: landscape) {
    .et_builder_inner_content:has(> .inner-banner-row .lps-quick-exit) {
        display: flex;
        flex-direction: column;
    }
    .inner-banner-row:has(.lps-quick-exit) {
        order: -1;
    }
}
