/* ===================================
   SEMTAK Base — base.css
   Wspolne style dla wszystkich zaplecz.
   Prefix: stb- (semtak-base)
   Dostosowane do CheerUp Magazine layout.
   =================================== */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body, 'Open Sans', sans-serif);
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text, #616161);
    background-color: var(--color-bg, #fff);
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--color-text-heading, #161616);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* === Container (CheerUp: 1170px + 35px padding) === */
.stb-container {
    max-width: var(--container-width, 1170px);
    margin: 0 auto;
    padding: 0 35px;
}

/* === Header (base — overridden in custom.css) === */
.stb-header {
    position: relative;
    z-index: 100;
    background: var(--color-header-bg);
    color: var(--color-header-text);
}

/* === Navigation === */
.stb-nav .stb-menu {
    display: flex;
    list-style: none;
    gap: 0;
}

.stb-nav .stb-menu li a {
    display: block;
    padding: 0.5rem 21px;
    color: var(--color-header-text);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: color 0.2s;
}

.stb-nav .stb-menu li a:hover,
.stb-nav .stb-menu li.current-menu-item a {
    color: var(--color-accent);
}

/* Sub-menu */
.stb-nav .stb-menu li {
    position: relative;
}

.stb-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    list-style: none;
    z-index: 101;
    padding: 0.5rem 0;
}

.stb-nav .stb-menu li:hover > .sub-menu,
.stb-nav .stb-menu li:focus-within > .sub-menu {
    display: block;
}

.stb-nav .sub-menu li a {
    padding: 0.4rem 1.25rem;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    color: #616161;
}

.stb-nav .sub-menu li a:hover {
    color: var(--color-accent);
}

/* Hamburger */
.stb-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.stb-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-header-text);
    transition: transform 0.3s, opacity 0.3s;
}

.stb-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.stb-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.stb-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* === Main Content === */
.stb-main {
    padding: 2rem 0;
    min-height: 60vh;
}

/* === Layout: Content + Sidebar (CheerUp: 1fr 370px gap 30px) === */
.stb-layout-sidebar .stb-layout-inner {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    align-items: start;
}

.stb-layout-sidebar .stb-layout-inner > * {
    min-width: 0;
}

.lds-content-col {
    min-width: 0;
}

/* === Post Grid (archive — 2 columns CheerUp style) === */
.stb-post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* === Card (base — CheerUp overrides in custom.css) === */
.stb-card {
    background: var(--color-card-bg);
    border-radius: 0;
    overflow: hidden;
}

/* === Article Content (single.php) === */
.stb-post-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--color-text-heading);
}

.stb-post-content {
    font-size: 16px;
    line-height: 1.8125;
    color: var(--color-text);
}

.stb-post-content h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    color: var(--color-text-heading);
}

.stb-post-content h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
    color: var(--color-text-heading);
}

.stb-post-content h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
}

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

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

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

.stb-post-content blockquote {
    margin: 1.5rem 0;
    padding: 25px 25px 25px 45px;
    border-left: none;
    background: none;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 17px;
    line-height: 1.7;
    color: #989898;
    position: relative;
}

.stb-post-content blockquote::before {
    content: '\201C';
    position: absolute;
    left: 0;
    top: 10px;
    font-family: Georgia, serif;
    font-size: 60px;
    line-height: 1;
    color: var(--color-accent);
    font-style: normal;
}

.stb-post-content img {
    margin: 1.5rem auto;
}

.stb-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.stb-post-content th,
.stb-post-content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    text-align: left;
}

.stb-post-content th {
    background: var(--color-bg-alt);
    font-weight: 700;
}

/* === Tags === */
.stb-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.stb-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    transition: border-color 0.2s, color 0.2s;
}

.stb-tag a {
    color: inherit;
}

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

/* === Sidebar === */
.stb-sidebar {
    position: static;
    overflow: hidden;
    max-width: 100%;
}

.stb-widget {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    padding: 20px;
    margin-bottom: 24px;
}

/* Search widget */
.stb-widget.widget_search {
    padding: 0;
    border: none;
    background: none;
}

.stb-widget .search-form {
    display: flex;
    gap: 0;
}

.stb-widget .search-field {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-right: none;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text);
    outline: none;
}

.stb-widget .search-field:focus {
    border-color: var(--color-accent);
}

.stb-widget .search-submit {
    padding: 10px 18px;
    background: var(--color-accent);
    color: #fff;
    border: 1px solid var(--color-accent);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.2s;
}

.stb-widget .search-submit:hover {
    opacity: 0.9;
}

.stb-widget-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    color: var(--color-text-heading);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

.stb-widget-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--color-accent);
}

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

.stb-widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
    line-height: 1.4;
}

.stb-widget ul li:first-child {
    padding-top: 0;
}

.stb-widget ul li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stb-widget ul li a {
    color: var(--color-text);
    text-decoration: none;
}

.stb-widget ul li a:hover {
    color: var(--color-accent);
}

/* === Breadcrumbs === */
.stb-breadcrumbs {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0;
}

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

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

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

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

/* === Archive Header (page title bar — dark) === */
.stb-archive-header {
    background: var(--color-text-heading, #161616);
    color: #fff;
    margin-bottom: 2rem;
}

.stb-archive-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-height: 100px;
    padding-top: 1.1rem;
    padding-bottom: 0.9rem;
    gap: 1.5rem;
}

.stb-archive-header h1,
.stb-archive-header .stb-post-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.stb-archive-header .stb-breadcrumbs {
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* === Pagination === */
.navigation.pagination {
    margin-top: 2.5rem;
    text-align: center;
}

.navigation.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.navigation.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    background: var(--color-bg-alt);
    transition: background 0.2s, color 0.2s;
}

.navigation.pagination .page-numbers:hover,
.navigation.pagination .page-numbers.current {
    background: var(--color-accent);
    color: #fff;
}

/* === TOC === */
.stb-toc {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 2rem;
}

.stb-toc-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    margin-bottom: 0.75rem;
}

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

.stb-toc-list li {
    margin-bottom: 0.3rem;
}

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

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

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

/* === Footer (base — overridden in custom.css) === */
.stb-footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    margin-top: 0;
}

.stb-footer a {
    color: var(--color-footer-text);
    transition: color 0.2s;
}

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

/* === 404 === */
.stb-404 {
    text-align: center;
    padding: 4rem 0;
}

.stb-404 h1 {
    font-family: var(--font-heading);
    font-size: 6rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
}

.stb-404 p {
    font-size: 1.1rem;
    color: var(--color-text);
    margin: 1rem 0 2rem;
}

/* === Button === */
.stb-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--color-accent);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: opacity 0.2s;
}

.stb-btn:hover {
    opacity: 0.9;
    color: #fff;
}

/* === Back to Top === */
.stb-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-text-heading);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 50;
}

.stb-back-to-top:hover {
    transform: translateY(-2px);
}

/* === No Results === */
.stb-no-results {
    text-align: center;
    padding: 3rem 0;
}

.stb-no-results h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-heading);
}

.stb-no-results p {
    color: var(--color-text);
    margin-bottom: 1rem;
}

/* ===================================
   RESPONSIVE (mobile-first overrides)
   =================================== */

@media (max-width: 940px) {
    .stb-layout-sidebar .stb-layout-inner {
        grid-template-columns: 1fr 300px;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .stb-archive-header-inner {
        flex-direction: column;
        align-items: flex-start;
        max-height: none;
        gap: 0.25rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .stb-archive-header h1,
    .stb-archive-header .stb-post-title {
        font-size: 1.2rem;
    }

    .stb-layout-sidebar .stb-layout-inner {
        grid-template-columns: 1fr;
    }

    .stb-post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .stb-menu-toggle {
        display: flex;
    }

    .stb-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        z-index: 200;
    }

    .stb-nav.stb-nav-open {
        display: block;
    }

    .stb-nav .stb-menu {
        flex-direction: column;
    }

    .stb-nav .sub-menu {
        position: static;
        box-shadow: none;
        padding-left: 1rem;
        display: block;
    }

    .stb-post-title {
        font-size: 1.5rem;
    }

    .stb-sidebar {
        position: static;
    }
}

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

    .stb-post-title {
        font-size: 1.3rem;
    }

    .stb-post-content {
        font-size: 14px;
    }

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

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

    html {
        scroll-behavior: auto;
    }
}
