/* Global styles */
:root {
    --primary-color: #007bff; /* Blue for links, buttons */
    --accent-color: #28a745; /* Green for success, highlights */
    --warning-color: #ffc107; /* Yellow for warnings */
    --danger-color: #dc3545; /* Red for errors */
    --text-color: #343a40; /* Dark grey for body text */
    --light-text-color: #6c757d; /* Lighter grey for meta info */
    --background-color: #f8f9fa; /* Light grey for body background */
    --card-background: #ffffff; /* White for cards */
    --border-color: #e9ecef; /* Light grey for borders */
    --shadow-color: rgba(0, 0, 0, 0.08); /* Subtle shadow */
    --header-bg: #ffffff; /* White for header background */
    --footer-bg: #343a40; /* Dark grey for footer */
    --footer-text: #f8f9fa; /* Light text for footer */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%; /* Prevent any element from exceeding container width */
}

/* Override max-width for specific elements that need full width */
html, body, .container, .main-content-wrapper, .content-area {
    max-width: none;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    scroll-behavior: smooth;
    overflow-wrap: break-word; /* Dodano dla ogólnego łamania wierszy */
}

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

a:hover {
    color: #0056b3; /* Darker blue */
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-color);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.8rem;
    overflow-wrap: break-word; /* Dodano dla nagłówków */
}

p {
    margin-bottom: 1rem;
    overflow-wrap: break-word; /* Dodano dla paragrafów */
}
figcaption {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--light-text-color);
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto; /* No top/bottom margin for a full-width header/footer */
    background-color: var(--card-background);
    box-shadow: 0 4px 20px var(--shadow-color);
    border-radius: 0; /* Remove rounded corners for full-width sections */
    overflow: hidden;
    padding: 0 1rem; /* Add mobile padding */
}

/* Header */
.main-header {
    background-color: var(--header-bg);
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-wrap a {
    display: inline-block;
}

.logo-img {
    max-height: 4rem;
    width: auto;
}

.logo-image{
    width: 7rem;
}

.author-avatar{
    width: 8rem;
}
.search-form {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.search-form:focus-within {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    border-color: var(--primary-color);
}

.search-form input {
    padding: 0.75rem 1rem;
    border: none;
    outline: none;
    width: 250px;
    font-size: 0.95rem;
    color: var(--text-color);
    background-color: var(--card-background);
}

.search-form input::placeholder {
    color: var(--light-text-color);
}

.search-form button {
    padding: 0.75rem 1.2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background-color: #0056b3;
}

/* Breaking News Banner */
.breaking-news {
    background-color: var(--danger-color);
    color: white;
    padding: 0.75rem 0;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.breaking-news .container-sm {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header Ad */
.header-ad {
    background-color: #e9ecef; /* Lighter background for ads */
    padding: 1rem 0;
    text-align: center;
    font-size: 0.9em;
    color: var(--light-text-color);
    border-bottom: 1px solid var(--border-color);
}
.header-ad .ad-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}


/* Navigation */
.main-nav {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.03);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-links {
    display: flex;
    justify-content: flex-start;
    list-style: none;
    gap: 2.5rem;
}

.nav-links li a {
    color: var(--text-color);
    font-weight: 600;
    padding: 1rem 0;
    position: relative;
    display: block;
    transition: color 0.3s ease;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links li a:hover {
    color: var(--primary-color);
}

.nav-links li a:hover::after {
    width: 100%;
}

/* Main Layout */
.main-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    padding: 2.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.content-area {
    /* No specific background or shadow here, apply to individual cards/sections within */
    min-height: 60vh; /* Ensure content area takes up space */
}

.sidebar {
    /* No specific background or shadow here */
}

/* Card General Styling */
.card {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 15px var(--shadow-color);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color); /* Subtle border */
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: center;
}

.card-body {
    padding: 1.5rem;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--light-text-color);
    margin-bottom: 0.8rem;
}

.card-meta span, .card-meta a {
    background-color: #e9ecef;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-weight: 500;
    color: var(--light-text-color);
    white-space: nowrap;
}

.card-meta a:hover {
    background-color: #dee2e6;
    color: var(--text-color);
}

.card-title {
    font-size: 1.35rem;
    margin-bottom: 0.6rem;
    overflow-wrap: break-word; /* Dodano dla tytułów kart */
}

.card-title a {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.card-title a:hover {
    color: var(--primary-color);
}

.card-excerpt {
    font-size: 0.95rem;
    color: var(--light-text-color);
    margin-bottom: 1rem;
    overflow-wrap: break-word; /* Dodano dla fragmentów kart */
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--light-text-color);
}

.article-tags {
    margin-top: 0.8rem;
}

.article-tags .tag {
    display: inline-block;
    background-color: #e9ecef;
    color: var(--light-text-color);
    padding: 0.25rem 0.6rem;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-right: 0.4rem;
    margin-bottom: 0.4rem;
    transition: background-color 0.3s ease;
}

.article-tags .tag:hover {
    background-color: #dee2e6;
    color: var(--text-color);
}

/* Article Rating */
.article-rating {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Hero Section (Main Featured Article) */
.main-hero {
    margin-bottom: 2.5rem;
}

.hero-article-large {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 0;
    color: white;
    box-shadow: 0 4px 20px var(--shadow-color);
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.hero-article-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
    transition: all 0.3s ease;
}

.hero-article-large:hover::before {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.7) 100%);
}

.hero-article-large:hover .hero-overlay-content {
    transform: translateY(-5px);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 25px 50px rgba(0, 0, 0, 0.5);
}

.hero-overlay-content {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.32) 0%, rgba(0, 0, 0, 0.6) 100%);
    padding: 2rem;
    border-radius: 0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    width: 100%;
}

.hero-overlay-content .article-type {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    letter-spacing: 0.5px;
}

.hero-title {
    font-size: 2.8rem;
    margin: 1rem 0;
    line-height: 1.1;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.02em;
    overflow-wrap: break-word; /* Dodano dla tytułów hero */
}

.hero-title a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.hero-title a:hover {
    color: var(--primary-color);
}

.hero-excerpt {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 2rem;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 400;
    overflow-wrap: break-word; /* Dodano dla fragmentów hero */
}

.hero-meta {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Section Headings */
.section-heading {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.section-heading.reviews {
    border-color: var(--danger-color);
}

.section-heading.trending {
    border-color: var(--accent-color);
}

.logo-img {
    height: 4rem;
}

/* Article Grids */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 0.9fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 0.9fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Sidebar */
.sidebar-section {
    background-color: var(--card-background);
    padding: 1.8rem;
    border-radius: 8px;
    box-shadow: 0 2px 15px var(--shadow-color);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.sidebar-section h3 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

.sidebar-section ul {
    list-style: none;
    padding: 0;
}

.sidebar-section ul li {
    margin-bottom: 0.8rem;
}

.sidebar-section ul li a {
    color: var(--text-color);
    font-weight: 500;
    display: block;
    transition: color 0.3s ease, transform 0.3s ease;
}

.sidebar-section ul li a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Ad Placement */
.ad-placement {
    background-color: #f1f3f4; /* Lighter grey for ad blocks */
    border: 1px dashed var(--border-color);
    padding: 1.5rem;
    text-align: center;
    border-radius: 8px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-text-color);
    margin: 1.5rem 0;
    font-weight: 500;
    font-size: 0.9em;
}

.ad-placement.ad-article {
    margin: 2rem 0;
}

/* Newsletter Signup */
.newsletter-signup {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.newsletter-signup h3 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.newsletter-signup p {
    color: var(--light-text-color);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.newsletter-form {
    gap: 0.75rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.newsletter-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.newsletter-form button {
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #0056b3;
}

/* Footer */
.main-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.main-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.main-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.main-footer a:hover {
    text-decoration: underline;
}

/* Messages */
.messages {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 2rem;
}

.messages .alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    border: 1px solid transparent;
    font-weight: 500;
    font-size: 0.95rem;
}

.messages .alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.messages .alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.messages .alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Article Detail Page Specific Styles */
.article-header {
    padding: 2.5rem;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 15px var(--shadow-color);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.article-header-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Align to top for rating */
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.article-header-meta .article-info {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.article-header-meta .article-info span,
.article-header-meta .article-info a {
    padding: 0.5rem 1rem;
    border-radius: 20px; /* More rounded */
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.article-header-meta .article-info span { /* For article type */
    background-color: var(--primary-color);
    color: white;
}
.article-header-meta .article-info a { /* For category */
    background-color: #e9ecef;
    color: var(--light-text-color);
}
.article-header-meta .article-info a:hover {
    background-color: #dee2e6;
    color: var(--text-color);
}

.article-header h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.2; /* Ensure optimal line height */
}

.article-header .excerpt {
    font-size: 1.2rem; /* Slightly larger */
    color: var(--light-text-color);
    margin-bottom: 2rem; /* More spacing */
    line-height: 1.6;
}

.article-meta-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color); /* Add bottom border */
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--light-text-color);
}

.article-meta-bottom .meta-items {
    display: flex;
    gap: 2rem; /* More spacing */
    flex-wrap: wrap;
}

/* Specific button styles for social sharing */
.article-social-share .btn {
    margin-left: 0.5rem;
}
.article-social-share .btn-twitter {
    background-color: #1da1f2; /* Twitter blue */
}
.article-social-share .btn-twitter:hover {
    background-color: #0c85d0;
}
.article-social-share .btn-print {
    background-color: #6c757d; /* Grey for print */
}
.article-social-share .btn-print:hover {
    background-color: #5a6268;
}

.featured-image {
    margin: 0 0 2rem 0; /* Adjusted margins */
}
.featured-image img {
    width: 100%;
    height: 400px; /* Slightly reduced height for better content flow */
    object-fit: cover;
    border-radius: 10px; /* Slightly more rounded */
    box-shadow: 0 2px 10px var(--shadow-color);
}

.article-content {
    background-color: var(--card-background);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 15px var(--shadow-color);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.article-content div {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-color);
    word-break: break-word; /* Dodano dla łamania długich słów/ciągów znaków w treści */
    overflow-wrap: break-word; /* Dodano dla ogólnego łamania wierszy */
    hyphens: auto; /* Add automatic hyphenation */
}

/* Ensure all text elements in article content handle long words properly */
.article-content * {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Specific handling for links and code elements that might contain long URLs */
.article-content a,
.article-content code,
.article-content pre {
    word-break: break-all;
    overflow-wrap: break-word;
}

.article-content h2, .article-content h3, .article-content h4, .article-content h5, .article-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}
.article-content h2 { font-size: 1.8rem; }
.article-content h3 { font-size: 1.5rem; }
.article-content h4 { font-size: 1.3rem; }

.article-content p {
    margin-bottom: 1rem;
}

.article-content ul, .article-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

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

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-color);
    font-style: italic;
}

.article-content img {
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 5px;
    margin: 1.5rem 0;
    display: block;
    object-fit: contain; /* Ensure images fit within container */
}

.article-content figcaption {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--light-text-color);
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.article-content .image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.article-content .image-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* Table Styling for Article Content */
.article-content .table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 2.5rem 0; /* Increased margin for better spacing */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); /* Softer shadow */
    border: 1px solid rgba(0, 0, 0, 0.08); /* More subtle border */
    background-color: var(--card-background);
    overflow: hidden; /* Ensure border-radius applies to contents */
}

.article-content table {
    width: 100%;
    table-layout: fixed; /* Ensures equal width distribution for columns */
    border-collapse: collapse;
    margin: 0;
    font-size: 0.85rem;
    min-width: 600px;
}

.article-content th,
.article-content td {
    padding: 0.75rem 1rem; /* Reduced padding for compactness */
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* Lighter border */
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    vertical-align: top;
}

.article-content thead th {
    background: linear-gradient(to right, var(--primary-color), #0056b3); /* Elegant gradient */
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem; /* Slightly smaller font for compactness */
    padding: 0.9rem 1rem; /* Compact padding */
    border-bottom: 2px solid rgba(255, 255, 255, 0.2); /* Subtle separation line */
    position: sticky; /* Sticky headers */
    top: 0;
    z-index: 1;
}

.article-content tbody tr:nth-child(even) {
    background-color: #fcfcfc; /* More subtle alternating row color */
}

.article-content tbody tr:hover {
    background-color: #f0f0f0; /* Softer hover effect */
}

.article-content tbody tr:last-child td {
    border-bottom: none;
}

/* Mobile-first card style for tables (requires data-label attributes on TDs) */
@media (max-width: 700px) {
    .article-content .table-container {
        overflow-x: visible;
        border: none;
        box-shadow: none;
        background-color: transparent;
    }

    .article-content table {
        min-width: unset;
        font-size: 0.9rem;
    }

    .article-content thead {
        display: none;
    }

    .article-content table,
    .article-content tbody,
    .article-content tr,
    .article-content th,
    .article-content td {
        display: block;
        width: 100%;
    }

    .article-content tr {
        margin-bottom: 1rem;
        border: 1px solid rgba(0, 0, 0, 0.08); /* Slightly more prominent border for cards */
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); /* Clearer shadow for cards */
        background-color: var(--card-background);
        overflow: hidden;
        transition: all 0.3s ease; /* Smooth transition for hover */
    }

    .article-content tr:nth-child(even) {
        background-color: var(--card-background);
    }
    .article-content tr:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        background-color: var(--card-background); /* Keep card background on hover */
    }

    .article-content td {
        border-bottom: 1px solid var(--border-color); /* Consistent border between cell contents */
        position: relative;
        padding-left: 45%;
        text-align: right;
    }

    .article-content td:last-child {
        border-bottom: none;
    }

    .article-content td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 40%;
        padding-left: 1rem;
        font-weight: 600;
        text-align: left;
        color: var(--text-color); /* More neutral color for labels */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        box-sizing: border-box;
    }
}

.comments-section {
    background-color: var(--card-background);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 15px var(--shadow-color);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.comments-section h3 {
    margin-bottom: 2rem; /* More spacing */
    color: var(--text-color);
    font-size: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.comment-form {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px; /* Slightly more rounded */
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.comment-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.comment-form textarea {
    min-height: 100px; /* Slightly smaller min-height */
    resize: vertical;
    margin-bottom: 1rem; /* Added margin */
}

.comment-form .btn { /* Use general btn styling for consistency */
    padding: 0.75rem 2rem;
    border-radius: 25px; /* More rounded button */
    font-weight: bold;
    font-size: 0.95rem;
}
.comment-form .btn-primary { /* Override for primary color */
    background-color: var(--primary-color);
    color: white;
}
.comment-form .btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}


.comment-list .comment {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

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

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.comment-header strong {
    color: var(--text-color);
}

.comment-header span {
    color: var(--light-text-color);
}

.comment-content {
    color: var(--text-color);
    line-height: 1.6;
    overflow-wrap: break-word; /* Dodano dla treści komentarzy */
}

.no-comments {
    text-align: center;
    color: var(--light-text-color);
    font-style: italic;
    padding: 1.5rem 0;
}

.related-articles-section {
    background-color: var(--card-background);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.related-articles-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.related-article-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.related-article-image {
    height: 140px;
    width: 100%;
    object-fit: cover;
    object-position: center;
}

.related-article-body {
    padding: 1rem;
}

.related-article-body h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.related-article-body h4 a {
    color: var(--text-color);
}

.related-article-body h4 a:hover {
    color: var(--primary-color);
}

.related-article-body p {
    font-size: 0.9rem;
    color: var(--light-text-color);
    margin-bottom: 0.5rem;
}

.related-article-body .meta-info {
    font-size: 0.8rem;
    color: var(--light-text-color);
}

/* Category and Search Page Headers */
.page-header {
    background-color: var(--primary-color);
    color: white;
    padding: 3rem 2rem;
    border-radius: 8px; /* Consistent border-radius */
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.page-header.reviews {
    background-color: var(--danger-color);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
}

.page-header h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: white;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.page-header .article-count {
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Search form on search page */
.search-page-form-container {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 15px var(--shadow-color);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.search-page-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-page-form input {
    flex: 1;
    min-width: 280px;
    padding: 0.9rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    outline: none;
    font-size: 1rem;
    color: var(--text-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-page-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.search-page-form button {
    padding: 0.9rem 2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.search-page-form button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* No results / Search Suggestions */
.info-card {
    background-color: var(--card-background);
    padding: 3rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.info-card .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.info-card h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.info-card p {
    color: var(--light-text-color);
    margin-bottom: 2rem;
}

.info-card .button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.info-card .button-group a {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.info-card .button-group a.secondary {
    background-color: var(--danger-color);
}

.info-card .button-group a:hover {
    transform: translateY(-2px);
    background-color: #0056b3;
}
.info-card .button-group a.secondary:hover {
    background-color: #b02a39;
}

.popular-terms {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.popular-terms h3 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
}

.popular-terms .term-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.popular-terms .term-list a {
    background-color: #e9ecef;
    color: var(--light-text-color);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.popular-terms .term-list a:hover {
    transform: translateY(-2px);
    background-color: var(--primary-color);
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.pagination-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-links a,
.pagination-links span {
    padding: 0.6rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination-links a {
    background-color: var(--primary-color);
    color: white;
}

.pagination-links a:hover {
    background-color: #0056b3;
}

.pagination-links span {
    background-color: #e9ecef;
    color: var(--text-color);
}

.review-card-rating {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--danger-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.review-card-type {
    background-color: var(--danger-color);
}

.rating-stars {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-stars .star {
    width: 15px;
    height: 15px;
    background-color: var(--danger-color);
    border-radius: 50%;
}

.rating-stars .star.empty {
    background-color: #e0e0e0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: transform 0.3s ease, background-color 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #b02a39;
    transform: translateY(-2px);
}

/* Categories on frontpage */
.category-card {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 123, 255, 0.2);
    background-color: #0056b3;
}

.category-card .article-count {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Responsive Design */

.nav-toggle {
    display: none;
}

/* Hide close button on screens wider than 992px */
@media (min-width: 993px) {
    .close-btn {
        display: none;
    }
}

@media (max-width: 992px) {
    .nav-toggle {
        display: block;
        background: transparent;
        border: 0;
        cursor: pointer;
        padding: 10px;
        position: absolute;
        right: 20px;
        top: 20px;
        z-index: 1000;
    }

    .hamburger {
        display: block;
        position: relative;
        width: 24px;
        height: 2px;
        background: #333;
        transition: background 0.2s ease-in-out;
    }

    .hamburger::before,
    .hamburger::after {
        content: '';
        position: absolute;
        width: 100%;
        height: 2px;
        background: #333;
        left: 0;
        transition: transform 0.2s ease-in-out;
    }

    .hamburger::before {
        top: -8px;
    }

    .hamburger::after {
        bottom: -8px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.9);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }

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

    .close-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        background: transparent;
        border: 0;
        color: #fff;
        font-size: 30px;
        cursor: pointer;
    }


    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links li a {
        padding: 15px 0;
        color: white;
    }
    
    .main-content-wrapper {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem;
        gap: 2rem;
    }


    .header-content {
        flex-direction: column;
        gap: 1.5rem;
        padding: 0 1.5rem;
    }

    .search-form input {
        width: 100%;
    }



    .hero-article-large {
        padding: 2rem;
    }
    .hero-title {
        font-size: 2rem;
    }
    .hero-excerpt {
        font-size: 1rem;
    }

    .articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    .reviews-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }

    .article-header {
        padding: 1.5rem;
    }
    .article-header h1 {
        font-size: 2rem;
    }
    .featured-image img {
        height: 300px;
    }
    .article-content {
        padding: 1.5rem;
    }

    .comments-section, .related-articles-section {
        padding: 1.5rem;
    }
    .comment-form .form-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        padding: 2rem 1.5rem;
    }
    .page-header h1 {
        font-size: 2.2rem;
    }
    .page-header p {
        font-size: 1rem;
    }
    
    .search-page-form input {
        min-width: unset;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 0.5rem; /* Tighter padding on very small screens */
    }
    
    .header-content {
        align-items: flex-start;
    }
    .search-form {
        width: 100%;
    }
    .search-form input {
        width: calc(100% - 80px); /* Adjust for button width */
        border-radius: 5px 0 0 5px;
    }
    .search-form button {
        border-radius: 0 5px 5px 0;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 0.8rem;
        justify-content: center;
    }
    .nav-links li {
        width: 45%; /* Two items per row */
        text-align: center;
    }
    .nav-links li a {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    .nav-links li a::after {
        width: 50%;
        left: 25%;
    }

    .main-content-wrapper {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }
    .card-title {
        font-size: 1.2rem;
    }
    .card-excerpt {
        font-size: 0.9rem;
    }
    .card-meta {
        font-size: 0.8rem;
    }

    .hero-article-large {
        padding: 1.5rem;
    }
    .hero-title {
        font-size: 1.8rem;
    }
    .hero-excerpt {
        font-size: 0.95rem;
    }

    .article-header {
        padding: 1rem;
    }
    .article-header h1 {
        font-size: 1.8rem;
    }
    .article-header .excerpt {
        font-size: 1rem;
    }
    .featured-image img {
        height: 250px;
    }
    .article-content {
        padding: 1rem;
    }
    .article-social-share {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    .article-social-share button {
        width: 100%;
        margin-left: 0 !important;
    }

    .comments-section, .related-articles-section, .sidebar-section, .newsletter-signup, .popular-terms, .search-page-form-container, .info-card {
        padding: 1.2rem;
    }
    .newsletter-form {
        flex-direction: column;
        gap: 0.75rem;
    }
    .newsletter-form button {
        width: 100%;
    }

    .page-header {
        padding: 1.5rem 1rem;
    }
    .page-header h1 {
        font-size: 2rem;
    }
    .page-header p {
        font-size: 0.9rem;
    }
}

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(33, 37, 41, 0.95); /* Dark background with slight transparency */
    color: #f8f9fa; /* Light text color */
    padding: 1.2rem 1.5rem;
    text-align: center;
    z-index: 1050; /* Ensure it's above most content */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(100%); /* Start off-screen for slide-up animation */
    transition: transform 0.5s ease-out; /* Smooth transition */
}

.cookie-consent-banner.show {
    transform: translateY(0); /* Slide up into view */
}

.cookie-consent-banner p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 800px;
}

.cookie-consent-banner a {
    color: var(--primary-color); /* Use primary color for link */
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.3s ease;
}

.cookie-consent-banner a:hover {
    color: #0056b3; /* Darker primary on hover */
}

.cookie-consent-banner .btn {
    background-color: var(--accent-color); /* Green for accept button */
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap; /* Prevent button text from wrapping */
}

.cookie-consent-banner .btn:hover {
    background-color: #218838; /* Darker green on hover */
    transform: translateY(-2px);
}

/* Responsive adjustments for the banner */
@media (min-width: 768px) {
    .cookie-consent-banner {
        flex-direction: row; /* Row layout on larger screens */
        justify-content: space-between;
        padding: 1rem 2rem;
    }

    .cookie-consent-banner p {
        text-align: left;
        margin-right: 1.5rem;
    }

    .cookie-consent-banner .btn {
        margin-left: auto; /* Push button to the right */
    }
}

@media (max-width: 576px) {
    .cookie-consent-banner {
        padding: 1rem;
        gap: 0.8rem;
    }
    .cookie-consent-banner p {
        font-size: 0.85rem;
    }
    .cookie-consent-banner .btn {
        width: 100%; /* Full width button on small screens */
        padding: 0.6rem 1rem;
    }
}

/* --- REFINED POPULAR TAGS WIDGET --- */

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* Slightly reduced gap for a tighter look */
}

.tag-item {
    background-color: transparent;
    color: var(--light-text-color);
    padding: 0.25rem 0.6rem; /* Reduced padding */
    border-radius: 5px; /* Slightly less rounded */
    font-size: 0.8rem; /* Reduced font size */
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    border: 1px solid var(--border-color);
}

.tag-item:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05); /* A subtle scale effect on hover */
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.article-social-share-bottom {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
    display: flex;
    gap: 10px;
}

.btn-facebook {
    background-color: #3b5998;
    color: white;
}

.btn-x {
    background-color: #000000;
    color: white;
}

.btn-linkedin {
    background-color: #0077b5;
    color: white;
}

.btn-copy {
    background-color: #6c757d;
    color: white;
}

/* Author Detail Page */
.author-page {
    padding: 2rem 0;
}

.author-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 15px var(--shadow-color);
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-color);
}

.author-avatar .avatar-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
}

.author-info h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.author-bio {
    font-size: 1rem;
    color: var(--light-text-color);
    max-width: 600px;
}

.author-articles-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.article-list {
    display: grid;
    gap: 1.5rem;
}

.article-item {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.article-item h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.article-item h3 a {
    color: var(--text-color);
}

.article-item h3 a:hover {
    color: var(--primary-color);
}

.article-meta {
    font-size: 0.85rem;
    color: var(--light-text-color);
    margin-bottom: 1rem;
}

.article-meta a {
    font-weight: 600;
}

.article-excerpt {
    font-size: 0.95rem;
    color: var(--text-color);
}

/* Image optimization and lazy loading styles */
.lazy-image-container {
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Maintain existing image styles with optimization */
.hero-image, .card-image, .featured-image img {
    /* Keep existing styles while supporting optimization */
}
