import 'package:flutter/material.dart';

import 'kc_colors.dart';

/// Shared typography scale for Kell Creations design system.
///
/// Provides a consistent text style hierarchy across web and mobile
/// applications. Use [applyKcTypography] to merge these styles into
/// a [TextTheme], or reference individual styles directly.
abstract final class KcTypography {
  // ── Display ──────────────────────────────────────────────────────────

  static const displayLarge = TextStyle(
    fontSize: 57,
    fontWeight: FontWeight.w400,
    letterSpacing: -0.25,
    color: KcColors.deepTeal,
  );

  static const displayMedium = TextStyle(
    fontSize: 45,
    fontWeight: FontWeight.w400,
    color: KcColors.deepTeal,
  );

  static const displaySmall = TextStyle(
    fontSize: 36,
    fontWeight: FontWeight.w400,
    color: KcColors.deepTeal,
  );

  // ── Headline ─────────────────────────────────────────────────────────

  static const headlineLarge = TextStyle(
    fontSize: 32,
    fontWeight: FontWeight.w700,
    color: KcColors.deepTeal,
  );

  static const headlineMedium = TextStyle(
    fontSize: 28,
    fontWeight: FontWeight.w700,
    color: KcColors.deepTeal,
  );

  static const headlineSmall = TextStyle(
    fontSize: 24,
    fontWeight: FontWeight.w600,
    color: KcColors.deepTeal,
  );

  // ── Title ────────────────────────────────────────────────────────────

  static const titleLarge = TextStyle(
    fontSize: 20,
    fontWeight: FontWeight.w600,
    color: KcColors.deepTeal,
  );

  static const titleMedium = TextStyle(
    fontSize: 16,
    fontWeight: FontWeight.w600,
    color: KcColors.deepTeal,
  );

  static const titleSmall = TextStyle(
    fontSize: 14,
    fontWeight: FontWeight.w600,
    color: KcColors.deepTeal,
  );

  // ── Body ─────────────────────────────────────────────────────────────

  static const bodyLarge = TextStyle(
    fontSize: 16,
    fontWeight: FontWeight.w400,
    color: KcColors.deepTeal,
  );

  static const bodyMedium = TextStyle(
    fontSize: 14,
    fontWeight: FontWeight.w400,
    color: KcColors.deepTeal,
  );

  static const bodySmall = TextStyle(
    fontSize: 12,
    fontWeight: FontWeight.w400,
    color: KcColors.deepTeal,
  );

  // ── Label ────────────────────────────────────────────────────────────

  static const labelLarge = TextStyle(
    fontSize: 14,
    fontWeight: FontWeight.w600,
    color: KcColors.deepTeal,
  );

  static const labelMedium = TextStyle(
    fontSize: 12,
    fontWeight: FontWeight.w600,
    color: KcColors.deepTeal,
  );

  static const labelSmall = TextStyle(
    fontSize: 11,
    fontWeight: FontWeight.w600,
    letterSpacing: 0.5,
    color: KcColors.deepTeal,
  );

  /// Applies the Kell Creations typography scale to the given [base]
  /// text theme (or a default one if omitted).
  static TextTheme applyKcTypography([TextTheme? base]) {
    return (base ?? const TextTheme()).copyWith(
      displayLarge: KcTypography.displayLarge,
      displayMedium: KcTypography.displayMedium,
      displaySmall: KcTypography.displaySmall,
      headlineLarge: KcTypography.headlineLarge,
      headlineMedium: KcTypography.headlineMedium,
      headlineSmall: KcTypography.headlineSmall,
      titleLarge: KcTypography.titleLarge,
      titleMedium: KcTypography.titleMedium,
      titleSmall: KcTypography.titleSmall,
      bodyLarge: KcTypography.bodyLarge,
      bodyMedium: KcTypography.bodyMedium,
      bodySmall: KcTypography.bodySmall,
      labelLarge: KcTypography.labelLarge,
      labelMedium: KcTypography.labelMedium,
      labelSmall: KcTypography.labelSmall,
    );
  }
}
