/*
 * Registr subjektů - minimal layout styles.
 * Colors and fonts are inherited from the theme; override the rs-* classes in the theme CSS if needed.
 */

.rs-registr {
    margin: 1em 0;
}

/* Filter form */
.rs-filtr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em 1em;
    margin: 1em 0;
}

.rs-filtr-polozka {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}

.rs-filtr input[type="text"] {
    width: 10em;
    max-width: 100%;
}

.rs-filtr select {
    max-width: 100%;
}

/* Texts */
.rs-aktualizace,
.rs-pocet,
.rs-zpet {
    margin: 0.5em 0;
}

/* Pagination */
.rs-strankovani {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em 0.6em;
    margin: 0.75em 0;
}

.rs-strankovani .rs-neaktivni {
    opacity: 0.5;
}

.rs-strankovani-aktualni {
    font-weight: bold;
}

/* Tables */
.rs-tabulka {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5em 0 1.5em;
}

.rs-tabulka th,
.rs-tabulka td {
    padding: 0.35em 0.6em;
    text-align: left;
    vertical-align: top;
}

.rs-tabulka td {
    overflow-wrap: anywhere;
}

/* Subject list - activities row directly below the subject row */
.rs-tabulka-subjekty .rs-radek-subjekt td {
    padding-bottom: 0;
}

.rs-tabulka-subjekty .rs-radek-cinnosti td {
    padding-top: 0;
}

/* Both rows of a subject share one background (theme row striping would split the subject), striped per subject */
.rs-tabulka-subjekty tbody.rs-subjekt tr,
.rs-tabulka-subjekty tbody.rs-subjekt td {
    background: transparent;
}

.rs-tabulka-subjekty tbody.rs-subjekt:nth-of-type(even) td {
    background: rgba(0, 0, 0, 0.04);
}

.rs-udaje {
    border-collapse: collapse;
    margin: 0.5em 0 1.5em;
}

.rs-udaje th,
.rs-udaje td {
    padding: 0.2em 0.6em 0.2em 0;
    text-align: left;
    vertical-align: top;
    border: none;
}

.rs-udaje th {
    font-weight: normal;
    white-space: nowrap;
}

/* Hallmark images */
.rs-bunka-nahled {
    width: 1%;
    white-space: nowrap;
}

.rs-nahled {
    display: block;
    max-height: 60px;
    width: auto;
    height: auto;
}

.rs-obrazek {
    display: block;
    max-width: 100%;
    height: auto;
}

.rs-eshopy-subjektu {
    margin: 0.5em 0 1.5em;
}

/* Mobile - table rows displayed as cards (label + value) */
@media (max-width: 700px) {
    .rs-tabulka,
    .rs-tabulka tbody,
    .rs-tabulka tr,
    .rs-tabulka td {
        display: block;
        width: 100%;
    }

    .rs-tabulka thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .rs-tabulka tr {
        margin-bottom: 1em;
        border: 1px solid rgba(0, 0, 0, 0.15);
        border-radius: 4px;
        padding: 0.4em 0;
    }

    .rs-tabulka td {
        display: flex;
        gap: 0.75em;
        border: none;
    }

    .rs-tabulka td::before {
        content: attr(data-label);
        flex: 0 0 40%;
        font-weight: bold;
    }

    .rs-bunka-nahled {
        white-space: normal;
    }

    /* Subject list - one card per subject (both rows) */
    .rs-tabulka-subjekty tbody.rs-subjekt {
        margin-bottom: 1em;
        border: 1px solid rgba(0, 0, 0, 0.15);
        border-radius: 4px;
        padding: 0.4em 0;
    }

    .rs-tabulka-subjekty tr,
    .rs-tabulka-subjekty tr.rs-radek-subjekt td,
    .rs-tabulka-subjekty tr.rs-radek-cinnosti td {
        margin: 0;
        border: none;
        border-radius: 0;
        padding: 0.35em 0.6em;
    }

    .rs-tabulka-subjekty .rs-bunka-prazdna {
        display: none;
    }

    .rs-filtr-polozka {
        display: flex;
        width: 100%;
    }

    .rs-filtr-polozka label {
        flex: 0 0 5em;
    }

    .rs-filtr input[type="text"],
    .rs-filtr select {
        flex: 1 1 auto;
        width: auto;
    }
}
