/* Variable definitions for custom colors */
:root {
  --page-primary-color: #11A84E;
  --page-auxiliary-color: #22C768;
  --page-button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  --page-card-bg: #11271B;
  --page-background-color: #08160F;
  --page-text-main: #F2FFF6;
  --page-text-secondary: #A7D9B8;
  --page-border-color: #2E7A4E;
  --page-glow-color: #57E38D;
  --page-gold-color: #F2C14E;
  --page-divider-color: #1E3A2A;
  --page-deep-green: #0A4B2C;
}

/* Base styles for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--page-text-main);
  background: var(--page-background-color);
  padding-top: 10px; /* Small top padding for the first section */
  box-sizing: border-box;
}

.page-blog__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
}

.page-blog__section-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--page-text-main);
  text-align: center;
  margin-bottom: 40px;
  margin-top: 60px;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  overflow: hidden;
  padding-bottom: 40px;
  background: var(--page-background-color);
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  margin-bottom: 30px; /* Space between image and content */
}

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

.page-blog__main-title {
  font-size: clamp(28px, 4vw, 48px); /* Responsive font size */
  font-weight: 800;
  color: var(--page-text-main);
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-blog__description {
  font-size: 18px;
  color: var(--page-text-secondary);
  margin-bottom: 30px;
}

/* Buttons */
.page-blog__btn-primary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  background: var(--page-button-gradient);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--page-glow-color, rgba(87, 227, 141, 0.4));
}

.page-blog__btn-secondary {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  background: transparent;
  color: var(--page-text-main);
  border: 2px solid var(--page-border-color);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__btn-secondary:hover {
  background: var(--page-border-color);
  color: #ffffff;
}

/* Recent Posts Section */
.page-blog__recent-posts {
  padding: 40px 0 60px;
  background: var(--page-background-color);
}

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

.page-blog__post-card {
  background: var(--page-card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  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 25px rgba(0, 0, 0, 0.3);
}

.page-blog__post-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.page-blog__post-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-blog__post-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--page-text-main);
  margin-bottom: 10px;
}

.page-blog__post-meta {
  font-size: 14px;
  color: var(--page-text-secondary);
  margin-bottom: 15px;
}

.page-blog__post-excerpt {
  font-size: 16px;
  color: var(--page-text-main);
}

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

/* Categories Section */
.page-blog__categories-section {
  padding: 60px 0;
  background: var(--page-background-color);
}

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

.page-blog__category-card {
  background: var(--page-card-bg);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

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

.page-blog__category-image {
  width: 100px;
  height: 75px; /* Maintain aspect ratio for category icons */
  object-fit: contain;
  margin-bottom: 15px;
  display: block;
}

.page-blog__category-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--page-text-main);
  margin: 0;
}

/* FAQ Section */
.page-blog__faq-section {
  padding: 60px 0;
  background: var(--page-background-color);
}

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

details.page-blog__faq-item {
  margin-bottom: 15px;
  border-radius: 10px; /* Larger radius for cards */
  border: 1px solid var(--page-border-color);
  overflow: hidden;
  background: var(--page-card-bg); /* Card background */
}
details.page-blog__faq-item summary.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.3s ease;
}
details.page-blog__faq-item summary.page-blog__faq-question::-webkit-details-marker {
  display: none;
}
details.page-blog__faq-item summary.page-blog__faq-question:hover {
  background: rgba(46, 122, 78, 0.2); /* Hover with border color */
}
.page-blog__faq-qtext {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: var(--page-text-main);
}
.page-blog__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  color: var(--page-text-secondary);
  flex-shrink: 0;
  margin-left: 15px;
  width: 28px;
  text-align: center;
}
details.page-blog__faq-item .page-blog__faq-answer {
  padding: 0 25px 20px;
  background: rgba(17, 39, 27, 0.8); /* Slightly lighter card background for answer */
  border-radius: 0 0 10px 10px;
  color: var(--page-text-secondary);
}
.page-blog__faq-answer p {
  margin: 0;
}

/* --- Responsive styles --- */

/* Mobile images and containers */
@media (max-width: 768px) {
  .page-blog__container {
    padding: 0 15px;
  }

  .page-blog__section-title {
    font-size: 28px;
    margin-top: 40px;
    margin-bottom: 30px;
  }

  /* Hero Section */
  .page-blog__hero-section {
    padding-bottom: 30px;
  }
  .page-blog__hero-image {
    margin-bottom: 20px;
  }
  .page-blog__main-title {
    font-size: 28px;
    margin-bottom: 15px;
  }
  .page-blog__description {
    font-size: 16px;
    margin-bottom: 25px;
  }

  /* Buttons */
  .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;
    font-size: 16px;
  }
  .page-blog__view-all-button-container {
    margin-top: 40px;
  }

  /* Images */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
  }

  /* Containers for images/buttons */
  .page-blog__hero-section,
  .page-blog__recent-posts,
  .page-blog__categories-section,
  .page-blog__faq-section,
  .page-blog__post-grid,
  .page-blog__category-grid,
  .page-blog__faq-list,
  .page-blog__post-card,
  .page-blog__category-card,
  .page-blog__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-blog__post-card {
    padding-left: 0;
    padding-right: 0;
  }
  .page-blog__post-image {
    height: 180px;
  }
  .page-blog__post-title {
    font-size: 18px;
  }
  .page-blog__post-excerpt {
    font-size: 15px;
  }

  /* Category grid adjustment */
  .page-blog__category-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
  }
  .page-blog__category-image {
    width: 80px;
    height: 60px;
  }
  .page-blog__category-title {
    font-size: 16px;
  }

  /* FAQ */
  details.page-blog__faq-item summary.page-blog__faq-question { padding: 15px; }
  .page-blog__faq-qtext { font-size: 15px; }
  details.page-blog__faq-item .page-blog__faq-answer { padding: 0 15px 15px; }
}

/* --- Homepage specific CSS (as per instruction, even if not directly used by blog.html content) --- */
/* A. @media (max-width: 1023px) must be output as is */
@media (max-width: 1023px) {
  .page-blog__home-hero {
    display: block !important;
    grid-template-columns: none !important;
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .page-blog__hero-brand,
  .page-blog__hero-jackpot {
    display: none !important;
  }
  .page-blog__game-trial {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    margin: 0 auto;
    padding: 0 0 12px !important;
    box-sizing: border-box;
  }
  .page-blog__game-trial-shell {
    height: auto !important;
    max-height: none !important;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }
  .page-blog__game-trial-topbar,
  .page-blog__game-trial-bottombar {
    display: none !important;
  }
  .page-blog__game-trial-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 1024 / 768;
    flex: none !important;
    min-height: 240px;
    max-height: none !important;
    overflow: hidden;
    box-sizing: border-box;
  }
  .page-blog__game-trial-frame {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    max-width: 100%;
    border: none;
    z-index: 1;
    overflow: hidden;
  }
  .page-blog__game-trial-overlay {
    z-index: 5 !important;
    pointer-events: auto !important;
  }
  .page-blog__game-trial-start {
    z-index: 6 !important;
    pointer-events: auto !important;
    touch-action: manipulation;
  }
}

/* B. @media (min-width: 1024px) must be output as is */
@media (min-width: 1024px) {
  .page-blog__home-hero {
    display: grid;
    grid-template-columns: 26% 48% 26%;
    gap: 16px;
    align-items: stretch;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 16px 24px;
    box-sizing: border-box;
  }
  .page-blog__hero-brand,
  .page-blog__hero-jackpot,
  .page-blog__game-trial {
    height: 300px;
    max-height: 300px;
    overflow: hidden;
    box-sizing: border-box;
  }
  .page-blog__game-trial {
    max-width: none !important;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .page-blog__game-trial-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 300px;
    box-sizing: border-box;
  }
  .page-blog__game-trial-viewport {
    flex: 1;
    min-height: 0;
    position: relative;
    width: 100%;
  }
  .page-blog__game-trial-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: none;
  }
  .page-blog__hero-jackpot-claim {
    background: #c62828 !important;
    color: #fff !important;
  }
}

/* Additional Homepage-related mobile rules if they were not covered by the 1023px block, or if 768px is different */
@media (max-width: 768px) {
  /* 2. Ưu Đãi __promo-strip */
  .page-blog__promo-strip-track {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
  }
  .page-blog__promo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    background: var(--page-card-bg);
    border-radius: 8px;
  }
  .page-blog__promo-card img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
  }
  .page-blog__promo-card-title {
    font-size: 18px;
    color: var(--page-text-main);
    margin-bottom: 5px;
  }
  .page-blog__promo-card-desc {
    font-size: 14px;
    color: var(--page-text-secondary);
  }

  /* 3. Hot Games __hot-games */
  .page-blog__hot-games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
  }
  .page-blog__hot-games-item {
    background: var(--page-card-bg);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .page-blog__hot-games-item img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
  }
  .page-blog__hot-games-name,
  .page-blog__hot-games-rtp,
  .page-blog__hot-games-desc {
    display: none;
  }
  .page-blog__hot-games-play-btn {
    font-size: 14px;
    padding: 8px 12px;
  }

  /* 4. Brand Intro __brand-intro (≤768px) */
  .page-blog__brand-intro {
    padding: 30px 15px;
    text-align: center;
    background: var(--page-background-color);
    color: var(--page-text-main);
  }
  .page-blog__brand-intro-title {
    font-size: 24px;
    margin-bottom: 15px;
  }
  .page-blog__brand-intro-text {
    font-size: 15px;
    color: var(--page-text-secondary);
  }

  /* 5. Winner Ticker __winner-ticker */
  .page-blog__winner-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 15px;
    font-size: 14px;
    text-align: center;
    z-index: 9999;
  }
  body {
    padding-bottom: 50px; /* Adjust body padding-bottom to avoid ticker overlapping content */
  }
  .page-content.page-blog {
    padding-bottom: 50px; /* Ensure main content respects ticker */
  }
}

/* General styles for hidden elements, for JS to toggle */
.is-hidden {
  display: none !important;
  pointer-events: none !important;
}

/* Reward Modal (for homepage, but included as per instruction to ensure all JS/CSS for homepage trial is present) */
.page-blog__reward-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.page-blog__reward-modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}
.page-blog__reward-modal-content {
  background: var(--page-card-bg);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  position: relative;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
  color: var(--page-text-main);
}
.page-blog__reward-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--page-text-secondary);
  cursor: pointer;
  line-height: 1;
}
.page-blog__reward-modal-title {
  font-size: 24px;
  color: var(--page-gold-color);
  margin-bottom: 15px;
}
.page-blog__reward-modal-text {
  font-size: 16px;
  margin-bottom: 25px;
}
.page-blog__reward-modal-btn {
  background: var(--page-button-gradient);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}
/* Ensure body doesn't scroll when modal is open */
body.page-blog--reward-open {
  overflow: hidden;
}