/* ═══════════════════════════════════════════════════
   base.css — mebleonline24.pl
   Core styles: reset, tokens, layout, grid, cards,
   breadcrumbs, pagination, sidebar, responsive
   ═══════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
    --color-primary: #dd3333;
    --color-secondary: #951010;
    --color-tertiary: #6d0000;
    --color-primary-text: #c62828;
    --color-link: #800505;
    --color-link-hover: #dd9933;
    --color-bg: #ffffff;
    --color-text: #000000;
    --color-text-light: #666666;
    --color-meta: #767676;
    --color-footer-bg: #1b1b1b;
    --color-footer-text: #999999;
    --color-border: #e0e0e0;
    --color-card-bg: #ffffff;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --font-menu: 'Raleway', sans-serif;
    --container-width: 1200px;
    --radius: 0px;
    --header-height: 80px;
}

/* ─── Reset ─── */
*, *::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: var(--font-body);
    font-weight: 300;
    font-size: 13px;
    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-link);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--color-link-hover); }

ul, ol { list-style: none; }

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

h1 { font-size: 36px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }
h5 { font-size: 18px; }
h6 { font-size: 14px; }

/* ─── Accessibility ─── */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.stb-skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--color-primary);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 9999;
    font-size: 14px;
}
.stb-skip-link:focus {
    top: 0;
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

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

/* ─── Grid System ─── */
.mo-grid {
    display: grid;
    gap: 30px;
}

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

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

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

/* ─── Cards ─── */
.mo-card {
    position: relative;
    background: var(--color-card-bg);
    overflow: hidden;
}

.stb-entry-overlink {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.mo-card-thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 400 / 280;
}

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

.mo-card:hover .mo-card-img {
    transform: scale(1.03);
}

.mo-card-placeholder {
    width: 100%;
    height: 100%;
    background: #e0e0e0;
}

.mo-card-body {
    padding: 16px 0 0;
}

.mo-cat-badge {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

.mo-card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.mo-card-title a {
    color: var(--color-text);
    position: relative;
    z-index: 2;
    text-decoration: none;
}

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

.mo-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--color-meta);
}

.mo-card-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mo-card-date svg {
    opacity: 0.6;
}

.mo-card-excerpt {
    font-size: 13px;
    line-height: 22px;
    color: var(--color-text);
    font-weight: 300;
}

.mo-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 18px;
    margin-top: 12px;
    position: relative;
    z-index: 2;
    transition: background 0.2s ease;
}

.mo-readmore:hover {
    background: var(--color-secondary);
    color: #fff;
}

/* ─── Section Headers ─── */
.mo-section {
    padding: 40px 0;
}

.mo-section-latest {
    padding-top: 40px;
}

.mo-section-featured {
    padding: 40px 0 60px;
}

.mo-section-header {
    margin-bottom: 28px;
}

.mo-section-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.mo-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
}

/* Accent variant — kolorowa kreska pod nagłówkiem */
.mo-section-title--accent::after {
    background: var(--accent, var(--color-primary));
}

.mo-section-title a {
    color: inherit;
}

.mo-section-title a:hover {
    color: var(--color-primary);
}

/* Wariant z kreskami po bokach (np. "Więcej artykułów") */
.mo-section-title--lines {
    padding: 0 24px 0;
    text-align: center;
}

.mo-section-title--lines::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    width: 60px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
}

.mo-section-title--lines::after {
    bottom: auto;
    top: 50%;
    left: 100%;
    width: 60px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
}

.mo-section-header--center {
    text-align: center;
}

/* ─── Breadcrumbs Bar ─── */
.stb-archive-header {
    background: #1b1d1f;
    color: #fff;
    padding: 0.8rem 0;
    margin-bottom: 10px;
}

.stb-archive-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stb-archive-header h1 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.stb-breadcrumbs {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

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

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

.stb-breadcrumbs-sep {
    margin: 0 6px;
    color: rgba(255,255,255,0.4);
}

.stb-breadcrumbs-current {
    color: rgba(255,255,255,0.9);
}

/* ─── Pagination ─── */
.mo-pagination {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.mo-pagination .nav-links {
    display: flex;
    gap: 6px;
    align-items: center;
}

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

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

.mo-pagination .prev,
.mo-pagination .next {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ─── Archive Ad ─── */
.mo-archive-ad {
    margin: 1.5rem 0;
}

.mo-inline-ad {
    margin: 1.5rem auto;
}

.mo-inline-ad--tight {
    margin: 15px auto;
}

/* ─── Single Article — 2 kolumny ─── */
.mo-single-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    padding-top: 24px;
    padding-bottom: 48px;
}

.mo-single-content {
    min-width: 0;
}

.mo-article-hero {
    margin: 0 0 24px;
}

.mo-article-hero-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1200 / 600;
    object-fit: cover;
}

.mo-article-meta-top {
    margin-bottom: 16px;
}

.mo-article-body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 15px;
    line-height: 1.8;
    color: var(--color-text);
}

.mo-article-body h2 {
    font-size: 26px;
    margin: 32px 0 16px;
}

.mo-article-body h3 {
    font-size: 22px;
    margin: 24px 0 12px;
}

.mo-article-body p {
    margin-bottom: 16px;
}

.mo-article-body img {
    margin: 24px 0;
    border-radius: var(--radius);
}

.mo-article-body ul,
.mo-article-body ol {
    margin: 16px 0;
    padding-left: 24px;
    list-style: disc;
}

.mo-article-body ol { list-style: decimal; }

.mo-article-body li {
    margin-bottom: 8px;
}

.mo-article-body a {
    color: var(--color-primary-text);
    text-decoration: underline;
}

.mo-article-body a:hover {
    color: var(--color-link-hover);
}

.mo-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    overflow-x: auto;
    display: block;
}

.mo-article-body th,
.mo-article-body td {
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    text-align: left;
    font-size: 13px;
}

.mo-article-body th {
    background: #f5f5f5;
    font-weight: 600;
}

.mo-article-body pre {
    background: #f5f5f5;
    padding: 16px;
    overflow-x: auto;
    margin: 24px 0;
    font-size: 13px;
    line-height: 1.5;
}

.mo-article-body code {
    background: #f5f5f5;
    padding: 2px 6px;
    font-size: 0.9em;
}

.mo-article-body pre code {
    background: none;
    padding: 0;
}

.mo-article-body blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    border-left: 4px solid var(--color-primary);
    background: #f9f9f9;
    font-style: italic;
}

.mo-article-body figure {
    margin: 24px 0;
}

.mo-article-body figcaption {
    font-size: 12px;
    color: var(--color-meta);
    margin-top: 8px;
    text-align: center;
}

.mo-article-footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    padding: 24px 0;
    margin-top: 32px;
    border-top: 1px solid var(--color-border);
    font-size: 13px;
    color: var(--color-meta);
}

.mo-article-author,
.mo-article-date,
.mo-article-category {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mo-article-footer-meta svg {
    vertical-align: middle;
}

/* ─── Post Navigation ─── */
.mo-post-nav {
    display: flex;
    gap: 24px;
    padding: 32px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    margin: 32px 0;
}

.mo-post-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.4;
}

.mo-post-nav-link:hover {
    color: var(--color-primary);
}

.mo-post-nav-link small {
    display: block;
    font-size: 11px;
    color: var(--color-meta);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mo-post-nav-next {
    text-align: right;
    justify-content: flex-end;
}

/* ─── Related Posts ─── */
.mo-related {
    padding: 40px 0;
}

.mo-related-title {
    font-size: 22px;
    margin-bottom: 24px;
}

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

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

.mo-toc-title {
    font-size: 18px;
    margin-bottom: 12px;
}

.mo-toc-list {
    list-style: none;
    padding: 0;
}

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

.mo-toc-list a {
    color: var(--color-text);
    font-size: 14px;
}

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

.mo-toc-sub {
    padding-left: 16px;
}

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

.stb-widget {
    margin-bottom: 32px;
}

.stb-widget-title {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-text);
    margin-bottom: 16px;
}

/* ─── Page / Contact ─── */
.mo-page-container {
    max-width: 800px;
    padding-top: 32px;
    padding-bottom: 48px;
}

.mo-page-content p { margin-bottom: 16px; }
.mo-page-content h2 { margin: 32px 0 16px; }
.mo-page-content h3 { margin: 24px 0 12px; }

.mo-contact-container {
    max-width: 800px;
    padding-top: 32px;
    padding-bottom: 48px;
}

.mo-form-group {
    margin-bottom: 16px;
}

.mo-form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 6px;
}

.mo-form-group .required { color: var(--color-primary); }

.mo-form-group input,
.mo-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    border: 1px solid var(--color-border);
    background: #fff;
    transition: border-color 0.2s;
}

.mo-form-group input:focus,
.mo-form-group textarea:focus {
    border-color: var(--color-primary);
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.mo-btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 24px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.mo-btn:hover {
    background: var(--color-secondary);
    color: #fff;
}

.mo-btn--outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mo-btn--outline:hover {
    background: var(--color-primary);
    color: #fff;
}

.mo-section-cta {
    text-align: center;
    margin-top: 32px;
}

.mo-form-status {
    margin-top: 16px;
    padding: 12px;
    font-size: 14px;
}

.mo-form-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mo-form-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ─── 404 ─── */
.mo-404-container {
    text-align: center;
    padding: 60px 24px;
}

.mo-404-code {
    font-size: 120px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 16px;
}

.mo-404-content p {
    margin-bottom: 24px;
    font-size: 16px;
}

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

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

.mo-no-results p {
    margin-bottom: 24px;
}

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

.mo-sidebar-entry {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}

.mo-sidebar-entry:last-child {
    border-bottom: none;
}

.mo-sidebar-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
}

.mo-sidebar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mo-sidebar-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: #e8e8e8;
}

.mo-sidebar-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.mo-sidebar-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 4px;
}

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

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

.mo-sidebar-date {
    font-size: 12px;
    color: var(--color-meta);
}

.mo-categories-list {
    list-style: none;
    padding: 0;
}

.mo-categories-list li {
    border-bottom: 1px solid var(--color-border);
}

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

.mo-categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: var(--color-text);
    font-size: 14px;
    transition: color 0.2s;
}

.mo-categories-list a:hover {
    color: var(--color-primary);
}

.mo-cat-count {
    background: #f0f0f0;
    color: var(--color-meta);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.mo-archives-list {
    list-style: none;
    padding: 0;
}

.mo-archives-list li {
    border-bottom: 1px solid var(--color-border);
}

.mo-archives-list li:last-child {
    border-bottom: none;
}

.mo-archives-list a {
    display: block;
    padding: 8px 0;
    color: var(--color-text);
    font-size: 14px;
}

.mo-archives-list a:hover {
    color: var(--color-primary);
}

.mo-widget-ad {
    margin-bottom: 24px;
}

/* ─── Back to Top ─── */
.stb-back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 100;
    opacity: 0.9;
    transition: opacity 0.2s;
}

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

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

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

    .mo-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mo-single-layout {
        grid-template-columns: 1fr 280px;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .stb-container {
        padding: 0 16px;
    }

    .mo-grid-3,
    .mo-grid-2,
    .mo-grid-4 {
        grid-template-columns: 1fr;
    }

    .mo-single-layout {
        grid-template-columns: 1fr;
    }

    .mo-section-title--lines::before,
    .mo-section-title--lines::after {
        width: 30px;
    }

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

    h1 { font-size: 24px; }
    h2 { font-size: 22px; }
    h3 { font-size: 20px; }

    .stb-archive-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .stb-archive-header h1 {
        font-size: 0.85rem;
    }

    .mo-section-title { font-size: 24px; }

    .mo-section-title::before,
    .mo-section-title::after {
        width: 30px;
    }

    .mo-post-nav {
        flex-direction: column;
    }

    .mo-article-hero {
        margin: 0 -16px 24px;
    }

    .mo-single-container {
        padding-top: 20px;
    }

    .mo-card-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .stb-container {
        padding: 0 12px;
    }

    .mo-section { padding: 24px 0; }
    .mo-section-featured { padding-bottom: 32px; }

    .mo-section-title::before,
    .mo-section-title::after {
        display: none;
    }

    .mo-404-code { font-size: 80px; }
}

/* ─── Print ─── */
@media print {
    .mo-header, .mo-footer, .stb-back-to-top,
    .mo-hamburger, .mo-post-nav, .mo-related,
    .mo-toc, .mo-pagination, .mo-archive-ad,
    .mo-inline-ad, .stb-skip-link, .stb-archive-header,
    .mo-readmore, .mo-cat-badge { display: none !important; }

    body { font-size: 12pt; line-height: 1.5; color: #000; }
    .mo-article-body { font-size: 12pt; }
    .stb-container { max-width: 100%; padding: 0; }
    a { color: #000; text-decoration: underline; }
}
