/* =====================================================================
   mobil.css - kun til telefoner (skærme under 768 px)
   Indlæses SIDST og med media="(max-width: 767.98px)" i funktioner.top.php,
   så PC- og tabletvisningen ikke påvirkes. @media herunder er en ekstra sikring.
   ===================================================================== */
@media (max-width: 767.98px) {

    /* ---------- Generelt layout ---------- */
    .container-BB {
        padding-right: .75rem;
        padding-left: .75rem;
    }

    .borderexample {
        padding: 16px 14px;
    }

    h1 { font-size: 1.6rem; line-height: 1.25; }
    h2 { font-size: 1.35rem; line-height: 1.3; }
    h3 { font-size: 1.2rem; line-height: 1.3; }
    h4 { font-size: 1.1rem; line-height: 1.35; }
    h5 { font-size: 1rem; line-height: 1.4; }

    img,
    video,
    iframe {
        max-width: 100%;
    }

    img {
        height: auto;
    }

    input,
    select,
    textarea {
        max-width: 100%;
    }

    textarea {
        width: 100%;
    }

    /* Knapper: lidt mindre og må gerne bryde linjen */
    .button-md {
        padding: 12px 22px;
        max-width: 100%;
        white-space: normal;
    }

    /* Tabeller: tættere og mindre skrift */
    table td,
    table th {
        padding: .45rem .5rem;
    }

    table {
        font-size: .9rem;
    }

    /* Brede tabeller pakkes ind af js/site.003.js, så de kan scrolles sidelæns */
    .BB-tabel-scroll {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
        background:
            linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)),
            linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) 100% 0,
            linear-gradient(to right, rgba(0, 0, 0, .12), rgba(0, 0, 0, 0)),
            linear-gradient(to left, rgba(0, 0, 0, .12), rgba(0, 0, 0, 0)) 100% 0;
        background-repeat: no-repeat;
        background-size: 30px 100%, 30px 100%, 12px 100%, 12px 100%;
        background-attachment: local, local, scroll, scroll;
    }

    .BB-tabel-scroll > table {
        margin-bottom: 0;
    }

    /* Dialogbokse (KØB / DOWNLOAD) */
    .modal-dialog {
        margin: .5rem;
    }

    .modal-body {
        font-size: .92rem;
    }

    .modal-footer {
        justify-content: center;
    }

    /* Bunden: mindre og mere kompakt */
    footer .section-sm {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    footer .container {
        font-size: .82rem;
        line-height: 1.5;
    }

    footer p {
        margin-bottom: .1rem;
    }

    /* ---------- Søgesiden (index.php) ---------- */
    /* Søgefelterne først, vejledningen bagefter */
    .BB-soeg-panel {
        order: -1;
    }

    .BB-soeg-panel > .container {
        padding-right: 0;
        padding-left: 0;
    }

    .BB-soeg-intro {
        order: 2;
        margin-top: 1.25rem;
        padding-top: 1rem;
        border-top: 1px solid #e3e6e9;
        font-size: .92rem;
    }

    .BB-soeg-intro ol {
        padding-left: 1.2rem;
    }

    .BB-hent {
        gap: 12px;
    }

    .BB-hent .button-md {
        flex-shrink: 0;
        margin: 0 !important;
    }

    /* Filterlinjer: feltvalg i fuld bredde, Medtag/Udeluk og værdi ved siden af hinanden */
    .BB-filter-raekke {
        --bs-gutter-x: .5rem;
        row-gap: .5rem;
        margin-bottom: .9rem;
    }

    .BB-filter-raekke > .col {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .BB-filter-raekke > .col:nth-child(2) {
        flex: 0 0 38%;
        max-width: 38%;
    }

    .BB-filter-raekke > .col:nth-child(3) {
        flex: 0 0 62%;
        max-width: 62%;
    }

    /* Landelinjen har kun ét felt - de to tomme kolonner skjules */
    .BB-filter-land > .col:nth-child(-n+2) {
        display: none;
    }

    .BB-filter-land > .col:nth-child(3) {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .BB-filter-raekke .form-select,
    .BB-filter-raekke .BB--form-input {
        margin-bottom: 0;
    }

    .BB-dato-raekke {
        --bs-gutter-x: .5rem;
    }

    .BB-dato-raekke > .col {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* SØG og NULSTIL ved siden af hinanden, visningsvælger centreret herunder */
    .BB-knap-raekke {
        --bs-gutter-x: .75rem;
    }

    .BB-knap-raekke > .col-auto {
        flex: 1 1 0;
    }

    .BB-knap-raekke > .col-auto .button-md {
        width: 100%;
        margin-right: 0 !important;
    }

    .BB-knap-raekke > .col-auto.ms-auto {
        flex: 0 0 100%;
        display: flex;
        justify-content: center;
        margin-left: 0 !important;
    }

    .BB-soeg h5 {
        font-size: 1rem;
    }

    /* Bladring */
    .center-element {
        width: 100%;
    }

    /* ---------- Listevisning og billedsiden ---------- */
    /* Direkte link + KOPIER + TIL SØGNING */
    .BB-link-raekke {
        flex-wrap: wrap;
        gap: .5rem;
        align-items: center;
    }

    .BB-link-raekke > div {
        width: auto !important;
    }

    .BB-link-raekke > div:empty {
        display: none;
    }

    .BB-link-raekke > div:first-child {
        flex: 1 1 100%;
    }

    .BB-link-raekke > div:not(:first-child) {
        flex: 1 1 0;
    }

    .BB-link-raekke .button-md {
        width: 100%;
        margin: 0 !important;
        padding-left: 12px;
        padding-right: 12px;
    }

    .BB-link-raekke input {
        font-size: 12px !important;
        margin-bottom: 0;
    }

    /* Billedoplysninger: etiket over værdi i stedet for to klemte kolonner */
    .BB-data-tabel,
    .BB-data-tabel tbody,
    .BB-data-tabel tr,
    .BB-data-tabel td {
        display: block;
        width: auto !important;
    }

    .BB-data-tabel tr {
        padding: .45rem 0;
        border-bottom: 1px solid #eef2f6;
    }

    .BB-data-tabel td {
        padding: 0 !important;
        border: 0;
        overflow-wrap: anywhere;
    }

    .BB-data-tabel td:first-child {
        font-size: .75rem;
        font-weight: 700;
        letter-spacing: .03em;
        text-transform: uppercase;
        color: #6B7785;
    }

    /* Knapper i listevisningen: to pr. linje */
    .BB-liste-knapper {
        --bs-gutter-x: .5rem;
    }

    .BB-liste-knapper > .col {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .BB-liste-knapper .button-md {
        width: 100%;
        margin-right: 0 !important;
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Billedsiden: DOWNLOAD / KØB / KRAK - knap over forklaring */
    .BB-handling-tabel,
    .BB-handling-tabel tbody,
    .BB-handling-tabel tr,
    .BB-handling-tabel td {
        display: block;
        width: auto !important;
    }

    .BB-handling-tabel tr {
        padding: .5rem 0 .75rem;
        border-bottom: 1px solid #eef2f6;
    }

    .BB-handling-tabel td {
        padding: 0 !important;
        border: 0;
    }

    .BB-handling-tabel .button-md {
        width: 100%;
        margin: 0 0 .5rem !important;
    }

    .button--secondary {
        width: 100%;
    }
}
