/**
 * Fluid Typography System
 * Responsive typography using clamp() for smooth scaling across all devices.
 *
 * @package Anora
 * @version 1.0.0
 */

/* ==========================================================================
   CSS CUSTOM PROPERTIES — FLUID TYPE SCALE
   ========================================================================== */

:root {
    /* Display sizes — hero sections */
    --font-size-display-xl: clamp(2.5rem, 5vw + 1rem, 4.5rem);
    /* 40px → 72px */
    --font-size-display-lg: clamp(2rem, 4vw + 1rem, 3.75rem);
    /* 32px → 60px */
    --font-size-display-md: clamp(1.75rem, 3.5vw + 0.5rem, 3rem);
    /* 28px → 48px */

    /* Heading sizes */
    --font-size-h1: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
    /* 28px → 40px */
    --font-size-h2: clamp(1.5rem, 2.5vw + 0.5rem, 2rem);
    /* 24px → 32px */
    --font-size-h3: clamp(1.25rem, 2vw + 0.25rem, 1.5rem);
    /* 20px → 24px */
    --font-size-h4: clamp(1.125rem, 1.5vw + 0.25rem, 1.25rem);
    /* 18px → 20px */
    --font-size-h5: clamp(1rem, 1vw + 0.25rem, 1.125rem);
    /* 16px → 18px */
    --font-size-h6: clamp(0.875rem, 0.5vw + 0.5rem, 1rem);
    /* 14px → 16px */

    /* Body text sizes */
    --font-size-body-lg: clamp(1.125rem, 1vw + 0.5rem, 1.25rem);
    /* 18px → 20px */
    --font-size-body: clamp(1rem, 0.5vw + 0.75rem, 1.125rem);
    /* 16px → 18px */
    --font-size-body-sm: clamp(0.875rem, 0.5vw + 0.5rem, 1rem);
    /* 14px → 16px */
    --font-size-body-xs: clamp(0.75rem, 0.25vw + 0.5rem, 0.875rem);
    /* 12px → 14px */

    /* Line heights */
    --line-height-tight: 1.2;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 1.75;

    /* Letter spacing */
    --letter-spacing-tight: -0.02em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
}

/* ==========================================================================
   BASE TYPOGRAPHY
   ========================================================================== */

html {
    font-size: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-size: var(--font-size-body);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-normal);
}

/* ==========================================================================
   DISPLAY TEXT — Hero Sections
   ========================================================================== */

.display-xl,
.hero-title-xl {
    font-size: var(--font-size-display-xl);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    font-weight: 700;
    margin-bottom: 0.5em;
}

.display-lg,
.hero-title-lg {
    font-size: var(--font-size-display-lg);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    font-weight: 700;
    margin-bottom: 0.5em;
}

.display-md,
.hero-title {
    font-size: var(--font-size-display-md);
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-tight);
    font-weight: 700;
    margin-bottom: 0.5em;
}

/* ==========================================================================
   HEADINGS
   ========================================================================== */

h1,
.h1 {
    font-size: var(--font-size-h1);
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-tight);
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.75em;
}

h2,
.h2 {
    font-size: var(--font-size-h2);
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-tight);
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.75em;
}

h3,
.h3 {
    font-size: var(--font-size-h3);
    line-height: var(--line-height-normal);
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.75em;
}

h4,
.h4 {
    font-size: var(--font-size-h4);
    line-height: var(--line-height-normal);
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.75em;
}

h5,
.h5 {
    font-size: var(--font-size-h5);
    line-height: var(--line-height-normal);
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.75em;
}

h6,
.h6 {
    font-size: var(--font-size-h6);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-wide);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 0.75em;
}

/* ==========================================================================
   BODY TEXT
   ========================================================================== */

p,
.body-text {
    font-size: var(--font-size-body);
    line-height: var(--line-height-relaxed);
    margin-top: 0;
    margin-bottom: 1.25em;
}

.lead-text,
.intro-text {
    font-size: var(--font-size-body-lg);
    line-height: var(--line-height-relaxed);
    font-weight: 400;
    margin-bottom: 1.5em;
}

.small-text {
    font-size: var(--font-size-body-sm);
    line-height: var(--line-height-normal);
}

.tiny-text {
    font-size: var(--font-size-body-xs);
    line-height: var(--line-height-normal);
}

/* ==========================================================================
   COMPONENT TYPOGRAPHY
   ========================================================================== */

/* Hero */
.hero-section h1,
.hero-section .hero-title {
    font-size: var(--font-size-display-lg);
    line-height: var(--line-height-tight);
    font-weight: 700;
    margin-bottom: 0.5em;
}

.hero-section .hero-subtitle,
.hero-section p {
    font-size: var(--font-size-body-lg);
    line-height: var(--line-height-relaxed);
    margin-bottom: 1.5em;
    opacity: 0.9;
}

/* Cards / Posts */
.card-title,
.post-title {
    font-size: var(--font-size-h3);
    line-height: var(--line-height-snug);
    font-weight: 600;
    margin-bottom: 0.5em;
}

.card-text,
.post-excerpt {
    font-size: var(--font-size-body-sm);
    line-height: var(--line-height-relaxed);
}

/* Section headings */
.section-title {
    font-size: var(--font-size-h2);
    line-height: var(--line-height-snug);
    font-weight: 700;
    margin-bottom: 1em;
    text-align: center;
}

.section-subtitle {
    font-size: var(--font-size-body-lg);
    line-height: var(--line-height-relaxed);
    text-align: center;
    margin-bottom: 2em;
    opacity: 0.85;
}

/* Buttons */
.btn,
button,
.button {
    font-size: var(--font-size-body-sm);
    line-height: 1;
    letter-spacing: var(--letter-spacing-wide);
    font-weight: 600;
}

.btn-lg {
    font-size: var(--font-size-body);
}

.btn-sm {
    font-size: var(--font-size-body-xs);
}

/* Navigation */
.nav-menu a,
.menu-item a {
    font-size: var(--font-size-body-sm);
    line-height: 1;
    font-weight: 500;
}

/* Forms */
label,
.form-label {
    font-size: var(--font-size-body-sm);
    line-height: var(--line-height-normal);
    font-weight: 500;
    margin-bottom: 0.5em;
    display: block;
}

input,
textarea,
select,
.form-control {
    font-size: var(--font-size-body);
    line-height: var(--line-height-normal);
}

::placeholder {
    font-size: var(--font-size-body-sm);
    opacity: 0.6;
}

/* ==========================================================================
   RESPONSIVE OVERRIDES
   ========================================================================== */

@media (max-width: 767px) {

    h1,
    .h1 {
        margin-bottom: 0.5em;
    }

    h2,
    .h2 {
        margin-bottom: 0.5em;
    }

    p {
        margin-bottom: 1em;
    }

    .hero-section h1,
    .hero-section .hero-title {
        line-height: var(--line-height-snug);
    }

    .hero-section .hero-subtitle,
    .hero-section p {
        line-height: var(--line-height-normal);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .section-title {
        margin-bottom: 1.25em;
    }

    .section-subtitle {
        margin-bottom: 2.5em;
    }
}

@media (min-width: 1024px) {

    p,
    .body-text {
        line-height: var(--line-height-loose);
    }

    .lead-text,
    .intro-text {
        line-height: var(--line-height-loose);
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

/* Font weight */
.font-light {
    font-weight: 300;
}

.font-normal {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.font-extrabold {
    font-weight: 800;
}

/* Line height */
.leading-tight {
    line-height: var(--line-height-tight);
}

.leading-snug {
    line-height: var(--line-height-snug);
}

.leading-normal {
    line-height: var(--line-height-normal);
}

.leading-relaxed {
    line-height: var(--line-height-relaxed);
}

.leading-loose {
    line-height: var(--line-height-loose);
}

/* Letter spacing */
.tracking-tight {
    letter-spacing: var(--letter-spacing-tight);
}

.tracking-normal {
    letter-spacing: var(--letter-spacing-normal);
}

.tracking-wide {
    letter-spacing: var(--letter-spacing-wide);
}

.tracking-wider {
    letter-spacing: var(--letter-spacing-wider);
}

/* Text alignment */
.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

@media (max-width: 767px) {
    .text-center-mobile {
        text-align: center;
    }

    .text-left-mobile {
        text-align: left;
    }
}

/* Text transform */
.uppercase {
    text-transform: uppercase;
}

.lowercase {
    text-transform: lowercase;
}

.capitalize {
    text-transform: capitalize;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.text-muted {
    opacity: 0.7;
}

.text-subtle {
    opacity: 0.6;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    h1 {
        font-size: 24pt;
    }

    h2 {
        font-size: 20pt;
    }

    h3 {
        font-size: 16pt;
    }

    h4 {
        font-size: 14pt;
    }

    h5 {
        font-size: 12pt;
    }

    h6 {
        font-size: 11pt;
    }
}