/* =========================================================
   prokulski-science Hugo theme — główny arkusz stylów
   Wzorowany na: prokulski.science (nicepage + index.css)
   Kolory: primary #478ac9 / hover #387cbd / tekst #333 / tło sekcji #f7f9fa
   Czcionki: Open Sans (treść) + Roboto (nagłówki)
   ========================================================= */

/* ---- IMPORTS ---- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&family=Open+Sans:wght@300;400;600;700;800&display=swap');

/* ---- CSS VARS ---- */
:root {
  --color-primary:   #478ac9;
  --color-primary-h: #387cbd;
  --color-black:     #000000;
  --color-text:      #333333;
  --color-text-muted:#666666;
  --color-bg:        #ffffff;
  --color-bg-alt:    #f7f9fa;
  --color-border:    #cccccc;
  --color-footer-bg: #333333;
  --color-footer-txt:#cccccc;
  --color-card-bg:   #ffffff;
  --font-body:       'Open Sans', sans-serif;
  --font-heading:    'Open Sans', sans-serif;
  --max-width:       1200px;
  --radius-btn:      16px;
  --radius-card:     8px;
  --shadow-card:     0 4px 10px rgba(0,0,0,0.05);
}

/* ---- RESET / BASE ---- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  margin: 0;
  padding: 0;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-h); text-decoration: underline; }

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem;   font-weight: 700; }
h6 { font-size: 0.9rem; }

p { margin-top: 0; margin-bottom: 1rem; }
ul, ol { margin-top: 0; margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.25rem; }

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

code {
  font-family: 'Courier New', Courier, monospace;
  background: #f0f0f0;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  background: #f0f0f0;
  padding: 1rem;
  border-radius: var(--radius-card);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.9rem;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

table th, table td {
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

table th {
  background: var(--color-bg-alt);
  font-weight: 600;
}

/* ---- LAYOUT CONTAINER ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 30px;
}

/* ---- BUTTON ---- */
.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  text-transform: uppercase;
}

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

.btn-primary:hover {
  background-color: var(--color-black);
  color: #fff;
  text-decoration: none;
}

/* ========================================================
   HEADER
   ======================================================== */
.site-header {
  background-color: #fff;
  border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  min-height: 72px;
  gap: 8px;
}

/* Logo — skrajna lewa */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: 12px;
  text-decoration: none;
}

.site-logo img {
  height: 44px;
  width: auto;
}

.logo-blog-badge {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--color-primary);
  background: #eef6fc;
  border: 1px solid #c9e2f5;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.site-logo:hover .logo-blog-badge {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.site-logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

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

/* Nawigacja — środek, rozciąga się */
.site-nav {
  display: flex;
  align-items: center;
  flex: 1;
  flex-wrap: wrap;
  gap: 0;
}

/* Każdy link w nawigacji */
.nav-link {
  display: block;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
  letter-spacing: 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
  text-decoration: none;
}

/* Social icons — skrajna prawa */
.header-social {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 8px;
}

.header-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-text);
  color: #fff;
  transition: background-color 0.2s;
  text-decoration: none;
}

.header-social a:hover { background: var(--color-primary); }

.header-social svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  flex-shrink: 0;
  order: 3;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: 0.3s;
}

/* ========================================================
   FOOTER
   ======================================================== */
.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-txt);
  text-align: center;
  padding: 20px 30px;
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--color-footer-txt);
  text-decoration: underline;
}

.site-footer a:hover { color: #fff; }

/* ========================================================
   BLOG — LISTA POSTÓW (index / list)
   ======================================================== */
.posts-section {
  padding: 60px 0;
  background-color: var(--color-bg);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
  margin-top: 40px;
}

.post-card {
  background: var(--color-card-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.post-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.35;
}

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

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

.post-card-summary {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  flex-grow: 1;
  margin-bottom: 16px;
  line-height: 1.5;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag-pill {
  display: inline-block;
  background: #e8f0f8;
  color: var(--color-primary);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.2s;
}

.tag-pill:hover {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

/* Paginacja */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.pagination a {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  transition: background 0.2s;
}

.pagination a:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); text-decoration: none; }

.pagination .current {
  background: var(--color-primary);
  color: #fff;
  border: 1px solid var(--color-primary);
}

/* ========================================================
   BLOG — POJEDYNCZY POST (single)
   ======================================================== */
.post-layout {
  padding: 48px 0 80px;
}

.post-layout .container {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

.post-content-area {
  min-width: 0;
}

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

.post-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 16px;
}

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

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 32px;
}

.post-tags-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #eef2f5;
}

.post-tags-footer .tags-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 6px;
}

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

.post-body h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 0.75rem; }
.post-body h3 { font-size: 1.2rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.post-body h4 { font-size: 1rem; margin-top: 1.25rem; margin-bottom: 0.4rem; }

.post-body img {
  border-radius: var(--radius-card);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  margin: 1rem 0;
  max-width: 100%;
}

.post-body a { color: var(--color-primary); }
.post-body a:hover { color: var(--color-primary-h); }

/* Nav prev/next */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.post-nav a {
  display: block;
  max-width: 48%;
  font-size: 0.9rem;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s;
}

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

.post-nav .prev { text-align: left; }
.post-nav .next { text-align: right; margin-left: auto; }

.post-nav .nav-label {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* ========================================================
   SIDEBAR
   ======================================================== */
.sidebar {
  position: sticky;
  top: 100px;
}

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

.sidebar-widget h3 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary);
}

.sidebar-recent-posts a {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: var(--color-text);
  line-height: 1.4;
  text-decoration: none;
}

.sidebar-recent-posts a:hover { color: var(--color-primary); }

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

/* Lista kategorii w sidebarze */
.sidebar-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-category-list li {
  margin-bottom: 8px;
  border-bottom: 1px solid #eef2f5;
  padding-bottom: 8px;
}
.sidebar-category-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.sidebar-category-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
}
.sidebar-category-list a:hover {
  color: var(--color-primary);
}
.sidebar-category-list .cat-count {
  background: #e8f0f8;
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Pasek kategorii (na dole strony głównej oraz pod wpisem) */
.categories-bar {
  background: var(--color-bg-alt);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-card);
  padding: 24px 28px;
  margin-top: 56px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.categories-bar-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.categories-bar-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.category-pill:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.category-pill .pill-count {
  font-size: 0.75rem;
  background: #e8f0f8;
  color: var(--color-primary);
  padding: 1px 7px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.category-pill:hover .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Sekcja kategorii na dole pojedynczego posta */
.post-footer-categories {
  background: #fff;
  border-top: 1px solid #eef2f5;
  padding: 40px 0 60px;
}

.post-footer-categories .categories-bar {
  margin-top: 0;
  margin-bottom: 0;
}

/* ========================================================
   STRONA GŁÓWNA BLOGA (hero)
   ======================================================== */
.blog-hero {
  background: linear-gradient(135deg, #f7f9fa 0%, #e8f0f8 100%);
  padding: 60px 0 40px;
  border-bottom: 1px solid var(--color-border);
}

.blog-hero .container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: center;
}

.blog-hero-text h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.25;
}

.blog-hero-text p {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.blog-hero-photo img {
  width: 220px;
  height: 270px;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 16px;
  border: 5px solid #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  display: block;
  margin-left: auto;
}

/* ========================================================
   404 / SPECJALNE STRONY
   ======================================================== */
.page-404 {
  text-align: center;
  padding: 100px 30px;
}

.page-404 h1 { font-size: 6rem; color: var(--color-primary); margin-bottom: 0; }
.page-404 h2 { font-size: 1.5rem; margin-bottom: 24px; }

/* ========================================================
   STRONY TAKSONOMII (kategorie / tagi)
   ======================================================== */
.taxonomy-header {
  background: var(--color-bg-alt);
  padding: 40px 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--color-border);
}

.taxonomy-header h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.taxonomy-header p {
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* ========================================================
   SECTION HEADERS (dla stron lists)
   ======================================================== */
.section-header {
  margin-bottom: 8px;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0;
}

.section-divider {
  height: 3px;
  width: 50px;
  background: var(--color-primary);
  margin: 12px 0 0;
  border-radius: 2px;
}

/* ========================================================
   RESPONSIVE
   ======================================================== */
@media (max-width: 991px) {
  .post-layout .container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .blog-hero .container {
    grid-template-columns: 1fr;
  }

  .blog-hero-photo {
    display: none;
  }

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

@media (max-width: 767px) {
  .container { padding: 0 16px; }

  /* Header: logo po lewej, hamburger po prawej, nav chowa się pod spodem */
  .site-header .container {
    flex-wrap: wrap;
    min-height: 60px;
    padding: 10px 16px;
    gap: 8px;
  }

  /* Nav chowa się, hamburger ją odkrywa */
  .site-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    order: 4;           /* po hamburgerze i ikonach */
    background: #fff;
    border-top: 1px solid var(--color-border);
    padding: 4px 0;
  }

  .site-nav.open { display: flex; }

  /* Linki w otwartym menu */
  .nav-link {
    padding: 10px 16px;
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
  }

  .nav-link:last-child { border-bottom: none; }

  /* Hamburger widoczny */
  .nav-toggle { display: flex; margin-left: auto; }

  /* Ikony — zmniejszamy, zostają w belce */
  .header-social { gap: 6px; margin-left: 0; }
  .header-social a { width: 28px; height: 28px; }
  .header-social svg { width: 14px; height: 14px; }

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

  .post-title { font-size: 1.6rem; }

  .post-nav a { max-width: 100%; }

  .blog-hero { padding: 40px 0 30px; }
  .blog-hero-text h1 { font-size: 1.7rem; }
}

@media (max-width: 575px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.3rem; }
  .post-title { font-size: 1.4rem; }
}

/* ========================================================
   SHORTCODES: ALERTS, DETAILS, TOC
   ======================================================== */
/* Alert boxes */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-card);
  margin: 24px 0;
  border-left: 5px solid #ccc;
  background: #f9f9f9;
}
.alert-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.alert p:last-child { margin-bottom: 0; }

.alert-info {
  background: #eef6fc;
  border-color: #478ac9;
  color: #1d4e7d;
}
.alert-warning {
  background: #fff8e6;
  border-color: #f5a623;
  color: #8a5a00;
}
.alert-success {
  background: #edf9f0;
  border-color: #27ae60;
  color: #196f3d;
}
.alert-danger {
  background: #fdf2f2;
  border-color: #e74c3c;
  color: #922b21;
}

/* Expandable details / accordion */
.post-details {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 12px 18px;
  margin: 20px 0;
}
.post-details summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--color-primary);
  user-select: none;
}
.post-details summary:hover { color: var(--color-primary-h); }
.post-details .details-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e0e0e0;
}

/* Spis treści (TOC) */
.post-toc {
  background: var(--color-bg-alt);
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-card);
  padding: 16px 24px;
  margin: 24px 0;
}
.post-toc .toc-title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 4px;
  display: inline-block;
}
.post-toc ul {
  list-style: none;
  padding-left: 16px;
  margin-bottom: 0;
}
.post-toc > ul { padding-left: 0; }
.post-toc li { margin-bottom: 4px; }
.post-toc a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
}
.post-toc a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ========================================================
   NEWSLETTER BANNER W POŚCIE
   ======================================================== */
.newsletter-hero-banner {
  background: linear-gradient(135deg, #f0f7fd 0%, #e1effa 100%);
  border: 1px solid #cce3f5;
  border-left: 5px solid var(--color-primary);
  border-radius: var(--radius-card);
  padding: 28px 32px;
  margin: 36px 0;
  box-shadow: 0 4px 12px rgba(71, 138, 201, 0.08);
}

.newsletter-hero-banner h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1d4e7d;
  margin-top: 0;
  margin-bottom: 8px;
}

.newsletter-hero-banner p {
  font-size: 0.95rem;
  color: #335d87;
  margin-bottom: 20px;
  line-height: 1.5;
}

.newsletter-hero-banner .btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.newsletter-hero-banner .btn-primary {
  background-color: var(--color-primary);
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(71, 138, 201, 0.35);
}

.newsletter-hero-banner .btn-primary:hover {
  background-color: var(--color-primary-h);
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(71, 138, 201, 0.45);
  text-decoration: none;
}


