/**
 * Łóżko Kontynentalne — base.css
 * Core styles: reset, layout, typography, grid, cards, sidebar, responsive.
 * Design: foxiz.io/parents/ 1:1
 */

/* === 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: 1rem;
    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: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.25;
    color: var(--color-text);
}

h1 { font-size: 2.25rem; font-weight: 900; }
h2 { font-size: 1.75rem; font-weight: 900; }
h3 { font-size: 1.25rem; font-weight: 800; }
h4 { font-size: 1.1rem; }

p {
    margin-bottom: 1rem;
}

/* === FOCUS VISIBLE (WCAG AA) === */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* === SKIP LINK === */
.stb-skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--color-accent);
    color: #fff;
    padding: 8px 16px;
    z-index: 10000;
    font-weight: 700;
}

.stb-skip-link:focus {
    top: 8px;
}

/* === CONTAINER === */
.stb-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* === LAYOUT: Sidebar === */
.stb-layout-sidebar {
    padding: 48px 0;
}

.stb-layout-inner {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--gap);
}

.stb-main-col {
    min-width: 0;
    overflow: hidden;
}

.stb-sidebar {
    position: static;
    min-width: 0;
    overflow: hidden;
}

/* === POST GRID (foxiz 3-column) === */
.lk-posts-grid {
    display: grid;
    gap: 32px;
}

.lk-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.lk-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* === LATEST SECTION (Najnowsze — 4 w linii) === */
.lk-latest-section {
    padding: 40px 0 48px;
    border-bottom: 1px solid var(--color-border);
}

.lk-section-title-inline {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 28px;
}

.lk-section-title-inline span {
    flex-shrink: 0;
    white-space: nowrap;
}

.lk-section-title-inline::after {
    content: '';
    flex: 1;
    height: 3px;
    background: var(--color-accent);
}

/* === CARD (foxiz style: clean, minimal) === */
.lk-card {
    display: flex;
    flex-direction: column;
}

.lk-card-thumb {
    display: block;
    overflow: hidden;
    margin-bottom: 12px;
}

.lk-card-thumb img {
    width: 100%;
    aspect-ratio: 370 / 250;
    object-fit: cover;
    border-radius: var(--radius);
    transition: transform 0.3s ease;
}

.lk-card:hover .lk-card-thumb img,
.lk-card-thumb:hover img {
    transform: scale(1.03);
}

.lk-card-body {
    padding: 0 4px;
}

.lk-card-title {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 8px;
}

.lk-card-title a:hover {
    color: var(--color-accent);
}

.lk-card-date {
    display: block;
    font-size: 0.8rem;
    color: var(--color-meta);
}

/* === CATEGORY BADGE (foxiz style: rounded orange outline) === */
.lk-cat-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    border-radius: 20px;
    padding: 3px 12px;
    margin-bottom: 10px;
    transition: background 0.2s, color 0.2s;
}

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

.lk-cat-badge-sm {
    font-size: 0.65rem;
    padding: 1px 6px;
}

/* === META === */
.lk-meta {
    font-size: 0.85rem;
    color: var(--color-meta);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.lk-meta-sep {
    font-size: 0.5rem;
}

/* === SECTION HEADER === */
.lk-section-header {
    text-align: center;
    margin-bottom: 40px;
}

.lk-section-icon {
    margin-bottom: 12px;
}

.lk-section-title {
    font-size: 1.75rem;
    font-weight: 900;
}

.lk-section-footer {
    text-align: center;
    margin-top: 32px;
}

/* === VIEW MORE BUTTON (foxiz style) === */
.lk-view-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: var(--color-dark);
    padding: 12px 24px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.lk-view-more:hover {
    background: var(--color-accent);
    color: #fff;
}

/* === CTA BUTTON (foxiz orange) === */
.lk-cta-btn {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: var(--color-accent);
    padding: 12px 28px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.lk-cta-btn:hover {
    background: var(--color-accent-hover);
    color: #fff;
}

.lk-cta-btn-dark {
    background: var(--color-dark);
}

.lk-cta-btn-dark:hover {
    background: var(--color-accent);
}

/* === ARCHIVE HEADER === */
.stb-archive-header {
    background: var(--color-dark);
    color: #fff;
    padding: 32px 0;
}

.stb-archive-header h1 {
    color: #fff;
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.stb-archive-header .stb-breadcrumbs {
    color: rgba(255, 255, 255, 0.7);
}

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

.stb-archive-header .stb-breadcrumbs a:hover {
    color: var(--color-accent);
}

.lk-archive-desc {
    color: rgba(255, 255, 255, 0.8);
    margin-top: 8px;
    font-size: 0.95rem;
}

.lk-archive-kreacja {
    margin: 32px 0;
}

/* === BREADCRUMBS === */
.stb-breadcrumbs {
    font-size: 0.8rem;
    color: var(--color-meta);
}

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

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

.stb-breadcrumbs-sep {
    margin: 0 6px;
}

/* === ARTICLE CONTENT === */
.stb-post-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.stb-post-content h2 {
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.stb-post-content h3 {
    margin: 1.5rem 0 0.75rem;
    font-size: 1.25rem;
}

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

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

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

.stb-post-content ul {
    list-style: disc;
}

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

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

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

/* === CB KREACJE — dopasowanie do szerokości kontenera === */
.stb-post-content .cb-pad,
.lk-post-content .cb-pad,
.stb-main-col .cb-pad {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.stb-post-content .cb-kreacja-placeholder,
.lk-post-content .cb-kreacja-placeholder,
.stb-main-col .cb-kreacja-placeholder {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.stb-post-content .cb-pad__products,
.lk-post-content .cb-pad__products {
    overflow-x: auto;
}

/* === FEATURED IMAGE === */
.stb-featured-image,
.lk-featured-image {
    margin: 24px 0;
}

.stb-featured-image img,
.lk-featured-image img {
    width: 100%;
    border-radius: var(--radius);
}

/* === POST TAGS === */
.stb-post-tags {
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stb-tag {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--color-meta);
    background: var(--color-surface);
    padding: 4px 12px;
    border: 1px solid var(--color-border);
}

/* === SIDEBAR WIDGETS === */
.stb-widget {
    margin-bottom: 32px;
}

.stb-widget-title {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--color-text);
    margin-bottom: 16px;
}

/* === SIDEBAR: Recent Posts (foxiz style) === */
.lk-recent-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lk-recent-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.lk-recent-info {
    flex: 1;
    min-width: 0;
}

.lk-recent-title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 4px;
}

.lk-recent-date {
    font-size: 0.75rem;
    color: var(--color-meta);
}

.lk-recent-thumb {
    flex-shrink: 0;
    width: 80px;
}

.lk-recent-thumb img {
    width: 80px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius);
}

/* === SIDEBAR: Categories === */
.lk-cat-list li {
    border-bottom: 1px solid var(--color-border);
}

.lk-cat-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 0.9rem;
}

.lk-cat-list li a:hover {
    color: var(--color-accent);
}

.lk-cat-count {
    color: var(--color-meta);
    font-size: 0.8rem;
}

/* === SIDEBAR AD === */
.lk-sidebar-ad {
    margin-bottom: 32px;
}

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

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

.stb-toc-list {
    list-style: decimal;
    padding-left: 1.25rem;
}

.stb-toc-list li {
    margin-bottom: 6px;
}

.stb-toc-list a {
    color: var(--color-text);
    font-size: 0.9rem;
}

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

.stb-toc-sub {
    margin-left: 1rem;
}

/* === PAGINATION === */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 48px 0;
}

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

.page-numbers:hover,
.page-numbers.current {
    background: var(--color-dark);
    color: #fff;
    border-color: var(--color-dark);
}

/* === RELATED POSTS === */
.lk-related {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}

.lk-related-title {
    font-size: 1.25rem;
    margin-bottom: 24px;
}

/* === CONTACT FORM === */
.lk-contact-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 48px 24px;
}

.lk-contact-intro {
    margin-bottom: 32px;
    color: var(--color-meta);
}

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

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

.lk-form-group .required {
    color: var(--color-accent);
}

.lk-form-group input,
.lk-form-group select,
.lk-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.2s;
}

.lk-form-group input:focus,
.lk-form-group select:focus,
.lk-form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.lk-form-status {
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.lk-form-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.lk-form-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* === 404 === */
.lk-404 {
    text-align: center;
    padding: 80px 24px;
}

.lk-404 h1 {
    font-size: 6rem;
    color: var(--color-accent);
    margin-bottom: 16px;
}

.lk-404 p {
    font-size: 1.2rem;
    color: var(--color-meta);
    margin-bottom: 32px;
}

.lk-404-search {
    max-width: 480px;
    margin: 48px auto 0;
}

.lk-404-search h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
}

/* === PAGE === */
.lk-page-title {
    margin-bottom: 24px;
}

.lk-page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 24px;
}

/* === NO RESULTS === */
.lk-no-results {
    text-align: center;
    padding: 64px 24px;
}

.lk-no-results h2 {
    margin-bottom: 16px;
}

.lk-no-results p {
    color: var(--color-meta);
    margin-bottom: 24px;
}

/* === BACK TO TOP === */
.stb-back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--color-dark);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s, background 0.2s;
}

.stb-back-to-top[hidden] {
    display: none;
}

.stb-back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.stb-back-to-top:hover {
    background: var(--color-accent);
}

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

    .lk-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .lk-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.1rem; }

    .stb-container {
        padding: 0 16px;
    }

    .lk-cols-3 {
        grid-template-columns: 1fr;
    }

    .lk-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .stb-archive-header {
        padding: 24px 0;
    }

    .lk-related .lk-posts-grid {
        grid-template-columns: 1fr;
    }

    .lk-contact-page {
        padding: 32px 16px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 0.95rem;
    }

    .lk-card-title {
        font-size: 1rem;
    }
}
