/*
  F1Key Website - Typography System
  Font definitions, text styles, and utilities
*/

/* ==================== */
/* FONT IMPORTS */
/* ==================== */

/* Fonts are loaded via <link> in HTML for better performance */
/* Montserrat: 300, 400, 600, 700, 800, 900 */
/* Inter: 300, 400, 500, 600 */

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

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-white);
  margin-bottom: var(--spacing-sm);
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-black);
  letter-spacing: var(--letter-spacing-tight);
}

h2 {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: var(--letter-spacing-tight);
}

h3 {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-bold);
}

h4 {
  font-size: var(--font-size-h4);
  font-weight: var(--font-weight-semibold);
}

h5 {
  font-size: var(--font-size-h5);
  font-weight: var(--font-weight-semibold);
}

h6 {
  font-size: var(--font-size-h6);
  font-weight: var(--font-weight-semibold);
}

/* ==================== */
/* PARAGRAPH & TEXT */
/* ==================== */

p {
  margin-bottom: var(--spacing-sm);
  max-width: var(--text-max-width);
}

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

/* Text sizes */
.text-xs {
  font-size: var(--font-size-xs);
}

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

.text-base {
  font-size: var(--font-size-base);
}

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

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

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

/* Font Weights */
.font-light {
  font-weight: var(--font-weight-light);
}

.font-regular {
  font-weight: var(--font-weight-regular);
}

.font-medium {
  font-weight: var(--font-weight-medium);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.font-bold {
  font-weight: var(--font-weight-bold);
}

.font-extrabold {
  font-weight: var(--font-weight-extrabold);
}

.font-black {
  font-weight: var(--font-weight-black);
}

/* Font Families */
.font-primary {
  font-family: var(--font-primary);
}

.font-secondary {
  font-family: var(--font-secondary);
}

/* Text Transform */
.uppercase {
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

.lowercase {
  text-transform: lowercase;
}

.capitalize {
  text-transform: capitalize;
}

/* Text Alignment */
.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* ==================== */
/* SPECIAL TEXT STYLES */
/* ==================== */

/* Highlight/Accent Text (Ferrari Red) */
.highlight {
  color: var(--color-ferrari-red);
}

/* Secondary Text */
.text-secondary {
  color: var(--color-text-secondary);
}

/* Muted Text */
.text-muted {
  color: var(--color-light-gray);
  opacity: 0.7;
}

/* Lead Text (Larger intro paragraphs) */
.lead {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
}

/* Small Text */
small,
.small {
  font-size: var(--font-size-sm);
  line-height: 1.4;
}

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

a {
  color: var(--color-white);
  transition: var(--transition-color);
}

a:hover {
  color: var(--color-ferrari-red);
}

a:focus-visible {
  outline: 2px solid var(--color-ferrari-red);
  outline-offset: 4px;
}

/* Link with underline */
.link-underline {
  position: relative;
  padding-bottom: 2px;
}

.link-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-ferrari-red);
  transition: width var(--transition-normal) var(--ease-out);
}

.link-underline:hover::after {
  width: 100%;
}

/* ==================== */
/* SELECTION */
/* ==================== */

::selection {
  background-color: var(--color-ferrari-red);
  color: var(--color-white);
}

::-moz-selection {
  background-color: var(--color-ferrari-red);
  color: var(--color-white);
}

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

@media (max-width: 968px) {
  body {
    font-size: 0.9375rem; /* 15px */
  }
  
  .lead {
    font-size: var(--font-size-base);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 0.875rem; /* 14px */
  }
  
  h1, h2, h3, h4, h5, h6 {
    margin-bottom: calc(var(--spacing-sm) * 0.75);
  }
  
  p {
    margin-bottom: calc(var(--spacing-sm) * 0.75);
  }
}
