/* ==========================================================================
   Typography System - Premium News Portal
   ========================================================================== */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Base Typography */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: var(--font-weight-regular);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Headings - Editorial Style */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: var(--space-4);
  color: var(--color-text);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); font-weight: var(--font-weight-extrabold); }
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); }

/* Display headings */
.display-1 { font-size: var(--text-5xl); font-weight: var(--font-weight-extrabold); }
.display-2 { font-size: var(--text-4xl); font-weight: var(--font-weight-bold); }
.display-3 { font-size: var(--text-3xl); font-weight: var(--font-weight-bold); }

/* Body text */
p {
  margin-top: 0;
  margin-bottom: var(--space-4);
  line-height: var(--reading-line-height);
}

.lead {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-medium);
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* Links */
a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

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

/* Article typography */
.article-body {
  max-width: var(--reading-max-width);
  font-size: var(--text-base);
  line-height: var(--reading-line-height);
}

.article-body p {
  margin-bottom: var(--reading-paragraph-spacing);
}

.article-body h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.article-body h3 {
  font-size: var(--text-xl);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.article-body blockquote {
  margin: var(--space-8) 0;
  padding: var(--space-6) var(--space-8);
  border-left: 4px solid var(--color-accent);
  background: var(--color-bg-muted);
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--color-text-secondary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.article-body blockquote cite {
  display: block;
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  font-style: normal;
  font-family: var(--font-body);
  color: var(--color-text-muted);
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--space-6) 0;
}

.article-body figure {
  margin: var(--space-8) 0;
}

.article-body figcaption {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-2);
}

/* Pull quote */
.pull-quote {
  margin: var(--space-8) 0;
  padding: var(--space-6);
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-medium);
  font-style: italic;
  line-height: 1.4;
  color: var(--color-primary);
  text-align: center;
  position: relative;
}

.pull-quote::before,
.pull-quote::after {
  content: '"';
  font-size: var(--text-4xl);
  color: var(--color-accent);
  opacity: 0.3;
  position: absolute;
  line-height: 1;
}

.pull-quote::before {
  top: 0;
  left: 0;
}

.pull-quote::after {
  bottom: 0;
  right: 0;
}

/* Meta text */
.meta-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Category badge */
.category-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-inverse);
  background-color: var(--color-accent);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.category-badge:hover {
  background-color: var(--color-accent-hover);
  color: var(--color-text-inverse);
}

/* Date styling */
.date-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Read time */
.read-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

/* Utility classes */
.text-primary { color: var(--color-primary) !important; }
.text-accent { color: var(--color-accent) !important; }
.text-muted { color: var(--color-text-muted) !important; }
.text-light { color: var(--color-text-light) !important; }
.text-inverse { color: var(--color-text-inverse) !important; }

.font-heading { font-family: var(--font-heading); }
.font-body { font-family: var(--font-body); }
.font-weight-medium { font-weight: var(--font-weight-medium); }
.font-weight-semibold { font-weight: var(--font-weight-semibold); }
.font-weight-bold { font-weight: var(--font-weight-bold); }

/* Truncate text */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

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

/* Responsive typography adjustments */
@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
  .display-1 { font-size: var(--text-4xl); }
}
