/* Glo Blogs Organizer Styles */
/* Compatible with EduAll Theme */

/* Reset and Base Styles */
.glo-blogs-container * {
  box-sizing: border-box;
}

.glo-blogs-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  font-family: inherit;
  margin-top: 150px !important;
}

.gbo-header-content h1.gbo-page-title {
  font-size: 2.5rem;
  margin: 0 0 10px 0;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gbo-page-description {
  font-size: 1.1rem;
  margin: 0;
  opacity: 0.9;
  font-weight: 300;
}

/* Controls Section */
.gbo-controls-section {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e9ecef;
}

.gbo-search-container {
  display: flex;
  flex: 1;
  min-width: 300px;
}

.gbo-search-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #dee2e6;
  border-radius: 8px 0 0 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.gbo-search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.gbo-search-btn {
  padding: 12px 16px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.gbo-search-btn:hover {
  background: #5a6fd8;
}

.gbo-filter-container {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.gbo-filter-select {
  padding: 12px 16px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  min-width: 140px;
  outline: none;
  transition: border-color 0.3s ease;
}

.gbo-filter-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Loading and Results */
.gbo-loading {
  text-align: center;
  padding: 40px;
  color: #6c757d;
}

.gbo-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.gbo-results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  font-size: 14px;
  color: #6c757d;
}

.gbo-clear-btn {
  padding: 8px 16px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.3s ease;
}

.gbo-clear-btn:hover {
  background: #c82333;
}

/* Blog Posts Grid */
.gbo-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

/* Blog Card - FIXED IMAGE SIZING */
.gbo-blog-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.gbo-blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* FIXED: Image container with proper sizing */
.gbo-blog-image {
  position: relative;
  width: 100%;
  height: 220px; /* Fixed height for consistency */
  overflow: hidden;
  background: #f8f9fa;
  flex-shrink: 0; /* Prevent shrinking */
}

/* FIXED: Image sizing to fit perfectly in container */
.gbo-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover; /* This ensures images fit properly without distortion */
  object-position: center; /* Center the image */
  display: block;
  transition: transform 0.3s ease;
}

.gbo-blog-card:hover .gbo-thumbnail {
  transform: scale(1.05);
}

.gbo-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  color: #adb5bd;
  font-size: 3rem;
  background: linear-gradient(45deg, #f8f9fa, #e9ecef);
}

/* Content area takes remaining space */
.gbo-blog-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1; /* Takes remaining space */
  background: white;
}

.gbo-blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: #6c757d;
}

.gbo-date {
  background: #e9ecef;
  padding: 4px 8px;
  border-radius: 12px;
}

.gbo-category {
  background-color: #ad637c;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.gbo-blog-title {
  margin: 0 0 12px 0;
  font-size: 1.25rem;
  line-height: 1.3;
  color: #ad637c;
}

.gbo-blog-title a {
  color: #212529;
  text-decoration: none;
  transition: color 0.3s ease;
}

.gbo-blog-title a:hover {
  color: #667eea;
}

.gbo-blog-excerpt {
  color: black;
  line-height: 1.5;
  margin-bottom: 15px;
  font-size: 14px;
  flex: 1; /* Takes up remaining space */
}

.gbo-blog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
  font-size: 13px;
  margin-top: auto; /* Push to bottom */
}

.gbo-author {
  color: #6c757d;
  font-weight: 500;
}

.gbo-read-more {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.gbo-read-more:hover {
  color: #5a6fd8;
  text-decoration: underline;
}

/* No Posts Message */
.gbo-no-posts {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
  grid-column: 1 / -1;
}

.gbo-no-posts h3 {
  margin-bottom: 10px;
  color: #495057;
}

/* Pagination */
.gbo-pagination {
  text-align: center;
  margin: 40px 0;
}

.gbo-load-more-btn {
  background: #667eea;
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin-bottom: 15px;
}

.gbo-load-more-btn:hover {
  background: #5a6fd8;
  transform: translateY(-2px);
}

.gbo-load-more-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
}

.gbo-pagination-info {
  color: #6c757d;
  font-size: 14px;
}

/* Back to Top Button */
.gbo-back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.gbo-back-to-top:hover {
  background: #5a6fd8;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
  .glo-blogs-container {
    padding: 0 15px;
  }

  .gbo-page-header {
    margin-top: 10px;
    padding: 30px 20px;
  }

  .gbo-header-content h1.gbo-page-title {
    font-size: 2rem;
  }

  .gbo-page-description {
    font-size: 1rem;
  }

  .gbo-controls-section {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  .gbo-search-container {
    min-width: auto;
  }

  .gbo-filter-container {
    justify-content: space-between;
  }

  .gbo-filter-select {
    flex: 1;
    min-width: auto;
  }

  .gbo-posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .gbo-results-info {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .gbo-back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }

  /* Mobile image adjustments */
  .gbo-blog-image {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .gbo-blog-content {
    padding: 15px;
  }

  .gbo-blog-image {
    height: 180px;
  }

  .gbo-controls-section {
    padding: 12px;
  }

  .gbo-search-input,
  .gbo-filter-select {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Tablet specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .gbo-posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
  }

  .gbo-blog-image {
    height: 200px;
  }
}

/* Large screen adjustments */
@media (min-width: 1400px) {
  .glo-blogs-container {
    max-width: 1400px;
  }

  .gbo-posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  }
}

/* Dark Mode Support (if theme supports it) */
@media (prefers-color-scheme: dark) {
  .gbo-blog-card {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .gbo-blog-title a {
    color: #e2e8f0;
  }

  .gbo-blog-title a:hover {
    color: #667eea;
  }

  .gbo-blog-excerpt {
    color: #a0aec0;
  }

  .gbo-blog-footer {
    border-color: #4a5568;
  }

  .gbo-author {
    color: #a0aec0;
  }

  .gbo-controls-section {
    background: #2d3748;
    border-color: #4a5568;
  }

  .gbo-search-input,
  .gbo-filter-select {
    background: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
  }

  .gbo-no-image {
    background: linear-gradient(45deg, #2d3748, #4a5568);
    color: #718096;
  }
}

/* Animation for smooth transitions */
.gbo-posts-grid {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ensure images load properly */
.gbo-thumbnail {
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gbo-thumbnail[data-src] {
  opacity: 0.7;
}

.gbo-thumbnail.loaded {
  opacity: 1;
}
