/**
 * Extended CSS for Blog and Talks pages
 * Extends the existing iPortfolio template styles
 */

/*--------------------------------------------------------------
# Blog and Talks Page Layout
--------------------------------------------------------------*/

/* Main content adjustment for new pages */
.blog-page,
.talks-page {
  padding-top: 20px;
  min-height: 100vh;
}

/* Ensure proper main content offset when sidebar is visible */
@media (min-width: 1200px) {
  .blog-page .container,
  .talks-page .container {
    max-width: calc(100% - 340px);
  }
}

/*--------------------------------------------------------------
# Filter Controls
--------------------------------------------------------------*/

.filter-controls {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  border: 1px solid #e9ecef;
}

.filter-controls .form-label {
  font-weight: 600;
  color: #272829;
  margin-bottom: 0.5rem;
}

.filter-controls .form-control,
.filter-controls .form-select {
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.filter-controls .form-control:focus,
.filter-controls .form-select:focus {
  border-color: #149ddd;
  box-shadow: 0 0 0 0.2rem rgba(20, 157, 221, 0.25);
  outline: none;
}

.filter-controls .btn-outline-primary {
  border-color: #149ddd;
  color: #149ddd;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.filter-controls .btn-outline-primary:hover,
.filter-controls .btn-outline-primary:focus {
  background-color: #149ddd;
  border-color: #149ddd;
  color: white;
}

/*--------------------------------------------------------------
# Filter Tags
--------------------------------------------------------------*/

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  background: #e9ecef;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  min-height: 44px; /* Touch-friendly size */
}

.filter-tag:hover {
  background: #dee2e6;
  border-color: #149ddd;
}

.filter-tag.active {
  background: #149ddd;
  color: white;
  border-color: #149ddd;
}

.filter-tag:focus {
  outline: 2px solid #149ddd;
  outline-offset: 2px;
}

/*--------------------------------------------------------------
# Results Info
--------------------------------------------------------------*/

.results-count {
  font-size: 0.95rem;
  color: #6c757d;
  font-weight: 500;
}

/*--------------------------------------------------------------
# Loading Spinner
--------------------------------------------------------------*/

.loading-spinner {
  padding: 3rem 0;
}

.loading-spinner .spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3em;
}

/*--------------------------------------------------------------
# Blog Post Cards
--------------------------------------------------------------*/

.blog-card,
.talk-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card:hover,
.talk-card:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.blog-card .card-date,
.talk-card .card-date {
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.blog-card .card-title,
.talk-card .card-title {
  color: #272829;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.blog-card .card-title a,
.talk-card .card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.blog-card .card-title a:hover,
.talk-card .card-title a:hover {
  color: #149ddd;
}

.blog-card .card-excerpt {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.blog-card .card-tags,
.talk-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.blog-card .card-tag,
.talk-card .card-tag {
  background: #f8f9fa;
  color: #495057;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid #e9ecef;
}

.blog-card .card-footer,
.talk-card .card-footer {
  margin-top: auto;
  padding-top: 1rem;
}

.blog-card .card-footer .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.blog-card .btn-read-more,
.talk-card .btn-watch {
  color: #149ddd;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-card .btn-read-more:hover,
.talk-card .btn-watch:hover {
  color: #0d7aa7;
  text-decoration: none;
}

/*--------------------------------------------------------------
# Talk-specific styles
--------------------------------------------------------------*/

.talk-card .card-event {
  color: #149ddd;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.talk-card .card-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
  transition: opacity 0.3s ease;
}

.talk-card .card-thumbnail:hover {
  opacity: 0.9;
}

.talk-card .card-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.talk-card .btn-slides {
  color: #6c757d;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.talk-card .btn-slides:hover {
  color: #495057;
  text-decoration: none;
}

/*--------------------------------------------------------------
# Empty State
--------------------------------------------------------------*/

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}

.empty-state h3 {
  color: #495057;
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 0;
}

/*--------------------------------------------------------------
# Responsive Design
--------------------------------------------------------------*/

@media (max-width: 768px) {
  .filter-controls {
    padding: 1rem;
  }
  
  .filter-controls .row.g-3 {
    --bs-gutter-x: 1rem;
  }
  
  .blog-card,
  .talk-card {
    padding: 1rem;
  }
  
  .talk-card .card-thumbnail {
    height: 160px;
  }
  
  .talk-card .card-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .filter-tag {
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
  }
}

@media (max-width: 576px) {
  .blog-page,
  .talks-page {
    padding-top: 10px;
  }
  
  .filter-controls .col-12:not(:last-child) {
    margin-bottom: 0.75rem;
  }
  
  .blog-card .card-title,
  .talk-card .card-title {
    font-size: 1.1rem;
  }
  
  .talk-card .card-thumbnail {
    height: 140px;
  }
}

/*--------------------------------------------------------------
# Focus States for Accessibility
--------------------------------------------------------------*/

.blog-card:focus-within,
.talk-card:focus-within {
  outline: 2px solid #149ddd;
  outline-offset: 2px;
}

.btn-read-more:focus,
.btn-watch:focus,
.btn-slides:focus {
  outline: 2px solid #149ddd;
  outline-offset: 2px;
}

/*--------------------------------------------------------------
# Utility Classes
--------------------------------------------------------------*/

.util-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.util-loading {
  opacity: 0.6;
  pointer-events: none;
}

.util-fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/*--------------------------------------------------------------
# Blog Post Detail Pages
--------------------------------------------------------------*/

.blog-post {
  padding-top: 20px;
  min-height: 100vh;
}

@media (min-width: 1200px) {
  .blog-post .container {
    max-width: calc(100% - 340px);
  }
}

.blog-post-content {
  max-width: 800px;
}

.blog-meta {
  color: #6c757d;
  font-size: 0.95rem;
}

.blog-meta i {
  margin-right: 0.5rem;
}

.blog-tags .badge {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  background-color: #149ddd !important;
}

.blog-content {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #333;
}

.blog-content h2 {
  color: #149ddd;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.blog-content h3 {
  color: #2c3e50;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.blog-content p {
  margin-bottom: 1.25rem;
}

.blog-content ul, 
.blog-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.blog-content li {
  margin-bottom: 0.5rem;
}

.blog-content blockquote {
  background: #f8f9fa;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 8px;
}

.blog-content .card {
  border: 1px solid #e9ecef;
  margin-bottom: 1rem;
}

.blog-content .card-title i {
  font-size: 1.25rem;
  margin-right: 0.5rem;
}

.blog-footer {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 3rem;
}

.blog-footer a {
  color: #149ddd;
  text-decoration: none;
}

.blog-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .blog-post-content {
    padding: 0 1rem;
  }
  
  .blog-content {
    font-size: 1rem;
  }
  
  .blog-footer {
    padding: 1rem;
  }
}