@charset "UTF-8";
/* ***********************************************************************
 *
 *  File:   custom.css
 *
 *  Descr:  CSS file for "Svět zvířat" bibliography page.
 *
 *  Author: Jomar Hønsi, 2026
 *
 * ************************************************************************/
:root {
    --tooltip-width: 320px;
    --tooltip-bg-color: #d4eedb;
    --tooltip-text-color: #071a76;
    --tooltip-font-size: 0.9em;
}

/* General styles */
h2 {
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 1.2em;
    color: #333;
    text-align: center;
}

a {
    color: #3878b4;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: #00c;
}

p.literature-note {
    font-size: 0.9em;
    color: #555;
    text-align: center;
    margin-bottom: 20px;

    a {
        color: #3878b4;
        font-weight: bold;
        display: inline-block;
        margin-top: 5px;
        background-color: #e0f0d9;
        border: 1px solid #9a9;
        padding: 6px;
    }
}

/* Header styles */
div.credits {
    padding: 0 10px;
    margin: 0 auto;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 0.7em;
    text-align: center;
}

table.animals, table.refs {
    border-radius: 2px;
    text-align: left;
    font-size: 13px;
    margin: 0 auto;
    background-color: #9a9;
    width: 100%;
    margin-bottom: 20px;

    & caption {
        font-weight: bold;
        font-size: 1.5em;
        color: #333;
        padding: 16px 0 16px 0;
    }

    & th {
        background-color: #eae7c9;
        padding: 6px;
    }

    & td {
        background-color: #ebeed5;
        text-align: left;
        padding: 6px;
    }

    & td.signed a {
        color: #127e12;
        font-weight: bold;
        font-size: 1.2em;
    }

    & td.pseudonym a {
        color: #0d470d;
        font-weight: bold;
        font-size: 1.2em;
    }

    & td.certain a {
        color: #137e05;
        font-weight: bold;
        font-size: 1.2em;
    }

    & td.high a {
        font-weight: bold;
    }

    & td.hybrid a {
        font-weight: bold;
        font-size: 1.2em;
        color: rgb(51, 60, 102);
    }

    & td.joke a {
        font-style: italic;
        color: rgb(107, 44, 184);
    }

    & td.joke a::after {
        content: " (1. apríl)";
        color: #a60;
        text-decoration: none;
    }

    & td.reject {
        text-decoration: line-through;
        color: black;

        & a {
            color: #933;
        }
    }

    & td.disputable {
        text-decoration: wavy underline;
        color: #a60;

        & a {
            color: black;
        }
    }
}

table.refs {
    & td:nth-child(2) {
        /* Title column */
        letter-spacing: 1.2px;
    }

    & td:nth-child(5), th:nth-child(5) {
        /* Remark column */
        width: 30%;
    }
}

/* Abbreviated headers: table.animals th cells with both a full and a
   short label; the short form is shown only on narrow screens (see the
   mobile media query below), where it frees up width for the Date
   column. */
table.animals th span.th-short {
    display: none;
}

.tooltip {
    position: relative;
    display: inline-block;
    color: var(--tooltip-text-color);
    border-bottom: 2px dotted var(--tooltip-text-color);
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: var(--tooltip-width);
    background-color: var(--tooltip-bg-color);
    color: var(--tooltip-text-color);
    font-size: var(--tooltip-font-size);
    text-align: center;
    border-radius: 1px;
    border: 1px solid #999;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgb(34, 94, 155);
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin: 0 0 0 calc(var(--tooltip-width) / -2);
    opacity: 0;
    transition: opacity 0.5s;

    & span {
        display: block;
        margin: 4px 0;
    }

    & span:nth-child(1) {
        /* Title */
        font-weight: bold;
        font-size: 1.2em;
        border-bottom: 1px dotted var(--tooltip-text-color);
        padding-bottom: 4px;
    }

    & span:nth-child(3) {
        /* Date */
        font-size: 0.9em;
        color: rgb(76, 45, 5);
    }
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 0.95;
}

span.chapter {
    color: #6e0b0b;
    margin-left: 10px;
}

/* Responsive overrides for narrow screens: both tables use the default
   auto table layout, which sizes columns to their unwrapped content and
   grows wider than the container. Switch to a fixed layout with explicit
   column widths and let long words wrap so the tables fit on mobile. */
@media (max-width: 760px) {
    table.animals,
    table.refs {
        table-layout: fixed;
        font-size: 11px;
    }

    table.animals th,
    table.animals td,
    table.refs th,
    table.refs td {
        padding: 4px;
        overflow-wrap: anywhere;
        vertical-align: top;
    }

    /* Show the abbreviated header labels (Sig., Conf., Refs.) instead of
       the full words, and keep them on one line; the columns below are
       sized with enough room for these short labels. */
    table.animals th span.th-full {
        display: none;
    }

    table.animals th span.th-short {
        display: inline;
    }

    table.animals th {
        white-space: nowrap;
    }

    /* Columns: Title, Date, Signature, Confidence, References, Remark */
    table.animals td:nth-child(1), table.animals th:nth-child(1) {
        width: 18%;
    }

    table.animals td:nth-child(2), table.animals th:nth-child(2) {
        width: 18%;
    }

    table.animals td:nth-child(3), table.animals th:nth-child(3) {
        width: 12%;
    }

    table.animals td:nth-child(4), table.animals th:nth-child(4) {
        width: 14%;
    }

    table.animals td:nth-child(5), table.animals th:nth-child(5) {
        width: 14%;
    }

    table.animals td:nth-child(6), table.animals th:nth-child(6) {
        width: 24%;
    }

    /* Dates are at most 10 characters (e.g. "18.12.1909") and must never
       wrap; a smaller font and tighter horizontal padding than the rest
       of the table keep them on one line within the narrow column width
       used here, without overlapping the adjacent Signature column. */
    table.animals td:nth-child(2) {
        font-size: 9px;
        padding-left: 2px;
        padding-right: 2px;
        white-space: nowrap;
    }

    /* Columns: Abbr., Publication, Author(s), Date, Remark */
    table.refs td:nth-child(1), table.refs th:nth-child(1) {
        width: 10%;
    }

    table.refs td:nth-child(2), table.refs th:nth-child(2) {
        width: 24%;
    }

    table.refs td:nth-child(3), table.refs th:nth-child(3) {
        width: 18%;
    }

    table.refs td:nth-child(4), table.refs th:nth-child(4) {
        width: 18%;
    }

    table.refs td:nth-child(5), table.refs th:nth-child(5) {
        width: 30%;
    }

    /* Same fix as table.animals above: dates up to 10 characters (e.g.
       "27.12.1965") must stay on one line. */
    table.refs td:nth-child(4) {
        font-size: 9px;
        padding-left: 2px;
        padding-right: 2px;
        white-space: nowrap;
    }

    /* The tooltip popup is only ever revealed on :hover, which touch
       screens can't trigger, yet it still gets laid out (visibility:
       hidden, not display: none) at its full fixed width near whichever
       cell anchors it, often pushing the page wider than the viewport.
       Disable it on narrow screens where it can never be used anyway. */
    .tooltip .tooltiptext {
        display: none;
    }

    .tooltip {
        border-bottom: none;
    }
}