/* style/blog.css */
.page-blog {
  padding-top: var(--header-offset, 120px); /* Ensures content is not hidden by fixed header */
  background-color: #FFFFFF; /* Body background color */
  color: #333333; /* Dark text for light background */
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

.page-blog__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero Section */
.page-blog__hero-section {
  text-align: center;
  padding: 80px 20px 60px;
  background-color: #000000; /* Dark background for hero for contrast */
  color: #FFFFFF; /* Light text for dark background */
  position: relative;
  overflow: hidden;
}

.page-blog__hero-title {
  font-size: 3.5em;
  margin-bottom: 20px;
  font-weight: bold;
  color: #FCBC45; /* Highlight title with a contrasting color */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-blog__hero-description {
  font-size: 1.2em;
  max-width: 800px;
  margin: 0 auto 40px;
  color: #f0f0f0;
}

.page-blog__hero-cta {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.page-blog__button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
}

.page-blog__button--register {
  background-color: #FFFFFF; /* Custom color for Register */
  color: #000000;
  border: 2px solid #FFFFFF;
}

.page-blog__button--register:hover {
  background-color: #f0f0f0;
  transform: translateY(-2px);
}

.page-blog__button--login {
  background-color: #FCBC45; /* Custom color for Login */
  color: #000000;
  border: 2px solid #FCBC45;
}

.page-blog__button--login:hover {
  background-color: #e0a53a;
  transform: translateY(-2px);
}

/* Section Titles */
.page-blog__section-title {
  font-size: 2.5em;
  color: #000000;
  text-align: center;
  margin: 60px 0 40px;
  position: relative;
  padding-bottom: 15px;
}

.page-blog__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: #FCBC45;
  border-radius: 2px;
}

/* Latest Posts Grid */
.page-blog__latest-posts {
  padding: 60px 0;
  background-color: #f9f9f9;
}

.page-blog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-blog__post-card {
  background-color: #FFFFFF;
  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;
  display: flex;
  flex-direction: column;
}

.page-blog__post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.page-blog__post-card--featured {
  grid-column: 1 / -1; /* Featured post spans full width on desktop */
  display: flex;
  flex-direction: row;
}

.page-blog__post-card--featured .page-blog__post-image {
  flex: 1;
  max-width: 50%; /* Image takes half width */
  height: auto;
  object-fit: cover;
}

.page-blog__post-card--featured .page-blog__post-content {
  flex: 1;
  max-width: 50%; /* Content takes half width */
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.page-blog__post-image {
  width: 100%;
  height: 250px; /* Fixed height for consistency in grid */
  object-fit: cover;
  display: block; /* Ensure image behaves as a block element */
}

.page-blog__post-card--featured .page-blog__post-image {
  height: auto; /* Allow featured image to adjust height */
}

.page-blog__post-content {
  padding: 25px;
  flex-grow: 1; /* Allow content to grow and fill space */
  display: flex;
  flex-direction: column;
}

.page-blog__post-title {
  font-size: 1.5em;
  margin-top: 0;
  margin-bottom: 15px;
  color: #000000;
}

.page-blog__post-title a.page-blog__post-link {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.page-blog__post-title a.page-blog__post-link:hover {
  color: #FCBC45;
}

.page-blog__post-excerpt {
  font-size: 0.95em;
  color: #555555;
  margin-bottom: 20px;
  flex-grow: 1; /* Allow excerpt to grow */
}

.page-blog__button--read-more {
  background-color: #000000;
  color: #FFFFFF;
  padding: 10px 20px;
  font-size: 0.9em;
  align-self: flex-start; /* Align button to start of flex container */
  border: none;
}

.page-blog__button--read-more:hover {
  background-color: #333333;
}

/* Categories Section */
.page-blog__categories {
  padding: 60px 0;
}

.page-blog__category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.page-blog__category-card {
  background-color: #FCBC45;
  color: #000000;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-blog__category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.page-blog__category-title {
  font-size: 1.4em;
  margin-top: 0;
  margin-bottom: 10px;
}

.page-blog__category-title a.page-blog__category-link {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.page-blog__category-title a.page-blog__category-link:hover {
  color: #000000; /* Darker on hover */
}

.page-blog__category-description {
  font-size: 0.9em;
  color: #333333;
}

/* Expert Tips Section */
.page-blog__expert-tips {
  padding: 60px 0;
  background-color: #000000;
  color: #FFFFFF;
}

.page-blog__expert-tips .page-blog__section-title {
  color: #FFFFFF;
}

.page-blog__expert-tips .page-blog__section-title::after {
  background-color: #FCBC45;
}

.page-blog__tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.page-blog__tip-item {
  background-color: rgba(255, 255, 255, 0.08); /* Slightly transparent white for cards on dark background */
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.page-blog__tip-item:hover {
  transform: translateY(-5px);
  background-color: rgba(255, 255, 255, 0.15);
}

.page-blog__tip-image {
  width: 100%;
  max-width: 400px; /* Ensure images don't stretch too wide in grid items */
  height: 250px; /* Fixed height for consistency */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.page-blog__tip-title {
  font-size: 1.3em;
  margin-top: 0;
  margin-bottom: 10px;
  color: #FCBC45;
}

.page-blog__tip-description {
  font-size: 0.9em;
  color: #e0e0e0;
}

/* Why Jollywinph Section */
.page-blog__why-jollywinph {
  padding: 60px 0;
  background-color: #FFFFFF;
  color: #333333;
}

.page-blog__text-content {
  font-size: 1.1em;
  margin-bottom: 20px;
  line-height: 1.8;
  text-align: justify;
}

.page-blog__cta-final {
  text-align: center;
  margin-top: 50px;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
  .page-blog__hero-title {
    font-size: 3em;
  }

  .page-blog__post-card--featured {
    flex-direction: column; /* Stack image and content on smaller screens */
  }

  .page-blog__post-card--featured .page-blog__post-image,
  .page-blog__post-card--featured .page-blog__post-content {
    max-width: 100%;
  }

  .page-blog__post-image {
    height: 200px; /* Adjust height for smaller screens */
  }
}

@media (max-width: 768px) {
  .page-blog__hero-section {
    padding: 60px 15px 40px;
  }

  .page-blog__hero-title {
    font-size: 2.5em;
  }

  .page-blog__hero-description {
    font-size: 1.1em;
  }

  .page-blog__hero-cta {
    flex-direction: column;
    gap: 15px;
  }

  .page-blog__button {
    width: 80%;
    margin: 0 auto;
    padding: 12px 25px;
    font-size: 1em;
  }

  .page-blog__section-title {
    font-size: 2em;
    margin: 40px 0 30px;
  }

  .page-blog__grid,
  .page-blog__category-grid,
  .page-blog__tips-grid {
    grid-template-columns: 1fr; /* Single column layout for mobile */
    gap: 20px;
  }

  .page-blog__post-content,
  .page-blog__tip-item {
    padding: 20px;
  }

  .page-blog__post-title {
    font-size: 1.3em;
  }

  .page-blog__post-excerpt,
  .page-blog__category-description,
  .page-blog__tip-description,
  .page-blog__text-content {
    font-size: 0.9em;
  }
  
  /* Critical: Prevent images from overflowing on mobile */
  .page-blog img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 480px) {
  .page-blog__hero-title {
    font-size: 2em;
  }
  .page-blog__button {
    width: 95%;
  }
  .page-blog__section-title {
    font-size: 1.8em;
  }
}