/// Responsive layout breakpoint utilities for Kell Creations.
///
/// Provides named breakpoints and helper methods for building responsive
/// layouts that adapt between mobile, tablet, and desktop form factors.
///
/// Usage:
/// ```dart
/// if (KcBreakpoints.isDesktop(MediaQuery.of(context).size.width)) {
///   // desktop layout
/// }
/// ```
abstract final class KcBreakpoints {
  /// Maximum width considered "compact" (phone portrait).
  static const double compact = 600;

  /// Maximum width considered "medium" (tablet / phone landscape).
  static const double medium = 900;

  /// Maximum width considered "expanded" (small desktop / large tablet).
  static const double expanded = 1200;

  /// Anything wider than [expanded] is "large" (full desktop).

  // ── Named queries ────────────────────────────────────────────────────

  /// True when the available width is below the compact breakpoint.
  static bool isCompact(double width) => width < compact;

  /// True when the available width is at least compact but below medium.
  static bool isMedium(double width) => width >= compact && width < medium;

  /// True when the available width is at least medium but below expanded.
  static bool isExpanded(double width) => width >= medium && width < expanded;

  /// True when the available width is at or above the expanded breakpoint.
  static bool isLarge(double width) => width >= expanded;

  /// True when the width is at least [medium] (tablet-and-up).
  static bool isTabletOrLarger(double width) => width >= medium;

  /// True when the width is at least [compact] but below [medium].
  static bool isTablet(double width) => isMedium(width);

  /// True when the width is below [compact] (phone).
  static bool isMobile(double width) => isCompact(width);

  /// True when the width is at least [medium] (desktop-class).
  static bool isDesktop(double width) => width >= medium;

  // ── Grid helpers ─────────────────────────────────────────────────────

  /// Returns a suggested grid cross-axis count based on the available [width].
  ///
  /// Useful for GridView layouts that adapt column count to screen size.
  static int gridColumns(double width) {
    if (width >= expanded) return 4;
    if (width >= medium) return 3;
    if (width >= compact) return 2;
    return 1;
  }
}
