/* ==========================================================================
   BASE.CSS — markowe-lampy.pl
   Core styles: reset, layout, typography, cards, sidebar, responsive
   Design: Newspaper Baby Pro (Noto Serif TC + Montserrat + Verdana)
   Prefix: stb-
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET & BASE
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 21px;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

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

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

ul, ol {
    list-style: none;
}

/* --------------------------------------------------------------------------
   2. LAYOUT
   -------------------------------------------------------------------------- */

.stb-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

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

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

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

/* --------------------------------------------------------------------------
   3. CATEGORY BADGE
   -------------------------------------------------------------------------- */

.stb-category-badge {
    display: inline-block;
    background-color: var(--color-badge-bg);
    color: var(--color-badge-text);
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 0;
    transition: background-color 0.2s ease;
}

.stb-category-badge:hover {
    background-color: var(--color-accent-hover);
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   4. CARDS (archive grid)
   -------------------------------------------------------------------------- */

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

.stb-card {
    background-color: var(--color-card-bg);
    border-radius: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

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

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

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

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

.stb-card-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
}

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

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

.stb-card-meta {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.stb-card-excerpt {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 8px;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   5. SIDEBAR WIDGETS
   -------------------------------------------------------------------------- */

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

.stb-widget-title {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-left: 10px;
    border-left: 3px solid var(--color-accent);
    margin-bottom: 16px;
}

.stb-sidebar-post {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.stb-sidebar-post-thumb {
    width: 100px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 0;
    overflow: hidden;
}

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

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

.stb-sidebar-post-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.stb-sidebar-post-title a {
    color: var(--color-heading);
}

.stb-sidebar-post-title a:hover {
    color: var(--color-accent);
}

.stb-sidebar-post-date {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

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

.stb-sidebar-categories li {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
}

.stb-sidebar-categories a {
    color: var(--color-heading);
    font-size: 14px;
}

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

.stb-sidebar-cat-count {
    color: var(--color-text-secondary);
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   6. ENTRY CONTENT (single post)
   -------------------------------------------------------------------------- */

.stb-entry-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--color-text);
}

.stb-entry-content p {
    margin-bottom: 1.5em;
}

.stb-entry-content h2 {
    font-size: 1.5rem;
    margin-top: 2em;
    margin-bottom: 0.8em;
}

.stb-entry-content h3 {
    font-size: 1.25rem;
    margin-top: 1.5em;
    margin-bottom: 0.6em;
}

.stb-entry-content blockquote {
    background-color: var(--color-blockquote-bg);
    padding: 24px 32px;
    margin: 2em 0;
    border-left: 4px solid var(--color-accent);
    font-style: italic;
    font-size: 1.1em;
    line-height: 1.7;
}

.stb-entry-content img {
    border-radius: 0;
    height: auto;
}

.stb-entry-content a {
    color: var(--color-accent);
    text-decoration: underline;
}

.stb-entry-content ul,
.stb-entry-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

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

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

.stb-entry-content li {
    margin-bottom: 0.4em;
}

/* --------------------------------------------------------------------------
   7. BREADCRUMBS
   -------------------------------------------------------------------------- */

.stb-breadcrumbs {
    font-size: 13px;
    color: var(--color-text-secondary);
    padding: 12px 0;
    margin-bottom: 16px;
}

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

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

.stb-breadcrumb-sep {
    margin: 0 8px;
    color: #cccccc;
}

/* --------------------------------------------------------------------------
   8. PAGINATION
   -------------------------------------------------------------------------- */

.stb-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 40px;
    margin-bottom: 40px;
}

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

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

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

/* --------------------------------------------------------------------------
   9. BACK TO TOP
   -------------------------------------------------------------------------- */

.stb-back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background-color: var(--color-accent);
    color: #ffffff;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    z-index: 99;
}

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

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

/* --------------------------------------------------------------------------
   10. RESPONSIVE
   -------------------------------------------------------------------------- */

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

    .stb-sidebar {
        width: 100%;
    }
}

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

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

    h1 {
        font-size: 1.5rem;
    }
}

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

/* --------------------------------------------------------------------------
   11. SEARCH OVERLAY
   -------------------------------------------------------------------------- */

.stb-search-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.stb-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.stb-search-overlay input[type="search"] {
    width: 600px;
    max-width: 90vw;
    padding: 16px 24px;
    font-size: 24px;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid #ffffff;
    color: #ffffff;
    outline: none;
    font-family: var(--font-body);
}

.stb-search-overlay input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.stb-search-close {
    position: absolute;
    top: 32px;
    right: 32px;
    color: #ffffff;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

/* --------------------------------------------------------------------------
   12. MOBILE MENU
   -------------------------------------------------------------------------- */

.stb-mobile-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.stb-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.stb-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background-color: #ffffff;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 24px;
}

.stb-mobile-menu.active {
    transform: translateX(0);
}

.stb-mobile-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--color-heading);
}

.stb-mobile-nav-list {
    list-style: none;
    padding: 0;
}

.stb-mobile-nav-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.stb-mobile-nav-list a {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--color-heading);
    font-weight: 500;
}

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

/* --------------------------------------------------------------------------
   13. TOC (Table of Contents)
   -------------------------------------------------------------------------- */

.stb-toc {
    background-color: var(--color-surface);
    padding: 24px;
    border-radius: 0;
    margin-bottom: 32px;
    border: 1px solid var(--color-border);
}

.stb-toc-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

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

.stb-toc li {
    padding: 6px 0;
}

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

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

.stb-toc .stb-toc-sublist {
    padding-left: 20px;
    margin-top: 4px;
}

/* --------------------------------------------------------------------------
   14. FORMS
   -------------------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="search"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 0;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text);
    background-color: var(--color-bg);
    transition: border-color 0.2s ease;
}

input:focus,
textarea:focus {
    border-color: var(--color-accent);
    outline: none;
}

.stb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: var(--color-accent);
    color: #ffffff;
    border: none;
    border-radius: 0;
    font-family: var(--font-ui);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.stb-btn:hover {
    background-color: var(--color-accent-hover);
    color: #ffffff;
}
