/**
 * Bengal SSG Default Theme
 * Documentation Home Page Components
 *
 * Styles for the doc/home.html template - documentation landing pages.
 * Aligned with Bengal's neumorphic design system.
 *
 * Uses tokens from: tokens/semantic.css, tokens/foundation.css
 */

/* ============================================
   DOCS HOME CONTAINER
   ============================================ */

.docs-home {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* ============================================
   HERO SECTION
   ============================================ */

.docs-home-hero {
  padding: var(--space-12) 0 var(--space-8);
  text-align: center;
}

.docs-home-hero-content {
  max-width: var(--container-md);
  margin-inline: auto;
}

.docs-home-title {
  margin: 0 0 var(--space-4) 0;
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text-primary);
}

.docs-home-subtitle {
  margin: 0;
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  max-width: var(--container-prose, 65ch);
  margin-inline: auto;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.docs-home-content {
  max-width: var(--container-lg);
  margin: var(--space-8) auto;
  padding: 0;
}

/* When docs-home-content has prose class, constrain text blocks for readability */
.docs-home-content.prose > p,
.docs-home-content.prose > ul,
.docs-home-content.prose > ol,
.docs-home-content.prose > blockquote {
  max-width: var(--container-prose, 65ch);
  margin-inline: auto;
}

/* ============================================
   DOCUMENTATION SECTIONS - Grid of Section Cards
   ============================================ */

.docs-home-sections {
  padding: var(--space-10) 0;
}

.docs-home-sections-title {
  margin: 0 0 var(--space-8) 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  text-align: center;
}

.docs-home-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-6);
}

/* Section Card - Neumorphic clickable style */
.docs-home-section-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);

  /* Neumorphic background gradient */
  background: linear-gradient(180deg,
    var(--color-surface, var(--color-bg-elevated)),
    var(--color-bg-secondary));

  /* Standard border */
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);

  /* Neumorphic shadow */
  box-shadow: var(--neumorphic-base);

  /* Link styling */
  text-decoration: none;
  color: inherit;

  /* Smooth transitions */
  transition:
    transform var(--motion-medium) var(--ease-out),
    box-shadow var(--motion-medium) var(--ease-out),
    border-color var(--motion-fast);
}

.docs-home-section-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow: var(--neumorphic-hover);
}

.docs-home-section-card:active {
  transform: translateY(0) scale(0.99);
  box-shadow: var(--neumorphic-pressed);
}

.docs-home-section-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  transition: color var(--motion-fast);
}

.docs-home-section-card:hover .docs-home-section-title {
  color: var(--color-primary);
}

.docs-home-section-description {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  flex: 1;
}

.docs-home-section-count {
  display: inline-flex;
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   QUICK LINKS SECTION
   ============================================ */

.docs-home-quick-links {
  padding: var(--space-10) 0 var(--space-12);
}

.docs-home-quick-links-title {
  margin: 0 0 var(--space-8) 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  text-align: center;
}

.docs-home-quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-6);
}

/* Quick Link Card - Neumorphic clickable style */
.docs-home-quick-link-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);

  /* Neumorphic background */
  background: linear-gradient(180deg,
    var(--color-surface, var(--color-bg-elevated)),
    var(--color-bg-secondary));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--neumorphic-base);

  text-decoration: none;
  color: inherit;

  transition:
    transform var(--motion-medium) var(--ease-out),
    box-shadow var(--motion-medium) var(--ease-out),
    border-color var(--motion-fast);
}

.docs-home-quick-link-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary);
  box-shadow: var(--neumorphic-hover);
}

.docs-home-quick-link-card:active {
  transform: translateY(0) scale(0.99);
  box-shadow: var(--neumorphic-pressed);
}

/* Quick Link Icon - Neumorphic badge */
.docs-home-quick-link-icon {
  font-size: 1.75rem;
  line-height: 1;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(180deg,
    var(--color-surface, var(--color-bg-elevated)),
    var(--color-bg-tertiary));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--neumorphic-subtle);

  transition: transform var(--motion-fast), box-shadow var(--motion-fast);
}

.docs-home-quick-link-card:hover .docs-home-quick-link-icon {
  transform: scale(1.05);
  box-shadow: var(--neumorphic-hover);
}

.docs-home-quick-link-card h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  transition: color var(--motion-fast);
}

.docs-home-quick-link-card:hover h3 {
  color: var(--color-primary);
}

.docs-home-quick-link-card p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .docs-home-section-card,
  .docs-home-quick-link-card {
    transition: none !important;
  }

  .docs-home-section-card:hover,
  .docs-home-quick-link-card:hover {
    transform: none !important;
  }

  .docs-home-quick-link-card:hover .docs-home-quick-link-icon {
    transform: none !important;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .docs-home {
    padding-inline: var(--space-4);
  }

  .docs-home-hero {
    padding: var(--space-8) 0 var(--space-6);
  }

  .docs-home-title {
    font-size: var(--text-3xl);
  }

  .docs-home-subtitle {
    font-size: var(--text-lg);
  }

  .docs-home-sections,
  .docs-home-quick-links {
    padding: var(--space-8) 0;
  }

  .docs-home-sections-title,
  .docs-home-quick-links-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-6);
  }

  .docs-home-sections-grid,
  .docs-home-quick-links-grid {
    gap: var(--space-4);
  }

  .docs-home-section-card,
  .docs-home-quick-link-card {
    padding: var(--space-5);
  }
}

@media (max-width: 480px) {
  .docs-home-sections-grid,
  .docs-home-quick-links-grid {
    grid-template-columns: 1fr;
  }

  .docs-home-section-card,
  .docs-home-quick-link-card {
    padding: var(--space-4);
  }

  .docs-home-quick-link-icon {
    font-size: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
  }
}

/* ============================================
   PRINT
   ============================================ */

@media print {
  .docs-home {
    max-width: none;
    padding: 0;
  }

  .docs-home-hero {
    padding: 1rem 0;
  }

  .docs-home-sections,
  .docs-home-quick-links {
    padding: 1rem 0;
  }

  .docs-home-section-card,
  .docs-home-quick-link-card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}
