/* style/index.css */
/* 🚨 Body background is white (from shared.css var(--secondary-color)), so default text is dark */
.page-index {
  color: #333333; /* Default text color for light background */
  background: #ffffff; /* Explicitly set for clarity, though body handles it */
}

/* 🚨 Page title H1 font-size rule: No fixed large font-size, use clamp if necessary */
/* No standalone H1 in this specific homepage structure, but if it were, it would follow this rule. */

/* --- Module 1: Video Area --- */
.page-index__video-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  /* 🚨 页头整段高度由 shared 的 body { padding-top: var(--header-offset); } 承担；此处仅用小额顶距，禁止再写 var(--header-offset) 以免双倍空白 */
  padding-top: 10px;
  box-sizing: border-box; /* Ensure padding is included in the width */
}

.page-index__video-container {
  position: relative;
  width: 100%; /* 🚨 Desktop: MUST have width: 100% to avoid shrinking */
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* 🚨 Video click link style (MUST be strictly followed) */
.page-index__video-link {
  display: block;
  text-decoration: none;
  position: relative;
  width: 100%;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__video-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.page-index__video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio - 🚨 PageSpeed optimization: fixed aspect ratio to prevent CLS */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.page-index__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
  object-fit: cover;
  pointer-events: none; /* Prevent video controls from blocking click event */
  background-color: #000; /* Fallback for video loading */
}

/* 🚨 Video click hint overlay style (optional, enhances UX) */
.page-index__video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.page-index__video-link:hover .page-index__video-overlay {
  opacity: 1;
}

.page-index__video-click-hint {
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  padding: 10px 20px;
  background: rgba(1, 116, 57, 0.8); /* Using primary color with opacity */
  border-radius: 5px;
  white-space: nowrap;
}

/* 🚨 Play Now button style (MUST be strictly followed, positioned below video in center) */
.page-index__video-cta {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
  box-sizing: border-box;
}

.page-index__play-now-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--primary-color, #017439); /* Use brand primary color */
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: none;
  cursor: pointer;
  white-space: nowrap; /* Prevent text wrapping on desktop */
}

.page-index__play-now-button:hover {
  background: #005f2f; /* Slightly darker green */
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.page-index__play-now-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* --- Module 2: Promo Dark (GifCode Tabs + Blog Section Title) --- */
.page-index__promo-dark {
  background: #2c2c2c; /* Dark grey background */
  padding: 24px 16px;
  box-sizing: border-box;
  color: #ffffff; /* Text color for dark background */
}

.page-index__gifcode-tabs {
  max-width: 1250px;
  margin: 0 auto;
  padding: 20px 0;
}

.page-index__gifcode-title {
  color: #017439; /* Brand primary color for title */
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 20px;
  font-size: clamp(1.5rem, 4vw, 2rem); /* Responsive font size */
  font-weight: bold;
}

.page-index__gifcode-tab-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 16px 0 30px;
  flex-wrap: wrap; /* Allow tabs to wrap on smaller screens */
}

.page-index__gifcode-tab-nav li {
  margin: 0;
}

.page-index__gifcode-tab-nav a {
  color: #ffffff; /* White text for inactive tabs */
  text-decoration: none;
  text-transform: uppercase;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  font-weight: 600;
  white-space: nowrap;
}

.page-index__gifcode-tab-nav a.is-active,
.page-index__gifcode-tab-nav a[aria-selected="true"] {
  color: #017439; /* Primary color for active tab text */
  border-bottom-color: #017439; /* Primary color for active tab underline */
}

.page-index__gifcode-tab-nav a:hover {
  color: #017439;
}

.page-index__gifcode-panel {
  display: none;
}

.page-index__gifcode-panel.is-active {
  display: block;
}

.page-index__gifcode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1250px;
  margin: 0 auto;
}

.page-index__gifcode-col {
  flex: 1 1 calc(50% - 6px); /* Desktop: 2 columns */
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0; /* Allow flex items to shrink */
}

.page-index__gifcode-img {
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.page-index__gifcode-img:hover {
  transform: translateY(-2px);
}

.page-index__gifcode-img img {
  display: block;
  width: 100%;
  aspect-ratio: 370 / 127; /* Maintain aspect ratio */
  object-fit: cover;
  transition: transform 0.3s ease;
  min-height: 200px; /* 🚨 Min size requirement */
}

.page-index__gifcode-img:hover img {
  transform: scale(1.03);
}

.page-index__blog-section-title {
  color: #017439; /* Brand primary color for blog title */
  text-align: center;
  margin: 40px 0 20px;
  font-size: clamp(1rem, 3vw, 1.2rem); /* Responsive font size */
  font-weight: bold;
  text-transform: uppercase;
}

/* --- Module 3: Latest Articles Horizontal Slider --- */
.page-index__blog-slider {
  padding: 16px 0 32px;
  background: #ffffff; /* Light background for blog slider */
  box-sizing: border-box;
}

.page-index__blog-slider-wrap {
  position: relative;
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
}

.page-index__blog-slider-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* For Firefox */
  -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
  padding-bottom: 10px; /* Space for scrollbar on some systems */
}

.page-index__blog-slider-track::-webkit-scrollbar {
  display: none; /* For Chrome, Safari, Opera */
}

.page-index__post-item {
  flex: 0 0 calc((100% - (16px * 4)) / 5); /* Desktop: 5 cards with 4 gaps */
  scroll-snap-align: start;
  min-width: 0; /* Allow item to shrink below content size if necessary */
  background: #2c2c2c; /* Dark background for card */
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: #ffffff; /* Light text for dark card background */
}

.page-index__post-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-index__post-box {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%; /* Ensure consistent height for flex container */
}

.page-index__post-image {
  position: relative;
  overflow: hidden;
}

.page-index__post-cover {
  position: relative;
  padding-top: 120px; /* 🚨 Fixed height for cover image */
  overflow: hidden;
  background-color: #3a3a3a; /* Placeholder background */
}

.page-index__post-cover-link {
  display: block;
  position: absolute;
  inset: 0;
}