/* ==========================================================================
   BASE.CSS — Pokój Młodzieżowy | Standalone Theme
   Design: Newspaper/Forcast (byteflows.net)
   Author: Damian Zięba | SEMTAK | https://semtak.pl
   ========================================================================== */

/* @font-face for Plus Jakarta Sans is inline in <head> (immune to LiteSpeed defer) */

/* --------------------------------------------------------------------------
   1. RESET & BOX-SIZING
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
    text-decoration: underline;
}

ul, ol {
    padding-left: 1.5em;
}

figure {
    margin: 0;
}

/* --------------------------------------------------------------------------
   2. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
    margin-top: 0;
}

h1 {
    font-size: 32px;
    margin-bottom: 16px;
}

h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

h4 {
    font-size: 18px;
    margin-bottom: 8px;
}

h5 {
    font-size: 16px;
    margin-bottom: 8px;
}

h6 {
    font-size: 14px;
    margin-bottom: 8px;
}

p {
    margin-top: 0;
    margin-bottom: 1em;
}

/* --------------------------------------------------------------------------
   3. LAYOUT
   -------------------------------------------------------------------------- */
.stb-container {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}

.stb-layout {
    display: flex;
    gap: var(--gap);
}

.stb-main,
.stb-content {
    flex: 1;
    min-width: 0;
}

.stb-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: static;
}

/* --------------------------------------------------------------------------
   4. SECTIONS
   -------------------------------------------------------------------------- */
.stb-section {
    margin-bottom: 48px;
}

.stb-section-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 24px;
    color: var(--color-text);
}

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

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

.stb-section-link {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-primary);
    text-transform: uppercase;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.stb-section-link:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   5. CARDS
   -------------------------------------------------------------------------- */
.stb-card {
    background-color: var(--color-card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    box-shadow: 0 -1px 10px 0 rgba(172, 171, 171, 0.3);
}

.stb-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stb-card-image,
.stb-card-thumb-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    display: block;
}

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

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

.stb-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--color-surface);
}

/* Badge inside card thumb */
.stb-card-thumb-wrap .stb-cat-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

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

.stb-card-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

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

.stb-card-excerpt {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stb-card-meta {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--color-text-secondary);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stb-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* --------------------------------------------------------------------------
   6. CATEGORY BADGE
   -------------------------------------------------------------------------- */
.stb-cat-badge {
    display: inline-block;
    background-color: var(--color-primary);
    color: #ffffff;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 3px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.stb-cat-badge:hover {
    opacity: 0.85;
    color: #ffffff;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   7. GRID SYSTEM
   -------------------------------------------------------------------------- */
/* Cards grid: 2-col & 3-col variants */
.stb-cards-grid {
    display: grid;
    gap: var(--gap);
}

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

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

/* Featured layout: 1 big card left + list right */
.stb-featured-layout,
.stb-featured-list {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

/* Featured big card */
.stb-featured-big {
    position: relative;
}

.stb-featured-big-thumb {
    display: block;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
}

.stb-featured-big-thumb img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.stb-featured-big-thumb:hover img {
    transform: scale(1.03);
}

.stb-featured-big-thumb .stb-cat-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

.stb-featured-big-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    margin: 16px 0 8px;
    line-height: 1.3;
}

.stb-featured-big-title a {
    color: var(--color-text);
    text-decoration: none;
}

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

/* Section "See more" link */
.stb-section-more {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-primary);
    text-transform: uppercase;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.stb-section-more:hover {
    text-decoration: underline;
}

/* Meta line (generic) */
.stb-meta {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--color-text-secondary);
    display: flex;
    gap: 8px;
    align-items: center;
}

.stb-meta-sep {
    color: #ccc;
}

/* List items (horizontal card: image + text) */
.stb-list-items {
    display: flex;
    flex-direction: column;
}

.stb-list-item {
    display: flex;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 16px;
}

.stb-list-item:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.stb-list-item-thumb {
    width: 100px;
    height: 70px;
    flex-shrink: 0;
    border-radius: var(--radius);
    overflow: hidden;
}

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

.stb-list-item-info {
    flex: 1;
    min-width: 0;
}

.stb-list-item-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 4px;
}

.stb-list-item-title a {
    color: var(--color-text);
    text-decoration: none;
}

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

.stb-list-item-date {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--color-text-secondary);
}

.stb-list-item-content .stb-card-title {
    font-size: 15px;
}

/* --------------------------------------------------------------------------
   8. SIDEBAR WIDGETS
   -------------------------------------------------------------------------- */
.stb-widget {
    margin-bottom: 32px;
    padding: 20px;
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.stb-widget-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--color-primary);
    display: inline-block;
    color: var(--color-text);
}

/* --------------------------------------------------------------------------
   9. SIDEBAR TABS (wzorzec portal-o-meblach: ul > li > a)
   -------------------------------------------------------------------------- */
.stb-tab-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    border-bottom: 2px solid var(--color-border);
}

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

.stb-tab-nav a {
    display: block;
    padding: 10px 8px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.stb-tab-nav a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

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

/* Tab content panels */
.stb-tab-content {
    display: none;
}

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

/* Tab items (post entries inside tabs) */
.stb-tab-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stb-tab-item:last-child {
    border-bottom: 0;
}

.stb-tab-thumb {
    flex-shrink: 0;
}

.stb-tab-thumb img {
    width: 94px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

.stb-tab-info {
    flex: 1;
    min-width: 0;
}

.stb-tab-meta {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.stb-tab-meta a {
    color: var(--color-primary);
    text-decoration: none;
}

.stb-tab-meta a:hover {
    text-decoration: underline;
}

.stb-tab-meta .stb-meta-sep {
    margin: 0 4px;
    color: #ccc;
}

.stb-tab-title {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.stb-tab-title a {
    color: var(--color-text);
    text-decoration: none;
}

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

/* --------------------------------------------------------------------------
   10. SIDEBAR CATEGORIES
   -------------------------------------------------------------------------- */
.stb-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stb-category-item {
    border-bottom: 1px solid #f0f0f0;
}

.stb-cat-list li:last-child,
.stb-category-item:last-child {
    border-bottom: 0;
}

.stb-category-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: var(--color-text);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 14px;
    transition: color 0.2s ease;
}

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

.stb-cat-count,
.stb-category-count {
    background-color: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
}

.stb-category-name {
    flex: 1;
}

/* --------------------------------------------------------------------------
   12. PAGINATION
   -------------------------------------------------------------------------- */
.stb-pagination {
    margin-top: 40px;
}

.stb-pagination ul {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.stb-pagination li {
    display: inline-flex;
}

.stb-pagination a,
.stb-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    transition: all 0.2s ease;
}

.stb-pagination .current {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.stb-pagination a:hover {
    background-color: var(--color-surface);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   13. BREADCRUMBS
   -------------------------------------------------------------------------- */
.stb-breadcrumbs {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text-secondary);
}

.stb-breadcrumbs-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
}

.stb-breadcrumbs-item {
    display: inline-flex;
    align-items: center;
}

.stb-breadcrumbs-sep {
    display: inline-flex;
    align-items: center;
    margin: 0 6px;
    color: #cccccc;
}

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

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

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

.stb-breadcrumbs .separator {
    margin: 0 8px;
    color: #cccccc;
}

/* Archive header bar — H1 left, breadcrumbs right */
.stb-archive-header {
    background-color: #1b1d1f;
    max-height: 100px;
    margin-bottom: 5px;
}

.stb-archive-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: calc(1.1rem + 5px);
    padding-bottom: calc(0.9rem + 5px);
}

.stb-archive-header-inner--path-only {
    justify-content: flex-start;
}

.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: #ffffff;
}

/* --------------------------------------------------------------------------
   14. TABLE OF CONTENTS (TOC)
   -------------------------------------------------------------------------- */
nav.stb-toc {
    background-color: #f8f9fa;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 24px 0;
}

.stb-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stb-toc-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stb-toc-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--color-text-secondary);
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
}

.stb-toc-toggle--collapsed {
    transform: rotate(180deg);
}

.stb-toc ol,
.stb-toc-list {
    padding-left: 20px;
    margin: 0;
    list-style-type: decimal;
}

.stb-toc li,
.stb-toc-item {
    margin-bottom: 8px;
    font-family: var(--font-body);
    font-size: 14px;
}

.stb-toc-item--sub {
    padding-left: 16px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.stb-toc a {
    color: var(--color-text);
    text-decoration: none;
}

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

.stb-toc .stb-toc-sub {
    padding-left: 16px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   15. RESPONSIVE
   -------------------------------------------------------------------------- */

/* Tablet */
@media (max-width: 1024px) {
    .stb-layout {
        flex-direction: column;
    }

    .stb-sidebar {
        width: 100%;
    }

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

    .stb-featured-layout,
    .stb-featured-list {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .stb-grid-3,
    .stb-cards-grid--3 {
        grid-template-columns: 1fr;
    }

    .stb-grid-2,
    .stb-cards-grid--2 {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 26px;
    }

    h2 {
        font-size: 22px;
    }

    h3 {
        font-size: 18px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .stb-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    body {
        font-size: 15px;
    }
}

/* --------------------------------------------------------------------------
   16. UTILITIES
   -------------------------------------------------------------------------- */

/* Screen reader text — WordPress standard */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Back to top button */
.stb-back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background-color: var(--color-primary);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.2s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.stb-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.stb-back-to-top svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
