/* ==========================================================================
   CUSTOM.CSS — InvestNews-specific styles for meble-tapicerowane24
   Author: Damian Zieba | semtak.pl
   ========================================================================== */

/* ==========================================================================
   HEADER — 3-row layout
   ========================================================================== */

.stb-header {
    background: var(--color-bg);
    position: relative;
    z-index: 100;
}

/* --- Topbar (1st row) --- */
.stb-topbar {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8rem;
    color: #888;
}
.stb-topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 36px;
}
.stb-topbar-date {
    text-transform: capitalize;
}
.stb-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.stb-social-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}
.stb-social-icons a {
    color: #888;
    display: flex;
    align-items: center;
    transition: color .2s;
}
.stb-social-icons a:hover { color: var(--color-primary); }

/* --- Midbar (2nd row) — centered logo --- */
.stb-midbar {
    border-bottom: 1px solid var(--color-border);
    padding: 12px 0;
}
.stb-midbar-inner {
    display: flex;
    justify-content: center;
    align-items: center;
}
.stb-logo {
    text-align: center;
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
}
.stb-logo .custom-logo {
    max-height: 72px;
    width: auto;
}
.stb-logo-text {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-heading);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.stb-logo-text:hover { color: var(--color-primary); }

/* --- Navbar (3rd row) --- */
.stb-navbar {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}
.stb-navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}
.stb-nav { flex: 1; }
.stb-menu {
    display: flex;
    align-items: center;
    gap: 0;
}
.stb-menu > li > a {
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 18px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-heading);
    border-bottom: 3px solid transparent;
    transition: all .2s;
}
.stb-menu > li > a:hover,
.stb-menu > li.current-menu-item > a,
.stb-menu > li.current-menu-parent > a {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Dropdown */
.stb-menu > li { position: relative; }
.stb-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--color-bg);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-top: 3px solid var(--color-primary);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all .25s;
    z-index: 200;
}
.stb-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.stb-menu .sub-menu a {
    display: block;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: none;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}
.stb-menu .sub-menu a:hover {
    background: var(--color-surface);
    color: var(--color-primary);
}

/* Hamburger */
.stb-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 8px;
}
.stb-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-heading);
    transition: all .25s;
}

/* Search toggle */
.stb-search-toggle {
    display: flex;
    align-items: center;
    padding: 8px;
    color: var(--color-heading);
    transition: color .2s;
}
.stb-search-toggle:hover { color: var(--color-primary); }

/* --- Sticky header --- */
.stb-header-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--color-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: slideDown .3s ease;
}
.stb-header-sticky .stb-topbar,
.stb-header-sticky .stb-midbar { display: none; }
.stb-header-sticky .stb-navbar { border-bottom: 0; }

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* ==========================================================================
   SEARCH OVERLAY
   ========================================================================== */

.stb-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
}
.stb-search-overlay[hidden] { display: none; }
.stb-search-overlay-inner {
    position: relative;
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
}
.stb-search-overlay .stb-search-form {
    display: flex;
}
.stb-search-overlay .stb-search-form input {
    flex: 1;
    padding: 16px 20px;
    font-size: 1.1rem;
    background: #fff;
    border: 0;
}
.stb-search-overlay .stb-search-form button {
    padding: 16px 24px;
    background: var(--color-primary);
    color: #fff;
    border: 0;
}
.stb-search-close {
    position: absolute;
    top: -50px;
    right: 20px;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
}

/* ==========================================================================
   BREAKING NEWS TICKER
   ========================================================================== */

.stb-ticker {
    background: var(--color-primary);
    color: #fff;
    overflow: hidden;
}
.stb-ticker-inner {
    display: flex;
    align-items: center;
    height: 40px;
}
.stb-ticker-label {
    flex-shrink: 0;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-right: 16px;
    border-right: 1px solid rgba(255,255,255,0.3);
    margin-right: 16px;
}
.stb-ticker-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.stb-ticker-track {
    display: flex;
    gap: 48px;
    animation: tickerScroll 30s linear infinite;
    white-space: nowrap;
}
.stb-ticker-track:hover { animation-play-state: paused; }
.stb-ticker-item {
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
    padding: 0 24px;
    position: relative;
}
.stb-ticker-item::after {
    content: '\2022';
    position: absolute;
    right: 0;
    color: rgba(255,255,255,0.4);
}
.stb-ticker-item:last-child::after { display: none; }

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ==========================================================================
   HERO SECTION — 2/3 + 1/3 grid with overlay
   ========================================================================== */

.stb-hero {
    padding: 24px 0;
}
.stb-hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4px;
    min-height: 450px;
}

/* Main featured (left 2/3) */
.stb-hero-main {
    position: relative;
    overflow: hidden;
}
.stb-hero-link {
    display: block;
    position: relative;
    height: 100%;
}
.stb-hero-main .stb-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.stb-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: #fff;
}
.stb-hero-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin-top: 8px;
    margin-bottom: 8px;
}
.stb-hero-meta {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
    display: flex;
    align-items: center;
    gap: 6px;
}
.stb-hero-overlay .stb-category-badge {
    position: static;
}

/* Side posts (right 1/3 — 2 stacked) */
.stb-hero-side {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stb-hero-side-item {
    flex: 1;
    position: relative;
    overflow: hidden;
}
.stb-hero-side-item .stb-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.stb-hero-side-item .stb-hero-overlay {
    padding: 20px;
}
.stb-hero-side-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    margin-top: 6px;
}
.stb-hero-side-item .stb-category-badge {
    position: static;
    font-size: 0.65rem;
    padding: 3px 8px;
}

/* Hero hover effects */
.stb-hero-main:hover .stb-hero-img,
.stb-hero-side-item:hover .stb-hero-img {
    transform: scale(1.03);
    transition: transform .5s;
}

/* ==========================================================================
   HOMEPAGE SECTIONS
   ========================================================================== */

.stb-section {
    margin-bottom: 32px;
}
.stb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-heading);
}
.stb-section-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: relative;
}
.stb-section-title::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--color-primary);
}
.stb-section-link {
    font-size: 0.8rem;
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.stb-section-link:hover { text-decoration: underline; }

/* ==========================================================================
   FOOTER — 4-column dark
   ========================================================================== */

.stb-footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding-top: 48px;
}
.stb-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.stb-footer-logo { margin-bottom: 16px; }
.stb-footer-logo-img {
    max-height: 48px;
    width: auto;
    filter: brightness(0) invert(1);
}
.stb-footer-logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}
.stb-footer-desc {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-footer-text);
    margin-bottom: 16px;
}
.stb-footer-social {
    display: flex;
    gap: 12px;
}
.stb-footer-social a {
    color: var(--color-footer-text);
    transition: color .2s;
}
.stb-footer-social a:hover { color: #fff; }

.stb-footer-widget-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-primary);
}
.stb-footer-links li {
    margin-bottom: 10px;
}
.stb-footer-links a {
    font-size: 0.875rem;
    color: var(--color-footer-text);
    transition: color .2s;
}
.stb-footer-links a:hover {
    color: #fff;
}
.stb-footer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.stb-footer-tag {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 0.8rem;
    color: var(--color-footer-text);
    transition: all .2s;
}
.stb-footer-tag:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* Footer bottom bar */
.stb-footer-bottom {
    padding: 16px 0;
}
.stb-footer-bottom-inner {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* ==========================================================================
   BACK TO TOP
   ========================================================================== */

.stb-back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 500;
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: opacity .3s, transform .3s;
}
.stb-back-to-top[hidden] {
    display: none;
}
.stb-back-to-top:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .stb-hero-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .stb-hero-side {
        flex-direction: row;
    }
    .stb-hero-side-item { min-height: 200px; }
    .stb-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    /* Topbar hide on mobile */
    .stb-topbar { display: none; }

    /* Navbar mobile */
    .stb-hamburger { display: flex; }
    .stb-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: var(--color-bg);
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
        overflow-y: auto;
        transition: left .3s;
        z-index: 3000;
        padding: 20px;
    }
    body.stb-nav-open .stb-nav { left: 0; }
    .stb-menu {
        flex-direction: column;
        gap: 0;
    }
    .stb-menu > li > a {
        height: auto;
        padding: 14px 0;
        border-bottom: 1px solid var(--color-border);
        border-left: 3px solid transparent;
    }
    .stb-menu > li > a:hover,
    .stb-menu > li.current-menu-item > a {
        border-left-color: var(--color-primary);
        border-bottom-color: var(--color-border);
    }
    .stb-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-top: 0;
        padding-left: 16px;
    }

    /* Nav overlay */
    body.stb-nav-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 2999;
    }

    /* Hero mobile */
    .stb-hero-side { flex-direction: column; }
    .stb-hero-side-item { min-height: 180px; }
    .stb-hero-title { font-size: 1.25rem; }

    /* Footer mobile */
    .stb-footer-grid { grid-template-columns: 1fr; gap: 24px; }

    /* Section */
    .stb-section-header { flex-direction: column; gap: 8px; align-items: flex-start; }
}

@media (max-width: 480px) {
    .stb-hero-grid { gap: 2px; }
    .stb-hero-overlay { padding: 16px; }
    .stb-hero-title { font-size: 1.1rem; }
    .stb-hero-side-title { font-size: 0.9rem; }
    .stb-ticker-label { display: none; }
}
