/* ============================================================
   BLOG.CSS — Lista wpisów (/blog/) + typografia artykułu
   Jednorazowy arkusz dla całego bloga. Tokeny z variables.css.
   ============================================================ */

/* ===========================================================
   1. NAGŁÓWEK SEKCJI BLOGA
   =========================================================== */
.blog-hero {
    padding: calc(var(--navbar-height) + var(--space-16)) 0 var(--space-12);
    background: var(--gradient-hero);
    text-align: center;
}

.blog-hero__container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.blog-hero h1 {
    font-size: var(--text-5xl);
    color: var(--color-slate-900);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-4);
}

.blog-hero p {
    font-size: var(--text-lg);
    color: var(--color-slate-600);
    line-height: 1.6;
}

/* ===========================================================
   2. LISTA WPISÓW (układ poziomy)
   =========================================================== */
.blog-list {
    max-width: 880px;
    margin: 0 auto;
    padding: var(--space-16) var(--container-padding) var(--space-24);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.blog-card {
    position: relative;
    display: grid;
    grid-template-columns: 240px 1fr;
    align-items: stretch;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.blog-card:hover,
.blog-card:focus-within {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
    border-color: var(--color-primary-light);
}

.blog-card__media {
    position: relative;
    overflow: hidden;
    /* tło = kolor tła grafiki og (#0f172a), żeby „contain" zlewał się bez pasów */
    background: var(--color-slate-900);
    min-height: 100%;
}

/* Cała grafika widoczna (bez przycinania); wpisana w ramkę, nie wychodzi poza nią */
.blog-card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.blog-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-6);
    min-width: 0;
}

.blog-card__cat {
    align-self: flex-start;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.blog-card__title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-slate-900);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

/* Cały kafelek klikalny: link rozciągnięty na kartę */
.blog-card__title a {
    color: inherit;
}
.blog-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.blog-card__excerpt {
    font-size: var(--text-base);
    color: var(--color-slate-600);
    line-height: 1.6;
}

.blog-card__meta {
    margin-top: auto;
    padding-top: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-slate-500);
}

.blog-card__meta .dot {
    width: 3px;
    height: 3px;
    border-radius: var(--radius-full);
    background: var(--color-slate-300);
}

.blog-card__arrow {
    margin-left: auto;
    color: var(--color-primary);
    font-weight: var(--font-semibold);
    transition: transform var(--transition-fast);
}

.blog-card:hover .blog-card__arrow {
    transform: translateX(3px);
}

@media (max-width: 640px) {
    .blog-card {
        grid-template-columns: 1fr;
    }
    .blog-card__media {
        aspect-ratio: 16 / 9;
        min-height: 0;
    }
    .blog-card__body {
        padding: var(--space-5) var(--space-5) var(--space-6);
    }
    .blog-hero h1 {
        font-size: var(--text-4xl);
    }
}

/* ===========================================================
   3. ARTYKUŁ — nagłówek
   =========================================================== */
.post {
    padding-top: var(--navbar-height);
}

.post__header {
    max-width: 760px;
    margin: 0 auto;
    padding: var(--space-12) var(--container-padding) var(--space-8);
}

.post__breadcrumb {
    font-size: var(--text-sm);
    color: var(--color-slate-500);
    margin-bottom: var(--space-6);
}

.post__breadcrumb a {
    color: var(--color-slate-500);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.post__breadcrumb a:hover {
    color: var(--color-primary);
}

.post__cat {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: var(--space-3);
}

.post__title {
    font-size: var(--text-5xl);
    color: var(--color-slate-900);
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-5);
}

.post__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-slate-500);
}

.post__meta .dot {
    width: 3px;
    height: 3px;
    border-radius: var(--radius-full);
    background: var(--color-slate-300);
}

.post__meta strong {
    color: var(--color-slate-700);
    font-weight: var(--font-semibold);
}

/* ===========================================================
   4. ARTYKUŁ — treść (prose)
   =========================================================== */
.post-prose {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 var(--container-padding) var(--space-16);
    color: var(--color-slate-700);
    font-size: var(--text-lg);
    line-height: 1.75;
}

.post-prose > p {
    margin-bottom: var(--space-6);
}

.post-prose h2 {
    font-size: var(--text-3xl);
    color: var(--color-slate-900);
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: var(--space-12) 0 var(--space-5);
}

.post-prose h3 {
    font-size: var(--text-xl);
    color: var(--color-slate-900);
    line-height: 1.3;
    margin: var(--space-8) 0 var(--space-4);
}

.post-prose ul,
.post-prose ol {
    margin: 0 0 var(--space-6) var(--space-6);
    padding: 0;
}

.post-prose ul li {
    list-style: disc;
    margin-bottom: var(--space-3);
    padding-left: var(--space-2);
}

.post-prose ol li {
    list-style: decimal;
    margin-bottom: var(--space-3);
    padding-left: var(--space-2);
}

.post-prose strong {
    color: var(--color-slate-900);
    font-weight: var(--font-semibold);
}

.post-prose a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}
.post-prose a:hover {
    color: var(--color-primary-hover);
}

.post-prose figure {
    margin: var(--space-8) 0;
}

.post-prose img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
}

.post-prose figcaption {
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-slate-500);
    text-align: center;
}

/* Blockquote / disclaimer */
.post-prose blockquote {
    margin: var(--space-8) 0;
    padding: var(--space-5) var(--space-6);
    background: var(--color-blue-50);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-base);
    color: var(--color-slate-700);
    font-size: var(--text-base);
    line-height: 1.7;
}

.post-prose blockquote p {
    margin: 0;
}

/* Tabela */
.post-prose .post-table-wrap {
    overflow-x: auto;
    margin: var(--space-8) 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.post-prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.post-prose th,
.post-prose td {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.post-prose thead th {
    background: var(--color-surface-alt);
    color: var(--color-slate-900);
    font-weight: var(--font-semibold);
}

.post-prose tbody tr:last-child td {
    border-bottom: none;
}

/* ===========================================================
   5. ARTYKUŁ — autor + CTA końcowe
   =========================================================== */
.post-author {
    max-width: 760px;
    margin: var(--space-12) auto 0;
    padding: var(--space-6);
    display: flex;
    gap: var(--space-5);
    align-items: center;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.post-author__avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--gradient-tofu);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-xl);
}

.post-author__name {
    font-weight: var(--font-bold);
    color: var(--color-slate-900);
}

.post-author__role {
    font-size: var(--text-sm);
    color: var(--color-slate-600);
    line-height: 1.5;
}

.post-cta {
    max-width: 760px;
    margin: var(--space-8) auto var(--space-24);
    padding: var(--space-10);
    text-align: center;
    background: var(--color-ink);
    border-radius: var(--radius-xl);
    color: #fff;
}

.post-cta h2 {
    font-size: var(--text-3xl);
    color: #fff;
    margin-bottom: var(--space-3);
}

.post-cta p {
    color: var(--color-slate-300);
    font-size: var(--text-base);
    max-width: 480px;
    margin: 0 auto var(--space-6);
    line-height: 1.6;
}

@media (max-width: 640px) {
    .post__title {
        font-size: var(--text-4xl);
    }
    .post-prose {
        font-size: var(--text-base);
    }
    .post-cta {
        padding: var(--space-8) var(--space-6);
    }
}
