/**
 * Insights Page Template Styles
 * Custom styles for the Insights page template with two-column layout
 */

/* Main Layout */
.insights-page-wrapper {
  padding: 60px 0;
  background-color: transparent;
}

.insights-container {
  display: flex;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  gap: 40px;
}

.insights-main-content {
  flex: 1;
  min-width: 65%;
}

.insights-sidebar {
  width: 25%;
  min-width: 250px;
}

/* Page Title and Intro */
.insights-title {
  color: #404a9a;
  margin-bottom: 30px;
  font-size: 2.0rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: visible;
}

.insights-intro {
  margin-bottom: 40px;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Posts Container */
.insights-posts-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  grid-auto-rows: 1fr; /* Make all rows the same height */
}

/* Ensure all posts have equal size */
.insights-posts-container > .insights-post {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  /* Added to ensure consistent sizing */
  min-height: 450px;
}

/* Individual Post Styling */
.insights-post {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%; /* Ensure full height usage */
}

.insights-post:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.insights-post-image {
  overflow: hidden;
  height: 200px; /* Standardized height for all blog images */
}

.insights-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.insights-post:hover .insights-post-image img {
  transform: scale(1.05);
}

.insights-post-content {
  padding: 25px;
}

.insights-post-title {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.2rem !important; /* Reduced blog title size */
  line-height: 1.3;
  /* Removed fixed height and overflow hidden to show full titles */
  word-wrap: break-word;
  hyphens: auto;
}

.insights-post-title a {
  color: #404a9a;
  text-decoration: none;
  transition: color 0.3s ease;
}

.insights-post-title a:hover {
  color: #8690e1;
  text-decoration: none;
}

.insights-post-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: #666;
}

.insights-post-date,
.insights-post-reading-time {
  display: flex;
  align-items: center;
}

.insights-post-date::before {
  content: "\f073"; /* Calendar icon */
  font-family: "FontAwesome";
  margin-right: 5px;
}

.insights-post-reading-time::before {
  content: "\f017"; /* Clock icon */
  font-family: "FontAwesome";
  margin-right: 5px;
}

.insights-post-excerpt {
  margin-bottom: 20px;
  color: #333;
  line-height: 1.6;
  max-height: 4.8em; /* Limit to approximately 3 lines (1.6 line-height × 3) */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.insights-post-link {
  display: inline-block;
  color: #404a9a;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease, transform 0.2s ease;
}

.insights-post-link:after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #404a9a;
  transition: width 0.3s ease;
}

.insights-post-link:hover {
  color: #8690e1;
  transform: translateX(5px);
}

.insights-post-link:hover:after {
  width: 100%;
}

/* Pagination */
.insights-pagination {
  margin-top: 40px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap; /* Prevent wrapping to keep all numbers in one line */
  overflow-x: visible; /* Remove any overflow that might create a slider */
  width: 100%;
  font-family: "Noto Sans KR", sans-serif;
}

.insights-pagination .page-numbers {
  display: inline-block;
  padding: 8px 12px;
  margin: 0 3px;
  border-radius: 4px;
  background-color: #fff;
  color: #404a9a;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  font-weight: 400;
  min-width: 36px;
  text-align: center;
}

.insights-pagination .page-numbers.current {
  background-color: #404a9a;
  color: #fff;
  font-weight: 600;
}

.insights-pagination .page-numbers:hover {
  background-color: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.insights-pagination .page-numbers.prev,
.insights-pagination .page-numbers.next {
  padding: 8px 16px;
  font-weight: 500;
  white-space: nowrap;
  min-width: auto;
  width: auto;
}

/* Remove arrow animation for next/prev links */
.insights-pagination .page-numbers.next:hover,
.insights-pagination .page-numbers.prev:hover {
  transform: none;
}

/* Sidebar Widgets */
.insights-widget {
  background-color: #fff;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.insights-widget-title {
  color: #404a9a;
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
  position: relative;
}

.insights-widget-title:after {
  content: "";
  position: absolute;
  width: 60px;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #404a9a;
}

.insights-categories,
.insights-recent-posts {
  list-style: none;
  padding: 0;
  margin: 0;
}

.insights-categories li,
.insights-recent-posts li {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.insights-categories li:last-child,
.insights-recent-posts li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.insights-categories a,
.insights-recent-posts a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease, transform 0.2s ease;
  display: block;
  padding: 5px 0;
}

.insights-categories a:before {
  content: none; /* Remove square icon */
}

.insights-recent-posts a:before {
  content: none; /* Remove square icon */
}

.insights-categories a:hover,
.insights-recent-posts a:hover {
  color: #404a9a;
  transform: translateX(5px);
}

/* No Posts Found */
.no-posts-found {
  text-align: center;
  padding: 40px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Responsive Styles */
@media (max-width: 992px) {
  .insights-container {
    flex-direction: column;
  }

  .insights-main-content,
  .insights-sidebar {
    width: 100%;
  }

  .insights-post {
    flex-direction: column;
  }

  .insights-post-image {
    max-height: none;
  }

  /* Tablet view - 2 columns */
  .insights-posts-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .insights-page-wrapper {
    padding: 40px 0;
  }

  .insights-title {
    font-size: 2rem;
  }

  .insights-post-title {
    font-size: 1.3rem;
  }

  .insights-post-content {
    padding: 20px;
  }

  /* Mobile view - 1 column */
  .insights-posts-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 576px) {
  .insights-container {
    padding: 0 15px;
  }

  .insights-title {
    font-size: 1.8rem;
  }

  .insights-pagination {
    margin-top: 30px;
  }

  .insights-pagination .page-numbers {
    padding: 6px 10px;
    margin: 0 2px 8px;
    min-width: 36px;
  }
}
