/* home.css — Homepage only */

/* HERO */
.home-hero {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  max-width: 800px;
  margin: 0 auto;
}

.home-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--color-primary);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.home-hero-sub { 
  color: var(--color-muted); 
  margin-top: 1.25rem; 
  font-size: 1.1rem; 
  font-weight: 400;
}

/* CATEGORY GRID */
.home-categories { max-width: 1000px; margin: 0 auto 4rem; padding: 0 1.5rem; }

.home-categories h2,
.home-blog h2 {
  font-family: var(--font-heading);
  color: var(--color-text);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.cat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.cat-card:hover { 
  box-shadow: var(--shadow-lg); 
  border-color: #93c5fd; 
  transform: translateY(-2px);
  text-decoration: none; 
}

.cat-card-label { font-weight: 700; color: var(--color-primary); font-size: 1.05rem; line-height: 1.3; }
.cat-card-count { font-size: 0.85rem; color: var(--color-muted); }

/* BLOG CAROUSEL */
.home-blog { max-width: 1000px; margin: 0 auto 4rem; padding: 0 1.5rem; }

.blog-carousel-wrapper {
  display: flex; align-items: center; gap: 1rem;
}

.blog-carousel-track {
  display: flex; flex: 1; overflow: hidden; gap: 1.5rem; min-height: 320px;
  padding: 0.5rem 0; /* space for shadows */
}

/* Cards: hidden by default, .visible = shown */
.blog-card {
  display: none;
  flex: 0 0 calc((100% - 3rem) / 3);
  min-width: 0;
}

.blog-card.visible {
  display: flex; flex-direction: column;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid var(--color-border);
}

.blog-card.visible:hover { 
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.blog-card-link { display: flex; flex-direction: column; text-decoration: none; height: 100%; }

.blog-card-thumb-wrap { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #e2e8f0; }

.blog-card-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }

.blog-card.visible:hover .blog-card-thumb { transform: scale(1.05); }

.blog-card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }

.blog-card-cat { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-accent); font-weight: 700; }

.blog-card-title { font-family: var(--font-heading); font-size: 1.1rem; color: var(--color-text); line-height: 1.4; margin: 0; font-weight: 600;}

.blog-card-date { font-size: 0.8rem; color: var(--color-muted); margin-top: auto; padding-top: 0.5rem;}

/* PREV / NEXT */
.carousel-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50%; width: 44px; height: 44px;
  font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--color-primary);
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.carousel-btn:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); transform: scale(1.05);}

/* DOTS */
.carousel-dots { display: flex; justify-content: center; gap: 0.6rem; margin-top: 1.5rem; }

.carousel-dot {
  width: 10px; height: 10px; border-radius: 50%; border: none;
  background: #cbd5e1; cursor: pointer; padding: 0;
  transition: background 0.3s, transform 0.3s;
}

.carousel-dot.active { background: var(--color-accent); transform: scale(1.3); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .blog-card { flex: 0 0 100%; }
  /* Show only 1 card on mobile: hide 2nd and 3rd visible card */
  .blog-card.visible ~ .blog-card.visible { display: none; }
  .carousel-btn { width: 36px; height: 36px; }
  .home-hero h1 { font-size: 2.2rem; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .blog-card { flex: 0 0 calc((100% - 1.5rem) / 2); }
  /* Show only 2 cards on tablet */
  .blog-card.visible ~ .blog-card.visible ~ .blog-card.visible { display: none; }
}
