/*
Theme Name: Book Catalog Portal
Description: Portal katalogowy — książki, filmy, wydarzenia
Version: 3.0.0
*/

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

:root {
    --bg:           #f5f3ff;
    --bg-card:      #ffffff;
    --bg-card-hover:#f0edff;
    --surface:      #ede9fe;
    --primary:      #6c5ce7;
    --primary-light:#a29bfe;
    --accent:       #e17055;
    --success:      #00b894;
    --warning:      #fdcb6e;
    --text:         #2d3436;
    --text-muted:   #636e72;
    --text-dim:     #b2bec3;
    --border:       rgba(108, 92, 231, 0.12);
    --radius:       12px;
    --radius-sm:    8px;
    --shadow:       0 2px 16px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 32px rgba(108, 92, 231, 0.12);
    --transition:   0.25s ease;
    --max-width:    1200px;
    --header-bg:   rgba(245, 243, 255, 0.85);
    --hero-grad:    rgba(108,92,231,0.05);
    --badge-bg:     rgba(255,255,255,0.92);
    --badge-shadow: rgba(0,0,0,0.08);
}

[data-theme="dark"] {
    --bg:           #0f0f1a;
    --bg-card:      #1a1a2e;
    --bg-card-hover:#25253d;
    --surface:      #16213e;
    --primary:      #a29bfe;
    --primary-light:#6c5ce7;
    --accent:       #fd79a8;
    --text:         #edf2f7;
    --text-muted:   #a0aec0;
    --text-dim:     #4a5568;
    --border:       rgba(108, 92, 231, 0.15);
    --shadow:       0 4px 24px rgba(0,0,0,0.3);
    --shadow-hover: 0 8px 32px rgba(108, 92, 231, 0.25);
    --header-bg:   rgba(15, 15, 26, 0.9);
    --hero-grad:    rgba(108,92,231,0.08);
    --badge-bg:     rgba(0,0,0,0.7);
    --badge-shadow: rgba(0,0,0,0.3);
}

html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg); color: var(--text);
    line-height: 1.6; min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

/* ═══════════════════════════════════════════════════════════════════
   HEADER & NAVIGATION
   ═══════════════════════════════════════════════════════════════════ */
.site-header {
    background: var(--header-bg); border-bottom: 1px solid var(--border);
    padding: 0 20px; position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.nav-wrap {
    max-width: var(--max-width); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.site-logo {
    font-size: 22px; font-weight: 800; color: var(--text);
    display: flex; flex-direction: column; gap: 0; text-decoration: none;
}
.site-logo:hover { color: var(--text); }
.logo-title { font-size: 20px; font-weight: 800; line-height: 1.2; }
.logo-desc { font-size: 11px; font-weight: 500; color: var(--text-muted); line-height: 1.3; letter-spacing: 0.3px; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-links { display: flex; gap: 20px; list-style: none; }
.nav-links a {
    color: var(--text-muted); font-weight: 500; font-size: 14px;
    transition: color var(--transition); white-space: nowrap;
}
.nav-links a:hover { color: var(--primary); }

/* Nav dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
    display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover); padding: 8px 0; min-width: 160px; z-index: 200;
    list-style: none;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu li a {
    display: block; padding: 8px 16px; font-size: 13px; color: var(--text-muted);
}
.nav-dropdown-menu li a:hover { color: var(--primary); background: var(--surface); }

.theme-toggle {
    background: var(--surface); border: 1px solid var(--border); border-radius: 50%;
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 18px; transition: all var(--transition); flex-shrink: 0;
}
.theme-toggle:hover { background: var(--primary); border-color: var(--primary); transform: rotate(20deg); }

/* ═══════════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════════ */
.hero {
    text-align: center; padding: 60px 20px 40px;
    background: linear-gradient(180deg, var(--hero-grad) 0%, transparent 100%);
}
.hero h1 {
    font-size: clamp(28px, 5vw, 48px); font-weight: 800; margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p { color: var(--text-muted); font-size: 16px; margin-bottom: 32px; }
.search-bar { max-width: 600px; margin: 0 auto; position: relative; }
.search-bar input {
    width: 100%; padding: 16px 56px 16px 20px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 50px; color: var(--text);
    font-size: 16px; box-shadow: var(--shadow); transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar input:focus { outline: none; border-color: var(--primary); box-shadow: var(--shadow-hover); }
.search-bar input::placeholder { color: var(--text-dim); }
.search-bar button {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: var(--primary); border: none; color: #fff;
    width: 44px; height: 44px; border-radius: 50%; font-size: 18px; cursor: pointer;
}
.search-bar button:hover { background: var(--primary-light); }

/* ═══════════════════════════════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════════════════════════════ */
.stats-bar {
    display: flex; justify-content: center; gap: 40px; padding: 24px 20px;
    max-width: var(--max-width); margin: 0 auto;
}
.stat-item { text-align: center; }
.stat-link { text-decoration: none; }
.stat-link:hover { text-decoration: none; }
.stat-link .stat-number { color: var(--primary); }
.stat-number { font-size: 32px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* ═══════════════════════════════════════════════════════════════════
   HOME SECTIONS (new)
   ═══════════════════════════════════════════════════════════════════ */
.home-sections {
    max-width: var(--max-width); margin: 0 auto; padding: 0 20px 60px;
}
.home-section {
    margin-bottom: 48px; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); box-shadow: var(--shadow);
}
.home-section-header {
    position: relative; min-height: 200px; background-size: cover; background-position: center;
}
.home-section-overlay {
    position: relative; z-index: 2; padding: 40px 30px;
    background: linear-gradient(135deg, rgba(15,15,26,0.85) 0%, rgba(15,15,26,0.7) 100%);
    color: #fff; min-height: 200px; display: flex; flex-direction: column; justify-content: center;
}
.home-section-overlay h2 {
    font-size: 28px; font-weight: 800; margin-bottom: 8px; color: #fff;
}
.home-section-overlay p { color: rgba(255,255,255,0.8); font-size: 15px; margin-bottom: 20px; }
.home-section-links { display: flex; gap: 10px; flex-wrap: wrap; }
.home-section-btn {
    display: inline-block; padding: 10px 20px; border-radius: 25px;
    font-weight: 600; font-size: 14px; text-decoration: none; transition: all var(--transition);
}
.home-section-btn:not(.secondary) {
    background: var(--primary); color: #fff;
}
.home-section-btn:not(.secondary):hover { background: var(--primary-light); color: #fff; }
.home-section-btn.secondary {
    background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3);
}
.home-section-btn.secondary:hover { background: rgba(255,255,255,0.25); color: #fff; }
.home-section-content { padding: 24px; }
.home-section-more {
    text-align: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}
.home-section-more a { font-weight: 600; font-size: 14px; color: var(--primary); }

/* ─── Home events list ───────────────────────────────────────────── */
.home-events-list { display: flex; flex-direction: column; gap: 12px; }
.home-event-item {
    display: flex; gap: 16px; padding: 14px; background: var(--surface);
    border-radius: var(--radius-sm); align-items: center; text-decoration: none;
    color: var(--text); transition: all var(--transition);
}
.home-event-item:hover { background: var(--bg-card-hover); transform: translateX(4px); }
.home-event-date {
    flex-shrink: 0; text-align: center; background: var(--primary); color: #fff;
    border-radius: var(--radius-sm); padding: 8px 12px; min-width: 64px;
}
.hed-day { display: block; font-size: 20px; font-weight: 800; line-height: 1.1; }
.hed-month { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.home-event-info { flex: 1; min-width: 0; }
.home-event-info strong { font-size: 14px; display: block; }
.home-event-info small { color: var(--text-muted); font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════════════════════════════ */
.filter-bar {
    display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
    padding: 0 20px 24px; max-width: var(--max-width); margin: 0 auto;
}
.filter-chip {
    padding: 6px 16px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; color: var(--text-muted); font-size: 13px;
    cursor: pointer; transition: all var(--transition); white-space: nowrap;
    text-decoration: none;
}
.filter-chip:hover, .filter-chip.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════════
   BOOKS / MOVIES GRID (shared)
   ═══════════════════════════════════════════════════════════════════ */
.books-container {
    max-width: var(--max-width); margin: 0 auto; padding: 0 20px 60px;
}
.books-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px;
}

/* ─── Card (shared for books & movies) ──────────────────────────── */
.card-item, .book-card {
    background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); transition: all var(--transition);
    cursor: pointer; position: relative; box-shadow: var(--shadow);
    display: block; text-decoration: none; color: var(--text);
}
.card-item:hover, .book-card:hover {
    transform: translateY(-4px); border-color: var(--primary);
    box-shadow: var(--shadow-hover); background: var(--bg-card-hover); color: var(--text);
}

.card-item .card-cover, .book-card .cover-wrap {
    position: relative; width: 100%; aspect-ratio: 2/3; overflow: hidden; background: var(--surface);
}
.card-item .card-cover img, .book-card .cover-wrap img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease;
}
.card-item:hover .card-cover img, .book-card:hover .cover-wrap img { transform: scale(1.05); }
.card-item .card-cover .no-cover, .book-card .cover-wrap .no-cover {
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; height: 100%; color: var(--text-dim);
}
.card-item .card-body, .book-card .card-body { padding: 12px; }
.card-item .card-body h3, .book-card .card-body h3 {
    font-size: 13px; font-weight: 700; line-height: 1.3; margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-subtitle, .book-card .card-body .card-author { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.card-meta-line, .book-card .card-body .card-publisher { font-size: 11px; color: var(--text-dim); }
.card-rating, .book-card .card-body .card-rating {
    position: absolute; top: 10px; right: 10px;
    background: var(--badge-bg); padding: 4px 8px; border-radius: 12px;
    font-size: 11px; color: var(--warning); backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px var(--badge-shadow);
}
.card-type-badge {
    position: absolute; top: 10px; left: 10px;
    background: var(--primary); color: #fff; padding: 3px 10px;
    border-radius: 12px; font-size: 10px; font-weight: 600;
}
.card-date-badge {
    position: absolute; bottom: 10px; left: 10px;
    background: rgba(0,0,0,0.7); color: #fff; padding: 4px 10px;
    border-radius: 12px; font-size: 11px; font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════
   EVENTS LIST (archive)
   ═══════════════════════════════════════════════════════════════════ */
.events-list { display: flex; flex-direction: column; gap: 8px; }
.event-list-item {
    display: flex; gap: 16px; padding: 16px; background: var(--bg-card);
    border-radius: var(--radius); border: 1px solid var(--border);
    align-items: center; text-decoration: none; color: var(--text);
    transition: all var(--transition); box-shadow: var(--shadow);
}
.event-list-item:hover {
    transform: translateX(4px); border-color: var(--primary); color: var(--text);
}
.event-date-block {
    flex-shrink: 0; text-align: center; background: var(--primary); color: #fff;
    border-radius: var(--radius-sm); padding: 10px 14px; min-width: 70px;
}
.event-day { font-size: 24px; font-weight: 800; line-height: 1.1; }
.event-month { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.event-year { font-size: 10px; opacity: 0.8; }
.event-info { flex: 1; min-width: 0; }
.event-info h3 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.event-artists { font-size: 13px; color: var(--text-muted); }
.event-location { font-size: 12px; color: var(--text-dim); }
.event-thumb { flex-shrink: 0; }
.event-thumb img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); }

/* ═══════════════════════════════════════════════════════════════════
   SINGLE PAGE (shared book/movie/event)
   ═══════════════════════════════════════════════════════════════════ */
.single-book { max-width: var(--max-width); margin: 0 auto; padding: 40px 20px; }
.book-hero { display: grid; grid-template-columns: 300px 1fr; gap: 40px; margin-bottom: 40px; }
.book-hero .cover-main { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-hover); }
.book-hero .book-details h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; line-height: 1.2; }
.book-hero .book-meta-line {
    display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
    color: var(--text-muted); font-size: 14px;
}
.book-hero .book-meta-line span { display: flex; align-items: center; gap: 4px; }
.book-hero .book-description { font-size: 16px; line-height: 1.8; margin-top: 16px; }
.book-hero .book-extras {
    margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
}
.book-hero .extra-item { background: var(--surface); padding: 12px; border-radius: var(--radius-sm); text-align: center; }
.book-hero .extra-item .extra-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.book-hero .extra-item .extra-value { font-size: 16px; font-weight: 700; color: var(--primary); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════════
   PAGINATION & FOOTER
   ═══════════════════════════════════════════════════════════════════ */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span {
    padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-muted); font-size: 14px;
    transition: all var(--transition); text-decoration: none;
}
.pagination a:hover, .pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.site-footer {
    text-align: center; padding: 32px 20px; border-top: 1px solid var(--border);
    color: var(--text-dim); font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .book-hero { grid-template-columns: 1fr; gap: 24px; }
    .book-hero .cover-main { max-width: 250px; margin: 0 auto; }
    .books-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .stats-bar { gap: 16px; }
    .stat-number { font-size: 24px; }
    .nav-links { gap: 10px; }
    .nav-links a { font-size: 13px; }
    .home-section-overlay { padding: 24px 20px; min-height: 150px; }
    .home-section-overlay h2 { font-size: 22px; }
    .event-list-item { flex-wrap: wrap; }
    .event-thumb { display: none; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 24px; }
    .hero p { font-size: 14px; }
    .books-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card-item .card-body, .book-card .card-body { padding: 8px; }
    .card-item .card-body h3, .book-card .card-body h3 { font-size: 12px; }
    .filter-bar { gap: 6px; }
    .filter-chip { padding: 4px 12px; font-size: 12px; }
    /* Mobile: show hamburger-style simplified nav */
    .nav-links { gap: 6px; }
    .nav-links a { font-size: 12px; }
    .nav-dropdown-menu { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); }
    .theme-toggle { width: 36px; height: 36px; font-size: 16px; }
    .logo-desc { display: none; }
    .home-section-btn { padding: 8px 14px; font-size: 12px; }
    .home-section-links { gap: 6px; }
    .stats-bar { gap: 12px; }
    .stat-number { font-size: 20px; }
    .stat-label { font-size: 10px; }
}
