/* blog.css - Styles for blog pages */

/* Universal reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;

header{position: absolute;padding: 15px 90px;}}

/* Header Override for Blog Pages */
.blog-header {
  display: block;
  width: 100%;
  background-color: #121212;
  /* padding: 20px auto; */
  position: fixed;
  top: 0;
  z-index: 100;
}
.blog-footer{
  background-color: #121212;
}

/* Loading State */
.blog-loading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  text-align: center;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(232, 124, 30, 0.2);
  border-radius: 50%;
  border-top-color: #e87c1e;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Animation for blog cards */
.blog-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.blog-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Blog Author */
.blog-detail-author {
  color: #777;
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 15px;
}

/* Blog Section */
#Blog {
  padding: 80px 0;
  background-color: #1e2023;
}

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

.Blog-title {
  text-align: center;
  margin-bottom: 50px;
  margin-top: min(30px);
  font-size: 2.5rem;
  color: #fff;
}

.Blog-content {
  display: flex;
  flex-wrap: wrap; /* Allow items to wrap to the next line */
  gap: 30px;
  padding: 20px;
}

.Blog-content > * {
  flex: 1 1 280px; /* Ensures that each item can grow and shrink, with a minimum width of 280px */
  min-width: 280px; /* Set a minimum width for each item */
  max-width: calc(25% - 30px); /* Prevents items from exceeding 25% of the container width minus the gap */
}

.blog-card {
  background-color: transparent;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 350px;
  color: #f1f1f1;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.blog-card-image {
  width: 350px;
  height: 235px;
  object-fit: cover;
  object-position: center;
}

.blog-card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 217px;
}

.blog-card-title {
  font-size: 1.4rem;
  margin-bottom: 20px;
  color: #e87c1e;
}

.blog-card-excerpt {
  font-size: 0.8rem;
  color: #ccc;
  margin-bottom: 15px;
  line-height: 1.3;
  flex-grow: 1;
}

.blog-card-date {
  font-size: 0.65rem;
  color: #999;
  margin-bottom: 5px;
}

.blog-card-link {
  display: inline-block;
  color: #e87c1e;
  text-decoration: none;
  font-weight: 600;
  position: relative;
  align-self: flex-start;
}

.blog-card-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #e87c1e;
  transition: width 0.3s ease;
}

.blog-card-link:hover::after {
  width: 100%;
}

/* Modal/Overlay Blog Detail */
.blog-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
}

.blog-modal {
  background: #003135f8;
  backdrop-filter: blur(30px);
  width: 95%;
  max-width: 1000px;
  max-height: 90vh;
  border-radius: 15px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
  position: relative;
  padding: 40px;
  margin: 30px 0;
}

/* Hide the scrollbar in frosted-glass */
.blog-modal::-webkit-scrollbar {
  width: 0; /* Hide the scrollbar */
  height: 0;
}

.blog-modal::-webkit-scrollbar-track {
  background: transparent; /* No track background */
}

.blog-modal::-webkit-scrollbar-thumb {
  background: transparent; /* Hide the thumb */
}


.blog-modal-close {
  position: sticky;
  bottom: -10px;
  left: calc(100px + 100%);
  background-color: #1d2d50; /* Dark blue background */
  color: #f1f1f1; /* Light text color */
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.blog-modal-close:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  background-color: #ffffff;
  color: #333; /* Dark text color for better contrast */
}

.blog-detail-header {
  margin-bottom: 30px;
  text-align: center;
}

.blog-detail-title {
  font-size: 2.5rem;
  color: #e87c1e;
  margin-bottom: 15px;
}

.blog-detail-date {
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.blog-detail-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 30px;
  color: #fff;
}

.blog-detail-section {
  margin-bottom: 40px;
}

.blog-detail-text {
  line-height: 1.8;
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 30px;
}

/* Blog admin management styles */
.blog-management {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

.blog-admin-controls {
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.blog-admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

.blog-admin-table th,
.blog-admin-table td {
  padding: 12px;
  border: 1px solid #ddd;
  text-align: left;
}

.blog-admin-table th {
  background-color: #f2f2f2;
  font-weight: 600;
}

.blog-admin-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.blog-admin-table tr:hover {
  background-color: #f1f1f1;
}

.blog-form {
  max-width: 800px;
  margin: 0 auto;
  background-color: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.blog-form-group {
  margin-bottom: 20px;
}

.blog-form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.blog-form-group input,
.blog-form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.blog-form-group textarea {
  min-height: 300px;
  resize: vertical;
}

.blog-status-published {
  color: #28a745;
  font-weight: 600;
}

.blog-status-draft {
  color: #dc3545;
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
  .Blog-content {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  header{padding: 10px 30px;}

  .blog-modal {
    width: 95%;
    padding: 25px;
  }

  .blog-detail-title {
    font-size: 1.8rem;
  }

  .blog-detail-image {
    height: 250px;
  }
}

@media (max-width: 480px) {
  .Blog-content {
    grid-template-columns: 1fr;
  }

  .blog-modal {
    padding: 20px;
  }

  .blog-detail-title {
    font-size: 1.5rem;
  }

  .blog-detail-date {
    font-size: 0.8rem;
  }
  
  .blog-modal-close {
    bottom: 10px;
    left: calc(100% - 50px);
    width: 35px;
    height: 35px;
  }
}

/* Focus Styling */
.blog-form-group input:focus,
.blog-form-group textarea:focus {
  outline: none;
  border-color: #e87c1e;
}

/* Button Hover Effect */
.btn:hover {
  background-color: #e87c1e;
  color: white;
}

/* Footer Social Link Hover Effect */
.social-link:hover {
  color: #e87c1e;
  transition: color 0.3s ease;
}

/* Show/Hide Animation for Modal */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.fade-in {
  animation: fadeIn 0.3s forwards;
}

.fade-out {
  animation: fadeOut 0.3s forwards;
}