/* Import custom properties and base styles */
@import "custom.css";

/* Lists Styling */
ul {
   font-family: var(--font-primary);
   list-style-type: disc;
   list-style-position: inside;
   margin-bottom: var(--spacing-lg);
   padding-left: var(--spacing-md);
}

ol {
   font-family: var(--font-primary);
   list-style-type: decimal;
   list-style-position: inside;
   margin-bottom: var(--spacing-lg);
   padding-left: var(--spacing-md);
}

ul ul,
ol ul {
   font-family: var(--font-primary);
   list-style-position: inside;
   margin-left: var(--spacing-lg);
   margin-bottom: var(--spacing-md);
}

ol ol,
ul ol {
   font-family: var(--font-primary);
   list-style-type: lower-latin;
   list-style-position: inside;
   margin-left: var(--spacing-lg);
   margin-bottom: var(--spacing-md);
}

/* Post Content Styling */
.post-content {
   line-height: 1.7;
   color: var(--color-secondary);
}

.post-content img {
   max-width: 100%;
   height: auto;
   border-radius: var(--radius-lg);
   margin: var(--spacing-xl) 0;
   box-shadow: var(--shadow-md);
}

.post-content blockquote {
   border-left: 4px solid var(--color-primary);
   margin: var(--spacing-xl) 0;
   padding: var(--spacing-lg);
   background-color: var(--color-gray-lighter);
   border-radius: var(--radius-md);
   font-style: italic;
}

.post-content code {
   background-color: var(--color-gray-lighter);
   padding: var(--spacing-xs) var(--spacing-sm);
   border-radius: var(--radius-sm);
   font-size: var(--font-size-sm);
   color: var(--color-primary-dark);
}

.post-content pre {
   background-color: var(--color-gray-lighter);
   padding: var(--spacing-lg);
   border-radius: var(--radius-md);
   overflow-x: auto;
   margin: var(--spacing-xl) 0;
}

.post-content pre code {
   background: none;
   padding: 0;
}

/* Table Styling */
.post-content table {
   width: 100%;
   border-collapse: collapse;
   margin: var(--spacing-xl) 0;
   background-color: var(--color-white);
   border-radius: var(--radius-md);
   overflow: hidden;
   box-shadow: var(--shadow-sm);
}

.post-content th,
.post-content td {
   padding: var(--spacing-md);
   text-align: left;
   border-bottom: 1px solid var(--color-gray-lighter);
}

.post-content th {
   background-color: var(--color-primary);
   color: var(--color-white);
   font-weight: 600;
}

.post-content tr:hover {
   background-color: var(--color-gray-lighter);
}

/* Posts Layout Improvements */
.posts-wrapper {
   background-color: var(--color-white);
   margin-bottom: var(--spacing-lg);
   padding: var(--spacing-xl);
   border-radius: var(--radius-pill);
   box-shadow: var(--shadow-sm);
   transition: all var(--transition-normal);
}

.posts-wrapper:hover {
   box-shadow: var(--shadow-md);
   transform: translateY(-2px);
}

.posts-avatar-img {
   width: 30px;
   height: 30px;
   border-radius: var(--radius-full);
   object-fit: cover;
   border: 2px solid var(--color-primary-light);
}

.summary-post-title {
   color: var(--color-black);
   font-family: var(--font-primary);
   font-size: var(--font-size-2xl);
   font-weight: 600;
   line-height: 1.3;
   margin: var(--spacing-md) 0;
}

.summary-post-title a {
   color: inherit;
   text-decoration: none;
   transition: color var(--transition-fast);
}

.summary-post-title a:hover,
.summary-post-title a:focus {
   color: var(--color-primary);
}

.posts-footer {
   display: flex;
   flex-wrap: wrap;
   gap: var(--spacing-md);
   align-items: center;
   margin-top: var(--spacing-lg);
   padding-top: var(--spacing-md);
   border-top: 1px solid var(--color-gray-lighter);
   font-size: var(--font-size-sm);
   color: var(--color-gray-light);
}

.posts_header {
   font-size: var(--font-size-4xl);
   font-weight: 700;
   color: var(--color-black);
   margin-bottom: var(--spacing-2xl);
   text-align: center;
}

/* Reading Progress Bar */
.reading-progress {
   position: fixed;
   top: 0;
   left: 0;
   width: 0%;
   height: 4px;
   background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
   z-index: var(--z-sticky);
   transition: width var(--transition-fast);
}

/* Post Meta Information */
.post-meta {
   display: flex;
   flex-wrap: wrap;
   gap: var(--spacing-lg);
   align-items: center;
   margin: var(--spacing-xl) 0;
   padding: var(--spacing-lg);
   background-color: var(--color-gray-lighter);
   border-radius: var(--radius-lg);
   font-size: var(--font-size-sm);
}

.post-meta-item {
   display: flex;
   align-items: center;
   gap: var(--spacing-sm);
   color: var(--color-gray-light);
}

.post-meta-icon {
   width: 16px;
   height: 16px;
   fill: currentColor;
}

/* Modern Page Styles for Posts and Single Pages */

/* Page Content */
.page-content {
  min-height: 100vh;
}

/* Page Hero */
.page-hero {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  padding: 64px 0 48px;
  border-bottom: 1px solid #e2e8f0;
}

.page-header {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 14px;
  color: #64748b;
}

.breadcrumb a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb a:hover {
  color: #1d4ed8;
}

.breadcrumb-separator {
  margin: 0 8px;
  color: #64748b;
}

.breadcrumb-current {
  color: #64748b;
}

.page-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: #1e293b;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.page-description {
  font-size: 1.25rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.page-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.author-details {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.author-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 16px;
}

.author-title {
  font-size: 14px;
  color: #64748b;
}

.content-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.publish-date {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.reading-time {
  font-size: 12px;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 4px;
  width: fit-content;
}

/* Page Body */
.page-body {
  padding: 64px 0;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
}

.page-article {
  min-width: 0; /* Prevents grid blowout */
}

.article-content {
  font-size: 1.125rem;
  line-height: 1.7;
  color: #64748b;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  color: #1e293b;
  margin-top: 32px;
  margin-bottom: 16px;
}

.article-content h2 {
  font-size: 1.875rem;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

.article-content h3 {
  font-size: 1.5rem;
}

.article-content h4 {
  font-size: 1.25rem;
}

.article-content p {
  margin-bottom: 24px;
}

.article-content ul,
.article-content ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content blockquote {
  border-left: 4px solid #2563eb;
  padding-left: 24px;
  margin: 32px 0;
  font-style: italic;
  font-size: 1.25rem;
  color: #64748b;
}

.article-content code {
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
}

.article-content pre {
  background: #0f172a;
  color: #ffffff;
  padding: 24px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 32px 0;
}

.article-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 32px 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
}

.article-content th,
.article-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.article-content th {
  background: #f8fafc;
  font-weight: 600;
  color: #1e293b;
}

/* Article Tags */
.article-tags {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid #e2e8f0;
}

.article-tags h4 {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 16px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: #2563eb;
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
}

/* Sidebar */
.page-sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
}

.sidebar-section h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
}

/* Related Articles */
.related-articles {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.related-article {
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.related-article:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.related-article h4 {
  margin-bottom: 8px;
}

.related-article h4 a {
  color: #1e293b;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.related-article h4 a:hover {
  color: #2563eb;
}

.related-excerpt {
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 8px;
}

.related-meta {
  font-size: 12px;
  color: #94a3b8;
}

/* CTA Card */
.sidebar-cta {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
}

.cta-card h3 {
  color: #ffffff;
  margin-bottom: 12px;
}

.cta-card p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.cta-card .btn {
  background: #ffffff;
  color: #2563eb;
  border-color: #ffffff;
}

.cta-card .btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

/* Newsletter Card */
.newsletter-card h3 {
  margin-bottom: 8px;
}

.newsletter-card p {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 16px;
  line-height: 1.5;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.newsletter-input {
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.newsletter-input:focus {
  outline: none;
  border-color: #2563eb;
}

/* Post Navigation */
.post-navigation {
  background: #f8fafc;
  padding: 48px 0;
  border-top: 1px solid #e2e8f0;
}

.post-navigation .nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 800px;
  margin: 0 auto;
}

.post-navigation .nav-link {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.post-navigation .nav-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.post-navigation .nav-prev {
  text-align: left;
}

.post-navigation .nav-next {
  text-align: right;
}

.post-navigation .nav-direction {
  font-size: 14px;
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 8px;
}

.post-navigation .nav-title {
  font-size: 16px;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.3;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .page-sidebar {
    order: -1;
  }
}

@media (max-width: 768px) {
  .page-hero {
    padding: 48px 0 32px;
  }
  
  .page-title {
    font-size: 2.25rem;
  }
  
  .page-description {
    font-size: 1.125rem;
  }
  
  .page-meta {
    flex-direction: column;
    gap: 16px;
  }
  
  .author-info {
    align-self: center;
  }
  
  .content-meta {
    align-items: center;
    text-align: center;
  }
  
  .post-navigation .nav-links {
    grid-template-columns: 1fr;
  }

  .post-navigation .nav-next {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.875rem;
  }
  
  .article-content {
    font-size: 16px;
  }
  
  .sidebar-section {
    padding: 16px;
  }
}