/* blogs.css - styling for blogs.html page */

/* Ensure page is always 100% viewport height minimum */
html {
  height: 100%;
}

body.blogs-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

#site-footer {
  margin-top: auto;
}

/* Blog section specific styles */
.blog-section {
  background: #ffffff;
  border-radius: 14px;
  padding: 28px;
  margin: 48px auto;
  box-shadow: 0 6px 30px rgba(2, 6, 23, 0.6);
  overflow: hidden;
}

.blog-section h2 {
  margin-top: 8px;
  margin-bottom: 24px;
  font-size: 28px;
  color: #000D27;
}

.section-body-blogs {
  min-height: 200px;
  display: grid;
  gap: 24px;
}

.section-body-blogs.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Blog post sections */
.blog-post-section {
  background: #ffffff;
  border-radius: 14px;
  padding: 28px;
  margin: 48px auto;
  box-shadow: 0 6px 30px rgba(2, 6, 23, 0.6);
  overflow: hidden;
  transition: transform 0.8s ease, opacity 0.8s ease;
  opacity: 0;
}

.ls {
    position:relative; left: 5%
}

.rs {
    position:relative; left: -5%
}

@media (max-width: 1300px) {
  .ls {
    position:relative; left: 2%
  }

  .rs {
    position:relative; left: -2%
  }
}

@media (max-width: 1200px) {
  .ls {
    position:relative; left: 0%
  }

  .rs {
    position:relative; left: -0%
  }
}


/* Initial positions for slide-in animation */
.blog-post-section:nth-child(odd) {
  transform: translateX(-100%);
}

.blog-post-section:nth-child(even) {
  transform: translateX(100%);
}

/* Final positions after slide-in */
.blog-post-section.slide-in:nth-child(1) {
  transform: translateX(-50%);
  opacity: 1;
}

.blog-post-section.slide-in:nth-child(2) {
  transform: translateX(50%);
  opacity: 1;
}

.blog-section-title {
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 28px;
  color: #000D27;
  text-align: center;
}

.blog-post-content {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.blog-image {
  flex: 0 0 300px;
  width: 300px;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}

.blog-text-container {
  flex: 1;
}

/* New layout: header with image and title, text below */
.blog-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.blog-header .blog-image {
  flex: 0 0 600px;
  width: 600px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

.blog-header .blog-section-title {
  flex: 1;
  margin: 0;
  font-size: 24px;
  text-align: left;
  line-height: 1.3;
}

/* Odd sections: image left, title right */
.blog-post-section:nth-child(odd) .blog-header {
  flex-direction: row;
}

/* Even sections: image right, title left */
.blog-post-section:nth-child(even) .blog-header {
  flex-direction: row-reverse;
}

.blog-post-section:nth-child(even) .blog-header .blog-section-title {
  text-align: right;
}

.blog-text {
  margin-bottom: 16px;
  line-height: 1.6;
  color: #333;
}

.read-more-btn {
  background: linear-gradient(90deg, #2b8cff, #4aa6ff);
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

.read-more-btn:hover {
  background: linear-gradient(90deg, #1a7cff, #3a9cff);
}

/* Slide section animation */
.slide-section {
  opacity: 0;
  /*transform: translateX(0);*/
  transition: opacity 0.5s ease;
  will-change: opacity;
}

.slide-section.slide-in {
  opacity: 1;
  /*transform: translateX(0);*/
}

.blog-post-section {
  opacity: 0;
  /*transform: translateY(20px);*/
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-post-section:nth-child(1) { animation-delay: 0.1s; }
.blog-post-section:nth-child(2) { animation-delay: 0.2s; }
.blog-post-section:nth-child(3) { animation-delay: 0.3s; }
.blog-post-section:nth-child(4) { animation-delay: 0.4s; }
.blog-post-section:nth-child(5) { animation-delay: 0.5s; }
.blog-post-section:nth-child(6) { animation-delay: 0.6s; }

.blog-post-section {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-post-section:nth-child(1) { animation-delay: 0.1s; }
.blog-post-section:nth-child(2) { animation-delay: 0.2s; }
.blog-post-section:nth-child(3) { animation-delay: 0.3s; }
.blog-post-section:nth-child(4) { animation-delay: 0.4s; }
.blog-post-section:nth-child(5) { animation-delay: 0.5s; }
.blog-post-section:nth-child(6) { animation-delay: 0.6s; }

/* Error state */
.error {
  color: #ff6b6b;
  text-align: center;
  padding: 48px 20px;
}

/* Spinner */
.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: conic-gradient(#2b8cff, rgba(255, 255, 255, 0.1));
  box-shadow: 0 6px 20px rgba(43, 140, 255, 0.12);
  animation: spin 1.2s linear infinite;
  margin: 0 auto;
}

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

/* Responsive design */
@media (max-width: 1000px) {
  .blog-post-section {
    padding: 20px;
    margin: 32px auto;
  }

  .blog-section-title {
    font-size: 24px;
  }

  .blog-post-content {
    flex-direction: column;
  }

  .blog-image {
    max-width: 600px;
    max-height: 200px;   
  }

  /* Adjust final positions on tablets */
  .blog-post-section.slide-in:nth-child(odd) {
    transform: translateX(-100px);
  }

  .blog-post-section.slide-in:nth-child(even) {
    transform: translateX(100px);
  }

  /* Tablet layout adjustments */
  .blog-header {
    flex-direction: column !important;
    gap: 16px;
  }

  .blog-header .blog-image {    
    width: 600px;
    height: 200px; 
    align-self: center;
  }

  .blog-header .blog-section-title {
    text-align: center !important;
    font-size: 22px;
  }
}

@media (max-width: 600px) {
  body.blogs-page {
    padding: 0;
  }

  .blog-post-section {
    border-radius: 0;
    margin: 24px 0;
    padding: 20px;
  }

  .blog-section-title {
    font-size: 20px;
  }

  .blog-text {
    font-size: 14px;
    white-space: pre-line;
  }

  .blog-post-content {
    flex-direction: column;
  }

  .blog-image {
    max-width: 100%;
    aspect-ratio: (1/3)
  }

  /* Remove shifts on mobile - center all sections */
  .blog-post-section:nth-child(odd),
  .blog-post-section:nth-child(even) {
    transform: translateX(0);
  }

  .blog-post-section.slide-in:nth-child(odd),
  .blog-post-section.slide-in:nth-child(even) {
    transform: translateX(0);
  }

  /* Mobile layout adjustments */
  .blog-header {
    flex-direction: column !important;
    gap: 16px;
  }

  .blog-header .blog-image {
    width: 100%;
    aspect-ratio: (1/3);
  }

  .blog-header .blog-section-title {
    text-align: center !important;
    font-size: 18px;
  }
}
