/* style/blog.css */

/* Root variables for consistent styling */
:root {
  --primary-color: #FFD700; /* Gold */
  --secondary-color: #1A1A1A; /* Dark Grey/Black */
  --text-color-dark: #333333;
  --text-color-light: #ffffff;
  --background-color-light: #f4f4f4;
  --button-hover-darken: #b39700; /* Darker gold for hover */
  --card-background: #ffffff;
  --border-radius: 8px;
  --spacing-unit: 20px;
}

/* Base styles for the blog page content */
.page-blog {
  color: var(--text-color-dark); /* Dark text on light body background */
  line-height: 1.6;
  font-family: Arial, sans-serif;
  padding-top: var(--header-offset, 120px); /* Ensure content is below fixed header */
}

.page-blog__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-unit);
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  overflow: hidden;
  color: var(--text-color-light);
  padding: 80px 0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-blog__hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  filter: brightness(0.6); /* Slightly darken image for text readability */
}

.page-blog__hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: var(--spacing-unit);
}

.page-blog__hero-title {
  font-size: 3.5em;
  margin-bottom: var(--spacing-unit);
  color: var(--primary-color);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  line-height: 1.2;
}

.page-blog__hero-description {
  font-size: 1.2em;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
  color: var(--text-color-light);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.page-blog__hero-button {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: 15px 30px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.page-blog__hero-button:hover {
  background-color: var(--button-hover-darken);
  transform: translateY(-2px);
}

/* Latest Posts Section */
.page-blog__latest-posts-section {
  padding: calc(var(--spacing-unit) * 2) 0;
  background-color: var(--background-color-light);
}

.page-blog__section-title {
  font-size: 2.5em;
  color: var(--secondary-color);
  text-align: center;
  margin-bottom: calc(var(--spacing-unit) * 2);
  position: relative;
}

.page-blog__section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background-color: var(--primary-color);
  margin: 10px auto 0;
  border-radius: 2px;
}

.page-blog__posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-unit);
}

.page-blog__post-card {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.page-blog__post-image {
  width: 100%;
  height: 225px; /* Fixed height for consistency, will be object-fit */
  object-fit: cover;
  display: block;
}

.page-blog__post-content {
  padding: var(--spacing-unit);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.page-blog__post-title {
  font-size: 1.5em;
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--secondary-color);
}

.page-blog__post-title a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-blog__post-title a:hover {
  color: var(--primary-color);
}

.page-blog__post-excerpt {
  font-size: 0.95em;
  color: #555;
  margin-bottom: var(--spacing-unit);
  flex-grow: 1;
}

.page-blog__read-more {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
  margin-top: auto; /* Push to bottom */
}

.page-blog__read-more:hover {
  color: var(--button-hover-darken);
  text-decoration: underline;
}

/* Categories Section */
.page-blog__categories-section {
  padding: calc(var(--spacing-unit) * 2) 0;
  background-color: var(--secondary-color);
  color: var(--text-color-light);
}

.page-blog__categories-section .page-blog__section-title {
  color: var(--primary-color);
}

.page-blog__categories-section .page-blog__section-title::after {
  background-color: var(--text-color-light);
}

.page-blog__categories-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-unit);
}

.page-blog__category-link {
  display: block;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-color-light);
  padding: 12px 25px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-blog__category-link:hover {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  border-color: var(--primary-color);
}

/* Call to Action Section */
.page-blog__cta-section {
  padding: calc(var(--spacing-unit) * 3) 0;
  text-align: center;
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.page-blog__cta-title {
  font-size: 2.8em;
  margin-bottom: var(--spacing-unit);
  color: var(--secondary-color);
}

.page-blog__cta-description {
  font-size: 1.3em;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
  color: #444;
}

.page-blog__cta-button {
  display: inline-block;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  padding: 18px 40px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2em;
  transition: background-color 0.3s ease, transform 0.2s ease;
  border: 2px solid var(--secondary-color);
}

.page-blog__cta-button:hover {
  background-color: #000;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Floating Buttons */
.page-blog__floating-button {
  position: fixed;
  right: var(--spacing-unit);
  padding: 12px 25px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1em;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, background-color 0.3s ease;
  z-index: 1000;
}

.page-blog__floating-button:hover {
  transform: scale(1.05);
}

.page-blog__floating-button--register {
  bottom: calc(var(--spacing-unit) * 4);
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.page-blog__floating-button--register:hover {
  background-color: var(--button-hover-darken);
}

.page-blog__floating-button--login {
  bottom: var(--spacing-unit);
  background-color: var(--secondary-color);
  color: var(--primary-color);
}

.page-blog__floating-button--login:hover {
  background-color: #000;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__hero-title {
    font-size: 3em;
  }
  .page-blog__section-title {
    font-size: 2em;
  }
  .page-blog__cta-title {
    font-size: 2.2em;
  }
}

@media (max-width: 768px) {
  .page-blog {
    padding-top: var(--header-offset, 80px); /* Adjust for smaller header on mobile */
  }
  .page-blog__hero-section {
    padding: 60px 0;
  }
  .page-blog__hero-title {
    font-size: 2.5em;
  }
  .page-blog__hero-description {
    font-size: 1em;
  }
  .page-blog__hero-button {
    padding: 12px 25px;
    font-size: 1em;
  }
  .page-blog__posts-grid {
    grid-template-columns: 1fr;
  }
  .page-blog__post-image {
    height: 200px;
  }
  .page-blog__section-title {
    font-size: 1.8em;
  }
  .page-blog__cta-title {
    font-size: 1.8em;
  }
  .page-blog__cta-description {
    font-size: 1.1em;
  }
  .page-blog__cta-button {
    padding: 15px 30px;
    font-size: 1em;
  }
  .page-blog__floating-button {
    padding: 10px 20px;
    font-size: 0.9em;
    right: 15px;
  }
  /* Prevent image overflow in content areas */
  .page-blog img {
    max-width: 100%;
    height: auto;
  }
  .page-blog__post-card img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 480px) {
  .page-blog__hero-title {
    font-size: 2em;
  }
  .page-blog__hero-description {
    font-size: 0.9em;
  }
  .page-blog__section-title {
    font-size: 1.5em;
  }
  .page-blog__post-title {
    font-size: 1.3em;
  }
  .page-blog__cta-title {
    font-size: 1.5em;
  }
  .page-blog__floating-button {
    font-size: 0.8em;
    padding: 8px 18px;
  }
}