/**
 * Bengal SSG Default Theme
 * Page Header Component
 *
 * Standardized page header styling for all content types.
 * Replaces individual header classes (docs-header, blog-header, tutorial-header, etc.)
 *
 * Usage:
 * <header class="page-header">
 *   <h1>Page Title</h1>
 *   <p class="lead">Optional description</p>
 * </header>
 *
 * Modifiers:
 * .page-header--centered    - Center-aligned header
 * .page-header--compact     - Smaller heading sizes for dense layouts
 * .page-header--bordered    - Add bottom border
 */

/* ============================================
   BASE PAGE HEADER
   ============================================ */

.page-header {
  margin-bottom: var(--space-6); /* Reduced from --space-8 (32px) to --space-6 (24px) for tighter spacing */
}

/* Reuse prose heading styles - inherit font properties, adjust margins for header context */
.page-header h1 {
  font-size: var(--type-h1);
  font-weight: var(--weight-extrabold);
  line-height: 1.2;
  letter-spacing: var(--letter-spacing-tighter);
  margin: 0 0 var(--space-3) 0; /* Tighter bottom margin for headers */
}

.page-header h2 {
  font-size: var(--type-h2);
  font-weight: var(--weight-bold);
  line-height: var(--type-leading-heading);
  letter-spacing: var(--letter-spacing-tight);
  margin: 0 0 var(--space-2) 0;
  border-bottom: none; /* No border in headers */
}

.page-header h3 {
  font-size: var(--type-h3);
  font-weight: var(--weight-semibold);
  line-height: var(--type-leading-heading);
  margin: 0 0 var(--space-2) 0;
}

/* Lead paragraph styling (defined in typography.css, reinforced here for specificity) */
.page-header .lead {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  font-weight: 200;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

/* ============================================
   MODIFIERS
   ============================================ */

/* Classic variant - uses action-bar + standard layout */
.page-header--classic {
  /* Inherits base .page-header styles */
}

/* Centered variant - for landing pages, blog indexes, etc. */
.page-header--centered {
  text-align: center;
  padding: var(--space-8) 0;
}

.page-header--centered .lead {
  max-width: 600px;
  margin-inline: auto; /* Changed from margin-left/right */
}

.page-header--centered .page-header__icon {
  margin-inline: auto; /* Changed from margin-left/right */
}

/* Compact variant - smaller headings for dense layouts */
.page-header--compact h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-2);
}

.page-header--compact h2 {
  font-size: var(--text-2xl);
}

.page-header--compact h3 {
  font-size: var(--text-xl);
}

.page-header--compact .lead {
  font-size: var(--text-base);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
}

/* Bordered variant - adds bottom border to entire header */
.page-header--bordered {
  padding-bottom: var(--space-6);
  border-block-end: 1px solid var(--color-border); /* Changed from border-bottom */
}

/* No-margin variant - for tight layouts */
.page-header--no-margin {
  margin-bottom: 0;
}

/* ============================================
   HEADER METADATA
   ============================================ */

/* Optional metadata/stats section in header */
.page-header__meta {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-block-start: 1px solid var(--color-border-light); /* Changed from border-top */
}

.page-header__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

/* Icons in header (optional) */
.page-header__icon {
  font-size: var(--text-3xl);
  line-height: 1;
  margin-bottom: var(--space-3);
}

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

@media (max-width: 768px) {
  /* Responsive sizes handled by prose styles - just adjust margins if needed */

  .page-header .lead {
    font-size: var(--text-base);
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
  }

  .page-header--centered {
    padding: var(--space-6) 0;
  }

  .page-header__meta {
    flex-direction: column;
    gap: var(--space-3);
  }
}

@media (max-width: 480px) {
  /* Responsive sizes handled by prose styles */

  .page-header--centered {
    padding: var(--space-4) 0;
  }
}
