/* style/index.css */

/* Global styles for page-index scope */
.page-index {
  color: #FFF3E6; /* Text Main color */
  font-family: Arial, sans-serif;
  background-color: #0D0E12; /* Background color */
}

.page-index__section {
  padding: 20px 0;
  margin-bottom: 20px;
}

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

.page-index__section-title.tieudevip {
  text-align: center;
  font-size: 2.5em;
  font-weight: bold;
  color: #FF8C1A; /* Main color */
  margin-bottom: 30px;
  padding-bottom: 10px;
  border-bottom: 2px solid #A84F0C; /* Border color */
  text-shadow: 0 0 5px rgba(255, 140, 26, 0.5);
}

/* Module 0: Hero Carousel */
.page-index__hero-carousel-section {
  padding-top: 10px; /* Small top padding, assuming body handles header offset */
  background-color: #0D0E12;
}

.page-index__hero-slider {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.page-index__hero-slide {
  display: none;
  width: 100%;
}

.page-index__hero-slide.is-active {
  display: block;
}

.page-index__hero-slide img {
  width: 100%;
  height: auto;
  display: block;
  min-width: 200px; /* Minimum size requirement */
  min-height: 200px;
}

.page-index__hero-slider-prev,
.page-index__hero-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 1.5em;
  z-index: 10;
  border-radius: 4px;
}

.page-index__hero-slider-prev {
  left: 10px;
}

.page-index__hero-slider-next {
  right: 10px;
}

.page-index__hero-slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.page-index__hero-slider-dots::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
}

.page-index__hero-slider-dots .is-active::before {
  background-color: #FF8C1A; /* Main color */
}

/* Module 1: Operation Guide */
.page-index__guide-section {
  background-color: #0D0E12;
}

.page-index__guide-box {
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 20px 24px;
  background: #17191F; /* Card BG color */
  border-radius: 15px;
  box-sizing: border-box;
  border: 1px solid #A84F0C; /* Border color */
  box-shadow: 0 0 15px rgba(255, 140, 26, 0.3);
}

.page-index__guide-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 15px;
}

.page-index__guide-card {
  display: block;
  flex: 0 0 calc(20% - 12px); /* 5 cards per row, accounting for gap */
  max-width: calc(20% - 12px);
  text-decoration: none;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
}

.page-index__guide-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(255, 165, 58, 0.5);
}

.page-index__guide-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 250 / 350; /* Fixed aspect ratio for vertical images */
  object-fit: contain;
  display: block;
  min-width: 200px;
  min-height: 200px;
  border-radius: 8px;
}

/* PC錯落：中間高、兩邊平行 */
.page-index__guide-card--pos-1,
.page-index__guide-card--pos-5 { padding-top: 50px; }
.page-index__guide-card--pos-2,
.page-index__guide-card--pos-4 { padding-top: 25px; }
.page-index__guide-card--pos-3 { padding-top: 0; }

/* Module 2: Home Content Long Text Area */
.page-index__home-content-section {
  background-color: #0D0E12;
  padding-bottom: 40px;
}

.page-index__home-content-row {
  display: flex;
  justify-content: center;
}

.page-index__home-content-box {
  max-width: 91%;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  border: 5px solid #FF8C1A; /* Main color border */
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(255, 140, 26, 0.5);
  height: 700px; /* Fixed height for desktop */
  text-align: left;
  box-sizing: border-box;
  background-color: #17191F; /* Card BG color */
}

.page-index__home-content-inner {
  height: 100%;
  overflow-y: auto; /* Scrollable content */
  overflow-x: hidden;
  padding-right: 15px; /* Space for scrollbar */
  color: #FFF3E6;
}

.page-index__home-content-inner::-webkit-scrollbar {
  width: 8px;
}

.page-index__home-content-inner::-webkit-scrollbar-track {
  background: #0D0E12;
  border-radius: 10px;
}

.page-index__home-content-inner::-webkit-scrollbar-thumb {
  background: #FF8C1A;
  border-radius: 10px;
}

.page-index__home-content-title {
  font-size: 2.2em;
  font-weight: bold;
  color: #FF8C1A;
  margin-bottom: 20px;
  text-align: center;
}

.page-index__home-content-inner h2 {
  font-size: 1.8em;
  color: #FFA53A; /* Auxiliary color */
  margin-top: 30px;
  margin-bottom: 15px;
  border-bottom: 1px solid #A84F0C;
  padding-bottom: 5px;
}

.page-index__home-content-inner h3 {
  font-size: 1.5em;
  color: #FFB04D; /* Glow color */
  margin-top: 25px;
  margin-bottom: 10px;
}

.page-index__home-content-inner p {
  margin-bottom: 15px;
  line-height: 1.6;
}

.page-index__home-content-inner ul,
.page-index__home-content-inner ol {
  margin-bottom: 15px;
  padding-left: 20px;
}

.page-index__home-content-inner li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.page-index__wp-caption {
  max-width: 100%;
  margin: 20px auto;
  text-align: center;
}

.page-index__wp-caption img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  min-width: 200px;
  min-height: 200px;
}

.page-index__wp-caption figcaption {
  font-style: italic;
  font-size: 0.9em;
  color: #A84F0C; /* Border color */
  margin-top: 10px;
}

.page-index__home-content-inner .highlight {
  color: #FFB04D; /* Use Glow for highlights */
  font-weight: bold;
}

/* Module 3: Latest Blog Posts */
.page-index__blog-section {
  background-color: #0D0E12;
  padding-bottom: 40px;
}

.page-index__blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Changed to 3 columns for better fit with 6-8 cards */
  gap: 20px;
  margin-top: 30px;
}

.page-index__blog-card {
  background-color: #17191F; /* Card BG color */
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #A84F0C;
}

.page-index__blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(255, 140, 26, 0.4);
}

.page-index__blog-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.page-index__blog-media {
  position: relative;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
}

.page-index__blog-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  min-width: 200px;
  min-height: 200px;
}

.page-index__blog-date {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(180deg, #FFA53A 0%, #D96800 100%); /* Button gradient */
  color: #FFF3E6;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 0.8em;
  font-weight: bold;
  text-align: center;
  line-height: 1.2;
}

.page-index__blog-date span:first-child {
  display: block;
  font-size: 1.2em;
}

.page-index__blog-title {
  font-size: 1.2em;
  font-weight: bold;
  color: #FFB04D; /* Glow color */
  padding: 15px;
  margin-bottom: 5px;
  line-height: 1.4;
}

.page-index__blog-excerpt {
  font-size: 0.9em;
  color: #FFF3E6;
  padding: 0 15px 15px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  -webkit-box-orient: vertical;
}

.page-index__view-all-posts {
  text-align: center;
  margin-top: 40px;
}

/* Module 4: App Download Promotion */
.page-index__app-download-section {
  background-color: #0D0E12;
  padding-bottom: 60px;
}

.page-index__app-download-box {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background-color: #17191F; /* Card BG color */
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 0 20px rgba(255, 140, 26, 0.3);
  border: 1px solid #A84F0C;
  gap: 30px;
}

.page-index__app-download-text {
  flex: 1;
  text-align: center;
}

.page-index__app-download-title {
  font-size: 2em;
  color: #FF8C1A; /* Main color */
  margin-bottom: 20px;
}

.page-index__app-download-description {
  font-size: 1.1em;
  color: #FFF3E6;
  margin-bottom: 30px;
  line-height: 1.6;
}

.page-index__app-download-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.page-index__app-download-image {
  flex: 0 0 400px;
  max-width: 400px;
  text-align: center;
}

.page-index__app-download-image img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  min-width: 200px;
  min-height: 200px;
}

/* Buttons */
.page-index__btn-primary {
  display: inline-block;
  padding: 12px 25px;
  background: linear-gradient(180deg, #FFA53A 0%, #D96800 100%); /* Button gradient */
  color: #FFF3E6;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1em;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__section-title.tieudevip {
    font-size: 2em;
  }

  .page-index__guide-grid {
    gap: 10px;
  }

  .page-index__guide-card {
    flex: 0 0 calc(25% - 8px); /* 4 cards per row */
    max-width: calc(25% - 8px);
  }

  .page-index__blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-index__app-download-box {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }

  .page-index__app-download-image {
    flex: none;
    max-width: 80%;
    margin-top: 20px;
  }
}

@media (max-width: 768px) {
  .page-index__section-content {
    padding: 0 10px;
  }

  .page-index__section-title.tieudevip {
    font-size: 1.8em;
    margin-bottom: 20px;
  }

  /* Hero Carousel */
  .page-index__hero-carousel-section {
    padding-top: 10px !important; /* Small top padding, no double offset */
  }

  .page-index__hero-slider-prev,
  .page-index__hero-slider-next {
    padding: 8px 12px;
    font-size: 1.2em;
  }

  /* Operation Guide */
  .page-index__guide-box {
    padding: 15px;
  }

  .page-index__guide-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* Use 6-column grid for 2-then-3 layout */
    gap: 8px;
  }

  .page-index__guide-card {
    flex: none;
    max-width: none;
    padding-top: 0 !important; /* Reset PC padding-top */
  }

  .page-index__guide-card--pos-1,
  .page-index__guide-card--pos-2 {
    grid-column: span 3; /* First two cards span 3 columns each (50%) */
  }

  .page-index__guide-card--pos-3,
  .page-index__guide-card--pos-4,
  .page-index__guide-card--pos-5 {
    grid-column: span 2; /* Next three cards span 2 columns each (33.33%) */
  }

  .page-index__guide-card img {
    min- /* Adjust min-width for mobile */
    min-height: 210px; /* Maintain aspect ratio */
  }

  /* Home Content Long Text Area */
  .page-index__home-content-box {
    max-width: 100%;
    height: auto; /* Auto height for mobile */
    padding: 15px;
    border-width: 3px;
  }

  .page-index__home-content-inner {
    height: auto; /* Auto height for mobile */
    overflow: visible; /* No scrollbar on mobile */
    padding-right: 0;
  }

  .page-index__home-content-title {
    font-size: 1.8em;
  }

  .page-index__home-content-inner h2 {
    font-size: 1.5em;
  }

  .page-index__home-content-inner h3 {
    font-size: 1.2em;
  }

  /* Blog Section */
  .page-index__blog-grid {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 15px;
  }

  .page-index__blog-card-media img,
  .page-index__blog-card img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* App Download */
  .page-index__app-download-box {
    padding: 20px 10px;
  }

  .page-index__app-download-title {
    font-size: 1.5em;
  }

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

  .page-index__app-download-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px;
  }

  .page-index__app-download-image {
    max-width: 90%;
  }

  /* General Image and Button Responsiveness */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }

  .page-index__section,
  .page-index__card,
  .page-index__container,
  .page-index__app-download-box {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 10px;
    padding-right: 10px;
  }

  .page-index__cta-button,
  .page-index__btn-primary,
  .page-index__btn-secondary,
  .page-index a[class*="button"],
  .page-index 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-index__cta-buttons,
  .page-index__button-group,
  .page-index__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 10px;
    padding-right: 10px;
    flex-wrap: wrap !important;
    gap: 10px;
    display: flex;
    flex-direction: column;
  }
}