/* ============================================
   BLOG ARCHIVE & SINGLE POST STYLES
   ============================================ */

/* Blog Archive Styles */
.blog-archive {
  min-height: 100vh;
}

.blog-card {
  position: relative;
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover {
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  transform: translateY(-4px);
}

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

.blog-card .category-badge {
  transition: all 0.3s ease;
}

.blog-card .entry-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sidebar Widgets */
.blog-sidebar .sidebar-widget {
  position: relative;
}

@media (min-width: 1024px) {
  .blog-sidebar .sidebar-widget:first-child {
    position: sticky;
    top: 2rem;
  }
}

.sidebar-widget .widget-title {
  position: relative;
  padding-bottom: 0.75rem;
}

.sidebar-widget .widget-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 3rem;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-alt) 100%);
  border-radius: 2px;
}

/* Search Form */
.search-widget input[type="search"] {
  appearance: none;
}

.search-widget input[type="search"]::-webkit-search-cancel-button {
  appearance: none;
}

/* Categories Widget */
.categories-widget li a:hover .inline-block {
  transform: scale(1.05);
}

/* Recent Posts Widget */
.recent-posts-widget .w-16 {
  flex-shrink: 0;
}

/* Pagination */
.pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.pagination a {
  background-color: white;
  color: var(--color-primary);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.pagination a:hover {
  background-color: var(--color-accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.pagination .current {
  background-color: var(--color-accent);
  color: white;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.pagination .dots {
  background-color: transparent;
  color: var(--color-primary);
  box-shadow: none;
}

/* ============================================
   SINGLE POST STYLES
   ============================================ */

.single-post {
  background-color: var(--color-secondary);
}

/* Post Hero */
.post-hero {
  position: relative;
  width: 100%;
}

.post-hero img {
  object-position: center center;
}

/* Entry Header */
.single-post .entry-header {
  animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Prose Styles (Enhanced Typography) */
.prose {
  color: var(--color-primary);
}

.prose h2 {
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  font-size: 1.875rem;
  line-height: 1.3;
}

.prose h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  line-height: 1.4;
}

.prose h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  line-height: 1.5;
}

.prose p {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.8;
}

.prose blockquote {
  position: relative;
  margin: 2rem 0;
  font-size: 1.125rem;
  font-style: italic;
  quotes: """ """ "'" "'";
}

.prose blockquote::before {
  content: open-quote;
  position: absolute;
  top: -0.5rem;
  left: 0.5rem;
  font-size: 4rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.3;
}

.prose ul,
.prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.prose ul > li::marker {
  color: var(--color-accent);
}

.prose ol > li::marker {
  color: var(--color-accent);
  font-weight: 600;
}

.prose img {
  margin: 2rem auto;
  max-width: 100%;
  height: auto;
}

.prose figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: #666;
  font-style: italic;
}

.prose pre {
  margin: 2rem 0;
  padding: 1.5rem;
  overflow-x: auto;
  border-radius: 0.75rem;
}

.prose code {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.prose a {
  font-weight: 500;
  text-decoration-skip-ink: auto;
  transition: color 0.3s ease;
}

.prose hr {
  margin: 3rem 0;
}

/* Table Styles */
.prose table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

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

.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
}

.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.prose tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Social Share Buttons */
.social-share a {
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.social-share a:hover {
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2);
  transform: translateY(-2px);
}

/* Post Navigation */
.post-navigation a {
  text-decoration: none;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.post-navigation a:hover {
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  transform: translateY(-2px);
}

/* Related Posts */
.related-posts {
  position: relative;
}

.related-post-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.related-post-card:hover {
  transform: translateY(-4px);
}

/* Line Clamp Utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 768px) {
  .prose {
    font-size: 1rem;
  }

  .prose h2 {
    font-size: 1.5rem;
  }

  .prose h3 {
    font-size: 1.25rem;
  }

  .prose h4 {
    font-size: 1.125rem;
  }

  .blog-content-wrapper {
    display: block;
  }

  .blog-sidebar {
    margin-top: 3rem;
  }

  .social-share .flex {
    flex-direction: column;
  }

  .social-share a {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus states */
.blog-card:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.sidebar-widget input:focus,
.sidebar-widget a:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card img,
  .pagination a,
  .post-navigation a,
  .social-share a,
  .related-post-card img {
    transition: none;
  }

  @keyframes slideUp {
    from,
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Print Styles */
@media print {
  .blog-sidebar,
  .social-share,
  .post-navigation,
  .related-posts {
    display: none;
  }

  .prose {
    max-width: 100%;
  }

  .prose a {
    color: var(--color-primary);
    text-decoration: underline;
  }

  .prose a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}
