/* Kolory - Paleta taneczna (elegancki fiolet i róż) */
:root {
  --color-primary: #9b59b6;
  --color-primary-dark: #7d3c98;
  --color-primary-light: #bb8fce;
  --color-text: #2c2c2c;
  --color-text-light: #666;
  --color-bg: #ffffff;
  --color-bg-light: #f5f0f8;
  --color-border: #e0d4e8;
  --color-hover: #8e44ad;
}

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

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

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

/* Header i nawigacja */
.navbar {
  background-color: var(--color-primary);
  border-bottom: 1px solid var(--color-primary-dark);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: #ffffff;
}

/* Mobile menu toggle - ukryty checkbox */
.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: #ffffff;
  border-radius: 3px;
  transition: all 0.3s ease;
}

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

.nav-link {
  text-decoration: none;
  color: #ffffff;
  font-weight: 500;
  transition: opacity 0.3s ease;
  opacity: 0.9;
}

.nav-link:hover {
  opacity: 1;
}

/* 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(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(155, 89, 182, 0.15);
}

.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(--color-text);
}

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

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

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

.post-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.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(--color-text);
}

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

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

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

.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;
}

@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(--color-text-light);
}

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

.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-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background-color: var(--color-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(155, 89, 182, 0.1);
}

.article-body thead {
  background-color: var(--color-primary);
  color: #ffffff;
}

.article-body th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 2px solid var(--color-primary-dark);
}

.article-body tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.2s ease;
}

.article-body tbody tr:hover {
  background-color: var(--color-bg-light);
}

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

.article-body td {
  padding: 1rem;
  font-size: 1rem;
  color: var(--color-text);
}

.article-body tbody td:first-child {
  font-weight: 500;
  color: var(--color-primary-dark);
}

@media (max-width: 768px) {
  .article-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .article-body th,
  .article-body td {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
  }
}

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

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

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

.tag:hover {
  background-color: var(--color-primary-dark);
}

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

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

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

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

.sidebar-section {
  background-color: var(--color-bg-light);
  padding: 1.5rem;
  border-radius: 8px;
}

.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(--color-text);
  transition: color 0.3s ease;
}

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

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

.pagination-numbers {
  display: flex;
  gap: 0.5rem;
}

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

.pagination-link:hover {
  background-color: var(--color-bg-light);
}

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

.pagination-active:hover {
  background-color: var(--color-primary-dark);
}

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

.author-card {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  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(--color-text);
}

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

.author-posts-count {
  color: var(--color-text-light);
  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(--color-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(--color-text-light);
}

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

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

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

.category-description,
.tag-description {
  font-size: 1.125rem;
  color: var(--color-text-light);
  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(--color-text);
}

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

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

.error-404 a:hover {
  text-decoration: underline;
}

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

/* 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;
  }
}
