/* ============================================================================
   BLOG STYLES
   ============================================================================ */

/* Admin Layout */
.admin-layout {
  background-color: #f5f5f5;
  min-height: 100vh;
}

.admin-nav {
  background: white;
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  text-decoration: none;
}

.admin-logo:hover {
  color: #6366f1;
}

.admin-nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.admin-nav-link {
  color: #666;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.admin-nav-link:hover {
  color: #6366f1;
}

.admin-user-info {
  color: #999;
  font-size: 0.875rem;
}

.admin-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Admin Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Admin Header */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.admin-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin: 0;
}

/* Admin Content */
.admin-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Admin Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead {
  background: #f8f9fa;
}

.admin-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #e0e0e0;
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.admin-table tbody tr:hover {
  background: #f8f9fa;
}

.admin-actions {
  display: flex;
  gap: 0.5rem;
}

.text-muted {
  color: #999;
  font-size: 0.875rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-secondary {
  background: #e0e0e0;
  color: #666;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background: #6366f1;
  color: white;
}

.btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: #e0e0e0;
  color: #333;
}

.btn-secondary:hover {
  background: #d0d0d0;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-info {
  background: #17a2b8;
  color: white;
}

.btn-info:hover {
  background: #138496;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Forms */
.blog-post-form {
  max-width: 900px;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control-file {
  display: block;
  margin-top: 0.5rem;
}

.form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #666;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

.form-check-label {
  font-weight: 600;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e0e0e0;
}

.col-md-8 {
  flex: 0 0 66.666%;
}

.col-md-4 {
  flex: 0 0 33.333%;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #666;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

/* ============================================================================
   PUBLIC BLOG STYLES
   ============================================================================ */

/* Blog Container */
.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.blog-header {
  text-align: center;
  margin-bottom: 4rem;
}

.blog-header h1 {
  font-size: 3rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 1rem;
}

.blog-subtitle {
  font-size: 1.25rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Blog Card */
.blog-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.blog-card-image {
  display: block;
  width: 100%;
  height: 240px;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.05);
}

.blog-card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 240px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.blog-card-image-placeholder span {
  font-size: 4rem;
}

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

.blog-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.3;
}

.blog-card-title a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s;
}

.blog-card-title a:hover {
  color: #6366f1;
}

.blog-card-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: #666;
}

.blog-card-excerpt {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.blog-card-link {
  display: inline-block;
  color: #6366f1;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s;
}

.blog-card-link:hover {
  transform: translateX(4px);
}

/* Blog Post (Single) */
.blog-post {
  background: white;
}

.blog-post-header {
  padding: 4rem 2rem 2rem;
  border-bottom: 1px solid #e0e0e0;
}

.blog-post-container {
  max-width: 800px;
  margin: 0 auto;
}

.blog-back-link {
  display: inline-block;
  color: #666;
  text-decoration: none;
  margin-bottom: 2rem;
  font-weight: 500;
  transition: color 0.2s;
}

.blog-back-link:hover {
  color: #6366f1;
}

.blog-post-title {
  font-size: 3rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
  margin: 0 0 1.5rem;
}

.blog-post-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.blog-post-separator {
  color: #ccc;
}

.blog-post-featured-image {
  margin-top: 2rem;
  border-radius: 12px;
  overflow: hidden;
}

.blog-post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.blog-post-content {
  padding: 3rem 2rem;
}

.blog-post-content .trix-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: #333;
}

.blog-post-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: #1a1a1a;
}

.blog-post-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: #1a1a1a;
}

.blog-post-content p {
  margin-bottom: 1.5rem;
}

.blog-post-content ul,
.blog-post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.blog-post-content li {
  margin-bottom: 0.5rem;
}

.blog-post-content a {
  color: #6366f1;
  text-decoration: underline;
}

.blog-post-content a:hover {
  color: #4f46e5;
}

.blog-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2rem 0;
}

.blog-post-content blockquote {
  border-left: 4px solid #6366f1;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #666;
}

.blog-post-content code {
  background: #f5f5f5;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Courier New', monospace;
}

.blog-post-content pre {
  background: #1a1a1a;
  color: #f5f5f5;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 2rem 0;
}

.blog-post-footer {
  padding: 2rem;
  border-top: 1px solid #e0e0e0;
}

/* Blog Empty State */
.blog-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #666;
}

/* Blog Pagination */
.blog-pagination {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .admin-nav-container {
    padding: 0 1rem;
  }

  .admin-nav-links {
    gap: 1rem;
    font-size: 0.875rem;
  }

  .admin-main {
    padding: 1rem;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .admin-table {
    font-size: 0.875rem;
  }

  .admin-actions {
    flex-direction: column;
  }

  .form-row {
    flex-direction: column;
  }

  .col-md-8,
  .col-md-4 {
    flex: 0 0 100%;
  }

  .blog-container {
    padding: 2rem 1rem;
  }

  .blog-header h1 {
    font-size: 2rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-post-header {
    padding: 2rem 1rem;
  }

  .blog-post-title {
    font-size: 2rem;
  }

  .blog-post-content {
    padding: 2rem 1rem;
  }

  .blog-post-content .trix-content {
    font-size: 1rem;
  }
}
