/* ============================================================================
   Fijara Platform - Typography
   ============================================================================
   Base typography styles including font loading, headings, and text utilities.
   Uses CSS variables from _variables.css for consistency.
   ============================================================================ */

/* ============================================================================
   FONT LOADING
   ============================================================================ */

/* Inter - Primary Font */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2")
    format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* JetBrains Mono - Monospace Font */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("https://fonts.gstatic.com/s/jetbrainsmono/v18/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxjPVmUsaaDhw.woff2")
    format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================================
   BASE TYPOGRAPHY
   ============================================================================ */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-body);
}

/* ============================================================================
   HEADINGS
   ============================================================================ */

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: var(--spacing-4);
}

h1,
.h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
}

h2,
.h2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tight);
}

h3,
.h3 {
  font-size: var(--font-size-2xl);
}

h4,
.h4 {
  font-size: var(--font-size-xl);
}

h5,
.h5 {
  font-size: var(--font-size-lg);
}

h6,
.h6 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

/* Display headings for hero sections */
.display-1 {
  font-size: var(--font-size-6xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  line-height: 1.1;
}

.display-2 {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  line-height: 1.15;
}

.display-3 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tight);
  line-height: 1.2;
}

/* ============================================================================
   PARAGRAPHS & BODY TEXT
   ============================================================================ */

p {
  margin-top: 0;
  margin-bottom: var(--spacing-4);
}

p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

.small,
small {
  font-size: var(--font-size-sm);
}

.tiny {
  font-size: var(--font-size-xs);
}

/* ============================================================================
   LINKS
   ============================================================================ */

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-link-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Underlined links */
.link-underline {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-underline:hover {
  text-decoration-thickness: 2px;
}

/* Muted links */
.link-muted {
  color: var(--text-secondary);
}

.link-muted:hover {
  color: var(--text-primary);
}

/* ============================================================================
   TEXT FORMATTING
   ============================================================================ */

strong,
b {
  font-weight: var(--font-weight-semibold);
}

em,
i {
  font-style: italic;
}

mark {
  background-color: rgba(67, 121, 255, 0.15);
  color: inherit;
  padding: 0.1em 0.3em;
  border-radius: var(--radius-sm);
}

del,
s {
  text-decoration: line-through;
  color: var(--text-muted);
}

ins,
u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
  border-bottom: none;
}

/* ============================================================================
   CODE & PREFORMATTED TEXT
   ============================================================================ */

code,
kbd,
samp,
pre {
  font-family: var(--font-family-mono);
}

code {
  font-size: 0.875em;
  color: var(--color-primary-dark);
  background-color: var(--bg-surface-secondary);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-md);
}

/* Code inside pre blocks */
pre code {
  padding: 0;
  background-color: transparent;
  color: inherit;
  font-size: inherit;
}

pre {
  display: block;
  margin-top: 0;
  margin-bottom: var(--spacing-4);
  padding: var(--spacing-4);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
  background-color: var(--bg-surface-secondary);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

kbd {
  font-size: 0.875em;
  padding: 0.125em 0.375em;
  background-color: var(--color-gray-800);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   LISTS
   ============================================================================ */

ul,
ol {
  margin-top: 0;
  margin-bottom: var(--spacing-4);
  padding-left: var(--spacing-6);
}

ul ul,
ul ol,
ol ul,
ol ol {
  margin-bottom: 0;
}

li {
  margin-bottom: var(--spacing-1);
}

/* Unstyled list */
.list-unstyled {
  padding-left: 0;
  list-style: none;
}

/* Inline list */
.list-inline {
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-4);
}

/* Checkmark list */
.list-check {
  padding-left: 0;
  list-style: none;
}

.list-check li {
  position: relative;
  padding-left: var(--spacing-6);
}

.list-check li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: var(--font-weight-bold);
}

/* ============================================================================
   BLOCKQUOTES
   ============================================================================ */

blockquote {
  margin: 0 0 var(--spacing-4);
  padding: var(--spacing-4) var(--spacing-6);
  border-left: 4px solid var(--color-primary);
  background-color: var(--bg-surface-secondary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

blockquote cite,
blockquote footer {
  display: block;
  margin-top: var(--spacing-2);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

blockquote cite::before,
blockquote footer::before {
  content: "— ";
}

/* ============================================================================
   HORIZONTAL RULE
   ============================================================================ */

hr {
  margin: var(--spacing-8) 0;
  border: 0;
  border-top: 1px solid var(--border-color);
}

/* ============================================================================
   TEXT UTILITIES
   ============================================================================ */

/* Text colors */
.text-primary {
  color: var(--text-primary) !important;
}
.text-secondary {
  color: var(--text-secondary) !important;
}
.text-muted {
  color: var(--text-muted) !important;
}
.text-success {
  color: var(--color-success) !important;
}
.text-warning {
  color: var(--color-warning) !important;
}
.text-error {
  color: var(--color-error) !important;
}
.text-info {
  color: var(--color-info) !important;
}
.text-brand {
  color: var(--color-primary) !important;
}

/* Font sizes */
.text-xs {
  font-size: var(--font-size-xs) !important;
}
.text-sm {
  font-size: var(--font-size-sm) !important;
}
.text-base {
  font-size: var(--font-size-base) !important;
}
.text-lg {
  font-size: var(--font-size-lg) !important;
}
.text-xl {
  font-size: var(--font-size-xl) !important;
}
.text-2xl {
  font-size: var(--font-size-2xl) !important;
}
.text-3xl {
  font-size: var(--font-size-3xl) !important;
}

/* Font weights */
.font-light {
  font-weight: var(--font-weight-light) !important;
}
.font-normal {
  font-weight: var(--font-weight-normal) !important;
}
.font-medium {
  font-weight: var(--font-weight-medium) !important;
}
.font-semibold {
  font-weight: var(--font-weight-semibold) !important;
}
.font-bold {
  font-weight: var(--font-weight-bold) !important;
}

/* Text alignment */
.text-left {
  text-align: left !important;
}
.text-center {
  text-align: center !important;
}
.text-right {
  text-align: right !important;
}
.text-justify {
  text-align: justify !important;
}

/* Text transform */
.text-lowercase {
  text-transform: lowercase !important;
}
.text-uppercase {
  text-transform: uppercase !important;
}
.text-capitalize {
  text-transform: capitalize !important;
}

/* Text decoration */
.text-underline {
  text-decoration: underline !important;
}
.text-line-through {
  text-decoration: line-through !important;
}
.text-no-decoration {
  text-decoration: none !important;
}

/* Text wrapping */
.text-nowrap {
  white-space: nowrap !important;
}
.text-truncate {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Line clamp (multi-line truncation) */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Monospace */
.font-mono {
  font-family: var(--font-family-mono) !important;
}

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

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  h1,
  .h1 {
    font-size: var(--font-size-3xl);
  }

  h2,
  .h2 {
    font-size: var(--font-size-2xl);
  }

  h3,
  .h3 {
    font-size: var(--font-size-xl);
  }

  .display-1 {
    font-size: var(--font-size-4xl);
  }

  .display-2 {
    font-size: var(--font-size-3xl);
  }

  .display-3 {
    font-size: var(--font-size-2xl);
  }

  .lead {
    font-size: var(--font-size-lg);
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
}
