/* ---- Zmienne motywu (ciemny, nowoczesny) ---- */
:root {
  --bg-page: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --navbar-bg: #0284c7;
  --navbar-bg-hover: #0ea5e9;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --border: #334155;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
}

/* Reset i podstawowe style */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--bg-page) 0%, #0c1222 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header i nawigacja - błękitne tło, białe napisy */
.navbar {
  background: linear-gradient(135deg, var(--navbar-bg) 0%, #0369a1 100%);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.navbar .flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s ease;
}
.logo:hover {
  opacity: 0.9;
}

/* Mobile menu toggle */
.mobile-menu-checkbox {
  display: none;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  width: 30px;
  height: 25px;
  justify-content: space-between;
}

.mobile-menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #fff;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.nav-menu {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Mobile menu styles */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .nav-menu {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    transition: max-height 0.3s ease;
    margin-top: 1rem;
  }
  
  .flex .mobile-menu-checkbox:checked ~ .nav-menu {
    max-height: 500px;
  }
  
  .flex .mobile-menu-checkbox:checked ~ .mobile-menu-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }
  
  .flex .mobile-menu-checkbox:checked ~ .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }
  
  .flex .mobile-menu-checkbox:checked ~ .mobile-menu-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }
}

/* Main content */
main {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* Posts grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

.post-card-content {
  padding: 1.5rem;
}

.post-card h3 {
  margin-bottom: 0.5rem;
}

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

.post-card h3 a:hover {
  color: var(--accent);
}

.post-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

/* Strona kategorii – wspólny wrapper dla listy i paginacji */
.category-content {
  max-width: 100%;
  min-width: 0;
}

.category-content .posts-list {
  max-width: 100%;
}

.category-content .pagination {
  max-width: 100%;
}

/* Posts list */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.post-item-image {
  flex-shrink: 0;
  width: 200px;
  height: 150px;
  overflow: hidden;
  border-radius: 4px;
}

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

.post-item-content {
  flex: 1;
}

.post-item h2 {
  margin-bottom: 0.5rem;
}

.post-item h2 a {
  text-decoration: none;
  color: var(--text-primary);
}

.post-item h2 a:hover {
  color: var(--accent);
}

.post-item-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.post-category,
.post-author {
  color: var(--accent);
}

.post-category a,
.post-author a {
  color: inherit;
  text-decoration: none;
}

.post-category a:hover,
.post-author a:hover {
  text-decoration: underline;
}

/* Article layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  margin-top: 2rem;
}

.article-layout .article-content,
.article-layout .article-sidebar {
  min-width: 0;
}

@media (max-width: 968px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
}

.article-image {
  margin-bottom: 2rem;
}

.article-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.article-header {
  margin-bottom: 2rem;
}

.article-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.article-body {
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  overflow-wrap: break-word;
}

.article-body h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-body h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

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

.article-body ul,
.article-body ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.tags-label {
  font-weight: 600;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--navbar-bg);
  color: #fff;
  text-decoration: none;
  border-radius: 20px;
  font-size: 0.875rem;
  transition: background-color 0.3s ease;
}

.tag:hover {
  background: var(--navbar-bg-hover);
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-posts h2 {
  margin-bottom: 1.5rem;
}

/* Sidebar */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-section {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.sidebar-section h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.sidebar-list {
  list-style: none;
}

.sidebar-list li {
  margin-bottom: 0.5rem;
}

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

.sidebar-list a:hover {
  color: var(--accent);
}

.sidebar-list a,
.converter-sidebar-list a {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Paginacja */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
  max-width: 100%;
  width: 100%;
}

.pagination-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 100%;
  min-width: 0;
}

.pagination-link {
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  transition: all 0.3s ease;
}

.pagination-link:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.pagination-active {
  background: var(--navbar-bg);
  color: #fff;
  border-color: var(--navbar-bg);
}

.pagination-active:hover {
  background: var(--navbar-bg-hover);
}

/* Authors */
.authors-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.author-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}

.author-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
}

.author-content h2 {
  margin-bottom: 0.5rem;
}

.author-content h2 a {
  text-decoration: none;
  color: var(--text-primary);
}

.author-content h2 a:hover {
  color: var(--accent);
}

.author-posts-count {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.author-header {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.author-header-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-header-content h1 {
  margin-bottom: 1rem;
}

.author-bio {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--navbar-bg);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background: var(--navbar-bg-hover);
}

.text-center {
  text-align: center;
}

.category-description,
.tag-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Error 404 page */
.error-404 {
  text-align: center;
  padding: 4rem 2rem;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.error-404 h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.error-404 p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.error-404 a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

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

/* Footer */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
  color: var(--text-secondary);
}

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

/* Responsive */
@media (max-width: 768px) {
  .post-item {
    flex-direction: column;
  }
  
  .post-item-image {
    width: 100%;
    height: 200px;
  }
  
  .article-title {
    font-size: 2rem;
  }
  
  .author-header {
    flex-direction: column;
    text-align: center;
  }
}

/* ---- Strony konwertera (ile-to-cm.pl) ---- */

.breadcrumb {
  padding: 0.75rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

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

.breadcrumb span {
  color: var(--text-muted);
}

.breadcrumb-sep {
  margin: 0 0.35rem;
}

.converter-page-wrapper {
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}

.single_post.converter-page {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  margin-top: 1rem;
}

@media (max-width: 968px) {
  .single_post.converter-page {
    grid-template-columns: 1fr;
  }
}

/* Mobile – converter page i sidebar */
@media (max-width: 768px) {
  .container {
    padding: 0 12px;
  }
  .converter-page .site-single {
    padding: 1rem;
  }
  .converter-page .sidebar {
    width: 100%;
    max-width: 100%;
  }
  .converter-page .widget {
    padding: 1rem;
  }
  .converter-article .entry-title {
    font-size: 1.35rem;
  }
  .unit-converter {
    max-width: 100%;
  }
  .table-scroll {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }
  .logo {
    font-size: 1rem;
  }
}

.converter-page .site-single {
  min-width: 0;
  overflow-wrap: break-word;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  border: 1px solid var(--border);
}

.converter-page .sidebar {
  min-width: 0;
}

.converter-article .entry-header {
  margin-bottom: 1.5rem;
}

.converter-article .thecategory {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.converter-article .thecategory a {
  color: var(--accent);
  text-decoration: none;
}

.converter-article .thecategory a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.converter-article .entry-title {
  font-size: 1.75rem;
  margin: 0 0 1rem;
}

.converter-article .entry-content {
  line-height: 1.7;
  overflow-wrap: break-word;
}

/* Reklama w treści (jak WP QUADS) */
.quads-location.quads-ad1 {
  float: right;
  margin: 5px 0 5px 15px;
}

.quads-location ins.adsbygoogle {
  background: transparent !important;
}

@media (max-width: 480px) {
  .quads-location.quads-ad1 {
    float: none;
    margin: 1rem 0;
    text-align: center;
  }
}

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

/* Widget kalkulatora jednostek */
.unit-converter {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  align-items: center;
  max-width: 320px;
  margin: 1rem 0 1.5rem;
  padding: 1.25rem;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.unit-converter label {
  font-weight: 500;
  color: var(--text-primary);
}

.unit-converter .uc-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-page);
  color: var(--text-primary);
}

.unit-converter .uc-input::placeholder {
  color: var(--text-muted);
}

.unit-converter .uc-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Zobacz także (strona konwertera) - clear po float reklamy */
.converter-page .related-posts {
  clear: both;
}

.converter-page .related-posts h4 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.converter-page .related-posts .latestpost {
  margin-bottom: 0.75rem;
}

.converter-page .related-posts .related-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
}

.converter-page .related-posts .related-link:hover {
  color: var(--accent);
}

.converter-page .related-posts .entry-title {
  font-size: 1rem;
  margin: 0;
}

/* Sidebar strony konwertera */
.converter-page .sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.converter-page .widget {
  background: var(--bg-card);
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.converter-page .widget-title {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.converter-sidebar-list,
.converter-page .widget_categories ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.converter-sidebar-list li,
.converter-page .widget_categories li {
  margin-bottom: 0.5rem;
}

.converter-sidebar-list a,
.converter-page .widget_categories a {
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.converter-sidebar-list a:hover,
.converter-page .widget_categories a:hover {
  color: var(--accent);
}

/* ---- Tabele ---- */

/* Wrapper z poziomym scrollem, zaokrągleniem i cieniem */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Bazowe style dla wszystkich tabel serwisu */
.conversion-table,
.tbcommonunit,
.article-body table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-card);
  min-width: 280px;
}

/* Tabele artykułów (Markdown) – samodzielne, z ramką i górnym akcentem */
.article-body table {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  box-shadow: var(--shadow);
}

/* Nagłówek tabel – ciemne tło, accent tekst */
.conversion-table thead tr,
.tbcommonunit thead tr,
.article-body table thead tr {
  background: linear-gradient(135deg, #0f2744 0%, #0c1e38 100%);
  border-bottom: 2px solid var(--accent);
}

.conversion-table th,
.tbcommonunit th,
.article-body table th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  white-space: nowrap;
  text-align: left;
}

/* Komórki danych */
.conversion-table td,
.tbcommonunit td,
.article-body table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  line-height: 1.5;
}

/* Zebra – co drugi wiersz ciut jaśniejszy */
.conversion-table tbody tr:nth-child(even),
.tbcommonunit tbody tr:nth-child(even),
.article-body table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.035);
}

/* Hover na wierszu */
.conversion-table tbody tr,
.tbcommonunit tbody tr,
.article-body table tbody tr {
  transition: background 0.15s ease;
}

.conversion-table tbody tr:hover,
.tbcommonunit tbody tr:hover,
.article-body table tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

/* Ostatni wiersz bez dolnej kreski */
.conversion-table tbody tr:last-child td,
.tbcommonunit tbody tr:last-child td,
.article-body table tbody tr:last-child td {
  border-bottom: none;
}

/* Tabele wewnątrz .table-scroll nie dublują ramki/cienia */
.table-scroll > .conversion-table,
.table-scroll > .tbcommonunit,
.table-scroll > table {
  border: none;
  border-top: 2px solid var(--accent);
  box-shadow: none;
  margin: 0;
}

/* Specyficzne: tbcommonunit (strona główna) */
.tbcommonunit {
  max-width: 420px;
}

.tbcommonunit .commonunit {
  font-weight: 600;
  color: var(--accent);
}

/* Specyficzne: conversion-table (strony konwertera) */
.conversion-table {
  max-width: 560px;
}

/* ---- Bloki kodu i wzory ---- */

.article-body pre,
.converter-article .entry-content pre {
  background: #0d1b2a;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: "Cascadia Code", "Fira Code", Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #7dd3fc;
  margin: 1.25rem 0;
}

.article-body code,
.converter-article .entry-content code {
  font-family: "Cascadia Code", "Fira Code", Consolas, "Courier New", monospace;
  font-size: 0.875em;
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

.article-body pre code,
.converter-article .entry-content pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.decorated-link {
  color: var(--accent);
  text-decoration: none;
}
.decorated-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

/* Nagłówki i tekst w entry-content */
.converter-article .entry-content h2 {
  color: var(--text-primary);
  margin-top: 2rem;
}

.converter-article .entry-content ul {
  color: var(--text-primary);
}

.converter-article .entry-content li a {
  color: var(--accent);
}
.converter-article .entry-content li a:hover {
  color: var(--accent-hover);
}

