/* --- Podstawowy Reset i Zmienne CSS --- */
:root {
    --primary-color: #1A3A5A;
    --secondary-color: #212529;
    --text-color: #333333;
    --light-text-color: #6c757d;
    /* ZMIANA: Poprawiono kontrast koloru dla zgodności z WCAG AA (było #2585d4) */
    --accent-color: #1a75c1; 
    --accent-color-hover: #1669a3;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --border-color: #e9ecef;
    --box-shadow-light: 0 4px 15px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --spacing-unit: 1rem;

    /* Zmienne dla Panelu Ustawień Ciasteczek */
    --cookie-modal-primary: #005A9C;
    --cookie-modal-background: #FFFFFF;
    --cookie-modal-text-primary: #212529;
    --cookie-modal-text-secondary: #495057;
    --cookie-modal-overlay: rgba(0, 0, 0, 0.5);
    --cookie-modal-border: #DEE2E6;
    --cookie-modal-disabled: #CED4DA;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
    margin-top: calc(var(--spacing-unit) * 2.5);
    margin-bottom: calc(var(--spacing-unit) * 1.2);
}

h1:first-child,
main h1:first-child {
    margin-top: 0;
}

h1 { font-size: 3rem; margin-bottom: 1.5rem; }
h2 { font-size: 2.4rem; }
h3 { font-size: 1.9rem; }
h4 { font-size: 1.6rem; }

p {
    margin-bottom: var(--spacing-unit);
    color: var(--text-color);
}

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

a:hover {
    color: var(--accent-color-hover);
    text-decoration: underline;
}

main {
    max-width: 1080px;
    margin: 60px auto;
    padding: 0 25px;
}

.container {
    /* UJEDNOLICONO: Używamy 1080px jako standardu */
    max-width: 1080px; 
    margin: 0 auto;
    padding: 0 25px;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 30px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.8rem;
    margin-bottom: 0.2rem;
    color: white;
    margin-top: 0;
}

header h1 a {
    color: white;
    text-decoration: none;
}

header h1 a:hover {
    color: #f0f0f0;
}

header p {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
}

header nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 35px;
    margin-top: 25px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 5px;
    position: relative;
    opacity: 0.9;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.nav-link:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0%;
    height: 2px;
    background-color: white;
    transition: width 0.3s ease-in-out;
}

.nav-link:hover::after {
    width: 100%;
}

/* --- Siatka Postów --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    justify-items: stretch;
    align-items: start;
    grid-auto-rows: 1fr;
}

/* --- Karta Posta --- */
.post-card {
    background-color: var(--card-background);
    border-radius: 10px;
    box-shadow: var(--box-shadow-light);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.post-card h2 {
    font-size: 1.6rem;
    margin-bottom: 10px;
    margin-top: 0;
    color: var(--primary-color);
}

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

.post-card h2 a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.post-meta {
    font-size: 0.9rem;
    color: var(--light-text-color);
    margin-bottom: 12px;
    font-weight: 400;
}

.post-excerpt {
    font-size: 1.05rem;
    color: var(--text-color);
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more-link {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    align-self: flex-start;
    text-decoration: none;
}

.read-more-link:hover {
    background-color: var(--accent-color-hover);
    transform: translateY(-2px);
    text-decoration: none;
}

footer {
    background-color: var(--secondary-color);
    color: #F7F8FA;
    padding: 35px 0;
    text-align: center;
    margin-top: 80px;
    font-size: 0.95rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.footer-link {
    color: #F7F8FA;
}
.footer-link::before {
    content: '|';
    margin: 0 1rem;
    color: var(--light-text-color);
}

/* --- Tabele --- */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 30px 0;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    background-color: var(--card-background);
}

table thead {
    background-color: var(--primary-color);
    color: white;
}

table th,
table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

table th {
    font-weight: 600;
    text-transform: uppercase;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

table tbody tr:nth-child(even) {
    background-color: var(--background-color);
}

table tbody tr:hover {
    background-color: #eef5fb;
    cursor: pointer;
}

table td {
    color: var(--text-color);
}

@media (max-width: 600px) {
    table {
        min-width: 500px;
    }
    table th, table td {
        padding: 10px 15px;
    }
}

/* --- Obrazki w treści --- */
figure {
    max-width: 100%;
    margin: 25px auto;
    display: block;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: var(--card-background);
    padding: 15px;
}

figure img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 10px auto;
}

.post-card-inner {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* --- Style Dostępności i Narzędziowe --- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 2000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Style Strony Polityki Prywatności --- */
.policy-page .container {
    max-width: 800px;
    background: var(--card-background);
    padding: calc(var(--spacing-unit) * 3);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-light);
}

.policy-page .back-link {
    display: inline-block;
    margin-bottom: 30px;
    color: var(--light-text-color);
    text-decoration: none;
    font-size: 1rem;
}

.policy-page .back-link:hover {
    color: var(--accent-color);
}

.policy-page h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.policy-page .effective-date {
    color: var(--light-text-color);
    margin-top: 0;
    margin-bottom: 3rem;
    font-style: italic;
}

.policy-page h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
}

.policy-page ul {
    list-style-position: outside;
    padding-left: 20px;
}

.policy-page pre {
    font-family: monospace, monospace;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 4px;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* --- Style Banera Cookie --- */
.cookie-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(33, 37, 41, 0.95);
    color: #f8f9fa;
    padding: 20px 40px;
    display: none; /* Ukryty domyślnie, JS go pokaże */
    justify-content: center;
    align-items: center;
    gap: 40px;
    z-index: 1000;
    font-family: 'Open Sans', sans-serif;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.cookie-banner__text {
    margin: 0;
    font-size: 0.9rem;
    color: #f8f9fa; 
}

.cookie-banner__text a {
    color: #ffffff;
    text-decoration: underline;
}

.cookie-banner__text a:focus-visible {
    outline-color: #ffffff; 
}

.cookie-banner__actions {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

.cookie-banner .btn {
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid transparent;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

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

.cookie-banner .btn-primary:hover {
    background-color: var(--accent-color-hover);
}

.cookie-banner .btn-secondary {
    background-color: transparent;
    color: white;
    border-color: rgba(255, 255, 255, 0.7);
}

.cookie-banner .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* --- Style Panelu Ustawień Ciasteczek --- */
.cookie-settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--cookie-modal-overlay);
    z-index: 2000;
    display: none; 
    justify-content: center;
    align-items: center;
    font-family: 'Inter', sans-serif;
}

.cookie-settings-overlay.is-visible {
    display: flex;
}

.cookie-settings-modal {
    background-color: var(--cookie-modal-background);
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 600px;
}

.cookie-settings-modal h2 {
    font-family: 'Poppins', sans-serif;
    color: var(--cookie-modal-text-primary);
    font-size: 1.75rem;
    margin-top: 0;
    margin-bottom: 16px;
}

.cookie-settings-intro {
    color: var(--cookie-modal-text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.category-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--cookie-modal-border);
}

.category-item:first-child {
    padding-top: 0;
}

.category-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.category-text h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    color: var(--cookie-modal-text-primary);
    margin: 0 0 8px 0;
}

.category-text p {
    font-size: 0.9rem;
    color: var(--cookie-modal-text-secondary);
    margin: 0;
}

.cookie-settings-actions {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--cookie-modal-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-settings {
    padding: 10px 20px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 5px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out, filter 0.2s ease-in-out;
}

.btn-primary-settings {
    background-color: var(--cookie-modal-primary);
    color: white;
}
.btn-primary-settings:hover {
    filter: brightness(115%);
}

.btn-secondary-settings {
    background-color: transparent;
    color: var(--cookie-modal-primary);
    border-color: var(--cookie-modal-primary);
}
.btn-secondary-settings:hover {
    background-color: var(--cookie-modal-primary);
    color: white;
}

/* Style dla przełącznika (toggle) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--cookie-modal-disabled);
    transition: .4s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--cookie-modal-primary);
}

input:focus-visible + .slider {
    box-shadow: 0 0 1px var(--cookie-modal-primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Styl dla zablokowanego przełącznika */
input:disabled + .slider {
    cursor: not-allowed;
    background-color: var(--cookie-modal-primary);
    opacity: 0.5;
}

/* Style Wyszukiwarki */
.search-container {
    position: relative;
    margin: 30px auto 0;
    max-width: 600px;
}

#search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    font-family: 'Open Sans', sans-serif;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(37, 133, 212, 0.2);
}

#search-results-container {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: var(--box-shadow-hover);
    margin-top: -2px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 500;
}

.search-results-list {
    padding: 10px;
}

.search-result-item {
    display: block;
    padding: 12px 15px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.search-result-item:hover,
.search-result-item:focus {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.search-result-item h3 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
    color: inherit;
}

.search-result-item mark {
    background-color: #a0d5ff;
    color: var(--primary-color);
    font-weight: bold;
}

.search-no-results {
    padding: 20px;
    color: var(--light-text-color);
    text-align: center;
}

@media (max-width: 768px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .cookie-banner__text {
        padding-right: 0;
    }
}

/* --- Style dla Pojedynczego Wpisu Blogowego (blog-post-single) --- */
.blog-post-single {
    max-width: 800px; /* Może być dostosowane do Twoich preferencji */
    margin: 60px auto; /* Dopasowane do marginesów main */
    padding: 30px;
    background-color: var(--card-background);
    border-radius: 10px;
    box-shadow: var(--box-shadow-light);
    border: 1px solid var(--border-color);
}

.blog-post-single header {
    background-color: transparent; /* Nadpisz styl z globalnego headera */
    color: var(--text-color);
    padding: 0;
    text-align: left; /* Zresetuj centrowanie z globalnego headera */
    box-shadow: none; /* Usuń cień z globalnego headera */
    margin-bottom: 25px; /* Dodaj odstęp po nagłówku posta */
}

.blog-post-single h1 {
    font-size: 2.8rem; /* Większy rozmiar dla tytułu posta */
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    line-height: 1.1;
}

.blog-post-single .post-meta {
    font-size: 0.95rem;
    color: var(--light-text-color);
    margin-bottom: 0; /* Użyj marginesów z .blog-post-single header */
    font-weight: 400;
}

.blog-post-single .post-content {
    /* Styl dla treści postów (np. obrazki, listy, cytaty) */
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-color);
}

.blog-post-single .post-content h2,
.blog-post-single .post-content h3,
.blog-post-single .post-content h4 {
    margin-top: calc(var(--spacing-unit) * 2);
    margin-bottom: var(--spacing-unit);
    color: var(--primary-color);
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

.blog-post-single .post-content p {
    margin-bottom: var(--spacing-unit);
}

.blog-post-single .post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: var(--box-shadow-light);
}

.blog-post-single .post-content ol,
.blog-post-single .post-content ul {
    margin-left: 25px;
    margin-bottom: var(--spacing-unit);
    color: var(--text-color);
}

.blog-post-single .post-content li {
    margin-bottom: 0.5rem;
}

.blog-post-single .post-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--light-text-color);
}

/* --- Style dla Sekcji Komentarzy (Utterances) --- */
.comments-section {
    margin-top: 60px; /* Większy odstęp od treści posta */
    padding-top: 30px;
    border-top: 1px solid var(--border-color); /* Delikatny separator */
}

.comments-section h2 {
    text-align: center; /* Wyśrodkuj nagłówek "Komentarze" */
    font-size: 2rem;
    margin-bottom: 25px;
    color: var(--primary-color);
}

/* Dostosowanie kontenera Utterances (jeśli potrzebujesz) */
/* Utterances sam w sobie ma swoje własne style, które są dynamicznie ładowane.
   Te style poniżej są dla kontenera, w którym Utterances jest osadzony,
   lub dla ewentualnych nadpisanych reguł, jeśli Utterances na to pozwala. */
.comments-section .utterances {
    /* Możesz tu np. zmienić padding, border, jeśli domyślne są niewystarczające */
    padding: 15px;
    background-color: var(--background-color); /* Lekkie tło dla kontrastu */
    border-radius: 8px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05); /* Delikatny wewnętrzny cień */
}


/* --- Media Queries dla Responsywności --- */
@media (max-width: 768px) {
    .blog-post-single {
        margin: 30px 15px; /* Zmniejsz marginesy na mniejszych ekranach */
        padding: 20px;
    }

    .blog-post-single h1 {
        font-size: 2.2rem;
    }

    .comments-section {
        margin-top: 40px;
        padding-top: 20px;
    }

    .comments-section h2 {
        font-size: 1.7rem;
    }
}

@media (max-width: 480px) {
    .blog-post-single h1 {
        font-size: 1.8rem;
    }
    .blog-post-single .post-content {
        font-size: 1rem;
    }
}
