/**
 * Mini CMS - Style frontendu
 */

/* ============================================
   Zmienne globalne
   ============================================ */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --accent: #f59e0b;
    
    --text: #1f2937;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    
    --bg: #ffffff;
    --bg-alt: #f9fafb;
    --bg-dark: #1f2937;
    
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    
    --radius: 8px;
    --radius-lg: 12px;
    
    --max-width: 1200px;
    --sidebar-width: 300px;
}

/* ============================================
   Reset i podstawy
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-alt);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

a:hover {
    color: var(--primary-dark);
}

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

/* ============================================
   Layout
   ============================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Header
   ============================================ */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.site-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo:hover {
    color: var(--primary);
}

.logo-img {
    height: 36px;
    max-width: 160px;
    object-fit: contain;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 65px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-nav a {
    color: var(--text-light);
    font-weight: 500;
    text-decoration: none;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.main-nav a {
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
}

/* ============================================
   Hero section
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Main content
   ============================================ */
.site-main {
    padding: 40px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 40px;
}

/* ============================================
   Posts grid
   ============================================ */
.section-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--text);
}

.section-title i {
    color: var(--primary);
    margin-right: 10px;
}

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

.post-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 20px;
}

.post-category {
    display: inline-block;
    margin-bottom: 8px;
}

.post-category a {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.post-category a:hover {
    background: var(--primary-dark);
    color: white;
}

.post-content h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-content h3 a {
    color: var(--text);
}

.post-content h3 a:hover {
    color: var(--primary);
}

.post-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-meta i {
    margin-right: 4px;
}

/* ============================================
   Single post
   ============================================ */
.post-full {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.post-header {
    margin-bottom: 30px;
}

.post-header h1 {
    font-size: 2rem;
    margin: 16px 0;
    line-height: 1.3;
}

.post-featured-image {
    margin: 24px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-body h2,
.post-body h3,
.post-body h4 {
    margin: 30px 0 15px;
    color: var(--text);
}

.post-body p {
    margin-bottom: 20px;
}

.post-body img {
    border-radius: var(--radius);
    margin: 20px 0;
}

.post-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    margin: 20px 0;
    background: var(--bg-alt);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-light);
}

/* ============================================
   Share buttons
   ============================================ */
.post-share {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.post-share h4 {
    margin-bottom: 16px;
    color: var(--text);
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.whatsapp {
    background: #25d366;
}

/* ============================================
   Related posts
   ============================================ */
.related-posts {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.related-posts h3 {
    margin-bottom: 20px;
    color: var(--text);
}

.related-posts h3 i {
    color: var(--primary);
    margin-right: 8px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-item {
    display: block;
    background: var(--bg-alt);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s;
}

.related-item:hover {
    transform: translateY(-2px);
}

.related-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.related-item h4 {
    padding: 12px;
    font-size: 0.95rem;
    color: var(--text);
}

.related-item small {
    display: block;
    padding: 0 12px 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============================================
   Sidebar
   ============================================ */
.site-sidebar {
    position: sticky;
    top: 90px;
    align-self: start;
}

.sidebar-widget {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.sidebar-widget h3 i {
    color: var(--primary);
    margin-right: 6px;
}

/* ============================================
   Wydarzenia w sidebar
   ============================================ */
.events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.events-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

.events-list a {
    display: block;
    color: var(--text);
    text-decoration: none;
}

.events-list a:hover {
    color: var(--primary);
}

.events-list small {
    color: var(--text-muted);
}

/* ============================================
   Social links
   ============================================ */
.social-links {
    display: flex;
    gap: 10px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

.social-link:hover {
    transform: scale(1.1);
}

.social-facebook { background: #1877f2; }
.social-twitter { background: #1da1f2; }
.social-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-youtube { background: #ff0000; }
.social-tiktok { background: #000; }

/* ============================================
   Udostępnianie
   ============================================ */
.post-share {
    margin: 30px 0;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius-lg);
}

.post-share h3 {
    margin-bottom: 12px;
    font-size: 1rem;
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.share-btn:hover { opacity: 0.85; color: white; }
.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }

/* ============================================
   Podobne posty
   ============================================ */
.related-posts {
    margin-top: 40px;
}

.related-posts h3 {
    margin-bottom: 16px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.related-card {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.related-card:hover {
    transform: translateY(-2px);
}

.related-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.related-content {
    padding: 12px;
}

.related-content h4 {
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.related-content small {
    color: var(--text-muted);
}

/* ============================================
   Stopka
   ============================================ */
.site-footer {
    background: #1a1a2e;
    color: #ccc;
    text-align: center;
    padding: 24px 0;
    margin-top: 40px;
}

.site-footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .site-nav {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-card {
        grid-template-columns: 1fr;
    }
    
    .event-card {
        grid-template-columns: 1fr;
    }
    
    .event-image {
        height: 200px;
    }
    
    .related-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .post-full .post-body {
        font-size: 0.95rem;
    }
    
    .share-buttons {
        flex-direction: column;
    }
}

/* ============================================
   Alerty
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ============================================
   Badge
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-secondary { background: #e2e3e5; color: #383d41; }
.badge-primary { background: #cce5ff; color: #004085; }

/* ============================================
   Przyciski
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #0056b3; color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #545b62; color: white; }
.btn-success { background: #28a745; color: white; }
.btn-success:hover { background: #218838; color: white; }
.btn-danger { background: #dc3545; color: white; }
.btn-danger:hover { background: #c82333; color: white; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-block { display: flex; justify-content: center; width: 100%; }

/* ============================================
   Empty state
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
}

.empty-state h2 {
    margin-bottom: 8px;
}

/* ============================================
   Tabela danych
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.data-table tr:hover {
    background: var(--bg-secondary);
}

.text-muted { color: var(--text-muted); }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }

