/* style/blog.css */

/* Root variables for colors */
:root {
  --ph22-primary: #F2C14E;
  --ph22-secondary: #FFD36B;
  --ph22-card-bg: #111111;
  --ph22-background: #0A0A0A;
  --ph22-text-main: #FFF6D6;
  --ph22-border: #3A2A12;
  --ph22-glow: #FFD36B;
  --ph22-btn-gradient: linear-gradient(180deg, #FFD86A 0%, #DDA11D 100%);
  --header-offset: 120px; /* Default desktop header height */
}

/* Base styles for the blog page content */
.page-blog {
  font-family: Arial, sans-serif;
  color: var(--ph22-text-main); /* Light text for dark background */
  background-color: var(--ph22-background); /* Dark background */
  line-height: 1.6;
}

/* Sections padding and max-width */
.page-blog__section {
  padding: 60px 0;
}

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

/* Section headers */
.page-blog__section-header {
  font-size: 2.5em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
  color: var(--ph22-primary);
  line-height: 1.2;
}

.page-blog__section-header--white {
  color: var(--ph22-text-main);
}

.page-blog__section-description {
  font-size: 1.1em;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px auto;
  color: rgba(255, 246, 214, 0.8);
}

.page-blog__section-description--white {
  color: rgba(255, 246, 214, 0.8);
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  overflow: hidden;
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  background: var(--ph22-background); /* Use background for the section */
}

.page-blog__hero-container {
  display: flex;
  flex-direction: column; /* Image above text */
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.page-blog__hero-image {
  width: 100%;
  max-width: 1200px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  margin-bottom: 30px; /* Space between image and text */
}

.page-blog__hero-content {
  text-align: center;
  padding: 0 20px;
  max-width: 900px;
}

.page-blog__main-title {
  font-size: clamp(2.5em, 4vw, 3.5em); /* Responsive font size */
  font-weight: 700;
  color: var(--ph22-primary);
  margin-bottom: 15px;
  line-height: 1.2;
}

.page-blog__hero-description {
  font-size: 1.2em;
  color: rgba(255, 246, 214, 0.9);
  margin-bottom: 30px;
}

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

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: all 0.3s ease;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__btn-primary {
  background: var(--ph22-btn-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 15px rgba(242, 193, 78, 0.4);
}

.page-blog__btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(242, 193, 78, 0.6);
}

.page-blog__btn-secondary {
  background: transparent;
  color: var(--ph22-primary);
  border: 2px solid var(--ph22-primary);
}

.page-blog__btn-secondary:hover {
  background: var(--ph22-primary);
  color: var(--ph22-text-main);
  transform: translateY(-3px);
}

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

.page-blog__article-card {
  background-color: var(--ph22-card-bg);
  border: 1px solid var(--ph22-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

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

.page-blog__card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.page-blog__article-date {
  font-size: 0.9em;
  color: rgba(255, 246, 214, 0.6);
  margin-bottom: 10px;
}

.page-blog__article-title {
  font-size: 1.4em;
  font-weight: bold;
  margin-bottom: 10px;
  line-height: 1.3;
}

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

.page-blog__article-title a:hover {
  color: var(--ph22-secondary);
}

.page-blog__article-excerpt {
  font-size: 0.95em;
  color: rgba(255, 246, 214, 0.8);
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-blog__read-more-btn {
  display: inline-block;
  padding: 8px 15px;
  border: 1px solid var(--ph22-primary);
  border-radius: 5px;
  color: var(--ph22-primary);
  text-decoration: none;
  font-size: 0.9em;
  transition: all 0.3s ease;
  align-self: flex-start;
}

.page-blog__read-more-btn:hover {
  background-color: var(--ph22-primary);
  color: var(--ph22-text-main);
}

.page-blog__view-all-button-container {
  text-align: center;
  margin-top: 50px;
}

/* Categories Section */
.page-blog__categories-section {
  background-color: var(--ph22-primary);
  color: var(--ph22-text-main);
  padding: 80px 0;
}

.page-blog__category-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 40px;
}

.page-blog__category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--ph22-text-main);
  transition: transform 0.3s ease, color 0.3s ease;
  max-width: 150px;
  text-align: center;
}

.page-blog__category-item:hover {
  transform: translateY(-5px);
  color: var(--ph22-background);
}

.page-blog__category-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 5px rgba(0,0,0,0.3));
}

.page-blog__category-name {
  font-size: 1.1em;
  font-weight: bold;
}

/* Featured Guides Section */
.page-blog__guide-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

.page-blog__guide-card {
  background-color: var(--ph22-card-bg);
  border: 1px solid var(--ph22-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.page-blog__guide-image {
  width: 100%;
  height: 285px;
  object-fit: cover;
  display: block;
}

.page-blog__guide-title {
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 10px;
  line-height: 1.3;
}

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

.page-blog__guide-title a:hover {
  color: var(--ph22-secondary);
}

.page-blog__guide-excerpt {
  font-size: 1em;
  color: rgba(255, 246, 214, 0.8);
  margin-bottom: 20px;
  flex-grow: 1;
}


/* FAQ Section */
.page-blog__faq-section {
  background-color: var(--ph22-card-bg);
  color: var(--ph22-text-main);
}

.page-blog__faq-list {
  max-width: 900px;
  margin: 40px auto 0 auto;
}

.page-blog__faq-item {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ph22-border);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

.page-blog__faq-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1em;
  color: var(--ph22-primary);
}

.page-blog__faq-question h3 {
  margin: 0;
  font-size: 1em;
  color: var(--ph22-primary);
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  transition: transform 0.3s ease;
  color: var(--ph22-text-main);
}

.page-blog__faq-item.active .page-blog__faq-toggle {
  transform: rotate(45deg);
}

.page-blog__faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 25px;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: rgba(255, 246, 214, 0.8);
}

.page-blog__faq-item.active .page-blog__faq-answer {
  max-height: 1000px !important;
  padding: 15px 25px;
}

.page-blog__faq-answer p {
  margin: 0 0 10px 0;
  color: rgba(255, 246, 214, 0.8);
}

/* Call to Action Section */
.page-blog__cta-section {
  padding: 80px 0;
  background-color: var(--ph22-primary);
  text-align: center;
  color: var(--ph22-text-main);
}

.page-blog__cta-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.page-blog__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__hero-image {
    max-width: 900px;
    height: auto;
  }
}

@media (max-width: 768px) {
  :root {
    --header-offset: 100px;
  }

  .page-blog__hero-section {
    padding-top: var(--header-offset) !important;
  }

  .page-blog__section {
    padding: 40px 0;
  }

  .page-blog__section-header {
    font-size: 2em;
  }

  .page-blog__main-title {
    font-size: clamp(2em, 8vw, 2.5em);
  }

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

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

  /* Mobile image responsiveness */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-blog__section,
  .page-blog__card,
  .page-blog__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Mobile button responsiveness */
  .page-blog__btn-primary,
  .page-blog__btn-secondary,
  .page-blog a[class*="button"],
  .page-blog a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-blog__cta-buttons,
  .page-blog__button-group,
  .page-blog__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
  }

  .page-blog__cta-buttons {
    flex-direction: column;
  }

  .page-blog__article-grid,
  .page-blog__guide-list {
    grid-template-columns: 1fr;
  }

  .page-blog__article-image,
  .page-blog__guide-image {
    height: auto;
  }

  .page-blog__category-list {
    gap: 20px;
  }

  .page-blog__category-item {
    max-width: 100px;
  }

  .page-blog__faq-question {
    padding: 15px 20px;
    font-size: 1em;
  }

  .page-blog__faq-answer {
    padding: 10px 20px;
  }
}

@media (max-width: 480px) {
  .page-blog__section-header {
    font-size: 1.8em;
  }

  .page-blog__main-title {
    font-size: clamp(1.8em, 10vw, 2.2em);
  }

  .page-blog__article-title {
    font-size: 1.2em;
  }

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