/* Print stylesheet for pages generated by Jekyll.
   Loaded from _layouts/default.html with media="print", so it does not
   affect the on-screen look. It only overrides what needs to change on
   paper; bootstrap.css and nucky.css stay untouched. */

@page {
    size: A4;
    margin: 18mm 15mm 18mm 20mm;   /* top, right, bottom, left */

    /* page number; margin boxes are supported by Chromium-based browsers
       (Chrome, Edge) since v131, other browsers ignore them */
    @bottom-center {
        content: "Strana " counter(page) " z " counter(pages);
        font-size: 9pt;
        color: #555;
    }
}

/* --- page basics ------------------------------------------------------ */

html {
    font-size: 11pt;
}

body {
    /* screen CSS sets 1.3em and reserves room for the fixed navbar */
    font-size: 1rem;
    line-height: 1.4;
    padding-top: 0;
    color: #000;
    background: #fff;
}

main {
    overflow: visible;
}

.container {
    max-width: none;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

/* --- elements that make no sense on paper ----------------------------- */

/* the menu comes from the site's own _includes/nav.html, whose markup is not
   part of this theme, so several likely selectors are covered */
body > header,
nav,
[role="navigation"],
.navbar,
.fixed-top,
.sticky-top,
.nav,
.breadcrumb,
.dropdown-menu,
.offcanvas,
#sidenav,
.footer,
iframe,
.video_container,
.embed-responsive {
    display: none !important;
}

/* --- header block ----------------------------------------------------- */

.jumbotron {
    padding: 0 0 0.5rem;
    margin-bottom: 1.5rem;
    background: none;
    border-bottom: 1pt solid #000;
    border-radius: 0;
}

.jumbotron h1,
.display-3 {
    font-size: 24pt;
    font-weight: bold;
}

/* --- headings --------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
    break-after: avoid;
    break-inside: avoid;
}

/* --- text, links ------------------------------------------------------ */

p, li {
    orphans: 3;
    widows: 3;
}

a {
    color: inherit;
    text-decoration: underline;
}

/* show the target of external links, so the printed text is still useful */
main a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444;
    word-break: break-all;
}

/* --- code ------------------------------------------------------------- */

pre,
code {
    font-size: 0.85em;
}

pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 0.5pt solid #999;
    padding: 0.4rem 0.6rem;
    background: #fff;
    break-inside: avoid;
}

pre code {
    background: none;
    /* highlight.js theme sets its own padding/background */
    padding: 0;
}

/* --- images, figures, tables, quotes ---------------------------------- */

img,
figure,
table,
blockquote {
    break-inside: avoid;
}

img {
    max-width: 100% !important;
}

/* obrazky s popiskom by na celu sirku zaberali zbytocne vela miesta */
figure img {
    max-width: 75% !important;
}

/* striped rows are drawn with backgrounds, which browsers drop when printing */
.table,
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg: transparent;
    --bs-table-bg-type: transparent;
    --bs-table-accent-bg: transparent;
    box-shadow: none;
    color: #000;
}

.table th,
.table td {
    border: 0.5pt solid #999;
}

thead {
    display: table-header-group;   /* repeat header on every page */
}

tr {
    break-inside: avoid;
}

main blockquote {
    border-left: 3pt solid #999;
}

/* --- alerts / notes --------------------------------------------------- */

.alert,
[class*="theme-alert-"] {
    background: none !important;
    break-inside: avoid;
    /* keep the coloured left border that identifies the alert type */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.alert {
    border: 0.5pt solid #999;
    border-left-width: 5pt;
}

.alert-success {
    border-left-color: #198754;
}

.alert-warning {
    border-left-color: #f0ad4e;
}
