/*
 * Nordisk Bilsport – resultatlistor
 *
 * All CSS är avsiktligt begränsad till .nb-result-list så att pluginet inte
 * påverkar Oxygen, Ultimate Member eller andra tabeller och knappar på sidan.
 */

.nb-result-list {
    --nb-table-stripe: #f6f6f5;
    --nb-table-border: #e3e3e2;
    --nb-table-heading: #404040;
    --nb-button: darkred;
    --nb-button-hover: #5f0000;

    width: 100%;
    max-width: 100%;
    color: inherit;
}

.nb-result-list,
.nb-result-list * {
    box-sizing: border-box;
}

/* Logotyper ------------------------------------------------------------- */

.nb-result-list .nb-result-logos {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: center;
    gap: clamp(8px, 1.5vw, 22px);
    width: 100%;
    margin: 0 0 24px;
}

.nb-result-list .nb-result-logo-slot {
    display: flex;
    min-width: 0;
    min-height: 70px;
    align-items: center;
    justify-content: center;
}

.nb-result-list .nb-result-logo-slot img {
    display: block;
    width: 100%;
    max-width: 180px;
    max-height: 120px;
    object-fit: contain;
}

/* Rubrik ---------------------------------------------------------------- */

.nb-result-list .nb-result-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 0 24px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: center !important;
}

.nb-result-list .nb-result-heading h1 {
    width: 100%;
    margin: 0 0 10px;
    padding: 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.15;
    text-align: center !important;
}

.nb-result-list .nb-result-heading p {
    width: 100%;
    margin: 0;
    padding: 0;
    font-size: clamp(1.25rem, 2.25vw, 1.65rem);
    font-weight: 600;
    line-height: 1.3;
    text-align: center !important;
}

/* Faktaruta ------------------------------------------------------------- */

.nb-result-list .nb-result-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: clamp(24px, 4vw, 64px);
    row-gap: 0;
    width: 100%;
    margin: 0 0 24px;
    padding: clamp(22px, 3vw, 34px) clamp(18px, 4vw, 42px);
    border-radius: 8px;
    background-color: #eeeeee;
    text-align: center;
    overflow: hidden;
}

.nb-result-list .nb-result-fact-column {
    min-width: 0;
    text-align: center;
}

.nb-result-list .nb-result-fact {
    min-width: 0;
    margin: 0 0 22px;
    padding: 0;
    border: 0;
    background: transparent;
}

.nb-result-list .nb-result-fact:last-child {
    margin-bottom: 0;
}

.nb-result-list .nb-result-fact h2,
.nb-result-list .nb-result-extra h2,
.nb-result-list .nb-result-sublist h2 {
    margin: 0 0 5px;
    padding: 0;
    color: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.nb-result-list .nb-result-fact h2 {
    text-align: center !important;
}

.nb-result-list .nb-result-fact-value {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 1rem;
    line-height: 1.45;
    text-align: center !important;
}

.nb-result-list .nb-result-extra {
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid var(--nb-table-border);
    background: #fff;
}

.nb-result-list .nb-result-extra p {
    margin: 0;
    padding: 0;
}

/* Knappar – Nordisk Bilsports röda resultatknappar --------------------- */

.nb-result-list .nb-result-actions {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 13px;
    margin: 0 0 18px;
}

.nb-result-list .nb-result-actions .nb-result-button {
    position: relative;
    display: inline-flex;
    min-height: 0;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 10px 26px;
    border: 0;
    border-radius: 5px;
    background-color: var(--nb-button);
    color: #fff;
    font: inherit;
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.nb-result-list .nb-result-actions .nb-result-button:hover,
.nb-result-list .nb-result-actions .nb-result-button:focus-visible {
    background-color: var(--nb-button-hover);
    color: #fff;
    text-decoration: none;
}

.nb-result-list .nb-result-actions .nb-result-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Resultattabeller – scoped version av Oxygen/DCF-stilen --------------- */

.nb-result-list .nb-result-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 1px;
    -webkit-overflow-scrolling: touch;
}

.nb-result-list .nb-result-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    border-spacing: 0;
    background-color: transparent;
    font-family: Arial, Helvetica, sans-serif;
    font-size: .84em;
    line-height: 1.35;
}

.nb-result-list .nb-result-table thead {
    font-size: 1em;
}

.nb-result-list .nb-result-table tbody {
    border-top: 1px solid var(--nb-table-border);
    border-bottom: 1px solid var(--nb-table-border);
}

.nb-result-list .nb-result-table th,
.nb-result-list .nb-result-table td {
    padding: .75em 1em;
    border: 1px solid var(--nb-table-border);
    vertical-align: top;
    text-align: left;
}

.nb-result-list .nb-result-table thead th {
    padding-top: 1.33em;
    padding-bottom: .75em;
    background-color: var(--nb-table-heading);
    color: #fff;
    font-weight: 700;
    vertical-align: bottom;
}

.nb-result-list .nb-result-table tbody tr:nth-of-type(2n) {
    background-color: var(--nb-table-stripe);
}

.nb-result-list .nb-result-table tbody tr:not(:last-child) {
    border-bottom: 1px solid var(--nb-table-border);
}

.nb-result-list .nb-result-table a,
.nb-result-list .nb-result-table a:visited {
    color: darkred !important;
    text-decoration: none !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
}

.nb-result-list .nb-result-table a:hover,
.nb-result-list .nb-result-table a:focus-visible {
    color: #5f0000 !important;
    text-decoration: none !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
}

.nb-result-list .nb-result-sublist {
    margin: 26px 0 0;
}

.nb-result-list .nb-result-timing {
    margin: 22px 0 0;
    text-align: center;
}

/* Meddelanden ---------------------------------------------------------- */

.nb-result-list .nb-result-message,
.nb-result-message {
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 3px;
}

.nb-result-list .nb-result-message--warning,
.nb-result-message--warning {
    border-color: #ffecb5;
    background: #fff3cd;
    color: #664d03;
}

.nb-result-list .nb-result-message--error,
.nb-result-message--error {
    border-color: #f5c2c7;
    background: #f8d7da;
    color: #842029;
}

.nb-print-frame {
    position: fixed;
    left: -10000px;
    top: 0;
    width: 1200px;
    height: 800px;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

/* Surfplatta ----------------------------------------------------------- */

@media only screen and (max-width: 900px) {
    .nb-result-list .nb-result-logos {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nb-result-list .nb-result-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobil – motsvarar Oxygen/DCF-tabellens responsiva läge --------------- */

@media only screen and (max-width: 42.09em) {
    .nb-result-list .nb-result-logos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nb-result-list .nb-result-facts {
        grid-template-columns: 1fr;
    }

    .nb-result-list .nb-result-actions {
        justify-content: stretch;
    }

    .nb-result-list .nb-result-actions .nb-result-button {
        flex: 1 1 100%;
    }

    .nb-result-list .nb-result-table-responsive,
    .nb-result-list .nb-result-table {
        border-width: 0;
    }

    .nb-result-list .nb-result-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .nb-result-list .nb-result-table tbody,
    .nb-result-list .nb-result-table tr {
        display: block;
        width: 100%;
    }

    .nb-result-list .nb-result-table tr {
        margin: 0 0 12px;
        border: 1px solid var(--nb-table-border);
        background: #fff;
    }

    .nb-result-list .nb-result-table td {
        display: grid;
        grid-template-columns: minmax(105px, 1fr) minmax(0, 2fr);
        column-gap: 3.16vw;
        width: 100%;
        padding: .75em 1em;
        border-width: 0 0 1px;
        white-space: normal;
        text-align: left;
    }

    .nb-result-list .nb-result-table td:last-child {
        border-bottom-width: 0;
    }

    .nb-result-list .nb-result-table td::before {
        content: attr(data-label);
        min-width: 0;
        padding-right: 1.78em;
        font-weight: 700;
    }
}
