
/* Blog: rozcestník /blog/ a stránky článků. Bez animací, jen hover stavy jako na úvodní stránce. */

.blog,
.post {
    padding-block: calc(var(--header-top) + var(--h-nav) + var(--s64)) calc(var(--section-pad) + var(--r-block));
}

.post-head,
.blog-head,
.post-layout {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
}
.post-topic,
.blog-label { grid-column: 1 / span 3; grid-row: 1; padding-top: 0.6em; }

.blog-head { margin-bottom: var(--s48); }
.blog-title {
    grid-column: 4 / -1;
    grid-row: 1;
    font-size: var(--fs-display-s);
    font-weight: var(--fw-display);
    line-height: 0.95;
    letter-spacing: var(--ls-display);
}
.blog-intro {
    grid-column: 4 / span 6;
    max-width: 52ch;
    margin-top: var(--s24);
    font-size: var(--fs-intro);
    line-height: 1.5;
    color: var(--ink-2);
}

.post-title {
    grid-column: 4 / -1;
    grid-row: 1;
    font-size: clamp(2.25rem, 1.1rem + 3vw, 4.25rem);
    font-weight: var(--fw-display);
    line-height: 0.98;
    letter-spacing: var(--ls-display);
}
.post-byline {
    grid-column: 4 / -1;
    display: flex;
    align-items: center;
    gap: var(--s12);
    margin-top: var(--s24);
    font-size: var(--fs-label);
    line-height: 1.45;
    color: var(--ink-2);
}
.post-byline-photo {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    outline: 1px solid rgb(0 0 0 / 0.1);
    outline-offset: -1px;
}
.post-byline a {
    font-weight: var(--fw-label);
    color: var(--ink);
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: transparent;
    transition: text-decoration-color var(--dur-fast) ease;
}
.post-lead {
    grid-column: 4 / span 7;
    max-width: 58ch;
    margin-top: var(--s40);
    font-size: var(--fs-q);
    line-height: 1.45;
    font-weight: var(--fw-lead);
    letter-spacing: var(--ls-ui);
    color: var(--ink);
}
.post-lead strong { font-weight: var(--fw-label); }
.post-figure--main { grid-column: 4 / span 8; margin-top: var(--s48); }

.post-layout { margin-top: var(--s64); row-gap: var(--s48); }
.post-toc {
    grid-column: 1 / span 3;
    grid-row: 1 / span 2;
    align-self: start;
    position: sticky;
    top: calc(var(--header-top) + var(--h-nav) + var(--s32));
    padding-right: var(--s24);
}
.post-toc-title {
    margin-bottom: var(--s12);
    font-size: var(--fs-label);
    font-weight: var(--fw-label);
    letter-spacing: var(--ls-ui);
}
.post-toc ol { display: flex; flex-direction: column; gap: var(--s4); }
.post-toc a {
    display: block;
    padding-block: var(--s4);
    font-size: var(--fs-small);
    line-height: 1.4;
    color: var(--ink-2);
    text-decoration: none;
    transition: color var(--dur-fast) ease;
}
.post-body { grid-column: 4 / span 7; grid-row: 1; min-width: 0; }
.author { grid-column: 4 / span 7; grid-row: 2; }

@media (hover: hover) and (pointer: fine) {
    .post-toc a:hover { color: var(--ink); }
    .post-byline a:hover { text-decoration-color: currentColor; }
}

/* Text článku */
.prose { max-width: 68ch; }
.prose > :where(* + *) { margin-top: var(--s20); }
.prose > :where(.quote, .post-figure, .post-gallery) { margin-top: var(--s40); }
.prose > :where(.quote, .post-figure, .post-gallery) + * { margin-top: var(--s40); }
.prose > :where(.table-scroll) { margin-top: var(--s24); }
.prose > :where(.table-scroll) + * { margin-top: var(--s24); }
.prose > :where(h2, h3) + * { margin-top: var(--s16); }
.prose > h2 {
    margin-top: var(--s64);
    font-size: clamp(1.5rem, 1.15rem + 1.1vw, 2.25rem);
    font-weight: var(--fw-display);
    line-height: 1.12;
    letter-spacing: var(--ls-heading);
    scroll-margin-top: calc(var(--header-top) + var(--h-nav) + var(--s24));
}
.prose > h2:first-child { margin-top: 0; }
.prose > h3 {
    margin-top: var(--s40);
    font-size: var(--fs-q);
    font-weight: var(--fw-ui);
    line-height: 1.25;
    letter-spacing: var(--ls-lead);
    scroll-margin-top: calc(var(--header-top) + var(--h-nav) + var(--s24));
}
.prose > h2 + h3 { margin-top: var(--s24); }
.prose p,
.prose li {
    font-size: var(--fs-intro);
    line-height: 1.65;
    color: var(--ink-2);
}
.prose strong { font-weight: var(--fw-label); color: var(--ink); }
.prose em { font-style: italic; }
.prose ul,
.prose ol {
    display: flex;
    flex-direction: column;
    gap: var(--s8);
    padding-left: 1.4em;
}
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { padding-left: 0.2em; }
.prose li::marker { color: var(--blue); }
.prose ol > li::marker { font-weight: var(--fw-label); font-variant-numeric: tabular-nums; }
.prose code {
    font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875em;
    color: var(--ink);
}
.prose a,
.post-lead a,
.post-figure figcaption a,
.quote-role a,
.author-bio a,
.author-links a {
    color: var(--ink);
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    transition: text-decoration-color var(--dur-fast) ease;
}
@media (hover: hover) and (pointer: fine) {
    .prose a:hover,
    .post-lead a:hover,
    .post-figure figcaption a:hover,
    .quote-role a:hover,
    .author-bio a:hover,
    .author-links a:hover { text-decoration-color: currentColor; }
}

/* Tabulky: široké se posouvají uvnitř svého rámečku, ne celá stránka */
.table-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    margin-inline: calc(-1 * var(--s8));
    padding-inline: var(--s8);
}
.table-scroll:focus-visible { outline-offset: 0; border-radius: var(--r-sm); }
.table-scroll table {
    width: 100%;
    min-width: calc(var(--cols, 3) * 9.5rem);
    border-collapse: separate;
    border-spacing: 0 6px;
}
.table-scroll thead th {
    padding: 0 var(--s16) var(--s4);
    vertical-align: bottom;
    text-align: left;
    font-size: var(--fs-label);
    font-weight: var(--fw-label);
    line-height: 1.35;
    color: var(--ink);
}
.table-scroll tbody th,
.table-scroll tbody td {
    padding: var(--s16);
    vertical-align: top;
    text-align: left;
    font-size: var(--fs-small);
    line-height: 1.5;
    background: var(--paper-2);
}
.table-scroll tbody th { font-weight: var(--fw-ui); color: var(--ink); }
.table-scroll tbody td { color: var(--ink-2); box-shadow: inset 1px 0 0 rgb(11 11 12 / 0.06); }
.table-scroll tbody tr > :first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.table-scroll tbody tr > :last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* Obrázky z portfolia */
.post-figure img {
    width: 100%;
    border-radius: var(--r-card);
    outline: 1px solid rgb(0 0 0 / 0.1);
    outline-offset: -1px;
    background: var(--paper-3);
}
.prose .post-figure img { border-radius: 20px; }
.post-figure figcaption {
    margin-top: var(--s12);
    font-size: var(--fs-label);
    line-height: 1.45;
    color: var(--ink-2);
}
.post-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gutter);
}
.post-gallery img { aspect-ratio: 960 / 624; object-fit: cover; }

/* Citace reference */
.quote {
    padding: var(--pad-card);
    border-radius: var(--r-card);
    background: var(--paper-2);
    box-shadow: var(--ring);
}
.quote .quote-text p {
    font-size: var(--fs-lead);
    line-height: 1.3;
    font-weight: var(--fw-lead);
    letter-spacing: var(--ls-lead);
    color: var(--ink);
    text-indent: -0.4em;
}
.quote-author {
    display: flex;
    align-items: center;
    gap: var(--s12);
    margin-top: var(--s24);
}
.quote-site {
    flex: none;
    width: calc(var(--h-sm) * 1.54);
    height: var(--h-sm);
    border-radius: 7px;
    object-fit: cover;
    outline: 1px solid rgb(0 0 0 / 0.1);
    outline-offset: -1px;
}
.quote-person { display: flex; flex-direction: column; min-width: 0; }
.quote-name { font-style: normal; font-size: var(--fs-small); font-weight: var(--fw-label); line-height: 1.3; color: var(--ink); }
.quote-role { font-size: var(--fs-label); line-height: 1.35; color: var(--ink-2); }

/* Boxík o autorovi */
.author {
    display: grid;
    grid-template-columns: clamp(96px, 10vw, 140px) minmax(0, 1fr);
    gap: var(--s24);
    align-items: start;
    padding: var(--pad-card);
    border-radius: var(--r-card);
    background: var(--paper-2);
    box-shadow: var(--ring);
}
.author-photo {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: var(--r-sm);
    object-fit: cover;
    outline: 1px solid rgb(0 0 0 / 0.1);
    outline-offset: -1px;
}
.author-label { font-size: var(--fs-label); font-weight: var(--fw-label); color: var(--ink-2); }
.author-name {
    margin-top: var(--s8);
    font-size: var(--fs-lead);
    font-weight: var(--fw-display);
    line-height: 1.1;
    letter-spacing: var(--ls-heading);
}
.author-name a {
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    text-decoration-color: transparent;
    transition: text-decoration-color var(--dur-fast) ease;
}
.author-role { margin-top: var(--s4); font-size: var(--fs-small); color: var(--ink-2); }
.author-bio {
    max-width: 60ch;
    margin-top: var(--s16);
    line-height: 1.6;
    color: var(--ink-2);
}
.author-bio strong { font-weight: var(--fw-label); color: var(--ink); }
.author-links {
    margin-top: var(--s12);
    font-size: var(--fs-small);
    line-height: 1.5;
    color: var(--ink-2);
}
.author-links a { font-weight: var(--fw-ui); }
@media (hover: hover) and (pointer: fine) {
    .author-name a:hover { text-decoration-color: currentColor; }
}

/* Karty článků */
.related { margin-top: clamp(80px, 9vw, 144px); }
.related-title {
    margin-bottom: var(--s40);
    font-size: clamp(2rem, 1.2rem + 2.6vw, 3.75rem);
    font-weight: var(--fw-display);
    line-height: 0.95;
    letter-spacing: var(--ls-display);
}
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gutter);
}
.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: var(--inset);
    border-radius: var(--r-card);
    background: var(--paper-2);
    box-shadow: var(--ring);
    transition: box-shadow var(--dur-fast) ease;
}
.post-card-img {
    width: 100%;
    aspect-ratio: 640 / 416;
    object-fit: cover;
    border-radius: calc(var(--r-card) - var(--inset));
    outline: 1px solid rgb(0 0 0 / 0.08);
    outline-offset: -1px;
    background: var(--paper-3);
}
.post-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--s8);
    padding: var(--s20) var(--s16) var(--s16);
}
.post-card-meta { font-size: var(--fs-micro); font-weight: var(--fw-ui); color: var(--ink-2); }
.post-card-title {
    font-size: var(--fs-q);
    font-weight: var(--fw-ui);
    line-height: 1.22;
    letter-spacing: var(--ls-lead);
}
.post-card-title a {
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: transparent;
    transition: text-decoration-color var(--dur-fast) ease;
}
.post-card-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--r-card);
}
.post-card-title a:focus-visible { outline: none; }
.post-card:has(a:focus-visible) { outline: 2px solid var(--blue); outline-offset: 3px; }
.post-card-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    font-size: var(--fs-small);
    line-height: 1.5;
    color: var(--ink-2);
}
@media (hover: hover) and (pointer: fine) {
    .post-card:hover { box-shadow: inset 0 0 0 1px rgb(11 11 12 / 0.24); }
    .post-card:hover .post-card-title a { text-decoration-color: currentColor; }
}

/* Filtr témat: přepínače bez JavaScriptu, všechny články jsou v HTML vždy */
.blog-filter {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s8);
    min-width: 0;
    margin: 0 0 var(--s24);
    padding: 0;
    border: 0;
}
.blog-filter label {
    display: inline-flex;
    align-items: center;
    height: var(--h-chip);
    padding: 0 var(--s16);
    border-radius: 999px;
    background: var(--paper-2);
    box-shadow: var(--ring);
    font-size: var(--fs-label);
    font-weight: var(--fw-ui);
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
    user-select: none;
    transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.blog-filter input:checked + label { background: var(--ink); color: var(--paper); box-shadow: none; }
.blog-filter input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
    .blog-filter input:not(:checked) + label:hover { box-shadow: inset 0 0 0 1px var(--ink); }
}

@media (max-width: 1024px) {
    .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .post-topic,
    .blog-label,
    .post-title,
    .blog-title,
    .post-byline,
    .post-lead,
    .blog-intro,
    .post-figure--main,
    .post-toc,
    .post-body,
    .author { grid-column: 1 / -1; grid-row: auto; }
    .post-topic,
    .blog-label { padding-top: 0; margin-bottom: var(--s16); }
    .post-toc {
        position: static;
        padding: var(--pad-card);
        border-radius: var(--r-card);
        background: var(--paper-2);
        box-shadow: var(--ring);
    }
    .post-layout { margin-top: var(--s48); row-gap: var(--s40); }
    .prose { max-width: none; }
}

@media (max-width: 760px) {
    .blog,
    .post { padding-top: calc(var(--header-top) + var(--h-nav) + var(--s40)); }
    .post-title { font-size: clamp(2rem, 8.4vw, 2.75rem); line-height: 1.02; }
    .blog-title { font-size: clamp(2.2rem, 10vw, 3.4rem); }
    .post-byline { align-items: flex-start; }
    .post-lead { margin-top: var(--s32); }
    .post-figure--main { margin-top: var(--s32); }
    .prose > h2 { margin-top: var(--s48); }
    .prose p,
    .prose li { font-size: var(--fs-body); }
    .author { grid-template-columns: 1fr; gap: var(--s20); }
    .author-photo { width: 96px; }
}

@media (max-width: 640px) {
    .post-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 559px) {
    .post-gallery { grid-template-columns: minmax(0, 1fr); row-gap: var(--s32); }
}

@media (forced-colors: active) {
    .post-card,
    .quote,
    .author,
    .post-toc,
    .blog-filter label { border: 1px solid CanvasText; }
    .blog-filter input:checked + label { outline: 2px solid Highlight; }
}
