/**
 * BlogCMS - Classic Theme
 * Czysty, nowoczesny, minimalistyczny design
 * Responsywny (mobile-first), system font stack
 */

/* ─── Reset i bazowe style ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #2d3436;
    background-color: #ffffff;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #0984e3;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0652DD;
    text-decoration: underline;
}

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

/* ─── Kontener ─── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ─── Nawigacja ─── */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid #dfe6e9;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.navbar-brand {
    font-size: 1.35rem;
    font-weight: 700;
    color: #2d3436;
    text-decoration: none;
    white-space: nowrap;
}

.navbar-brand:hover {
    color: #0984e3;
    text-decoration: none;
}

/* Hamburger (mobile) */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    gap: 5px;
}

.hamburger {
    display: block;
    width: 22px;
    height: 2px;
    background: #2d3436;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Menu nawigacyjne */
.navbar-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.navbar-menu li a {
    display: block;
    padding: 0.5rem 0.85rem;
    color: #636e72;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
    text-decoration: none;
}

.navbar-menu li a:hover {
    background: #f1f2f6;
    color: #0984e3;
    text-decoration: none;
}

/* ─── Główny wrapper ─── */
.site-wrapper {
    flex: 1;
    padding: 2rem 0;
}

/* ─── Layout: treść + sidebar ─── */
.content-layout {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.content-layout.with-sidebar .main-content {
    flex: 1;
    min-width: 0; /* zapobieganie overflow */
}

.content-layout.with-sidebar .sidebar {
    width: 320px;
    flex-shrink: 0;
}

.content-layout.full-width .main-content {
    width: 100%;
}

/* ─── Hero / Intro ─── */
.hero {
    text-align: center;
    padding: 2rem 0 2.5rem;
    border-bottom: 1px solid #dfe6e9;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 0.5rem;
}

.hero-desc {
    font-size: 1.1rem;
    color: #636e72;
    max-width: 600px;
    margin: 0 auto;
}

/* ─── Siatka wpisów ─── */
.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ─── Karta wpisu ─── */
.post-card {
    border-bottom: 1px solid #dfe6e9;
    padding-bottom: 2rem;
}

.post-card:last-child {
    border-bottom: none;
}

.post-card-image {
    display: block;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card-image:hover img {
    transform: scale(1.02);
}

.post-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Badge kategorii */
.category-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0984e3;
    background: #e8f4fd;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-decoration: none;
    align-self: flex-start;
    transition: background 0.2s ease;
}

.category-badge:hover {
    background: #d0e9fa;
    text-decoration: none;
}

/* Tytuł karty */
.post-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
}

.post-card-title a {
    color: #2d3436;
    text-decoration: none;
}

.post-card-title a:hover {
    color: #0984e3;
}

/* Excerpt */
.post-card-excerpt {
    color: #636e72;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Meta karty */
.post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #b2bec3;
    margin-top: 0.25rem;
}

.post-card-meta time {
    color: #b2bec3;
}

.read-more {
    font-weight: 600;
    color: #0984e3;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* ─── Paginacja ─── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    font-size: 0.9rem;
    color: #636e72;
    background: #ffffff;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: #f1f2f6;
    color: #0984e3;
    border-color: #0984e3;
    text-decoration: none;
}

.pagination-btn.active {
    background: #0984e3;
    color: #ffffff;
    border-color: #0984e3;
    font-weight: 600;
}

/* ─── Pojedynczy wpis ─── */
.single-post .category-badge {
    margin-bottom: 0.5rem;
}

.post-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 0.75rem;
    color: #2d3436;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: #b2bec3;
    margin-bottom: 1.5rem;
}

.post-views::before {
    content: '|';
    margin-right: 1.5rem;
    color: #dfe6e9;
}

.post-featured-image {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
}

/* Treść wpisu — typografia */
.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #2d3436;
}

.post-content p {
    margin-bottom: 1.25rem;
}

.post-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: #2d3436;
}

.post-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 1.75rem 0 0.75rem;
    color: #2d3436;
}

.post-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
}

.post-content ul,
.post-content ol {
    margin: 1rem 0 1.25rem 1.5rem;
}

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

.post-content blockquote {
    border-left: 4px solid #0984e3;
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    color: #636e72;
    border-radius: 0 6px 6px 0;
}

.post-content img {
    border-radius: 8px;
    margin: 1.5rem 0;
}

.post-content pre {
    background: #2d3436;
    color: #dfe6e9;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.post-content code {
    background: #f1f2f6;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-content th,
.post-content td {
    padding: 0.65rem 1rem;
    border: 1px solid #dfe6e9;
    text-align: left;
}

.post-content th {
    background: #f1f2f6;
    font-weight: 600;
}

.post-content a {
    color: #0984e3;
    text-decoration: underline;
}

.post-content a:hover {
    color: #0652DD;
}

/* ─── Nagłówek kategorii ─── */
.category-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dfe6e9;
}

.category-header h1 {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.category-desc {
    color: #636e72;
    font-size: 1rem;
}

/* ─── Strona statyczna ─── */
.static-page .page-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

/* ─── Breadcrumbs ─── */
.breadcrumbs {
    margin-bottom: 1.5rem;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    font-size: 0.85rem;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    color: #b2bec3;
}

.breadcrumbs li a {
    color: #636e72;
    text-decoration: none;
}

.breadcrumbs li a:hover {
    color: #0984e3;
}

.breadcrumb-sep {
    margin: 0 0.5rem;
    color: #b2bec3;
    font-size: 0.75rem;
}

/* ─── Komentarze ─── */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #dfe6e9;
}

.comments-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.no-comments {
    color: #b2bec3;
    font-style: italic;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.comment {
    border-left: 3px solid #0984e3;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border-radius: 0 6px 6px 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 700;
    color: #2d3436;
    font-size: 0.95rem;
}

.comment-date {
    font-size: 0.8rem;
    color: #b2bec3;
}

.comment-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #2d3436;
}

/* ─── Sidebar ─── */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.widget {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem;
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #2d3436;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0984e3;
}

/* Widget: About */
.widget-about-image {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.widget-about p {
    font-size: 0.9rem;
    color: #636e72;
    line-height: 1.6;
}

/* Widget: Kategorie */
.widget-categories-list {
    list-style: none;
}

.widget-categories-list li {
    border-bottom: 1px solid #e9ecef;
}

.widget-categories-list li:last-child {
    border-bottom: none;
}

.widget-categories-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    color: #2d3436;
    font-size: 0.9rem;
    text-decoration: none;
}

.widget-categories-list li a:hover {
    color: #0984e3;
}

.cat-count {
    color: #b2bec3;
    font-size: 0.8rem;
}

/* Widget: Ostatnie wpisy */
.widget-recent-list {
    list-style: none;
}

.widget-recent-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.widget-recent-list li:last-child {
    border-bottom: none;
}

.widget-recent-list li a {
    display: block;
    font-size: 0.9rem;
    color: #2d3436;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 0.15rem;
}

.widget-recent-list li a:hover {
    color: #0984e3;
}

.widget-recent-list li time {
    font-size: 0.78rem;
    color: #b2bec3;
}

/* Widget: Linki */
.widget-links-list {
    list-style: none;
}

.widget-links-list li {
    padding: 0.35rem 0;
}

.widget-links-list li a {
    font-size: 0.9rem;
    color: #0984e3;
}

/* Widget: Wyszukiwarka */
.widget-search-form {
    display: flex;
    gap: 0;
}

.widget-search-input {
    flex: 1;
    padding: 0.55rem 0.75rem;
    border: 1px solid #dfe6e9;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 0.9rem;
    background: #ffffff;
    color: #2d3436;
    outline: none;
    transition: border-color 0.2s ease;
}

.widget-search-input:focus {
    border-color: #0984e3;
}

.widget-search-btn {
    padding: 0.55rem 1rem;
    background: #0984e3;
    color: #ffffff;
    border: 1px solid #0984e3;
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.widget-search-btn:hover {
    background: #0652DD;
}

/* Widget: Custom HTML */
.widget-custom-html {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ─── Przyciski ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #0984e3;
    color: #ffffff;
}

.btn-primary:hover {
    background: #0652DD;
    color: #ffffff;
    text-decoration: none;
}

/* ─── Strona 404 ─── */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-404 h1 {
    font-size: 6rem;
    font-weight: 800;
    color: #dfe6e9;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.error-message {
    font-size: 1.5rem;
    font-weight: 600;
    color: #636e72;
    margin-bottom: 1rem;
}

.error-404 p {
    color: #b2bec3;
    margin-bottom: 2rem;
}

/* ─── Stopka ─── */
.site-footer {
    background: #f8f9fa;
    border-top: 1px solid #dfe6e9;
    padding: 2rem 0;
    margin-top: 2rem;
    text-align: center;
}

.footer-text {
    font-size: 0.9rem;
    color: #636e72;
    margin-bottom: 0.35rem;
}

.footer-copy {
    font-size: 0.8rem;
    color: #b2bec3;
}

/* ─── Brak wpisów ─── */
.no-posts {
    color: #b2bec3;
    font-style: italic;
    text-align: center;
    padding: 3rem 0;
}

/* ─── Responsywność ─── */

/* Tablet i mniejsze */
@media (max-width: 992px) {
    .content-layout.with-sidebar .sidebar {
        width: 280px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Nawigacja mobilna */
    .navbar-toggle {
        display: flex;
    }

    .navbar-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #ffffff;
        border-bottom: 1px solid #dfe6e9;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        padding: 0.5rem 0;
        z-index: 999;
    }

    .navbar-menu.open {
        display: flex;
    }

    .navbar-menu li a {
        padding: 0.75rem 1.25rem;
        border-radius: 0;
    }

    /* Animacja hamburgera — stan aktywny */
    .navbar-toggle.active .hamburger:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .navbar-toggle.active .hamburger:nth-child(2) {
        opacity: 0;
    }

    .navbar-toggle.active .hamburger:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Layout mobilny — kolumna */
    .content-layout {
        flex-direction: column;
    }

    .content-layout.with-sidebar .sidebar {
        width: 100%;
    }

    /* Mniejsze czcionki */
    .hero h1 {
        font-size: 1.5rem;
    }

    .post-title {
        font-size: 1.5rem;
    }

    .post-card-title {
        font-size: 1.2rem;
    }

    .category-header h1 {
        font-size: 1.4rem;
    }

    .error-404 h1 {
        font-size: 4rem;
    }

    /* Paginacja — zawijanie */
    .pagination {
        gap: 0.25rem;
    }

    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
        padding: 0 0.5rem;
    }

    /* Meta wpisu — kolumna */
    .post-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
}

/* Mały mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .hero {
        padding: 1.25rem 0 1.5rem;
    }

    .site-wrapper {
        padding: 1.25rem 0;
    }
}
