package com.tt.honeyDue.ui.theme

import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp

/**
 * Modern Typography Scale — matches iOS Design System.
 *
 * Target: iOS `.system(..., design: .rounded)` which is SF Pro Rounded on
 * Apple platforms. On Android Compose we fall back to [FontFamily.SansSerif]
 * — the system sans-serif (Roboto on Android) — which has a comparable
 * geometric feel and is always available without shipping custom fonts.
 *
 * Sizes are aligned with iOS dynamic-type defaults at the large accessibility
 * tier:
 *
 * | Compose token      | iOS UIFont.TextStyle | sp   |
 * |--------------------|----------------------|------|
 * | displayLarge       | —                    | 57   |
 * | displayMedium      | —                    | 45   |
 * | displaySmall       | —                    | 36   |
 * | headlineLarge      | largeTitle (-2)      | 32   |
 * | headlineMedium     | title1               | 28   |
 * | headlineSmall      | title2 (+2)          | 24   |
 * | titleLarge         | title2               | 22   |
 * | titleMedium        | title3               | 18   |
 * | titleSmall         | headline (-1)        | 16   |
 * | bodyLarge          | body                 | 17   |
 * | bodyMedium         | callout              | 15   |
 * | bodySmall          | footnote             | 13   |
 * | labelLarge         | subheadline (-1)     | 14   |
 * | labelMedium        | caption1             | 12   |
 * | labelSmall         | caption2             | 11   |
 *
 * Parity is exercised by
 * `composeApp/src/commonTest/kotlin/com/tt/honeyDue/ui/theme/TypographyTest.kt`.
 */
private val DefaultFontFamily = FontFamily.SansSerif

val AppTypography = Typography(
    // Display — hero sections
    displayLarge = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 57.sp,
        fontWeight = FontWeight.Bold,
        lineHeight = 64.sp
    ),
    displayMedium = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 45.sp,
        fontWeight = FontWeight.Bold,
        lineHeight = 52.sp
    ),
    displaySmall = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 36.sp,
        fontWeight = FontWeight.Bold,
        lineHeight = 44.sp
    ),

    // Headline — section headers
    headlineLarge = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 32.sp,
        fontWeight = FontWeight.Bold,
        lineHeight = 40.sp
    ),
    headlineMedium = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 28.sp, // iOS title1
        fontWeight = FontWeight.SemiBold,
        lineHeight = 36.sp
    ),
    headlineSmall = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 24.sp,
        fontWeight = FontWeight.SemiBold,
        lineHeight = 32.sp
    ),

    // Title — card titles
    titleLarge = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 22.sp, // iOS title2
        fontWeight = FontWeight.SemiBold,
        lineHeight = 28.sp
    ),
    titleMedium = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 18.sp,
        fontWeight = FontWeight.SemiBold,
        lineHeight = 24.sp
    ),
    titleSmall = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 16.sp,
        fontWeight = FontWeight.SemiBold,
        lineHeight = 20.sp
    ),

    // Body — main content
    bodyLarge = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 17.sp, // iOS body
        fontWeight = FontWeight.Normal,
        lineHeight = 24.sp
    ),
    bodyMedium = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 15.sp, // iOS callout
        fontWeight = FontWeight.Normal,
        lineHeight = 20.sp
    ),
    bodySmall = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 13.sp, // iOS footnote
        fontWeight = FontWeight.Normal,
        lineHeight = 16.sp
    ),

    // Label — labels and captions
    labelLarge = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 14.sp,
        fontWeight = FontWeight.Medium,
        lineHeight = 20.sp
    ),
    labelMedium = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 12.sp, // iOS caption1
        fontWeight = FontWeight.Medium,
        lineHeight = 16.sp
    ),
    labelSmall = TextStyle(
        fontFamily = DefaultFontFamily,
        fontSize = 11.sp, // iOS caption2
        fontWeight = FontWeight.Medium,
        lineHeight = 16.sp
    )
)
