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

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

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
    color: var(--color-primary);
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ─── Container ──────────────────────────────────────────── */
.stb-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 16px;
}

/* ─── Layout (Main + Sidebar) ────────────────────────────── */
.stb-layout {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--gap);
    padding: 40px 0;
}

@media (max-width: 1024px) {
    .stb-layout {
        grid-template-columns: 1fr;
    }
}

/* ─── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    margin-bottom: 1rem;
}

/* ─── Section Headers ────────────────────────────────────── */
.stb-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.stb-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 12px;
}

.stb-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: #000000;
    border-radius: 2px;
}

/* ─── Buttons ────────────────────────────────────────────── */
.stb-btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius);
    transition: background 0.2s ease, transform 0.2s ease;
}

.stb-btn:hover {
    background: var(--color-primary-hover);
    color: #fff;
    transform: translateY(-1px);
}

/* ─── Badge ──────────────────────────────────────────────── */
.stb-badge-cat {
    display: inline-block;
    padding: 4px 12px;
    background: var(--color-primary);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 2px;
    transition: background 0.2s ease;
}

.stb-badge-cat:hover {
    background: var(--color-primary-hover);
    color: #fff;
}

/* ─── Cards ──────────────────────────────────────────────── */
.stb-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stb-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
}

.stb-card-thumb {
    position: relative;
    overflow: hidden;
}

.stb-card-thumb img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.stb-card:hover .stb-card-thumb img {
    transform: scale(1.05);
}

.stb-card-body {
    padding: 20px;
}

.stb-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 8px 0;
}

.stb-card-title a {
    color: var(--color-text);
}

.stb-card-title a:hover {
    color: var(--color-primary);
}

.stb-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.stb-meta-author {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stb-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.stb-card-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ─── Archive Grid ───────────────────────────────────────── */
.stb-archive-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 640px) {
    .stb-archive-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Pagination ─────────────────────────────────────────── */
.stb-pagination {
    padding: 32px 0;
    text-align: center;
}

.stb-pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.stb-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.stb-pagination .page-numbers:hover {
    background: var(--color-surface);
    color: var(--color-primary);
}

.stb-pagination .page-numbers.current {
    background: var(--color-primary);
    color: #fff;
}

/* ─── Breadcrumbs Bar ────────────────────────────────────── */
.stb-breadcrumbs-bar {
    background: var(--color-surface);
    padding: 12px 0;
    margin-bottom: 5px;
    border-bottom: 1px solid var(--color-border);
}

.stb-breadcrumbs {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.stb-breadcrumbs a {
    color: var(--color-text-secondary);
}

.stb-breadcrumbs a:hover {
    color: var(--color-primary);
}

.stb-bc-sep {
    margin: 0 6px;
    color: var(--color-text-secondary);
}

.stb-bc-current {
    color: var(--color-text);
    font-weight: 500;
}

/* ─── Archive Header ─────────────────────────────────────── */
.stb-archive-header {
    background: var(--color-footer-bg);
    padding: 32px 0;
    margin-bottom: 0;
}

.stb-archive-header .stb-breadcrumbs,
.stb-archive-header .stb-breadcrumbs a,
.stb-archive-header .stb-bc-sep {
    color: rgba(255, 255, 255, 0.6);
}

.stb-archive-header .stb-breadcrumbs a:hover {
    color: #fff;
}

.stb-archive-header .stb-bc-current {
    color: #fff;
}

.stb-archive-title {
    color: #fff;
    margin-top: 12px;
    font-size: 1.75rem;
}

.stb-archive-desc {
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
    font-size: 0.9rem;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.stb-sidebar {
    position: static;
}

.stb-widget {
    margin-bottom: 24px;
    padding: 20px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.stb-widget-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--color-border);
    position: relative;
}

.stb-widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: #000000;
}

/* Sidebar Tabs */
.stb-tab-nav {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 16px;
}

.stb-tab-nav li {
    flex: 1;
}

.stb-tab-nav a {
    display: block;
    text-align: center;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.stb-tab-nav a.stb-tab-active,
.stb-tab-nav a:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Sidebar Posts */
.stb-sidebar-post {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}

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

.stb-sidebar-post-thumb {
    flex-shrink: 0;
}

.stb-sidebar-post-thumb img {
    width: 94px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius);
}

.stb-sidebar-post-meta {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.stb-sidebar-post-meta a {
    color: var(--color-primary);
    font-weight: 500;
}

.stb-meta-sep {
    margin: 0 4px;
}

.stb-sidebar-post-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
}

.stb-sidebar-post-title a {
    color: var(--color-text);
}

.stb-sidebar-post-title a:hover {
    color: var(--color-primary);
}

/* Category List */
.stb-category-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

.stb-category-list li:last-child {
    border-bottom: none;
}

.stb-category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--color-text);
}

.stb-category-list a:hover {
    color: var(--color-primary);
}

.stb-cat-count {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* ─── Article Single ─────────────────────────────────────── */
.stb-article-header {
    margin-bottom: 24px;
}

.stb-article-header .stb-badge-cat {
    margin-bottom: 12px;
}

.stb-article-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 16px;
}

.stb-article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.stb-article-thumbnail {
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
}

.stb-article-thumbnail img {
    width: 100%;
}

.stb-article-content {
    font-size: 1rem;
    line-height: 1.8;
}

.stb-article-content h2 {
    margin: 32px 0 16px;
    font-size: 1.5rem;
}

.stb-article-content h3 {
    margin: 24px 0 12px;
    font-size: 1.25rem;
}

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

.stb-article-content ul,
.stb-article-content ol {
    margin: 0 0 1.25rem 24px;
    list-style: disc;
}

.stb-article-content ol {
    list-style: decimal;
}

.stb-article-content li {
    margin-bottom: 0.5rem;
}

.stb-article-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--color-surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
}

.stb-article-content img {
    border-radius: var(--radius);
    margin: 16px 0;
}

/* Tags */
.stb-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.stb-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.stb-tag:hover {
    background: var(--color-primary);
    color: #fff;
}

/* Author Box */
.stb-author-box {
    display: flex;
    gap: 20px;
    padding: 24px;
    margin: 32px 0;
    background: var(--color-surface);
    border-radius: var(--radius);
}

.stb-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.stb-author-name {
    font-size: 1rem;
    margin-bottom: 8px;
}

.stb-author-bio {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Post Navigation */
.stb-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 32px 0;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.stb-post-nav-prev,
.stb-post-nav-next {
    padding: 16px;
    background: var(--color-surface);
    border-radius: var(--radius);
    transition: background 0.2s ease;
}

.stb-post-nav-prev:hover,
.stb-post-nav-next:hover {
    background: var(--color-border);
}

.stb-post-nav-next {
    text-align: right;
}

.stb-post-nav-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stb-post-nav-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

/* ─── Related Posts ──────────────────────────────────────── */
.stb-related {
    margin-top: 40px;
}

.stb-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stb-related-card {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease;
}

.stb-related-card:hover {
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .stb-related-grid {
        grid-template-columns: 1fr;
    }
    .stb-post-nav {
        grid-template-columns: 1fr;
    }
}

/* ─── 404 Page ───────────────────────────────────────────── */
.stb-404 {
    text-align: center;
    padding: 80px 16px;
}

.stb-404-code {
    font-size: 8rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 16px;
}

.stb-404-title {
    font-size: 1.75rem;
    margin-bottom: 12px;
}

.stb-404-text {
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

.stb-404-search {
    max-width: 400px;
    margin: 24px auto 0;
}

/* ─── Contact Form ───────────────────────────────────────── */
.stb-contact-form {
    max-width: 600px;
    margin-top: 24px;
}

.stb-form-group {
    margin-bottom: 20px;
}

.stb-form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.stb-form-group input,
.stb-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.stb-form-group input:focus,
.stb-form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(16, 147, 234, 0.1);
}

.stb-form-status {
    margin-top: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.stb-form-success {
    color: #38a169;
}

.stb-form-error {
    color: #e53e3e;
}

/* ─── Page ───────────────────────────────────────────────── */
.stb-page-title {
    margin-bottom: 24px;
    font-size: 2rem;
    font-weight: 800;
}

.stb-page-content {
    font-size: 1rem;
    line-height: 1.8;
}

.stb-page-content h2 { margin: 32px 0 16px; }
.stb-page-content h3 { margin: 24px 0 12px; }
.stb-page-content p { margin-bottom: 1.25rem; }
.stb-page-content ul,
.stb-page-content ol { margin: 0 0 1.25rem 24px; list-style: disc; }
.stb-page-content ol { list-style: decimal; }

/* ─── No Results ─────────────────────────────────────────── */
.stb-no-results {
    text-align: center;
    padding: 60px 16px;
}

.stb-no-results h2 {
    margin-bottom: 12px;
}

.stb-no-results p {
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

/* ─── Search Form ────────────────────────────────────────── */
.search-form {
    display: flex;
    gap: 8px;
}

.search-form .search-field {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.search-form .search-submit {
    padding: 10px 20px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
}

/* ─── Placeholder Image ─────────────────────────────────── */
.stb-placeholder-img {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-border) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── CB Kreacja Separator ───────────────────────────────── */
.stb-kreacja-separator {
    margin: 24px auto;
}

.stb-kreacja-widget {
    padding: 0;
    background: none;
    box-shadow: none;
}

/* ─── TOC ────────────────────────────────────────────────── */
.stb-toc {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 24px 0;
}

.stb-toc-title {
    font-size: 1rem;
    margin-bottom: 12px;
}

.stb-toc-list {
    list-style: decimal;
    margin-left: 20px;
}

.stb-toc-list li {
    padding: 4px 0;
    font-size: 0.9rem;
}

.stb-toc-list a {
    color: #000000;
}

.stb-toc-list a:hover {
    color: var(--color-primary);
}

.stb-toc-sub {
    margin-left: 16px;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    .stb-article-title { font-size: 1.5rem; }
    .stb-container { padding: 0 12px; }
    .stb-layout { padding: 24px 0; gap: 24px; }
    .stb-author-box { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 480px) {
    body { font-size: 15px; }
    .stb-card-thumb img { height: 200px; }
    .stb-card-body { padding: 16px; }
}
