/* Playground Styles for Live Speaker Demo Pages */

* {
  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: #333;
  background: #fafafa;
}

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

/* Common Header Styles */
.site-header, .news-header, .tutorial-header {
  background: #fff;
  border-bottom: 1px solid #e1e8ed;
  padding: 20px 0;
  margin-bottom: 30px;
}

.site-title, .news-header h1, .tutorial-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 5px;
}

.tagline, .tutorial-header p {
  color: #666;
  font-size: 0.9rem;
}

nav, .main-nav, .tutorial-nav {
  margin-top: 15px;
}

nav a, .main-nav a, .tutorial-nav a {
  text-decoration: none;
  color: #666;
  margin-right: 30px;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover, .main-nav a:hover, .tutorial-nav a:hover {
  color: #007bff;
}

/* Main Content Layout */
.main-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

/* Blog post specific: if sidebar is missing, expand main content */
.main-content:has(.blog-post:only-child) {
  grid-template-columns: 1fr;
}

/* Alternative approach for better browser support */
.main-content .blog-post:only-child {
  grid-column: 1 / -1;
}

.news-content {
  display: block;
  margin-bottom: 40px;
}

/* Article Styles */
.blog-post, .news-article, .lesson {
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.post-header, .article-header, .lesson-header {
  margin-bottom: 30px;
}

.post-title, .headline, .lesson h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #1a1a1a;
}

.post-meta, .article-meta {
  display: flex;
  gap: 20px;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.category-badge {
  background: #007bff;
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 15px;
  display: inline-block;
}

.lead {
  font-size: 1.25rem;
  font-weight: 400;
  color: #444;
  margin-bottom: 25px;
  line-height: 1.5;
}

.post-content, .article-body, .lesson-content {
  font-size: 1.1rem;
  line-height: 1.7;
}

.post-content h2, .article-body h2, .lesson-content h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 35px 0 20px 0;
  color: #1a1a1a;
}

.post-content h3, .article-body h3, .lesson-content h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 30px 0 15px 0;
  color: #1a1a1a;
}

.post-content p, .article-body p, .lesson-content p {
  margin-bottom: 20px;
}

.post-content ul, .article-body ul, .lesson-content ul {
  margin: 20px 0;
  padding-left: 30px;
}

.post-content li, .article-body li, .lesson-content li {
  margin-bottom: 8px;
}

/* Code Blocks */
.code-block {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin: 25px 0;
  overflow-x: auto;
}

.code-block pre {
  padding: 20px;
  margin: 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.code-block code {
  color: #333;
}

/* For training steps in code blocks */
.code-block.training-steps {
  background: #e8f5e9;
  border-color: #c8e6c9;
}

.code-block.training-steps code {
  color: #1b5e20;
}

/* Exercise Box */
.exercise-box {
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 6px;
  padding: 20px;
  margin: 25px 0;
}

.exercise-box h4 {
  color: #0d47a1;
  margin-bottom: 10px;
}

.exercise-box p {
  color: #0d47a1;
  margin-bottom: 0;
}

/* Puppy Training Specific Styles */
.training-step {
  background: #f5f5f5;
  border-left: 4px solid #4caf50;
  padding: 15px;
  margin: 15px 0;
}

.training-step-number {
  font-weight: bold;
  color: #2e7d32;
  margin-right: 8px;
}

.training-tip {
  background: #fff8e1;
  border-left: 4px solid #ffc107;
  padding: 12px;
  margin: 12px 0;
  font-style: italic;
}

.training-tip:before {
  content: "🐾 Tip: ";
  font-weight: bold;
}

/* Sidebar Styles */
.sidebar, .news-sidebar {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  height: fit-content;
}

.widget {
  margin-bottom: 30px;
}

.widget:last-child {
  margin-bottom: 0;
}

.widget h3, .news-sidebar h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #1a1a1a;
}

.widget ul, .news-sidebar ul {
  list-style: none;
  padding: 0;
}

.widget li, .news-sidebar li {
  margin-bottom: 10px;
}

.widget a, .news-sidebar a {
  text-decoration: none;
  color: #007bff;
  font-weight: 500;
}

.widget a:hover, .news-sidebar a:hover {
  text-decoration: underline;
}

/* Tutorial Specific Styles */
.tutorial-layout {
  max-width: 1400px;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

.tutorial-container {
  display: grid;
  grid-template-columns: minmax(250px, 300px) 1fr;
  gap: 40px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.tutorial-sidebar {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  height: fit-content;
  position: sticky;
  top: 30px;
  min-width: 0; /* Allow sidebar to shrink if needed */
  box-sizing: border-box;
}

.tutorial-content {
  min-width: 0; /* Allow content to shrink */
  overflow-x: hidden; /* Prevent content overflow */
}

.course-progress {
  margin-bottom: 30px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  margin: 10px 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #28a745;
  transition: width 0.3s ease;
}

.lesson-nav ul {
  list-style: none;
  padding: 0;
}

.lesson-nav li {
  margin-bottom: 8px;
}

.lesson-nav a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: #666;
  border-radius: 4px;
  transition: all 0.2s;
}

.lesson-nav a.completed {
  color: #28a745;
}

.lesson-nav a.active {
  background: #007bff;
  color: white;
}

.lesson-nav a.upcoming {
  color: #999;
}

.lesson-nav a:hover {
  background: #f8f9fa;
}

.lesson-nav a.active:hover {
  background: #0056b3;
}

.lesson-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.lesson-number, .difficulty, .duration {
  background: #f8f9fa;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #666;
}

.difficulty {
  background: #fff3cd;
  color: #856404;
}

.lesson-description {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 0;
}

/* Footer Styles */
.post-footer, .article-footer, .lesson-footer {
  border-top: 1px solid #e9ecef;
  padding-top: 30px;
  margin-top: 40px;
}

.tags {
  margin-bottom: 20px;
}

.tag {
  display: inline-block;
  background: #f8f9fa;
  color: #666;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-right: 8px;
  margin-bottom: 8px;
}

.share-buttons {
  display: flex;
  gap: 10px;
}

.share-btn, .btn {
  padding: 10px 20px;
  border: 1px solid #ddd;
  background: #fff;
  color: #666;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.share-btn:hover, .btn:hover {
  background: #f8f9fa;
}

.btn-primary {
  background: #007bff;
  border-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
  border-color: #0056b3;
}

.btn-secondary {
  background: #6c757d;
  border-color: #6c757d;
  color: white;
}

.btn-outline {
  background: transparent;
  border-color: #007bff;
  color: #007bff;
}

.lesson-navigation {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.lesson-actions {
  display: flex;
  gap: 10px;
}

.reporter-info, .related-coverage {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.reporter-info:last-child, .related-coverage:last-child {
  margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 992px) {
  .main-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .tutorial-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .tutorial-sidebar {
    position: static;
    order: -1; /* Put sidebar above content on mobile */
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  .tutorial-layout {
    max-width: 100%;
    padding: 0 10px;
  }
  
  .tutorial-container {
    gap: 20px;
  }
  
  .tutorial-sidebar {
    padding: 20px;
  }
  
  .blog-post, .news-article, .lesson {
    padding: 25px;
  }
  
  .post-title, .headline, .lesson h1 {
    font-size: 2rem;
  }
  
  .post-meta, .article-meta {
    flex-direction: column;
    gap: 10px;
  }
  
  .lesson-navigation {
    flex-direction: column;
    gap: 15px;
  }
  
  .lesson-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .post-title, .headline, .lesson h1 {
    font-size: 1.75rem;
  }
  
  .code-block pre {
    padding: 15px;
    font-size: 0.8rem;
  }
  
  .share-buttons, .lesson-actions {
    flex-direction: column;
  }
}

.liveSpeakerPlaceholder {
  display: block;
  max-width: 600px;
}
