/* ===================================
   SEMTAK Base — base.css
   Wspolne style dla wszystkich zaplecz.
   Prefix: stb- (semtak-base)
   =================================== */

/* === 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, 'Oxygen', sans-serif);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text, #1a1a1a);
    background-color: var(--color-bg, #ffffff);
    -webkit-font-smoothing: antialiased;
}

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

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

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

/* CB kreacje — przywróć style pluginu (nie nadpisuj) */
.cb-pad a, .cb-pad a:hover, .cb-pad a:visited { color: inherit; text-decoration: none; transition: none; }
.cb-pad img { display: inline; max-width: 100%; height: auto; }
.cb-pad h1, .cb-pad h2, .cb-pad h3, .cb-pad h4, .cb-pad h5, .cb-pad h6 { font-family: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; color: inherit; margin: 0; }

/* === Container === */
.stb-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === Skip Link === */
.stb-skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: #fff;
    z-index: 200;
    border-radius: var(--radius);
}

.stb-skip-link:focus {
    top: 0.5rem;
}

/* === Header === */
.stb-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-header-bg);
    color: var(--color-header-text);
}

/* === Navigation === */
.stb-nav .stb-menu,
.stb-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
}

.stb-nav .stb-menu li a,
.stb-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--color-header-text);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: background 0.2s, color 0.2s;
}

.stb-nav .stb-menu li a:hover,
.stb-nav .stb-menu li.current-menu-item a {
    color: var(--color-accent);
}

/* Sub-menu */
.stb-nav .stb-menu li,
.stb-menu li {
    position: relative;
}

.stb-nav .sub-menu,
.stb-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    list-style: none;
    z-index: 101;
    padding: 0.5rem 0;
}

.stb-nav .stb-menu li:hover > .sub-menu,
.stb-menu li:hover > .sub-menu {
    display: block;
}

.stb-nav .sub-menu li a,
.stb-menu .sub-menu li a {
    padding: 0.4rem 1.25rem;
    font-size: 0.85rem;
    color: #1a1a1a;
}

.stb-nav .sub-menu li a:hover,
.stb-menu .sub-menu li a:hover {
    color: var(--color-accent);
}

/* Hamburger */
.stb-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.stb-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-header-text);
    transition: transform 0.3s, opacity 0.3s;
}

.stb-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.stb-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.stb-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* === Main Content === */
.stb-main {
    padding: 2rem 0;
    min-height: 60vh;
}

/* === Layout: Content + Sidebar === */
.stb-layout-sidebar .stb-layout-inner {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    align-items: start;
}

/* === Post Grid (archive, index) === */
.stb-post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* === Card === */
.stb-card {
    background: var(--color-card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s, transform 0.3s;
}

.stb-card:hover {
    box-shadow: var(--shadow-hover);
    transform: scale(1.01);
}

.stb-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.stb-card-thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

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

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

.stb-card-body {
    padding: 1.25rem;
}

.stb-card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

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

.stb-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* === Article Content (single.php) === */
.stb-post-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.stb-post-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.stb-featured-image {
    margin-bottom: 2rem;
    border-radius: var(--radius);
    overflow: hidden;
}

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

.stb-post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}

.stb-post-content h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    color: var(--color-text);
}

.stb-post-content h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: var(--color-text);
}

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

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

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

.stb-post-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--color-accent);
    background: rgba(0, 0, 0, 0.03);
    font-style: italic;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.stb-post-content img {
    border-radius: var(--radius);
    margin: 1.5rem auto;
}

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

.stb-post-content th,
.stb-post-content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    text-align: left;
}

.stb-post-content th {
    background: #f5f5f5;
    color: #222;
    font-weight: 600;
}

/* === Tags === */
.stb-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.stb-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 20px;
    color: #666;
}

.stb-tag a { color: inherit; }
.stb-tag:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* === Related Posts === */
.stb-related {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.stb-related-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--color-text);
}

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

.stb-related-card {
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s;
}

.stb-related-card:hover { box-shadow: var(--shadow-hover); }

.stb-related-thumb {
    aspect-ratio: 370 / 250;
    overflow: hidden;
}

.stb-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stb-related-card-title {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: #222;
}

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

.stb-widget {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.stb-widget-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-text);
    color: var(--color-text);
}

.stb-widget ul { list-style: none; }
.stb-widget ul li { padding: 0.4rem 0; border-bottom: 1px solid var(--color-border); }
.stb-widget ul li:last-child { border-bottom: none; }
.stb-widget ul li a { font-size: 0.9rem; }

/* === Breadcrumbs === */
.stb-breadcrumbs { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-bottom: 1.5rem; }
.stb-breadcrumbs a { color: rgba(255,255,255,0.6); }
.stb-breadcrumbs a:hover { color: #fff; }
.stb-breadcrumbs-sep { margin: 0 0.4rem; color: rgba(255,255,255,0.3); }
.stb-breadcrumbs-current { color: rgba(255,255,255,0.9); }

/* === Archive Header === */
.stb-archive-header {
    background: var(--color-primary);
    color: #fff;
    margin-bottom: 5px;
}

.stb-archive-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-height: 100px;
    padding-top: 1.1rem;
    padding-bottom: 0.9rem;
    gap: 1.5rem;
}

.stb-archive-header h1,
.stb-archive-header .stb-post-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
    color: #fff;
}

.stb-archive-header .stb-breadcrumbs { margin-bottom: 0; white-space: nowrap; flex-shrink: 0; }
.stb-archive-header .stb-breadcrumbs a,
.stb-archive-header .stb-breadcrumbs-sep,
.stb-archive-header .stb-breadcrumbs-current { color: rgba(255,255,255,0.8); }
.stb-archive-header .stb-breadcrumbs a:hover { color: #fff; }

@media (max-width: 768px) {
    .stb-archive-header-inner {
        flex-direction: column;
        align-items: flex-start;
        max-height: none;
        gap: 0.25rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .stb-archive-header h1,
    .stb-archive-header .stb-post-title {
        font-size: 1.2rem;
    }
}

/* === Pagination === */
.navigation.pagination { margin-top: 2.5rem; text-align: center; }

.navigation.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.navigation.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-card-bg);
    box-shadow: var(--shadow);
    transition: background 0.2s, color 0.2s;
}

.navigation.pagination .page-numbers:hover,
.navigation.pagination .page-numbers.current {
    background: var(--color-accent);
    color: #fff;
}

/* === TOC === */
.stb-toc {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 2rem;
}

.stb-toc-title { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; margin-bottom: 0.75rem; }
.stb-toc-list { padding-left: 1.25rem; }
.stb-toc-list li { margin-bottom: 0.3rem; }
.stb-toc-list li a { font-size: 0.9rem; color: var(--color-text); }
.stb-toc-list li a:hover { color: var(--color-accent); }
.stb-toc-sub { margin-left: 1rem; font-size: 0.85rem; }

/* === Footer === */
.stb-footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: 2rem 0;
    margin-top: 2rem;
}

.stb-footer-legal { text-align: center; font-size: 0.8rem; color: #999; }
.stb-footer-legal p { margin-bottom: 0.25rem; }

/* === 404 === */
.stb-404 h1 { font-family: var(--font-heading); font-size: 6rem; font-weight: 700; color: var(--color-accent); line-height: 1; }
.stb-404 p { font-size: 1.2rem; color: #666; margin: 1rem 0 2rem; }

/* === Button === */
.stb-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.stb-btn:hover { transform: translateY(-1px); opacity: 0.9; color: #fff; }

/* === Back to Top === */
.stb-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: var(--shadow-hover);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 50;
}

.stb-back-to-top:hover { transform: translateY(-2px); }

/* === No Results === */
.stb-no-results { text-align: center; padding: 3rem 0; }
.stb-no-results h2 { font-family: var(--font-heading); font-size: 1.5rem; margin-bottom: 1rem; }
.stb-no-results p { color: var(--color-text-secondary); margin-bottom: 1rem; }

/* === Reading Time === */
.stb-reading-time::before { content: ''; }

/* === Page Content === */
.stb-page-content { max-width: 800px; margin: 0 auto; }

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 1024px) {
    .stb-layout-sidebar .stb-layout-inner {
        grid-template-columns: 1fr 280px;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .stb-layout-sidebar .stb-layout-inner { grid-template-columns: 1fr; }
    .stb-post-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .stb-related-grid { grid-template-columns: repeat(2, 1fr); }

    .stb-menu-toggle { display: flex; }

    .stb-post-title { font-size: 1.6rem; }
    .stb-sidebar { position: static; }
}

@media (max-width: 480px) {
    .stb-post-grid { grid-template-columns: 1fr; }
    .stb-related-grid { grid-template-columns: 1fr; }
    .stb-post-title { font-size: 1.4rem; }
    .stb-post-content { font-size: 1rem; }
    .stb-container { padding: 0 1rem; }
}
