@charset "utf-8";

/* ==========================================================================
   Neovlivněný Magazín 3.0 — magazínové téma pro Textpattern CMS
   Patkové nadpisy, bezpatkový text, hero s obrázkem, mřížka karet, sidebar.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Proměnné
   -------------------------------------------------------------------------- */

:root {
    --paper:      #ffffff;
    --panel:      #f4f5f7;   /* boxy v postranním sloupci */
    --panel-line: #e8eaee;
    --ink:        #1c1c1e;
    --ink-muted:  #5a606b;
    --ink-faint:  #878d97;
    --line:       #e2e5ea;
    --navy:       #1e2a5e;   /* logo, patkové nadpisy */
    --accent:     #2f47a0;   /* odkazy, tlačítka */
    --accent-soft:#5f74c4;
    --rant:       #b3261e;

    --serif: "Playfair Display", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --page:    75rem;
    --measure: 42rem;
    --aside:   15.5rem;
    --gutter:  2.75rem;
    --radius:  3px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper:      #12141a;
        --panel:      #1a1d25;
        --panel-line: #242833;
        --ink:        #e6e8ee;
        --ink-muted:  #a0a7b4;
        --ink-faint:  #7c8390;
        --line:       #262a34;
        --navy:       #c8d2f0;
        --accent:     #92a5e6;
        --accent-soft:#6d81cc;
        --rant:       #e0857c;
    }
}

:root[data-theme="dark"] {
    --paper:      #12141a;
    --panel:      #1a1d25;
    --panel-line: #242833;
    --ink:        #e6e8ee;
    --ink-muted:  #a0a7b4;
    --ink-faint:  #7c8390;
    --line:       #262a34;
    --navy:       #c8d2f0;
    --accent:     #92a5e6;
    --accent-soft:#6d81cc;
    --rant:       #e0857c;
}

/* --------------------------------------------------------------------------
   2. Základ
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation: none !important; transition: none !important; }
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video, svg, iframe { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.accessibility, .skip-link {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link:focus {
    position: fixed; top: .5rem; left: .5rem; z-index: 300;
    width: auto; height: auto; margin: 0; padding: .55rem 1rem; clip: auto;
    background: var(--accent); color: #fff; border-radius: var(--radius);
}

/* --------------------------------------------------------------------------
   3. Typografie
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .5em;
    font-family: var(--serif);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -.005em;
    color: var(--ink);
    text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 1.25rem + 2.6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1.15em; }

/* metařádek: Autor | datum | [RUBRIKA] | 8 min čtení */

.meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .55rem;
    margin: 0 0 .9rem;
    font-size: .8rem;
    color: var(--ink-faint);
    line-height: 1.5;
}

.meta a { color: var(--ink-muted); }
.meta .sep { opacity: .45; }

.meta .cat {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.meta .cat::before { content: "["; }
.meta .cat::after  { content: "]"; }

.meta .reading-time::before {
    content: "|";
    margin-right: .4rem;
    opacity: .45;
}

.is-rant .meta .cat { color: var(--rant); }

.excerpt { margin: 0 0 .9rem; color: var(--ink-muted); }
.excerpt p:last-child { margin-bottom: 0; }

.more {
    display: inline-block;
    font-size: .88rem;
    font-weight: 500;
}

blockquote {
    margin: 2rem 0;
    padding: .25rem 0 .25rem 1.4rem;
    border-left: 3px solid var(--accent-soft);
    font-family: var(--serif);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--ink-muted);
}

blockquote p:last-child { margin-bottom: 0; }

code, pre, kbd, samp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

:not(pre) > code {
    padding: .1em .35em;
    background: var(--panel);
    border-radius: var(--radius);
    font-size: .875em;
    color: var(--ink-muted);
}

pre {
    position: relative;
    margin: 2rem 0;
    padding: 1rem 1.15rem;
    overflow-x: auto;
    background: var(--panel);
    border: 1px solid var(--panel-line);
    border-radius: var(--radius);
    font-size: .86rem;
    line-height: 1.6;
    color: var(--ink-muted);
}

pre code { padding: 0; background: none; font-size: inherit; color: inherit; }

pre[data-lang]::before {
    content: attr(data-lang);
    position: absolute; top: .5rem; right: .75rem;
    font-size: .68rem; letter-spacing: .05em; text-transform: uppercase;
    color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   4. Hlavička
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.header-bar {
    display: flex;
    align-items: center;
    gap: 1rem 2rem;
    max-width: var(--page);
    margin: 0 auto;
    padding: 1.15rem 1.5rem;
}

.brand {
    font-family: var(--serif);
    font-size: clamp(1.35rem, 1.1rem + .9vw, 1.75rem);
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
    color: var(--navy);
    white-space: nowrap;
}

.brand:hover { text-decoration: none; opacity: .85; }

.site-nav { margin-left: auto; }

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.65rem;
    margin: 0; padding: 0;
    list-style: none;
}

.site-nav a {
    font-size: .94rem;
    color: var(--ink-muted);
}

.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav li.active a { color: var(--accent); }

.header-tools { display: flex; align-items: center; gap: .5rem; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; padding: 0;
    border: 0; border-radius: var(--radius);
    background: transparent; color: var(--ink-muted);
    cursor: pointer;
}

.icon-btn:hover { color: var(--accent); }
.icon-btn svg { width: 1.05rem; height: 1.05rem; display: block; }

.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

/* vysouvací hledání */

.search-drawer {
    display: none;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.search-drawer.is-open { display: block; }

.search-drawer form {
    max-width: var(--page);
    margin: 0 auto;
    padding: .85rem 1.5rem;
}

.search-drawer input[type="search"] {
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1rem;
}

.search-drawer input[type="search"]:focus { border-color: var(--accent); outline: none; }

/* --------------------------------------------------------------------------
   5. Rozvržení
   -------------------------------------------------------------------------- */

.wrapper {
    max-width: var(--page);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--aside);
    gap: 0 var(--gutter);
    padding: 2.25rem 0 4rem;
}

main { min-width: 0; }

.page-head {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.page-head h1 { margin-bottom: .25rem; }
.page-head .lede { margin: 0; color: var(--ink-muted); }

/* --------------------------------------------------------------------------
   6. Statický úvodní blok (sticky článek)
   -------------------------------------------------------------------------- */

.intro {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--line);
}

.intro h2 {
    margin-bottom: .6rem;
    font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem);
}

.intro-body {
    font-size: 1.06rem;
    color: var(--ink-muted);
}

.intro-body p:last-child { margin-bottom: 0; }

/* statická stránka (O mně, Kontakt) */

.static-page {
    max-width: var(--measure);
    margin: 0 auto;
}

.static-page .post-header {
    margin-bottom: 2rem;
}

/* --------------------------------------------------------------------------
   7. Hlavní článek (hero)
   -------------------------------------------------------------------------- */

.hero { margin-bottom: 2rem; }

.hero-image {
    margin: 0 0 1.5rem;
    overflow: hidden;
    border-radius: var(--radius);
}

.hero-image img {
    display: block;
    width: 100%;
    height: clamp(9rem, 5rem + 12vw, 14rem);
    object-fit: cover;
}

.hero h1 { margin-bottom: .65rem; }
.hero h1 a { color: inherit; }
.hero h1 a:hover { color: var(--accent); text-decoration: none; }

.hero .excerpt { font-size: 1.02rem; }

.hero.is-rant { padding-left: 1.15rem; border-left: 3px solid var(--rant); }

/* --------------------------------------------------------------------------
   8. Mřížka karet
   -------------------------------------------------------------------------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
}

.card {
    padding: 1.6rem 1.4rem;
    border-bottom: 1px solid var(--line);
}

.card:nth-child(3n+1) { padding-left: 0; }
.card:nth-child(3n)   { padding-right: 0; }

.card h3 { margin-bottom: .55rem; line-height: 1.22; }
.card h3 a { color: inherit; }
.card h3 a:hover { color: var(--accent); text-decoration: none; }

.card .meta { margin-bottom: .65rem; }

.card .excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: .92rem;
    margin-bottom: .7rem;
}

.card .more { font-size: .84rem; }

.card.is-rant { border-left: 3px solid var(--rant); padding-left: 1.1rem; }
.card.is-rant:nth-child(3n+1) { padding-left: 1.1rem; }

/* --------------------------------------------------------------------------
   9. Postranní sloupec
   -------------------------------------------------------------------------- */

.sidebar { font-size: .92rem; }

.panel {
    margin-bottom: 1.5rem;
    padding: 1.35rem 1.25rem;
    background: var(--panel);
    border-radius: var(--radius);
}

.panel h2 {
    margin-bottom: .9rem;
    font-size: 1.35rem;
}

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

.panel li {
    padding: .4rem 0;
    line-height: 1.45;
}

.panel li + li { border-top: 1px solid var(--panel-line); }

.panel a { color: var(--ink-muted); }
.panel a:hover { color: var(--accent); }

.panel .count { color: var(--ink-faint); font-size: .85em; }
.panel .count::before { content: "["; }
.panel .count::after  { content: "]"; }

/* profil autora */

.author-card { text-align: left; }

.author-card img {
    display: block;
    width: 4.25rem; height: 4.25rem;
    margin-bottom: .9rem;
    border-radius: 50%;
    object-fit: cover;
}

.author-card p {
    margin: 0;
    font-size: .88rem;
    line-height: 1.55;
    color: var(--ink-muted);
}

/* --------------------------------------------------------------------------
   10. Jednotlivý článek
   -------------------------------------------------------------------------- */

.post { max-width: var(--measure); }

.post-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.post-header h1 { margin-bottom: .7rem; }

.post-header .dek {
    margin: 0 0 1rem;
    font-family: var(--serif);
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--ink-muted);
}

.post.is-rant .post-header { padding-left: 1.2rem; border-left: 3px solid var(--rant); }

.article-body { font-size: 1.075rem; line-height: 1.75; }

.article-body > :first-child { margin-top: 0; }
.article-body h2 { margin-top: 2.5rem; scroll-margin-top: 5rem; }
.article-body h3 { margin-top: 2rem; scroll-margin-top: 5rem; }

.article-body ul, .article-body ol { margin: 0 0 1.15em; padding-left: 1.35rem; }
.article-body li { margin-bottom: .35em; }

/* obrázek článku může být uvnitř .article-body i před ním */
.post figure,
.post > p:has(> img) {
    margin: 2.25rem 0;
}

.post figure img,
.post > p > img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
}

.post figcaption {
    margin-top: .55rem;
    font-size: .82rem;
    line-height: 1.5;
    color: var(--ink-faint);
}

.note {
    margin: 2rem 0;
    padding: 1rem 1.15rem;
    background: var(--panel);
    border-left: 3px solid var(--accent-soft);
    border-radius: var(--radius);
    font-size: .97em;
    color: var(--ink-muted);
}

.note p:last-child { margin-bottom: 0; }

.post-footer {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }

.tags li {
    padding: .12rem .5rem;
    background: var(--panel);
    border-radius: 999px;
    font-size: .76rem;
    color: var(--ink-muted);
}

.tags li::before { content: "#"; opacity: .5; }

/* --------------------------------------------------------------------------
   11. Stránkování
   -------------------------------------------------------------------------- */

.paginator {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    font-size: .9rem;
}

.paginator a[rel="next"] { margin-left: auto; }

/* --------------------------------------------------------------------------
   12. Komentáře a formuláře
   -------------------------------------------------------------------------- */

#comments-head, #comments-form {
    max-width: var(--measure);
    margin-top: 3rem;
}

#comments-head h3, #comments-form h3 {
    margin-bottom: 1.25rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--line);
    font-size: 1.3rem;
}

.comments-list { margin: 0; padding: 0; list-style: none; }
.comments-list > li + li { margin-top: 1rem; }

.comments {
    padding: 1rem 1.15rem;
    background: var(--panel);
    border-radius: var(--radius);
}

.comments h4 {
    display: flex; align-items: baseline; gap: .5rem;
    margin-bottom: .1rem;
    font-family: var(--sans);
    font-size: .98rem;
    font-weight: 600;
}

.comments .is-author {
    padding: .05rem .4rem;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.comments-author { box-shadow: inset 3px 0 0 var(--accent); }

.comment-anchor a { color: var(--ink-faint); }
.comment-time { display: block; margin-bottom: .55rem; font-size: .78rem; color: var(--ink-faint); }
.comment-body p:last-child { margin-bottom: 0; }

label {
    display: block;
    margin-bottom: .3rem;
    font-size: .82rem;
    font-weight: 500;
    color: var(--ink-muted);
}

input[type="text"], input[type="email"], input[type="url"], textarea {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: .98rem;
}

textarea { line-height: 1.6; }

input:focus, textarea:focus {
    border-color: var(--accent);
    outline: none;
}

input[type="submit"] {
    width: auto;
    padding: .6rem 1.4rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-family: var(--sans);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
}

input[type="submit"]:hover { filter: brightness(1.1); }

input[type="submit"]:first-of-type {
    background: transparent;
    color: var(--accent);
}

input[type="submit"].disabled { opacity: .45; cursor: not-allowed; }

.comment-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0 1.25rem;
}

.comment-actions { display: flex; gap: .6rem; }

.required { color: var(--rant); }

.error_message {
    padding: .75rem 1rem;
    border-left: 3px solid var(--rant);
    background: var(--panel);
    color: var(--rant);
    list-style-position: inside;
}

.file-download { padding: 1rem 0; border-bottom: 1px solid var(--line); }

/* --------------------------------------------------------------------------
   13. Chybová stránka a patička
   -------------------------------------------------------------------------- */

.error-page main { text-align: center; padding: 2rem 0; }

.error-status {
    font-family: var(--serif);
    font-size: clamp(3rem, 2rem + 6vw, 5.5rem);
    color: var(--navy);
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    justify-content: space-between;
    align-items: center;
    max-width: var(--page);
    margin: 0 auto;
    padding: 1.75rem 1.5rem;
    font-size: .85rem;
    color: var(--ink-muted);
}

.site-footer a { color: var(--ink-muted); }
.site-footer a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   14. Responzivita
   -------------------------------------------------------------------------- */

@media screen and (max-width: 62rem) {
    .layout { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
        gap: 1.5rem;
    }

    .panel { margin-bottom: 0; }
}

@media screen and (max-width: 52rem) {
    .header-bar { flex-wrap: wrap; gap: .5rem 1.25rem; }
    .site-nav { order: 3; width: 100%; margin-left: 0; }
    .header-tools { margin-left: auto; }

    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card:nth-child(3n+1), .card:nth-child(3n) { padding-left: 1.4rem; padding-right: 1.4rem; }
    .card:nth-child(2n+1) { padding-left: 0; }
    .card:nth-child(2n)   { padding-right: 0; }
    .card.is-rant:nth-child(2n+1) { padding-left: 1.1rem; }
}

@media screen and (max-width: 34rem) {
    .card-grid { grid-template-columns: minmax(0, 1fr); }
    .card, .card:nth-child(2n+1), .card:nth-child(2n) { padding-left: 0; padding-right: 0; }
    .card.is-rant, .card.is-rant:nth-child(2n+1) { padding-left: 1.1rem; }
    .article-body { font-size: 1.02rem; }
}

/* --------------------------------------------------------------------------
   15. Tisk
   -------------------------------------------------------------------------- */

@media print {
    :root { --paper: #fff; --ink: #000; --line: #ddd; --panel: #f6f6f6; }
    .site-header, .search-drawer, .sidebar, .site-footer,
    .paginator, #comments-form, .skip-link { display: none; }
    .layout { display: block; }
    .post { max-width: none; }
    a { color: #000; }
    .article-body a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}