/**
 * ArtSI - GŁÓWNE STYLE
 * Style globalne: reset, typografia, header, footer, sidebar, karty artykułów, paginacja, responsywność
 */

/* ============================================
   RESET I PODSTAWY
   ============================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

a { color: #667eea; text-decoration: none; transition: color 0.2s; }
a:hover { color: #5568d3; }

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

html {
    scroll-behavior: smooth;
}

/* ============================================
   NAGŁÓWEK
   ============================================ */

.site-header {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo a {
    text-decoration: none;
}

.logo strong {
    font-size: 24px;
    color: #333;
}

.main-nav {
    display: flex;
    gap: 25px;
}

.nav-link {
    color: #666;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover, .nav-link.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
}

/* ============================================
   BREADCRUMBS + SIATKA TREŚCI
   ============================================ */

.breadcrumbs {
    padding: 20px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumbs .separator {
    margin: 0 8px;
}

.main-content {
    padding: 40px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
}

/* ============================================
   KARTY ARTYKUŁÓW
   ============================================ */

.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    color: #333;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.article-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    padding: 20px;
}

.article-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.article-category {
    color: #667eea;
    font-weight: 600;
}

.article-title {
    font-size: 20px;
    margin-bottom: 12px;
    line-height: 1.3;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.article-title a {
    color: #333;
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.article-excerpt {
    color: #666;
    font-size: 15px;
    margin-bottom: 15px;
}

.article-link {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

/* ============================================
   TAGI (globalne – sidebar + artykuł)
   ============================================ */

.tag {
    display: inline-block;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 15px;
    font-size: 13px;
    color: #666;
    margin: 0 8px 8px 0;
}

.tag:hover {
    background: #667eea;
    color: white;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.widget {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.search-widget {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.szukaj-pole {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.szukaj-przycisk {
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
}

.category-list {
    list-style: none;
}

.category-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.category-list .count {
    color: #999;
    font-size: 13px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ============================================
   STRONICOWANIE
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 20px;
}

.pagination-link {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #333;
}

.pagination-link:hover {
    border-color: #667eea;
    color: #667eea;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

/* ============================================
   STOPKA
   ============================================ */

.site-footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #bdc3c7;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #95a5a6;
    font-size: 14px;
}

.powered-by {
    margin-top: 5px;
    font-size: 12px;
}

/* ============================================
   COOKIE BANNER
   ============================================ */

.cookie-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2c3e50;
    color: white;
    padding: 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    z-index: 9999;
}

.cookie-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-accept {
    padding: 10px 30px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.cookie-more {
    color: #bdc3c7;
    text-decoration: underline;
}

/* ============================================
   REKLAMY
   ============================================ */

.ad-header, .ad-footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
}

.ad-container {
    display: inline-block;
    max-width: 100%;
}

.ad-image {
    max-width: 100%;
    height: auto;
}

.kontener-reklamy {
    max-width: 100%;
    overflow: hidden;
}

.obraz-reklamy {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.kontener-reklamy iframe,
.article-body iframe,
.page-body iframe {
    max-width: 100%;
    display: block;
}

/* ============================================
   MENU KATEGORII - DRZEWIASTE
   ============================================ */

.kategorie-nav {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.kategorie-nav > h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
    font-size: 1.1em;
    color: #1f2937;
}

.menu-kategorie {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-kategorie.level-0 {
    padding: 0;
}

.menu-kategorie.level-0 > .menu-item {
    border-bottom: 1px solid #e5e7eb;
}

.menu-kategorie.level-0 > .menu-item > a {
    font-weight: 600;
    font-size: 1em;
    color: #1f2937;
}

.menu-kategorie.level-1 {
    display: none;
    padding-left: 0;
    background: #f9fafb;
    border-left: 3px solid #3b82f6;
    margin: 5px 0;
}

.menu-kategorie.level-1.open {
    display: block;
}

.menu-kategorie.level-1 > .menu-item > a {
    font-size: 0.95em;
    color: #4b5563;
}

.menu-kategorie.level-2 {
    display: none;
    padding-left: 0;
    background: #f3f4f6;
    margin: 3px 0;
}

.menu-kategorie.level-2.open {
    display: block;
}

.menu-kategorie.level-2 > .menu-item > a {
    font-size: 0.9em;
    color: #6b7280;
}

.menu-kategorie.level-3 {
    display: none;
    padding-left: 15px;
}

.menu-kategorie.level-3.open {
    display: block;
}

.menu-item {
    position: relative;
    padding: 5px 10px;
}

.menu-item a {
    display: inline;
    padding: 0;
    color: #374151;
    text-decoration: none;
}

.menu-item.active > a {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

.menu-item a:hover {
    background: #f3f4f6;
}

.menu-kategorie .menu-kategorie {
    display: none;
    padding-left: 20px;
}

.menu-kategorie .menu-kategorie.open {
    display: block;
}

.toggle-arrow {
    display: inline;
    cursor: pointer;
    margin-right: 8px;
    font-size: 0.8em;
    user-select: none;
}

/* ============================================
   BANER PODGLĄDU SZKICU + ANTYSPAM
   ============================================ */

.baner-podgladu {
    background: #ff9800;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 9999;
}

.baner-podgladu-link {
    color: white;
    text-decoration: underline;
    margin-left: 15px;
}

.pulapka-antyspam {
    position: absolute;
    left: -5000px;
}

/* ============================================
   TREŚĆ STRON STATYCZNYCH
   ============================================ */

.page-body {
    font-size: 17px;
    line-height: 1.8;
    color: #444;
}

.page-body p {
    margin-bottom: 18px;
}

.page-body h1 {
    font-size: 32px;
    margin: 35px 0 15px;
}

.page-body h2 {
    font-size: 28px;
    margin: 30px 0 15px;
}

.page-body h3 {
    font-size: 22px;
    margin: 25px 0 12px;
}

.page-body h4, .page-body h5, .page-body h6 {
    margin: 20px 0 10px;
}

.page-body ul, .page-body ol {
    margin: 15px 0 15px 25px;
}

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

.page-body strong, .page-body b {
    font-weight: 700;
}

.page-body em, .page-body i {
    font-style: italic;
}

.page-body a {
    color: #667eea;
    text-decoration: underline;
}

.page-body blockquote {
    border-left: 4px solid #667eea;
    padding: 10px 20px;
    margin: 20px 0;
    color: #666;
    font-style: italic;
}

.page-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.page-body table td, .page-body table th {
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
}

.page-body table th {
    background: #f3f4f6;
    font-weight: 600;
}

.page-body img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   WIDGET RODO / COOKIES
   ============================================ */

.rodo-widget {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 99998;
    display: flex;
    justify-content: center;
    padding: 0 12px 12px;
    transform: translateY(110%);
    transition: transform 0.45s cubic-bezier(.22,1,.36,1);
    pointer-events: none;
    width: 100%;
    box-sizing: border-box;
}
.rodo-widget.rodo-visible {
    transform: translateY(0);
    pointer-events: all;
}
.rodo-inner {
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 40px rgba(0,0,0,0.15);
    max-width: 700px;
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
    border-bottom: none;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}
.rodo-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}
.rodo-icon { font-size: 20px; }
.rodo-title { font-weight: 700; font-size: 15px; flex: 1; }
.rodo-body { padding: 16px 20px 8px; }
.rodo-tekst { font-size: 13px; line-height: 1.65; color: #444; margin: 0 0 14px; }

.rodo-kategorie { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.rodo-kat {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 11px 14px;
    background: #fafafa;
}
.rodo-kat-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rodo-kat-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rodo-kat-nazwa { font-size: 13px; font-weight: 600; color: #333; }
.rodo-kat-badge {
    font-size: 11px;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.rodo-kat-opis { font-size: 12px; color: #666; margin: 7px 0 0; line-height: 1.5; }

.rodo-toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.rodo-toggle input { opacity: 0; width: 0; height: 0; }
.rodo-slider {
    position: absolute; inset: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.25s;
}
.rodo-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
}
.rodo-toggle input:checked + .rodo-slider { background: #667eea; }
.rodo-toggle input:checked + .rodo-slider::before { transform: translateX(18px); }
.rodo-toggle-disabled .rodo-slider { background: #43a047; cursor: default; }
.rodo-toggle-disabled .rodo-slider::before { transform: translateX(18px); }

.rodo-linki { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; padding-top: 2px; }
.rodo-linki a {
    font-size: 12px;
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid rgba(102,126,234,0.3);
}
.rodo-linki a:hover { color: #764ba2; }

.rodo-footer {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 20px 16px;
    background: #f8f8fb;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
    z-index: 2;
    justify-content: flex-end;
    align-items: center;
}
.rodo-btn {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.rodo-btn-reject { background: #f0f0f4; color: #555; }
.rodo-btn-reject:hover { background: #e4e4ea; color: #333; }
.rodo-btn-custom { background: #fff; color: #667eea; border: 1.5px solid #667eea; }
.rodo-btn-custom:hover { background: #f0f2ff; }
.rodo-btn-accept {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 3px 12px rgba(102,126,234,0.3);
}
.rodo-btn-accept:hover { box-shadow: 0 5px 18px rgba(102,126,234,0.5); transform: translateY(-1px); }

.rodo-float-btn {
    position: fixed;
    bottom: 20px; right: 0;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #667eea;
    font-size: 20px; line-height: 1;
    cursor: pointer;
    box-shadow: -2px 4px 16px rgba(0,0,0,0.12);
    z-index: 99997;
    display: none;
    align-items: center; justify-content: center;
    transform: translateX(50%);
    transition: transform 0.3s cubic-bezier(.22,1,.36,1), box-shadow 0.2s;
}
.rodo-float-btn:hover {
    transform: translateX(0);
    box-shadow: -4px 6px 20px rgba(102,126,234,0.35);
}
.rodo-float-btn.rodo-float-visible { display: flex; }

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* ============================================
   RESPONSYWNOŚĆ
   ============================================ */

@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    }

    .main-nav.active {
        display: flex;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 540px) {
    .rodo-widget { padding: 0 8px 8px; }
    .rodo-inner { border-radius: 12px 12px 0 0; }
    .rodo-header { padding: 12px 16px 10px; }
    .rodo-title { font-size: 14px; }
    .rodo-body { padding: 12px 16px 6px; }
    .rodo-tekst { font-size: 12px; margin-bottom: 10px; }
    .rodo-footer { flex-direction: column; align-items: stretch; padding: 10px 16px 12px; gap: 6px; }
    .rodo-btn { width: 100%; text-align: center; padding: 8px 12px; font-size: 13px; }
    .rodo-float-btn { bottom: 14px; font-size: 18px; width: 40px; height: 40px; }
}
