/* ============================================
   BASE.CSS — Core styles for kanapy-rozkladane
   Design: PenNews Fashion Magazine replica
   Prefix: stb-
   Author: Damian Zięba <biuro@semtak.pl>
   ============================================ */

/* ── 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: var(--body-size);
    line-height: var(--body-lh);
    color: var(--text-primary);
    background: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea { font-family: inherit; font-size: inherit; }

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

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

/* ── Layout (main + sidebar) ───────────────── */
.stb-layout {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--gap);
    align-items: start;
}
.stb-layout-main { min-width: 0; }
.stb-layout-sidebar { min-width: 0; }

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

/* ── Section titles (PenNews style-title-11: thin lines) ── */
.stb-section-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}
.stb-section-title--lines {
    display: flex;
    align-items: center;
    gap: 20px;
}
.stb-section-title--lines::before,
.stb-section-title--lines::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}
.stb-section-title--lines span {
    white-space: nowrap;
}
.stb-section-title--light { color: #fff; }
.stb-section-title--light::before,
.stb-section-title--light::after { background: rgba(255,255,255,0.2); }

/* ── Sections ──────────────────────────────── */
.stb-section { padding: 48px 0; }
.stb-section--gray { background: var(--bg-surface); }
.stb-section--dark { background: var(--bg-dark); color: #fff; }
.stb-section--dark .stb-card-title a { color: #fff; }
.stb-section--dark .stb-meta { color: rgba(255,255,255,0.6); }

/* ── Cards ─────────────────────────────────── */
.stb-card { border-radius: var(--radius); overflow: hidden; }
.stb-card-thumb {
    display: block;
    overflow: hidden;
    position: relative;
}
.stb-card-thumb img {
    width: 100%;
    height: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.stb-card:hover .stb-card-thumb img {
    opacity: 0.85;
    transform: scale(1.02);
}
.stb-card-body { padding: 16px 0; }
.stb-card-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}
.stb-card-title a:hover { color: var(--accent); }
.stb-card--large .stb-card-title { font-size: 22px; }
.stb-card-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}
.stb-card-no-thumb {
    background: var(--bg-surface);
    aspect-ratio: 370/250;
}

/* Card overlay (dark section cards) */
.stb-card--overlay { position: relative; }
.stb-card--overlay .stb-card-thumb { position: relative; }
.stb-card--overlay .stb-card-thumb img { aspect-ratio: 1/1; object-fit: cover; }
.stb-card-overlay-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}
.stb-card--overlay .stb-card-title { color: #fff; font-size: 16px; margin-bottom: 4px; }
.stb-card--overlay .stb-meta { color: rgba(255,255,255,0.6); }

/* ── Category badge ────────────────────────── */
.stb-cat-badge {
    display: inline-block;
    background: #000;
    color: #fff;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    margin-bottom: 8px;
    transition: var(--transition);
}
.stb-cat-badge:hover { background: var(--accent); color: #fff; }

/* ── Meta ──────────────────────────────────── */
.stb-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--meta-size);
    color: var(--text-meta);
}
.stb-meta svg { vertical-align: -2px; margin-right: 3px; }
.stb-meta span { display: inline-flex; align-items: center; }

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

.stb-widget { margin-bottom: 32px; }
.stb-widget-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--text-primary);
    position: relative;
}

/* Sidebar tabs */
.stb-tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}
.stb-tab-nav li { flex: 1; }
.stb-tab-nav a {
    display: block;
    text-align: center;
    padding: 10px 16px;
    font-family: var(--font-menu);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.stb-tab-nav a.stb-tab-active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.stb-tab-content { display: none; }
.stb-tab-content.stb-tab-active { display: block; }

/* Sidebar posts */
.stb-sidebar-post {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.stb-sidebar-post:last-child { border-bottom: none; }
.stb-sidebar-post-thumb {
    flex-shrink: 0;
    width: 94px;
    height: 70px;
    overflow: hidden;
}
.stb-sidebar-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.stb-sidebar-post-meta {
    font-size: 11px;
    color: var(--text-meta);
    margin-bottom: 4px;
}
.stb-sidebar-post-meta a { color: var(--accent); }
.stb-sidebar-post-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}
.stb-sidebar-post-title a:hover { color: var(--accent); }

/* Sidebar categories */
.stb-category-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.stb-category-list li:last-child { border-bottom: none; }
.stb-category-list a {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}
.stb-cat-count { color: var(--text-meta); }

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

.stb-breadcrumbs {
    font-size: 12px;
    color: var(--text-secondary);
}
.stb-breadcrumbs a { color: var(--text-secondary); }
.stb-breadcrumbs a:hover { color: var(--accent); }
.stb-breadcrumb-sep { margin: 0 6px; }
.stb-breadcrumb-current { color: var(--text-primary); }

/* ── Archive header ────────────────────────── */
.stb-archive-header {
    background: var(--bg-dark);
    color: #fff;
    padding: 32px 0;
    margin-bottom: 32px;
}
.stb-archive-header .stb-breadcrumbs,
.stb-archive-header .stb-breadcrumbs a { color: rgba(255,255,255,0.6); }
.stb-archive-header .stb-breadcrumb-current { color: #fff; }
.stb-archive-title {
    font-size: 32px;
    margin-top: 12px;
    color: #fff;
}
.stb-archive-desc { color: rgba(255,255,255,0.7); margin-top: 8px; }

/* ── Pagination ────────────────────────────── */
.stb-pagination { margin: 48px 0 24px; text-align: center; }
.stb-pagination .nav-links { display: flex; justify-content: center; gap: 4px; }
.stb-pagination a,
.stb-pagination span {
    display: inline-block;
    padding: 8px 14px;
    font-size: 13px;
    border: 1px solid var(--border-color);
}
.stb-pagination .current {
    background: var(--text-primary);
    color: #fff;
    border-color: var(--text-primary);
}
.stb-pagination a:hover { background: var(--bg-surface); }

/* ── Single article ────────────────────────── */
.stb-single-article { margin-bottom: 48px; }
.stb-article-header { margin-bottom: 24px; }
.stb-article-title {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.3;
    margin: 8px 0 16px;
}
.stb-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-meta);
}
.stb-article-meta img { border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 6px; }
.stb-article-featured { margin-bottom: 24px; }
.stb-article-featured img { width: 100%; }
.stb-article-content {
    font-size: 16px;
    line-height: 1.75;
}
.stb-article-content p { margin-bottom: 1.25em; }
.stb-article-content h2 { margin: 2em 0 0.75em; font-size: 24px; }
.stb-article-content h3 { margin: 1.5em 0 0.5em; font-size: 20px; }
.stb-article-content img { margin: 1.5em 0; }
.stb-article-content a { color: var(--accent); text-decoration: underline; }
.stb-article-content ul, .stb-article-content ol {
    margin: 1em 0;
    padding-left: 1.5em;
}
.stb-article-content ul { list-style: disc; }
.stb-article-content ol { list-style: decimal; }
.stb-article-content li { margin-bottom: 0.5em; }
.stb-article-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 16px 24px;
    margin: 1.5em 0;
    background: var(--bg-surface);
    font-style: italic;
}

/* Tags */
.stb-article-tags { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-color); }
.stb-tags-label { font-weight: 600; margin-right: 8px; }
.stb-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    background: var(--bg-surface);
    margin: 4px 4px 4px 0;
    transition: var(--transition);
}
.stb-tag:hover { background: var(--accent); color: #fff; }

/* ── TOC ───────────────────────────────────── */
.stb-toc {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 20px 24px;
    margin-bottom: 24px;
}
.stb-toc-header { display: flex; justify-content: space-between; align-items: center; }
.stb-toc-title { font-size: 16px; font-weight: 600; margin: 0; }
.stb-toc-toggle {
    font-size: 20px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}
.stb-toc-list {
    margin-top: 12px;
    padding-left: 20px;
    list-style: decimal;
}
.stb-toc-list li { padding: 4px 0; font-size: 14px; }
.stb-toc-list a { color: var(--text-primary); }
.stb-toc-list a:hover { color: var(--accent); }
.stb-toc-sub { padding-left: 20px; }

/* ── Related posts ─────────────────────────── */
.stb-related {
    padding-top: 32px;
    margin-top: 32px;
    border-top: 1px solid var(--border-color);
    margin-bottom: 32px;
}

/* ── Page & 404 ────────────────────────────── */
.stb-page-article { margin-bottom: 48px; }
.stb-page-title { margin-bottom: 24px; }
.stb-page-content { font-size: 16px; line-height: 1.75; }
.stb-page-content p { margin-bottom: 1.25em; }

.stb-404 { text-align: center; padding: 80px 0; }
.stb-404-title { font-size: 96px; font-weight: 700; color: var(--accent); margin-bottom: 16px; }
.stb-404-desc { font-size: 18px; color: var(--text-secondary); margin-bottom: 32px; }

/* ── Search form ───────────────────────────── */
.stb-search-form { display: flex; gap: 0; max-width: 480px; margin: 0 auto; }
.stb-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-right: none;
    font-size: 14px;
    outline: none;
}
.stb-search-input:focus { border-color: var(--accent); }
.stb-search-btn {
    padding: 12px 24px;
    background: var(--text-primary);
    color: #fff;
    font-family: var(--font-menu);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
}
.stb-search-btn:hover { background: var(--accent); }

/* ── Buttons ───────────────────────────────── */
.stb-btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--text-primary);
    color: #fff;
    font-family: var(--font-menu);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: var(--transition);
    margin-top: 16px;
}
.stb-btn:hover { background: var(--accent); color: #fff; }
.stb-btn--primary { background: var(--accent); }
.stb-btn--primary:hover { background: var(--accent-hover); }

/* ── Contact form ──────────────────────────── */
.stb-contact-form { max-width: 600px; margin-top: 32px; }
.stb-form-group { margin-bottom: 20px; }
.stb-form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.stb-form-group input,
.stb-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}
.stb-form-group input:focus,
.stb-form-group textarea:focus { border-color: var(--accent); }
.stb-form-status { margin-top: 16px; font-size: 14px; }
.stb-form-success { color: #155724; }
.stb-form-error { color: #721c24; }

/* ── CB kreacje containers ─────────────────── */
.stb-cb-billboard { padding: 24px 0; }
.stb-cb-inline { margin: 24px 0; }
.stb-widget-cb { margin: 24px 0; }

/* ── No results ────────────────────────────── */
.stb-no-results { text-align: center; padding: 48px 0; }
.stb-no-results-title { margin-bottom: 16px; }
.stb-no-results p { color: var(--text-secondary); margin-bottom: 8px; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
    .stb-layout {
        grid-template-columns: 1fr;
    }
    .stb-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root {
        --container-padding: 16px;
        --h1-size: 28px;
        --h2-size: 22px;
        --h3-size: 18px;
    }
    .stb-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .stb-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .stb-grid-2plus3-top { grid-template-columns: 1fr; }
    .stb-grid-2plus3-bottom { grid-template-columns: repeat(2, 1fr); }
    .stb-article-title { font-size: 24px; }
    .stb-archive-title { font-size: 24px; }
}

@media (max-width: 480px) {
    .stb-grid--2,
    .stb-grid--3 { grid-template-columns: 1fr; }
    .stb-grid--4 { grid-template-columns: 1fr; }
    .stb-grid-2plus3-bottom { grid-template-columns: 1fr; }
    .stb-hero-grid { grid-template-columns: repeat(2, 1fr); }
}
