/* style/index.css */
:root {
  --primary-color: #E53935;
  --secondary-color: #FF5A4F;
  --text-main-color: #333333;
  --card-bg-color: #FFFFFF;
  --background-color-page: #F5F7FA;
  --border-color: #E0E0E0;
}

.page-index {
  color: var(--text-main-color); /* Default text color for the page */
  background-color: var(--background-color-page);
}

/* -------------------------------------- */
/* 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;
  padding-top: 10px; /* As per rule, not var(--header-offset) */
  background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

.page-index__video-container {
  position: relative;
  width: 100%; /* Must be 100% for desktop flex layout */
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.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;
  border-radius: 8px;
  overflow: hidden;
}

.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 */
  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; /* Prevents video controls from blocking click event on parent link */
}

.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(0, 123, 255, 0.8);
  border-radius: 5px;
  white-space: nowrap;
}

.page-index__video-cta {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
}

.page-index__play-now-button {
  display: inline-block;
  padding: 15px 40px;
  background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-color) 100%);
  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;
}

.page-index__play-now-button:hover {
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  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/GifCode Area */
/* -------------------------------------- */
.page-index__promo-dark {
  background: #2c2c2c; /* Deep gray background */
  padding: 24px 16px;
  color: #ffffff; /* White text for dark background */
}

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

.page-index__gifcode-title {
  color: var(--primary-color);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 20px;
  font-size: 1.8rem;
  font-weight: bold;
}

.page-index__gifcode-tab-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 16px 0 30px;
}

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

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

.page-index__gifcode-tab-nav a.is-active,
.page-index__gifcode-tab-nav a:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.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);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.page-index__gifcode-img {
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-index__gifcode-img a {
  display: block;
}

.page-index__gifcode-img img {
  display: block;
  width: 100%;
  aspect-ratio: 370 / 127; /* Fixed aspect ratio for consistent card size */
  object-fit: cover;
  transition: transform 0.3s ease;
  border-radius: 4px;
}

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

.page-index__blog-section-title {
  color: var(--primary-color);
  text-align: center;
  margin: 40px 0 20px; /* Adjusted margin for spacing */
  font-size: 1.5rem;
  font-weight: bold;
}

/* -------------------------------------- */
/* Module 3: Latest Articles Slider */
/* -------------------------------------- */
.page-index__blog-slider {
  padding: 32px 0 40px;
  background-color: var(--background-color-page); /* Light background */
}

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

.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;
}

.page-index__blog-slider-track::-webkit-scrollbar {
  display: none; /* For Webkit browsers */
}

.page-index__post-item {
  flex: 0 0 calc((100% - 64px) / 5); /* 5 cards visible, 4 gaps of 16px */
  scroll-snap-align: start;
  min-width: 200px; /* Minimum width for cards */
  box-sizing: border-box;
}

.page-index__post-box {
  position: relative;
  background: #2c2c2c; /* Dark background for post box */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  height: 100%; /* Ensure all cards have same height */
  display: flex;
  flex-direction: column;
}

.page-index__post-image {
  position: relative;
  width: 100%;
}

.page-index__post-cover {
  position: relative;
  padding-top: 120px; /* Fixed height for cover image */
  overflow: hidden;
}

.page-index__post-cover-link {
  display: block;
}

.page-index__post-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.page-index__post-cover-link:hover img {
  transform: scale(1.05);
}

.page-index__post-text {
  padding: 15px;
  text-align: center;
  color: #ffffff;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-index__post-title {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1rem;
  line-height: 1.4;
}

.page-index__post-title a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

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

.page-index__post-divider {
  width: 40px;
  height: 2px;
  background: var(--primary-color);
  margin: 8px auto;
}

.page-index__post-excerpt {
  color: #bbb;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  -webkit-box-orient: vertical;
}

.page-index__post-date {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #ffffff;
  border: 2px solid var(--primary-color);
  border-radius: 4px;
  padding: 4px 8px;
  text-align: center;
  font-size: 12px;
  line-height: 1.2;
  color: var(--text-main-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-index__post-date-day {
  display: block;
  font-weight: 700;
  color: #333;
}

.page-index__post-date-month {
  display: block;
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(var(--primary-color), 0.8);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease;
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background: var(--primary-color);
}

.page-index__blog-slider-prev {
  left: 0;
}

.page-index__blog-slider-next {
  right: 0;
}

/* -------------------------------------- */
/* Responsive Design */
/* -------------------------------------- */
@media (max-width: 1024px) {
  .page-index__blog-slider-wrap {
    padding: 0 20px;
  }
  .page-index__blog-slider-prev { left: 5px; }
  .page-index__blog-slider-next { right: 5px; }
}

@media (max-width: 849px) {
  .page-index__post-item {
    flex: 0 0 calc((100% - 32px) / 3); /* 3 cards visible, 2 gaps of 16px */
  }
  .page-index__gifcode-title {
    font-size: 1.5rem;
  }
  .page-index__blog-section-title {
    font-size: 1.3rem;
  }
}