@charset "UTF-8";
/* ***********************************************************************
 *
 *  File:   common.css
 *
 *  Descr:  Common styles for the Švejk/Hašek database section.
 *          (Merged from common.css and custom.css.)
 *
 *  Author: Jomar Hønsi, 2021-2026
 *
 * ************************************************************************/

:root {
    --text-color: #333;
    --bg-color: #eec;
    --main-font: 'Inter', system-ui, Verdana, sans-serif;
    --content-width: 960px;
    --bg-body: #4b5320;
    --bg-body-light: #c1ca9b;
}

/*
* Generic style overrides
*/
body {
    font-size: 16px;
    line-height: 1.6;
    font-family: var(--main-font);
    color: var(--text-color);
    padding: 0;
    margin: 0;
    background: linear-gradient(to right, var(--bg-body), var(--bg-body-light), var(--bg-body));
}

h1 {
    text-align: center;
    clear: both;
    padding: 0 0 0.3em;
    margin: 1em 16px 16px;
    font-size: 1.6em;
}

h2 {
    font-size: 1.4em;
    border-bottom: 2px solid #8a6d3b;
    padding: 10px;
    margin-top: 1em;
    background: #fff;
    text-align: center;
}

h2.sub-header {
    font-size: 1.1em;
    padding: 8px;
    margin-top: 1em;
    text-align: center;
    background: transparent;
    border-bottom: 0;
}

a, a:hover, a:visited {
    text-decoration: none;
    color: #4e7a3a;
}

p {
    margin: 0 0 15px 0;
    padding: 0;
    text-align: justify;
}

em {
    color: #4a3b2a;
}

/* 
* Application specific styles
*/
div.main {
    margin: 0 auto;
    border: 1px solid #666;
    max-width: var(--content-width);
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    background-color: var(--bg-color);
    box-shadow: inset 0 0 20px #666;
    font-size: 1.2em;
}

/* Page header, rendered by renderPageHeaderTable() in common.php: home button, title, menu button. */
table.header {
    --button-size: 42px;
    --icon-size: 48px;
    font-family: "Times New Roman", serif;
    /* Matches quirks mode, which doesn't inherit font-size into tables, so pages with and without a doctype look alike. */
    font-size: medium;
    background-color: #ccb;
    border: 2px solid #ccc;
    box-shadow: inset 0 0 10px #666;
    border-radius: 5px;
    margin-bottom: 1.2em;
    width: 100%;
    table-layout: fixed;

    & td {
        padding: 18px;
        vertical-align: middle;
    }

    & td:first-child,
    & td:last-child {
        width: 20%;
    }

    & td:nth-of-type(2) {
        text-align: center;
        font-size: 2.2em;
        font-weight: bold;
        line-height: 1.15;
    }

    & h1 {
        margin: 0;
        padding: 0;
        font: inherit;
        clear: none;
    }

    /* Explicit size and line-height keep the buttons identical in quirks and standards mode. */
    & td:first-child a,
    & .nav-menu summary {
        box-sizing: border-box;
        width: var(--button-size);
        height: var(--button-size);
        background-color: #eed;
        border-radius: 3px;
        color: #003;
        cursor: pointer;
    }

    & td:first-child a:hover,
    & .nav-menu summary:hover,
    & .nav-menu[open] summary {
        background-color: #eee;
    }

    & td:first-child a {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25em;
        line-height: 1;
        text-decoration: none;
        background: none;
        width: var(--icon-size);
        height: var(--icon-size);
    }

    & td:first-child a:hover {
        background: none;
        filter: brightness(1.15);
    }

    & td:first-child a img {
        display: block;
        width: 100%;
        height: 100%;
    }
}

.title-short {
    display: none;
}

/* Dropdown with links to all database pages. */
.nav-menu {
    position: relative;
    /* A block rather than an inline-block avoids a line box around the button, which differs between quirks and standards mode. */
    width: var(--button-size);
    margin-left: auto;

    & summary {
        display: block;
        padding: 20px 11px;
        list-style: none;
    }

    & summary::-webkit-details-marker {
        display: none;
    }

    & summary::before {
        content: "";
        display: block;
        width: 20px;
        height: 2px;
        background: currentColor;
        box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
    }

    & nav {
        position: absolute;
        top: calc(100% + 6px);
        right: 0;
        z-index: 10;
        width: max-content;
        max-width: min(24em, calc(100vw - 60px));
        padding: 0.3em 0;
        background: #fffdf7;
        border: 1px solid #c9b98f;
        border-radius: 5px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
        font-family: var(--main-font);
        font-size: 1rem;
        font-weight: normal;
        line-height: 1.3;
        white-space: normal;
    }

    & .nav-section + .nav-section {
        margin-top: 0.3em;
        padding-top: 0.3em;
        border-top: 1px solid #e2d8bf;
    }

    & .nav-group {
        display: block;
        padding: 0.3em 0.9em 0.1em;
        font-size: 0.8em;
        font-weight: bold;
        color: #5a4522;
    }

    & ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    & nav a {
        display: block;
        padding: 0.45em 0.9em;
        color: #003;
    }

    & nav a:hover,
    & nav a:focus-visible {
        background: #ece0c4;
        color: darkred;
    }

    & nav a[aria-current="page"] {
        font-weight: bold;
        background: #f1e9d8;
    }
}

/* No room for fixed side columns: the title takes all the space between the two buttons. */
@media (max-width: 920px) {
    table.header {
        table-layout: auto;

        & td:first-child,
        & td:last-child {
            width: auto;
            white-space: nowrap;
        }
    }
}

@media (max-width: 760px) {
    .title-full {
        display: none;
    }

    .title-short {
        display: inline;
    }
}

@media (max-width: 700px) {
    table.header {
        --button-size: 32px;
        --icon-size: 36px;

        & td {
            padding: 4px;
        }

        & td:first-child a {
            font-size: 1em;
        }

        /* Grows with the width up to the 2.2em used from 482px, so the title stays on one line between the buttons. */
        & td:nth-of-type(2) {
            font-size: min(2.2em, calc(10vw - 13px));
        }
    }

    .nav-menu summary {
        padding: 15px 9px;
    }

    .nav-menu summary::before {
        width: 14px;
        box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 15px;
    }

    div.main {
        padding: 12px;
        border-radius: 0;
        font-size: 1.05em;
    }
}

p.intro {
    margin: 1em;
    font-size: 0.85em;
    color: #666;
}

div.intro-centered {
    margin: 0 auto;
    font-size: 0.85em;
    color: #666;
    text-align: center;

    & p {
        text-align: center;
    }
}

p.credits {
    margin: 1em;
    font-size: 0.75em;
    color: #666;
}

p.chart-intro {
    font-size: 0.9em;
    color: #333;
    margin: 0;
    padding: 10px;
}

/* Styled like the default Highcharts "Reset zoom" button */
.button-reset-zoom {
    display: inline-block;
    padding: 5px 8px;
    font-size: 0.7em;
    font-family: var(--main-font);
    color: #333333;
    background: #f7f7f7;
    border: 1px solid #cccccc;
    border-radius: 3px;
    text-decoration: none;
    cursor: default;
}

.button-reset-zoom:hover {
    background: #e6e6e6;
    color: #333333;
}

.chart-wrapper {
    position: relative;
}

#chart-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5em;
    margin: 0.1em 0 0.5em 0;
    padding: 2px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.06) 50%, transparent);
}

#chart-nav p {
    margin: 0;
}

#back-to-years {
    order: 2;
}

/* Collapses the wrapper so prev/next links join #chart-nav's flex order */
#year-nav,
#month-nav {
    display: contents;
}

#prev-year,
#prev-month {
    order: 1;
}

#next-year,
#next-month {
    order: 3;
}

/* Per-year collapsible bibliography sections, comenius_bib.php */
details.year {
    border: 1px solid #d8cdb8;
    border-radius: 4px;
    margin-bottom: 0.5em;
    background: #fff;
}

details.year>summary {
    cursor: pointer;
    list-style: none;
    padding: 0.5em 0.8em;
    font-weight: bold;
    background: #f1e9d8;
    display: flex;
    align-items: baseline;
    gap: 0.6em;
}

details.year>summary::-webkit-details-marker {
    display: none;
}

details.year>summary::before {
    content: "▸";
    display: inline-block;
    width: 1em;
    transition: transform 0.15s ease-in-out;
}

details.year[open]>summary::before {
    transform: rotate(90deg);
}

/* The graphical overview section stands out slightly from the per-year/publication/signature groups below it */
details.year[data-year="chart"] {
    border-width: 2px;
    border-color: #8a6d3b;
    color: black;
    text-shadow: white 1px 1px 0px;
}

details.year[data-year="chart"]>summary {
    font-size: 1.1em;
}

.year-label {
    font-size: 1.1em;
    color: #5a4522;
}

.story-count {
    font-size: 0.8em;
    color: #8a7a5a;
    font-weight: normal;
}

ol.stories {
    margin: 0;
    padding: 0.6em 1.2em 0.8em 2.2em;
}

li.story {
    margin-bottom: 0.6em;
    line-height: 1.4;
    padding-right: 10px;
}

li.story::after {
    content: "";
    display: block;
    clear: both;
}

/* Floated (not absolutely positioned) so long titles wrap beside the signature instead of under it. */
.signature {
    float: right;
    max-width: 35%;
    margin-left: 1em;
    text-align: right;
    font-size: 0.85em;
    font-style: italic;
    color: #8a7a5a;
}

.note {
    margin: 0.4em;
    display: block;
    font-size: 0.8em;
    color: #777;
}

.story-title {
    font-weight: bold;
}

.pl {
    font-size: 0.8em;
    color: #999;
    margin-left: 0.4em;
}

.bib-ref {
    font-size: 0.7em;
    color: #999;
    margin-left: 0.4em;
}

.pub {
    display: block;
    font-size: 0.92em;
    color: #444;
    margin-left: 0.2em;
}

.pub em {
    font-style: italic;
}

.pub .date {
    color: #8a7a5a;
    margin-left: 0.4em;
}

span.date {
    letter-spacing: 1.5px;
    color: #4a6b4a;
}

a.online {
    font-size: 0.85em;
    margin-left: 0.4em;
    color: #5a7a3a;
    text-decoration: none;
    border-bottom: 1px dotted #8a6d3b;
}

a.online:hover {
    color: #5a4522;
}

/* Duplicate entry marker, museum.php */
.dup-note {
    font-size: 0.8em;
    color: #222;
}

.total-count {
    font-weight: normal;
    font-size: 0.8em;
    padding: 0.5em 0.8em;
    text-align: center;

    & strong {
        color: darkgreen;
        background: #f0fff0;
        letter-spacing: 1.5px;
        padding: 2px;
        border-bottom: 1px dotted darkred;
        transition: color 0.3s ease, background-color 0.3s ease;
    }

    & strong.count-pulse {
        color: darkred;
        background: #fff0c2;
    }
}

.filter-row {
    font-size: 0.85em;
    color: #5a4522;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.5em;
}

.filter-label {
    font-size: 0.75em;
    color: #195548;
}

.filter-row label {
    margin-right: 1em;
    cursor: pointer;
}

.sort-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    margin: 0.5em 0 0.8em;
    font-size: 0.92em;
    color: #5a4522;
}

.sort-control select {
    font: inherit;
    color: inherit;
    background: #fff;
    border: 1px solid #d8cdb8;
    border-radius: 4px;
    padding: 0.2em 0.5em;
}

/* Portal page index cards, index.php */
.index-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1em;
    margin-top: 1em;
}

.index-card {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border: 2px solid #d8cdb8;
    border-radius: 5px;
    background: linear-gradient(to bottom, #fff, #f1e9d8);
    padding: 0 1.5em 1.2em;
    color: inherit;
    text-decoration: none;
    box-shadow: inset 0 0 6px rgba(102, 102, 102, 0.3), 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: background 0.15s ease-in-out, transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.index-card:hover,
.index-card:focus-visible {
    background: linear-gradient(to bottom, #fffdf7, #ece0c4);
    box-shadow: inset 0 0 6px rgba(102, 102, 102, 0.3), 0 4px 10px rgba(0, 0, 0, 0.18);
}

.index-card:focus-visible {
    outline: 3px solid #8a6d3b;
    outline-offset: 2px;
}

/* The lift is limited to devices that really hover (touch browsers keep :hover after a tap) and to users who accept motion. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .index-card:hover,
    .index-card:focus-visible {
        transform: translateY(-2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .index-card {
        transition: none;
    }
}

.index-card.featured {
    border-color: #8a6d3b;
    padding-bottom: 2.2em;
}

.index-card-badge {
    position: absolute;
    left: 1em;
    bottom: 0.55em;
    padding: 0.1em 0.8em;
    font-size: 0.75em;
    font-weight: 600;
    color: #fff;
    background: #8a6d3b;
    border-radius: 1em;
}

.index-card-name {
    font-size: 1.15em;
    font-weight: 600;
    border-bottom: none;
    padding: 0;
    margin: 0 0 0.2em;
    background: none;
    text-align: center;
    color: #5a4522;
}

.index-card:hover .index-card-name,
.index-card:focus-visible .index-card-name {
    color: darkred;
}

.index-card-descr {
    margin: 0 0 0.15em;
    font-size: 0.8em;
    color: #444;
    font-style: italic;
}

.index-card-count {
    margin: 0.4em 0 0;
    font-size: 0.85em;
    font-weight: 600;
    color: #5a4522;
}

/* Shown first, as a banner across the card top; the negative margin cancels the card's side padding (2em of this 0.75em text = 1.5em). */
.index-card-source {
    order: -1;
    margin: 0 -2em 1.2em;
    padding: 0.5em 1.2em;
    font-size: 0.75em;
    color: #6b5f4a;
    background: rgba(138, 109, 59, 0.1);
    border-bottom: 1px solid #e2d8c2;
    text-align: center;
}

.index-card-source em {
    color: #5a4522;
}