/**
 * Typography System - Complete typography in one place
 * All font declarations, sizes, weights, and component styles
 */

/* ============================================
   FONT DECLARATIONS
   ============================================ */

@font-face {
  font-family: 'Inter-Variable';
  src: url('/fonts/Inter-Variable.woff2') format('woff2-variations');
  font-weight: 400 785;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PressStart2P';
  src: url('/fonts/PressStart2P-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================
   TYPOGRAPHY VARIABLES
   ============================================ */

:root {
  /* Font Families */
  --font-main: 'Inter-Variable', system-ui, -apple-system, sans-serif;
  --font-accent: 'PressStart2P', 'Courier New', monospace;
  --font-code: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  
  /* Font Family Aliases */
  --font-body: var(--font-main);
  --font-menu: var(--font-main);
  
  /* Font Weights */
  --text-weight: 400;
  --heading-weight: 700;
  
  /* Font Sizes - Responsive with clamp() */
  --text-xs: clamp(10px, 1vw + 8px, 12px);
  --text-sm: clamp(12px, 1.5vw + 10px, 14px);
  --text-base: clamp(16px, 2vw + 14px, 18px);
  --text-lg: clamp(18px, 2.5vw + 16px, 20px);
  --text-xl: clamp(20px, 3vw + 18px, 24px);
  --text-2xl: clamp(24px, 4vw + 20px, 32px);
  --text-3xl: clamp(32px, 5vw + 24px, 48px);
  --text-4xl: clamp(40px, 6vw + 32px, 64px);
  
  /* Component-specific sizes */
  --menu-size: clamp(14px, 2vw + 12px, 28px);
  --title-font-size: clamp(49px, 3vw + 20px, 65px);
  --subtitle-font-size: clamp(14px, 1.2vw + 10px, 23px);
  
  /* Line Heights */
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;
  
  /* Letter Spacing */
  --tracking-normal: 0;
  --tracking-wide: 0.05ch;
}

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

body {
  font-family: var(--font-main);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  line-height: var(--leading-tight);
  margin: 0;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin: 0 0 1rem 0;
  line-height: var(--leading-relaxed);
}

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

/* Lists */
ul, ol {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.25rem;
  line-height: var(--leading-relaxed);
}

/* Code */
code {
  font-family: var(--font-code);
  font-size: 0.9em;
}

/* ============================================
   COMPONENT TYPOGRAPHY
   ============================================ */

/* Navigation styles moved to links.css to avoid duplication */

/* Retro Header */
.retro-header {
  font-family: var(--font-accent);
  line-height: 1;
  text-transform: uppercase;
}

.header__title {
  font-size: var(--title-font-size);
}

.header__subtitle {
  font-size: var(--subtitle-font-size);
}

/* Footer */
footer p {
  font-size: var(--text-sm);
}

/* Skip Link */
.skip-link {
  font-size: var(--text-sm);
}

/* Post Meta */
.post-meta {
  font-size: var(--text-sm);
}

.post-tag {
  font-size: 0.8rem;
}

/* Post Article */
.post-article {
  line-height: var(--leading-relaxed);
}

.post-article h1 {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
}

.post-article h2 {
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
}

.post-article h3 {
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
}

.post-article code {
  background: var(--box-bg);
  border: 1px solid var(--box-border-color);
  padding: 0.2rem 0.4rem;
  font-family: var(--font-code);
  font-size: 0.9em;
}

.post-article pre {
  background: var(--box-bg);
  border: var(--box-border-width) solid var(--box-border-color);
  padding: var(--box-padding);
}

.post-article pre code {
  background: none;
  border: none;
  padding: 0;
}

.post-article blockquote {
  font-style: italic;
}

/* Cards */
.card__title {
  font-family: var(--font-main);
  font-size: var(--text-lg);
  line-height: var(--leading-tight);
}

.card__text {
  font-family: var(--font-main);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

/* Buttons */
.button,
button {
  font-family: var(--font-main);
  font-size: var(--text-base);
  letter-spacing: var(--tracking-normal);
}

/* Accent Text */
.accent-text,
.text-accent {
  font-family: var(--font-accent);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
}

/* ============================================
   POST ARTICLE STYLES
   ============================================ */

.post-article h1 {
  margin-bottom: 1.5rem;
  color: var(--color-text-primary);
}

.post-article h2 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: var(--color-text-primary);
}

.post-article h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--color-text-primary);
}

.post-article p {
  margin-bottom: 1.5rem;
  color: var(--color-text-primary);
}

.post-article ul, .post-article ol {
  padding-left: 2rem;
  margin-bottom: 1.5rem;
}

.post-article li {
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
}

.post-article blockquote {
  border-left: 4px solid var(--color-accent-pink);
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: var(--color-text-secondary);
}

.post-article pre {
  overflow-x: auto;
  margin: 2rem 0;
}

.post-article pre code {
  border-radius: 0;
}

/* Article Grid Styles */
.article-grid h1 {
  margin-bottom: 1rem;
}

.article-grid h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-grid p {
  margin-bottom: 1rem;
}

.article-grid ul, .article-grid ol {
  padding-left: 2rem;
  margin-bottom: 1rem;
}

.article-grid li {
  margin-bottom: 0.5rem;
}

/* ============================================
   POST META STYLES
   ============================================ */

.post-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-separator);
  color: var(--color-text-secondary);
  flex-wrap: wrap;
}

.post-author {
  font-style: italic;
}

.post-reading-time {
  color: var(--color-text-muted);
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.post-tag {
  background: var(--color-bg-card);
  padding: 0.25rem 0.75rem;
  border-radius: 0;
  text-decoration: none;
  color: var(--color-text-secondary);
  transition: background-color 0.2s ease;
}

.post-tag:hover {
  background: var(--color-accent-pink);
  color: var(--color-text-primary);
}

@media (max-width: 768px) {
  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .post-tags {
    margin-left: 0;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

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

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

/* Font Weights */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Line Heights */
.leading-tight { line-height: var(--leading-tight); }
.leading-normal { line-height: var(--leading-normal); }
.leading-relaxed { line-height: var(--leading-relaxed); }

/* Letter Spacing */
.tracking-normal { letter-spacing: var(--tracking-normal); }
.tracking-wide { letter-spacing: var(--tracking-wide); }

/* Semantic Typography Classes */
.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  font-weight: 400;
}

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

.label {
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
