/* ==========================================================================
   KMSP Home Page — Video Gallery Grid Layout
   Extends: site-wide.css (inherits dark theme, header, footer, etc.)
   Only homepage-specific: grid, card layout, video embed, animations
   ========================================================================== */

/* ---------- 1. Grid Layout ---------- */
body.home #site-content {
  max-width: 1280px !important;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Remove separator lines between posts */
body.home .post-separator.styled-separator {
  display: none !important;
}

/* ---------- 2. Article Card ---------- */
body.home #site-content > article.post {
  background: var(--kmsp-bg-card);
  border-radius: var(--kmsp-radius);
  overflow: hidden;
  box-shadow: var(--kmsp-shadow);
  border: 1px solid var(--kmsp-border);
  transition: var(--kmsp-transition);
  display: flex;
  flex-direction: column;
}

body.home #site-content > article.post:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(183, 28, 28, 0.3), 0 4px 20px rgba(0,0,0,0.5);
  border-color: var(--kmsp-accent);
}

/* ---------- 3. Entry Header (inside card) ---------- */
body.home .entry-header {
  padding: 1rem 1.2rem 0.5rem !important;
  background: transparent !important;
  order: 2;
  border-bottom: none;
}

body.home .entry-header.has-text-align-center {
  text-align: left !important;
}

body.home .entry-header-inner.section-inner.medium {
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ---------- 4. Entry Title ---------- */
body.home .entry-title.heading-size-1 {
  font-size: 1rem !important;
  line-height: 1.5 !important;
  font-weight: 800 !important;
  margin: 0.3rem 0 0.5rem !important;
}

body.home .entry-title a {
  color: var(--kmsp-text) !important;
  text-decoration: none !important;
  transition: var(--kmsp-transition);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.home .entry-title a:hover {
  color: var(--kmsp-accent) !important;
}

/* ---------- 5. Category Tags ---------- */
body.home .entry-categories {
  margin-bottom: 0.3rem !important;
}

body.home .entry-categories a {
  background: var(--kmsp-primary) !important;
  color: #ffffff !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  padding: 0.2rem 0.6rem !important;
  border-radius: 20px !important;
  text-decoration: none !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--kmsp-transition);
  display: inline-block;
}

body.home .entry-categories a:hover {
  background: var(--kmsp-accent) !important;
  transform: scale(1.05);
}

/* ---------- 6. Hide Meta Info ---------- */
body.home .post-meta-wrapper,
body.home .post-meta,
body.home .post-author,
body.home .post-date,
body.home .post-comment-link {
  display: none !important;
}

/* ---------- 7. Video Content Area ---------- */
body.home .post-inner {
  order: 1;
  padding: 0 !important;
  max-width: 100% !important;
  position: relative;
}

body.home .post-inner.thin {
  max-width: 100% !important;
}

body.home .entry-content {
  padding: 0 !important;
  margin: 0 !important;
}

/* Video responsive container */
body.home .entry-content iframe {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  display: block;
  border-radius: var(--kmsp-radius) var(--kmsp-radius) 0 0;
}

/* View count overlay */
body.home .entry-content > p:first-child {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0,0,0,0.75);
  color: var(--kmsp-gold);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px 0 0 0;
  margin: 0;
  z-index: 2;
  backdrop-filter: blur(4px);
}

/* ---------- 8. Section Inner (Bottom area) ---------- */
body.home article.post > .section-inner {
  display: none !important;
}

/* ---------- 9. Pagination (Grid-spanning) ---------- */
body.home .pagination-wrapper,
body.home .nav-links {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 0;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  body.home #site-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    padding: 1.5rem 1rem;
  }

  body.home .entry-title.heading-size-1 {
    font-size: 0.95rem !important;
  }
}

@media (max-width: 700px) {
  body.home #site-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    padding: 1rem 0.6rem;
  }

  body.home .entry-title.heading-size-1 {
    font-size: 0.85rem !important;
    -webkit-line-clamp: 2;
  }

  body.home .entry-header {
    padding: 0.6rem 0.8rem 0.6rem !important;
  }

  body.home .entry-categories a {
    font-size: 0.6rem !important;
    padding: 0.15rem 0.5rem !important;
  }
}

@media (max-width: 480px) {
  body.home #site-content {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.8rem;
  }

  body.home .entry-title.heading-size-1 {
    font-size: 1rem !important;
  }
}

/* ==========================================================================
   ANIMATION — Fade-in
   ========================================================================== */
@keyframes kmsp-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.home #site-content > article.post {
  animation: kmsp-fadeInUp 0.5s ease-out both;
}

body.home #site-content > article.post:nth-child(1)  { animation-delay: 0.05s; }
body.home #site-content > article.post:nth-child(2)  { animation-delay: 0.10s; }
body.home #site-content > article.post:nth-child(3)  { animation-delay: 0.15s; }
body.home #site-content > article.post:nth-child(4)  { animation-delay: 0.20s; }
body.home #site-content > article.post:nth-child(5)  { animation-delay: 0.25s; }
body.home #site-content > article.post:nth-child(6)  { animation-delay: 0.30s; }
body.home #site-content > article.post:nth-child(7)  { animation-delay: 0.35s; }
body.home #site-content > article.post:nth-child(8)  { animation-delay: 0.40s; }
body.home #site-content > article.post:nth-child(9)  { animation-delay: 0.45s; }
body.home #site-content > article.post:nth-child(10) { animation-delay: 0.50s; }
