/*
 * The blog (/blog, /blog/<slug>): the list of the articles as cards and the page of an article. The page is an information page (.info-page), so the
 * title and the lead are those of the others; here is what is only on the blog. The colour of an article (BlogAccent) is set in --blog-accent (text and
 * lines), --blog-fill (a solid background that carries white text) and --blog-soft (a pale background); the dark theme has its own set of them.
 * The dark theme is at the end.
 */

/* ---- the palette of an article ---- */
.blog-card,
.blog-page,
.blog-others,
.blog-editor-content {
    --blog-accent: var(--brand);
    --blog-fill: var(--brand-fill, #2f5fa8);
    --blog-soft: var(--soft-blue, #e3ecfa);
}

/* the same palette colours a frame in the text (data-tone, see BlogBody and the editor), the grey is only for the frames */
.blog-accent-red, [data-tone="red"] { --blog-accent: #b3203a; --blog-fill: #c8283b; --blog-soft: #fceaed; }
.blog-accent-amber, [data-tone="amber"] { --blog-accent: #8a5a00; --blog-fill: #a36a00; --blog-soft: #fff2cf; }
.blog-accent-green, [data-tone="green"] { --blog-accent: #17683f; --blog-fill: #1d7a4a; --blog-soft: #e3f3ea; }
.blog-accent-teal, [data-tone="teal"] { --blog-accent: #0b6b64; --blog-fill: #0f766e; --blog-soft: #ddf2ef; }
.blog-accent-blue, [data-tone="blue"] { --blog-accent: #1c56a3; --blog-fill: #1f5fae; --blog-soft: #e3edfb; }
.blog-accent-violet, [data-tone="violet"] { --blog-accent: #61389f; --blog-fill: #6d3fb2; --blog-soft: #eee7f9; }
.blog-accent-gray, [data-tone="gray"] { --blog-accent: #3d4b5c; --blog-fill: #5a6b80; --blog-soft: #eceff3; }

/* ---- what the list and the page have in common ---- */
.blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .9rem;
    align-items: center;
    margin: 0 0 .35rem;
    color: #5a6878;
    font-size: .9rem;
}

.blog-topic {
    color: var(--blog-accent);
    font-weight: 700;
}

.blog-meta .blog-topic + .blog-topic {
    margin-left: -.25rem;
}

.blog-reading {
    white-space: nowrap;
}

/* ---- the list: the cards are equally high, the first article is bigger ---- */
.info-page.blog-wide {
    max-width: 72rem;
}

.blog-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1.25rem;
}

.blog-filter[hidden],
.blog-empty[hidden] {
    display: none;
}

.blog-chip {
    padding: .35rem .95rem;
    background: #e6ebf2;
    border: 1px solid #cfd8e3;
    border-radius: 999px;
    color: #2d3b4b;
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
}

.blog-chip:hover,
.blog-chip:focus {
    background: #d6dfeb;
}

.blog-chip.is-active {
    background: var(--brand-fill, #2f5fa8);
    border-color: var(--brand-fill, #2f5fa8);
    color: #fff;
}

.blog-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    margin: 1.25rem 0 2rem;
}

@media (min-width: 640px) {
    .blog-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .blog-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dedcd6;
    border-radius: 14px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.blog-card[hidden] {
    display: none;
}

.blog-card:hover,
.blog-card:focus-within {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(20, 40, 70, .13);
}

.blog-card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--blog-soft);
}

/* the picture lies in the box as a layer, so it fills the box to the edge whatever way the box gets its size (the aspect ratio of a card, the height of the big one beside the text) */
.blog-card-media img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.blog-card:hover .blog-card-media img {
    transform: scale(1.04);
}

.blog-card-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--blog-accent);
    font-size: 3.2rem;
}

.blog-card-topic {
    position: absolute;
    left: .8rem;
    bottom: .8rem;
    padding: .2rem .7rem;
    background: var(--blog-fill);
    border-radius: 999px;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
}

.blog-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1rem 1.2rem 1.2rem;
}

.blog-card .blog-meta {
    margin-bottom: .45rem;
}

.blog-card-title {
    margin: 0 0 .5rem;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.25;
}

/* the whole card is the link to the article */
.blog-card-title a {
    color: #1f2d3d;
}

.blog-card-title a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.blog-card-title a:hover {
    color: var(--blog-accent);
    text-decoration: none;
}

/* the perex is cut at the same height in every card and fades away at its end */
.blog-card-text {
    height: 4.9em;
    margin: 0 0 1rem;
    overflow: hidden;
    color: #3d4b5c;
    line-height: 1.5;
    -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
}

.blog-card-more {
    align-self: flex-start;
    margin-top: auto;
    padding: .45rem 1.1rem;
    background: var(--blog-fill);
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    transition: padding .18s ease;
}

.blog-card:hover .blog-card-more {
    padding-right: 1.4rem;
}

@media (min-width: 992px) {
    .blog-card--featured {
        grid-column: 1 / -1;
        flex-direction: row;
    }

    .blog-card--featured .blog-card-media {
        flex: 0 0 56%;
        aspect-ratio: auto;
        min-height: 20rem;
    }

    .blog-card--featured .blog-card-body {
        justify-content: center;
        padding: 2rem 2.25rem;
    }

    .blog-card--featured .blog-card-title {
        font-size: 1.9rem;
    }

    .blog-card--featured .blog-card-text {
        height: auto;
        max-height: 8em;
        font-size: 1.05rem;
    }

    .blog-card--featured .blog-card-more {
        margin-top: .5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blog-card,
    .blog-card-media img,
    .blog-card-more {
        transition: none;
    }

    .blog-card:hover,
    .blog-card:focus-within {
        transform: none;
    }

    .blog-card:hover .blog-card-media img {
        transform: none;
    }
}

/* ---- the page of an article ---- */
.info-page.blog-page {
    max-width: 62rem;
}

.blog-head {
    max-width: 48rem;
    margin: 0 0 1.25rem;
}

/* the strip under the lead: the day, the reading time and the topics */
.blog-strip {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.1rem;
    align-items: center;
    margin: 1.1rem 0 0;
    padding: .6rem 0;
    border-top: 1px solid #e1e7ee;
    border-bottom: 1px solid #e1e7ee;
    color: #5a6878;
    font-size: .9rem;
}

.blog-strip .bi-tag {
    color: var(--blog-accent);
}

/* the way to the editor, for the administrator only: at the end of the strip, quiet (the colour of the article on its soft background) */
.blog-edit-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-left: auto;
    padding: .1rem .65rem;
    background: var(--blog-soft);
    border-radius: 999px;
    color: var(--blog-accent);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
}

.blog-edit-link:hover,
.blog-edit-link:focus-visible {
    color: var(--blog-accent);
    text-decoration: underline;
}

/* on a phone the crumbs are only the way back, "‹ Blog": the name of the article is the heading right under them */
@media (max-width: 575px) {
    .crumbs--back li:not(:nth-last-child(2)) {
        display: none;
    }

    .crumbs--back li:nth-last-child(2)::before {
        content: "‹";
        margin-right: .25rem;
    }
}

.blog-title {
    margin: 0 0 .6rem;
    color: #1f2d3d;
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.15;
}

.blog-lead {
    margin: 0;
    color: #3d4b5c;
    font-size: 1.25rem;
    line-height: 1.5;
}

.blog-cover {
    margin: 0 0 1.75rem;
}

.blog-cover img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 30rem;
    object-fit: cover;
    border-radius: 14px;
}

/* the layout of the reading: the bar on top, the contents on the left (a wide screen), the text */
.blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 2.5rem;
}

.blog-layout > .blog-bar {
    grid-column: 1 / -1;
}

.blog-layout > .blog-main {
    min-width: 0;
    max-width: 46rem;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 1100px) {
    .blog-layout:not(.blog-layout--plain) {
        grid-template-columns: 13rem minmax(0, 46rem);
        justify-content: center;
    }

    .blog-layout:not(.blog-layout--plain) > .blog-main {
        margin: 0;
    }
}

/* the bar: it sticks under the header of the site (the script puts the height of the header into --blog-sticky-top) and tells where the reader is */
.blog-bar {
    position: sticky;
    top: calc(var(--blog-sticky-top, 0px) + .5rem);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0 0 1.5rem;
    padding: .6rem .9rem .75rem;
    background: #fff;
    border: 1px solid #dedcd6;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(20, 40, 70, .08);
}

.blog-bar[hidden] {
    display: none;
}

.blog-bar-contents,
.blog-bar-share,
.blog-bar-settings,
.blog-bar-exit {
    flex: none;
    padding: .25rem .7rem;
    background: var(--blog-soft);
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--blog-accent);
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
}

.blog-bar-contents:hover,
.blog-bar-share:hover,
.blog-bar-settings:hover,
.blog-bar-exit:hover,
.blog-bar-contents[aria-expanded="true"],
.blog-bar-settings[aria-expanded="true"] {
    border-color: var(--blog-accent);
}

.blog-bar-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: #1f2d3d;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blog-bar-remaining {
    flex: none;
    color: #5a6878;
    font-size: .88rem;
    white-space: nowrap;
}

.blog-bar-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 5px;
    overflow: hidden;
    background: #e6e3dc;
    border-radius: 0 0 12px 12px;
}

.blog-bar-fill {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--blog-accent);
    transform: scaleX(0);
    transform-origin: left;
}

/* the contents in the bar for a narrow screen: a list under the bar */
.blog-bar-menu {
    position: absolute;
    top: calc(100% + .4rem);
    right: 0;
    left: 0;
    max-height: 60vh;
    margin: 0;
    padding: .4rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dedcd6;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(20, 40, 70, .18);
    list-style: none;
}

.blog-bar-menu[hidden] {
    display: none;
}

.blog-bar-menu a {
    display: block;
    padding: .5rem .7rem;
    border-radius: 8px;
    color: #3d4b5c;
    font-weight: 600;
}

.blog-bar-menu a:hover {
    background: var(--blog-soft);
    text-decoration: none;
}

.blog-bar-menu li.is-current a {
    background: var(--blog-soft);
    color: var(--blog-accent);
    font-weight: 800;
}

.blog-bar-menu li.is-done a {
    color: #1f2d3d;
}

@media (max-width: 575px) {
    .blog-bar-remaining {
        display: none;
    }
}

/* the contents at the side: the sections the reader has passed are coloured, the one he is in is bold, the rest is grey */
.blog-toc {
    display: none;
}

@media (min-width: 1100px) {
    .blog-toc {
        position: sticky;
        top: calc(var(--blog-sticky-top, 0px) + 5rem);
        display: block;
        align-self: start;
        max-height: calc(100vh - var(--blog-sticky-top, 0px) - 6rem);
        overflow-y: auto;
    }

    .blog-bar-contents {
        display: none;
    }
}

.blog-toc-title {
    margin: 0 0 .6rem;
    color: #5a6878;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.blog-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-toc li {
    position: relative;
    padding: .4rem 0 .4rem 1rem;
    font-size: .92rem;
    line-height: 1.3;
}

.blog-toc li::before {
    content: "";
    position: absolute;
    top: .1rem;
    bottom: .1rem;
    left: 0;
    width: 4px;
    background: #d9d6ce;
    border-radius: 2px;
    transition: background-color .25s ease;
}

.blog-toc li.is-done::before,
.blog-toc li.is-current::before {
    background: var(--blog-accent);
}

.blog-toc a {
    color: #7b8794;
    transition: color .25s ease;
}

.blog-toc li.is-done a {
    color: #3d4b5c;
}

.blog-toc li.is-current a {
    color: var(--blog-accent);
    font-weight: 800;
}

.blog-toc a:hover {
    color: var(--blog-accent);
    text-decoration: none;
}

/* the summary: three points for the one who only scans */
.blog-summary {
    margin: 0 0 1.75rem;
    padding: 1rem 1.25rem 1.1rem;
    background: var(--blog-soft);
    border-left: 5px solid var(--blog-accent);
    border-radius: 0 12px 12px 0;
}

.blog-summary-title {
    margin: 0 0 .5rem;
    color: var(--blog-accent);
    font-size: .85rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.blog-summary ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-summary li {
    position: relative;
    margin: .35rem 0;
    padding-left: 1.7rem;
    line-height: 1.5;
}

.blog-summary li .bi {
    position: absolute;
    left: 0;
    top: .1rem;
    color: var(--blog-accent);
    font-weight: 800;
}

/* the text of an article: a comfortable measure and rhythm for reading */
.blog-body {
    /* the text holds what floats in it (a picture at the left or the right as the last thing of the text would otherwise stick out of it, over the blocks under it) */
    display: flow-root;
    font-size: var(--blog-text-size, 1.12rem);
    line-height: 1.75;
}

.blog-body h2 {
    margin: 2.25rem 0 .75rem;
    color: var(--blog-accent);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.25;
    scroll-margin-top: calc(var(--blog-sticky-top, 0px) + 5rem);
}

/* the small grey icon at the end of a heading that copies the address of the section (js/blog-anchors.js); only where there is a mouse to point with */
.blog-anchor {
    display: none;
    position: relative;
    margin: 0 0 0 .35rem;
    padding: 0 .2rem;
    background: none;
    border: 0;
    color: #8a96a3;
    font-size: .8em;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
}

@media (hover: hover) {
    .blog-anchor {
        display: inline-block;
        opacity: 0;
        transition: opacity .15s ease;
    }

    .blog-body h2:hover .blog-anchor,
    .blog-anchor:focus-visible,
    .blog-anchor.is-done {
        opacity: 1;
    }

    .blog-anchor:hover {
        color: var(--blog-accent);
    }
}

/* the answer ("Odkaz zkopírován") right of the icon */
.blog-anchor.is-done::after {
    content: attr(data-note);
    margin-left: .35rem;
    color: #5a6878;
    font-size: .6em;
    font-weight: 700;
    vertical-align: middle;
    white-space: nowrap;
}

.blog-body h3 {
    margin: 1.5rem 0 .5rem;
    color: var(--blog-accent);
    font-size: 1.2rem;
    font-weight: 800;
}

.blog-body a {
    color: var(--blog-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.blog-body p,
.blog-body ul,
.blog-body ol {
    margin-bottom: 1.15rem;
}

/* the browser avoids a short last line and a line broken in an ugly place, where it can */
.blog-body p,
.blog-body li {
    text-wrap: pretty;
}

.blog-body blockquote {
    margin: 1.25rem 0;
    padding: .6rem 1rem;
    border-left: 4px solid var(--yellow);
    background: var(--yellow-light);
}

.blog-body table {
    width: 100%;
    margin-bottom: 1.25rem;
    border-collapse: collapse;
    font-size: .98rem;
}

.blog-body th,
.blog-body td {
    padding: .45rem .6rem;
    border: 1px solid #dedcd6;
    text-align: left;
}

.blog-body th {
    background: #f3f1ec;
}

.blog-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.25rem auto;
    border-radius: 8px;
}

/* the frames in the text: a sentence the reader must not miss, and a block on its own background (a title and a list, a table of prices, a note) */
.blog-body [data-blog-box] {
    position: relative;
    clear: both;
    margin: 2rem 0;
    color: #1f2d3d;
    background: var(--blog-soft);
    border-radius: 14px;
}

.blog-body [data-blog-box] > :first-child {
    margin-top: 0;
}

.blog-body [data-blog-box] > :last-child {
    margin-bottom: 0;
}

.blog-body [data-blog-box="quote"] {
    padding: 1.2rem 1.5rem 1.2rem 4.25rem;
    border-left: 6px solid var(--blog-accent);
    border-radius: 0 14px 14px 0;
}

.blog-body [data-blog-box="quote"]::before {
    content: "\201E";
    position: absolute;
    top: .1rem;
    left: 1rem;
    color: var(--blog-accent);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    opacity: .55;
}

.blog-body [data-blog-box="quote"] p {
    color: var(--blog-accent);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.35;
    text-wrap: balance;
}

.blog-body [data-blog-box="info"] {
    padding: 1.1rem 1.4rem;
    border: 2px solid var(--blog-accent);
}

.blog-body [data-blog-box="info"] h2,
.blog-body [data-blog-box="info"] h3 {
    margin: 0 0 .6rem;
    color: var(--blog-accent);
    font-size: 1.25rem;
}

.blog-body [data-blog-box="info"] table {
    margin-bottom: 0;
    background: #fff;
}

.blog-body [data-blog-box="info"] ul,
.blog-body [data-blog-box="info"] ol {
    padding-left: 1.4rem;
}

@media (max-width: 575px) {
    .blog-body [data-blog-box="quote"] {
        padding: 1rem 1rem 1rem 3.25rem;
    }

    .blog-body [data-blog-box="quote"]::before {
        left: .65rem;
        font-size: 3.5rem;
    }

    .blog-body [data-blog-box="quote"] p {
        font-size: 1.25rem;
    }
}

/* the tips of a page of tips put into the text by the administrator */
.blog-inline-tips {
    margin: 2rem 0;
    padding: 1rem;
    background: #f3f1ec;
    border-radius: 10px;
}

.blog-inline-tips-title {
    margin: 0 0 .75rem;
    color: var(--blog-accent);
    font-size: 1.15rem;
    font-weight: 800;
}

/* sharing */
.blog-share-block {
    margin: 2rem 0 0;
    padding: 1.1rem 1.25rem;
    background: var(--blog-soft);
    border-radius: 12px;
}

.blog-share-title {
    margin: 0 0 .7rem;
    color: var(--blog-accent);
    font-size: 1.1rem;
    font-weight: 800;
}

.blog-share {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.blog-share-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .95rem;
    background: #fff;
    border: 1px solid #cfd8e3;
    border-radius: 999px;
    color: #2d3b4b;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
}

.blog-share-btn:hover,
.blog-share-btn:focus {
    border-color: var(--blog-accent);
    color: var(--blog-accent);
    text-decoration: none;
}

.blog-share-btn[hidden] {
    display: none;
}

.blog-sources {
    margin: 2rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid #dedcd6;
    font-size: .92rem;
    color: #5a6878;
}

.blog-sources h2 {
    margin: 0 0 .5rem;
    font-size: 1.05rem;
    font-weight: 800;
}

/* the long list is folded (js/blog-sources.js): the first line is clear, the second is half transparent; height 3.5em (two lines) is the one the script measures */
.blog-sources-text.is-folded {
    max-height: 3.5em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 45%, rgba(0, 0, 0, .2) 100%);
    mask-image: linear-gradient(to bottom, #000 45%, rgba(0, 0, 0, .2) 100%);
}

.blog-sources-text .blog-body > :first-child {
    margin-top: 0;
}

.blog-sources-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .6rem;
    padding: .3rem .9rem;
    background: #e7e5df;
    border: 0;
    border-radius: 999px;
    color: #2d3b4b;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
}

.blog-sources-toggle:hover,
.blog-sources-toggle:focus-visible {
    background: #dcd9d1;
}

.blog-sources-toggle[hidden] {
    display: none;
}

.blog-tips,
.blog-others {
    margin: 2.75rem 0 0;
}

/* the other articles: a row of cards, on a phone a row that is swiped */
@media (max-width: 639px) {
    .blog-list--others {
        display: flex;
        gap: 1rem;
        margin-right: -1rem;
        margin-left: -1rem;
        padding: .25rem 1rem 1rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }

    .blog-list--others .blog-card {
        flex: 0 0 82%;
        scroll-snap-align: center;
    }
}

@media (max-width: 575px) {
    .blog-title {
        font-size: 1.8rem;
    }

    .blog-lead {
        font-size: 1.1rem;
    }

    .blog-body table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }
}

/* ---- the dark theme ---- */
html[data-theme="dark"] .blog-card,
html[data-theme="dark"] .blog-page,
html[data-theme="dark"] .blog-others,
html[data-theme="dark"] .blog-editor-content {
    --blog-accent: var(--brand);
    --blog-fill: var(--brand-fill);
    --blog-soft: #1f2d44;
}

html[data-theme="dark"] .blog-accent-red, html[data-theme="dark"] [data-tone="red"] { --blog-accent: #ff9aa8; --blog-fill: #b3283e; --blog-soft: #3a1f27; }
html[data-theme="dark"] .blog-accent-amber, html[data-theme="dark"] [data-tone="amber"] { --blog-accent: #f2c566; --blog-fill: #8a5f0c; --blog-soft: #3a3115; }
html[data-theme="dark"] .blog-accent-green, html[data-theme="dark"] [data-tone="green"] { --blog-accent: #7fd9a5; --blog-fill: #1d7a4a; --blog-soft: #1c3328; }
html[data-theme="dark"] .blog-accent-teal, html[data-theme="dark"] [data-tone="teal"] { --blog-accent: #6fddd2; --blog-fill: #0f766e; --blog-soft: #173532; }
html[data-theme="dark"] .blog-accent-blue, html[data-theme="dark"] [data-tone="blue"] { --blog-accent: #9cc2f5; --blog-fill: #2f5fa8; --blog-soft: #1f2d44; }
html[data-theme="dark"] .blog-accent-violet, html[data-theme="dark"] [data-tone="violet"] { --blog-accent: #c6aef2; --blog-fill: #6d3fb2; --blog-soft: #2c2340; }
html[data-theme="dark"] .blog-accent-gray, html[data-theme="dark"] [data-tone="gray"] { --blog-accent: #c3ccd7; --blog-fill: #5a6b80; --blog-soft: #212b38; }

html[data-theme="dark"] .blog-strip {
    border-color: var(--dark-border);
}

/* the dark theme colours every link blue, the link to the editor keeps the colour of the article */
html[data-theme="dark"] .blog-edit-link,
html[data-theme="dark"] .blog-edit-link:hover,
html[data-theme="dark"] .blog-edit-link:focus-visible {
    color: var(--blog-accent);
}

html[data-theme="dark"] .blog-meta,
html[data-theme="dark"] .blog-strip,
html[data-theme="dark"] .blog-sources,
html[data-theme="dark"] .blog-toc-title,
html[data-theme="dark"] .blog-bar-remaining {
    color: var(--dark-muted);
}

html[data-theme="dark"] .blog-title,
html[data-theme="dark"] .blog-card-title a,
html[data-theme="dark"] .blog-bar-label,
html[data-theme="dark"] .blog-bar-menu li.is-done a {
    color: var(--dark-text);
}

html[data-theme="dark"] .blog-lead,
html[data-theme="dark"] .blog-card-text,
html[data-theme="dark"] .blog-toc li.is-done a,
html[data-theme="dark"] .blog-bar-menu a {
    color: #c3ccd7;
}

html[data-theme="dark"] .blog-card,
html[data-theme="dark"] .blog-bar,
html[data-theme="dark"] .blog-bar-menu {
    background: var(--dark-surface);
    border-color: var(--dark-border);
}

html[data-theme="dark"] .blog-card:hover,
html[data-theme="dark"] .blog-card:focus-within {
    box-shadow: 0 10px 24px rgba(0, 0, 0, .5);
}

html[data-theme="dark"] .blog-bar-progress {
    background: var(--dark-surface-3);
}

html[data-theme="dark"] .blog-toc li::before {
    background: var(--dark-border);
}

html[data-theme="dark"] .blog-toc li.is-done::before,
html[data-theme="dark"] .blog-toc li.is-current::before {
    background: var(--blog-accent);
}

html[data-theme="dark"] .blog-toc a {
    color: #7e8b9a;
}

html[data-theme="dark"] .blog-chip {
    background: var(--dark-surface-3);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

html[data-theme="dark"] .blog-chip:hover,
html[data-theme="dark"] .blog-chip:focus {
    background: #34445a;
}

html[data-theme="dark"] .blog-chip.is-active {
    background: var(--brand-fill);
    border-color: var(--brand-fill);
    color: #fff;
}

html[data-theme="dark"] .blog-share-btn {
    background: var(--dark-surface-2);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

html[data-theme="dark"] .blog-body th {
    background: var(--dark-surface-2);
}

html[data-theme="dark"] .blog-body th,
html[data-theme="dark"] .blog-body td,
html[data-theme="dark"] .blog-sources {
    border-color: var(--dark-border);
}

html[data-theme="dark"] .blog-sources-toggle {
    background: var(--dark-surface-2);
    color: var(--dark-text);
}

html[data-theme="dark"] .blog-sources-toggle:hover,
html[data-theme="dark"] .blog-sources-toggle:focus-visible {
    background: var(--dark-border);
}

html[data-theme="dark"] .blog-body blockquote {
    background: var(--dark-amber);
    border-left-color: var(--dark-amber-border);
    color: var(--dark-amber-text);
}

html[data-theme="dark"] .blog-inline-tips {
    background: var(--dark-surface-2);
}

/* the button of sharing in the bar says "copied" by a frame for a moment */
.blog-bar-share.is-done {
    border-color: var(--blog-accent);
}

html[data-theme="dark"] .blog-body [data-blog-box] {
    color: var(--dark-text);
}

html[data-theme="dark"] .blog-body [data-blog-box="info"] table {
    background: var(--dark-surface);
}

/* the number of a source in the text leads to the list of the sources; the source is also shown in a bubble (js/blog-refs.js) */
.blog-body sup.blog-ref {
    margin-left: .1rem;
    font-size: .72em;
    font-weight: 800;
    line-height: 0;
}

.blog-body sup.blog-ref a {
    padding: 0 .12rem;
    text-decoration: none;
}

.blog-sources li {
    scroll-margin-top: calc(var(--blog-sticky-top, 0px) + 5rem);
}

.blog-sources li:target {
    background: var(--blog-soft);
    border-radius: 6px;
}

.blog-ref-bubble {
    position: absolute;
    z-index: 1500;
    max-width: 22rem;
    padding: .6rem .8rem;
    background: #1f2d3d;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
    color: #fff;
    font-size: .88rem;
    line-height: 1.4;
    pointer-events: none;
}

.blog-ref-bubble[hidden] {
    display: none;
}

.blog-ref-bubble a {
    color: #9cc2f5;
}
/* the rating of the readers: a slider from Odpad (red) to Perfektní (green); the word of the step is above it, the average comes from a few votes on */
.blog-rating {
    margin: 2rem 0 0;
    padding: 1.1rem 1.25rem 1.2rem;
    background: var(--blog-soft);
    border-radius: 12px;
}

.blog-rating-form {
    margin: 0;
}

.blog-rating-value {
    margin: 0 0 .6rem;
    color: var(--blog-accent);
    font-size: 1.2rem;
    font-weight: 800;
}

.blog-rating-slider {
    display: block;
    width: 100%;
    height: 2rem;
    margin: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.blog-rating-slider::-webkit-slider-runnable-track {
    height: .6rem;
    background: linear-gradient(90deg, #d9534f, #f0ad4e 50%, #3f9b5f);
    border-radius: 999px;
}

.blog-rating-slider::-moz-range-track {
    height: .6rem;
    background: linear-gradient(90deg, #d9534f, #f0ad4e 50%, #3f9b5f);
    border-radius: 999px;
}

.blog-rating-slider::-webkit-slider-thumb {
    width: 1.7rem;
    height: 1.7rem;
    margin-top: -.55rem;
    background: #fff;
    border: 3px solid var(--blog-fill);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(20, 30, 45, .35);
    -webkit-appearance: none;
    appearance: none;
}

.blog-rating-slider::-moz-range-thumb {
    width: 1.3rem;
    height: 1.3rem;
    background: #fff;
    border: 3px solid var(--blog-fill);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(20, 30, 45, .35);
}

/* nobody has rated yet: the thumb is grey and waits to be moved */
.blog-rating-slider.is-unset::-webkit-slider-thumb {
    border-color: #8b97a5;
}

.blog-rating-slider.is-unset::-moz-range-thumb {
    border-color: #8b97a5;
}

.blog-rating-slider:focus-visible {
    outline: 2px solid var(--blog-accent);
    outline-offset: 4px;
}

.blog-rating-ends {
    display: flex;
    justify-content: space-between;
    color: #5a6878;
    font-size: .85rem;
    font-weight: 700;
}

.blog-rating-line,
.blog-rating-note {
    margin: .7rem 0 0;
}

.blog-rating-line[hidden] {
    display: none;
}

html[data-theme="dark"] .blog-rating-ends {
    color: var(--dark-muted);
}

html[data-theme="dark"] .blog-rating-slider::-webkit-slider-thumb {
    background: var(--dark-surface-2);
}

html[data-theme="dark"] .blog-rating-slider::-moz-range-thumb {
    background: var(--dark-surface-2);
}
