/* Custom styles for CoursesWyn theme */

/* Style links within post content to be blue */
.prose-invert a {
  color: #60a5fa; /* blue-400 */
  text-decoration: none;
}

.prose-invert a:hover {
  color: #38bdf8; /* sky-400 */
  text-decoration: underline;
}

/* Style code blocks and pre elements */
.prose-invert pre {
  background-color: #1e293b; /* slate-800 */
  border: 1px solid #334155; /* slate-700 */
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
}

.prose-invert code {
  background-color: #1e293b; /* slate-800 */
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-family: ui-monospace, monospace;
}

/* Style blockquotes */
.prose-invert blockquote {
  border-left: 4px solid #38bdf8; /* sky-400 */
  padding-left: 1rem;
  font-style: italic;
  color: #cbd5e1; /* slate-300 */
}

/* Style headings within posts */
.prose-invert h1,
.prose-invert h2,
.prose-invert h3,
.prose-invert h4,
.prose-invert h5,
.prose-invert h6 {
  color: #ffffff;
  font-weight: bold;
}

.prose-invert h1 {
  font-size: 1.875rem;
  margin-bottom: 1.5rem;
  margin-top: 2rem;
}

.prose-invert h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
}

.prose-invert h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  margin-top: 1.25rem;
}

/* Style lists */
.prose-invert ul,
.prose-invert ol {
  color: #cbd5e1; /* slate-300 */
}

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

/* Style tables */
.prose-invert table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #334155; /* slate-700 */
}

.prose-invert th,
.prose-invert td {
  border: 1px solid #334155; /* slate-700 */
  padding: 0.75rem 1rem;
  text-align: left;
}

.prose-invert th {
  background-color: #1e293b; /* slate-800 */
  font-weight: bold;
  color: #ffffff;
}

/* Image Styling for Better SEO and UX */
.featured-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.featured-image:hover {
  transform: scale(1.02);
}

.featured-image-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 2rem auto;
  text-align: center;
}

.course-image {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  margin: 1rem auto;
  display: block;
}

.framework-comparison {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: 8px;
  margin: 2rem auto;
  display: block;
}

.responsive-image {
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.gallery-container {
  margin: 2rem 0;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 12px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-caption {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
}

/* Dark mode support for images */
@media (prefers-color-scheme: dark) {
  .featured-image {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }

  .course-image {
    border-color: #4b5563;
  }

  .gallery-container {
    background: #1f2937;
  }

  .gallery-caption {
    color: #f3f4f6;
  }
}

/* Improve prose content spacing */
.prose-invert {
  line-height: 1.7;
  max-width: 100%;
}

.prose-invert h1,
.prose-invert h2,
.prose-invert h3,
.prose-invert h4,
.prose-invert h5,
.prose-invert h6 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.prose-invert p {
  margin-top: 1rem;
  margin-bottom: 1rem;
  line-height: 1.7;
}

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

.prose-invert li {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Better spacing for blockquotes */
.prose-invert blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
}

/* Image caption styling */
.prose-invert img + p, /* Caption after image */
.prose-invert img + em {
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
  font-style: italic;
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Responsive spacing improvements */
@media (max-width: 768px) {
  /* Mobile spacing */
  .prose-invert h1,
  .prose-invert h2,
  .prose-invert h3,
  .prose-invert h4,
  .prose-invert h5,
  .prose-invert h6 {
    margin-top: 1rem;
    margin-bottom: 0.75rem;
  }

  .prose-invert p {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .prose-invert ul,
  .prose-invert ol {
    padding-left: 1rem;
  }

  /* Mobile post cards */
  .grid.gap-8 {
    gap: 1rem;
  }

  article {
    padding: 1rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  /* Tablet spacing */
  .prose-invert h1,
  .prose-invert h2,
  .prose-invert h3,
  .prose-invert h4,
  .prose-invert h5,
  .prose-invert h6 {
    margin-top: 1.25rem;
    margin-bottom: 0.875rem;
  }
}

/* Dark mode support for markdown images */
@media (prefers-color-scheme: dark) {
  .prose-invert img {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }

  /* Dark mode for image captions */
  .prose-invert img + p,
  .prose-invert img + em {
    color: #9ca3af;
  }
}

/* Loading animation for images */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
  opacity: 1;
}
