/* === Farebná paleta === */
:root {
    --color-text: #222;
    --color-text-light: #555;
    --color-text-muted: #777;
    --color-bg: #fafafa;
    --color-bg-white: #fff;
    --color-border: #ddd;
    --color-border-light: #eee;
    --color-link: #1a6fb5;
    --color-link-hover: #0d4f82;
    --color-brand-blue: #0f1b7a;
    --color-brand-red: #d41920;
    --color-accent-bg: #f4f6fb;
}

/* === Reset a základ === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px;
    line-height: 1.6;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

::selection {
    background: var(--color-brand-blue);
    color: #fff;
}

/* === Layout === */
.container {
    max-width: 42rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* === Header === */
.site-header {
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    background: var(--color-bg-white);
    border-top: 3px solid var(--color-brand-blue);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: color 0.2s;
}

.site-name:hover {
    color: var(--color-brand-blue);
}

/* === Navigácia === */
.site-nav {
    display: flex;
    gap: 1.25rem;
}

.site-nav a {
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border-bottom: 2px solid transparent;
    background: rgba(0, 0, 0, 0.02);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.site-nav a:hover {
    color: var(--color-brand-blue);
    border-bottom-color: var(--color-brand-blue);
    background: rgba(15, 27, 122, 0.04);
}

/* === Main === */
.site-main {
    flex: 1;
    padding: 2.5rem 0;
}

/* === Typografia obsahu === */
.content h1 {
    font-size: 1.8rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.content h2 {
    font-size: 1.3rem;
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--color-brand-blue);
    color: var(--color-text);
}

.content h3 {
    font-size: 1.1rem;
    line-height: 1.35;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-light);
    font-weight: 600;
    padding-left: 0.75rem;
    border-left: 2px solid rgba(15, 27, 122, 0.3);
}

/* === Bežný obsah === */
.content p {
    margin-bottom: 1rem;
}

.content ul, .content ol {
    margin-bottom: 1.25rem;
    padding-left: 2rem;
}

.content li {
    margin-bottom: 0.35rem;
}

.content ul {
    list-style: none;
}

.content ul li::before {
    content: "»";
    color: var(--color-brand-blue);
    font-weight: 700;
    margin-right: 0.5rem;
}

/* === Odkazy === */
.content a {
    color: var(--color-link);
    text-decoration-color: rgba(26, 111, 181, 0.3);
    text-underline-offset: 2px;
    transition: color 0.2s, text-decoration-color 0.2s;
}

.content a:hover {
    color: var(--color-link-hover);
    text-decoration-color: var(--color-link-hover);
}

/* Externé odkazy */
.content a[href^="http"]::after {
    content: "\00a0↗";
    font-size: 0.75em;
    color: var(--color-text-muted);
}

/* === Obrázky === */
.content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.content figure {
    margin: 1.5rem 0;
}

.content figure img {
    display: block;
    max-width: 100%;
    height: auto;
}

.content figcaption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: center;
    font-style: italic;
}

/* === Blockquote === */
.content blockquote {
    border-left: 3px solid var(--color-brand-blue);
    padding: 0.75rem 1rem;
    background: var(--color-accent-bg);
    color: var(--color-text-light);
    margin-bottom: 1.25rem;
    border-radius: 0 4px 4px 0;
    box-shadow: 2px 3px 8px -2px rgba(0, 0, 0, 0.1);
}

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

/* Akcentový blockquote — štýl LinkedIn brand */
.content blockquote.accent {
    background: var(--color-brand-blue);
    color: #fff;
    border-left: none;
    border-radius: 12px 4px 4px 4px;
    padding: 1.5rem 1.5rem 1.5rem 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 3px 4px 12px -3px rgba(0, 0, 0, 0.2);
}

.content blockquote.accent::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--color-brand-red);
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.content blockquote.accent::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(
        to bottom right,
        transparent calc(50% - 2px),
        rgba(255, 255, 255, 0.5) 50%,
        transparent calc(50% + 2px)
    );
    pointer-events: none;
}

.content blockquote.accent p {
    color: #fff;
}

/* === Tabuľky === */
.content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.content thead th {
    background: var(--color-brand-blue);
    color: #fff;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.content thead th:first-child {
    border-radius: 4px 0 0 0;
}

.content thead th.empty-corner {
    background: transparent;
}

.content thead th:last-child {
    border-radius: 0 4px 0 0;
}

.content tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
    text-align: center;
    vertical-align: middle;
}

.content tbody tr:nth-child(even) {
    background: var(--color-accent-bg);
}

.content tbody tr:hover {
    background: rgba(15, 27, 122, 0.04);
}

.content tbody th {
    background: var(--color-brand-blue);
    color: #fff;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* === Code a pre === */
.content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85em;
    background: var(--color-accent-bg);
    border: 1px solid var(--color-border-light);
    border-radius: 3px;
    padding: 0.1em 0.35em;
    color: var(--color-brand-blue);
}

.content pre {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
    box-shadow: 2px 3px 8px -2px rgba(0, 0, 0, 0.15);
}

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

/* === Inline triedy === */
.highlight {
    background: var(--color-brand-blue);
    color: #fff;
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-weight: 600;
}

.num {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 1.05em;
    font-weight: 600;
    color: var(--color-brand-blue);
    letter-spacing: -0.02em;
}

.subtle {
    font-size: 0.85em;
    color: var(--color-text-muted);
}

/* === Video embed === */
.video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    box-shadow: 2px 3px 8px -2px rgba(0, 0, 0, 0.1);
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* === Horizontálna čiara === */
.content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2rem 0;
}

/* === Post === */
.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border-light);
}

.post-meta {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-category {
    background: var(--color-brand-blue);
    color: #fff;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.tags {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border-light);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    background: var(--color-border-light);
    color: var(--color-text-light);
    padding: 0.15rem 0.6rem;
    border-radius: 3px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.tag:hover {
    background: var(--color-brand-blue);
    color: #fff;
}

/* === Project === */
.project-description {
    color: var(--color-text-light);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--color-brand-red);
}

.project-info {
    margin-top: 2.5rem;
    padding: 1.25rem;
    background: var(--color-accent-bg);
    border-radius: 4px;
    border: 1px solid var(--color-border-light);
    font-size: 0.9rem;
}

.project-info dt {
    font-weight: 600;
    margin-top: 0.75rem;
    color: var(--color-text);
}

.project-info dt:first-child {
    margin-top: 0;
}

.project-info dd {
    margin-left: 0;
    color: var(--color-text-light);
}

/* === Homepage === */
.home-intro {
    margin-bottom: 2.5rem;
}

.home-intro img {
    float: left;
    width: 13rem;
    height: auto;
    margin: 0.25rem 1.5rem 1rem 0;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.home-intro figure {
    float: left;
    margin: 0.25rem 1.5rem 1rem 0;
}

.home-intro figcaption {
    display: none;
}

.home-intro::after {
    content: "";
    display: table;
    clear: both;
}

@media (max-width: 600px) {
    .home-intro img {
        width: 9rem;
        margin: 0.25rem 1rem 0.75rem 0;
    }
}

.home-section {
    margin-bottom: 2.5rem;
}

.home-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--color-brand-blue);
    color: var(--color-text);
}

/* Blog listing na homepage */
.home-blog ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.home-blog li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border-light);
}

.home-blog li:last-child {
    border-bottom: none;
}

.home-blog a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
}

.home-blog a:hover {
    color: var(--color-brand-blue);
}

.home-blog .post-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-left: 0.5rem;
}

.home-blog .more-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-brand-blue);
    text-decoration: none;
    font-weight: 600;
}

.home-blog .more-link:hover {
    text-decoration: underline;
}

/* Projekty na homepage */
.home-projects {
    background: var(--color-accent-bg);
    border-radius: 4px;
    padding: 1.5rem;
    border: 1px solid var(--color-border-light);
}

.home-projects .home-section-title {
    margin-top: 0;
}

.home-projects .projects-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--color-brand-blue);
    font-weight: 600;
    text-decoration: none;
}

.home-projects .projects-link:hover {
    text-decoration: underline;
}

/* Sociálne siete */
.home-social {
    text-align: center;
    padding: 1.5rem 0;
}

.home-social a {
    color: var(--color-text-light);
    text-decoration: none;
    margin: 0 0.75rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.home-social a:hover {
    color: var(--color-brand-blue);
}

/* === Listing stránky (projekty, blog) === */
.listing-card {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    border-left: 3px solid var(--color-brand-blue);
    transition: box-shadow 0.2s;
}

.listing-card:hover {
    box-shadow: 2px 3px 8px -2px rgba(0, 0, 0, 0.1);
}

.listing-card h2 {
    font-size: 1.15rem;
    margin: 0 0 0.4rem 0;
    border: none;
    padding: 0;
}

.listing-card h2 a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
}

.listing-card h2 a:hover {
    color: var(--color-brand-blue);
}

.listing-card .card-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.listing-card .card-description {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin: 0;
}

.listing-card .card-status {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: var(--color-accent-bg);
    color: var(--color-brand-blue);
    border: 1px solid var(--color-border-light);
}

.listing-empty {
    color: var(--color-text-muted);
    font-style: italic;
}

/* === Footer === */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    text-align: center;
    background: var(--color-bg-white);
}

/* === Responsive === */
@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav {
        width: 100%;
        justify-content: space-between;
        gap: 0;
    }

    .site-nav a {
        flex: 1;
        text-align: center;
        padding: 0.65rem 0.25rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-right: 1px solid var(--color-border-light);
    }

    .site-nav a:last-child {
        border-right: none;
    }

    .content h1 {
        font-size: 1.5rem;
    }

    .content h2 {
        margin-top: 2rem;
    }
}

/* === Focus — prístupnosť klávesnice === */
*:focus-visible {
    outline: 2px solid var(--color-brand-red);
    outline-offset: 2px;
    border-radius: 2px;
}

.site-nav a:focus-visible {
    outline-offset: 0;
}

/* === Print === */
@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }

    .site-header,
    .site-footer,
    .site-nav {
        display: none;
    }

    .site-main {
        padding: 0;
    }

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

    .content a {
        color: #000;
        text-decoration: underline;
    }

    .content a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }

    .content blockquote.accent {
        background: #eee;
        color: #000;
    }

    .content blockquote.accent::before {
        display: none;
    }

    .content blockquote.accent p {
        color: #000;
    }

    .content pre {
        background: #f0f0f0;
        color: #000;
        border: 1px solid #ccc;
    }

    .content img {
        box-shadow: none;
    }
}
