/* Reputación Algorítmica - CSS Minimalista */
/* Inspirado en diseño OpenAI */

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-light: #666666;
  --color-border: #e5e5e5;
  --color-accent: #2d2d2d;
  --color-hover: #f5f5f5;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-xxl: 4rem;
  --max-width: 1200px;
  --max-width-content: 800px;
  --border-radius: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--spacing-md);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.content-width {
  max-width: var(--max-width-content);
  margin: 0 auto;
}

/* Header */
header {
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-lg) 0;
  position: sticky;
  top: 0;
  background-color: var(--color-bg);
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}

nav ul {
  display: flex;
  gap: var(--spacing-lg);
  list-style: none;
}

nav a {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: all 0.2s ease;
}

nav a:hover,
nav a.active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

/* Hero Section */
.hero {
  padding: var(--spacing-xxl) 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  font-size: 1.25rem;
  color: var(--color-text-light);
  max-width: 700px;
  margin: 0 auto var(--spacing-lg);
}

.hero-cta {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: var(--color-accent);
  color: var(--color-bg);
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: transform 0.2s ease;
}

.hero-cta:hover {
  transform: translateY(-2px);
  color: var(--color-bg);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin: var(--spacing-xxl) 0;
}

.card {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--color-text-light);
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--spacing-md);
}

.card h3 {
  margin-bottom: var(--spacing-sm);
}

.card p {
  color: var(--color-text-light);
  margin-bottom: var(--spacing-md);
  font-size: 0.9375rem;
}

.card-link {
  font-size: 0.9375rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.card-link::after {
  content: '→';
  transition: transform 0.2s ease;
}

.card-link:hover::after {
  transform: translateX(4px);
}

/* Sections */
section {
  padding: var(--spacing-xxl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.section-header h2 {
  margin-bottom: var(--spacing-sm);
}

.section-header p {
  color: var(--color-text-light);
  font-size: 1.125rem;
}

/* Content Page */
.page-header {
  padding: var(--spacing-xxl) 0 var(--spacing-lg);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.page-header h1 {
  margin-bottom: var(--spacing-sm);
}

.page-meta {
  color: var(--color-text-light);
  font-size: 0.9375rem;
}

.content {
  padding: var(--spacing-xxl) 0;
}

.content h2 {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

.content h2:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.content ul, .content ol {
  margin-left: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.content li {
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-light);
}

.content strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Table of Contents */
.toc {
  position: sticky;
  top: 100px;
  background-color: var(--color-hover);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.toc h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-md);
}

.toc ul {
  list-style: none;
  margin: 0;
}

.toc li {
  margin-bottom: var(--spacing-sm);
}

.toc a {
  font-size: 0.9375rem;
  color: var(--color-text-light);
}

.toc a:hover,
.toc a.active {
  color: var(--color-text);
}

/* Two Column Layout */
.two-column {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: var(--spacing-xl);
  align-items: start;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-lg) 0;
  font-size: 0.9375rem;
}

th, td {
  text-align: left;
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
  color: var(--color-text);
}

td {
  color: var(--color-text-light);
}

/* Blog */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.blog-post-preview {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--spacing-xl);
}

.blog-post-preview:last-child {
  border-bottom: none;
}

.blog-post-preview h2 {
  margin-top: 0;
  border: none;
  padding: 0;
}

.blog-post-preview .post-meta {
  color: var(--color-text-light);
  font-size: 0.875rem;
  margin-bottom: var(--spacing-sm);
}

.blog-post-preview .post-excerpt {
  color: var(--color-text-light);
  margin-bottom: var(--spacing-md);
}

.read-more {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.read-more::after {
  content: '→';
  transition: transform 0.2s ease;
}

.read-more:hover::after {
  transform: translateX(4px);
}

/* Glossary */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin: var(--spacing-lg) 0;
}

.glossary-letter {
  margin: var(--spacing-xl) 0 var(--spacing-lg);
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-text);
}

.glossary-term {
  margin-bottom: var(--spacing-lg);
}

.glossary-term dt {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: var(--spacing-xs);
}

.glossary-term dd {
  color: var(--color-text-light);
  margin-left: 0;
}

/* Footer */
footer {
  border-top: 1px solid var(--color-border);
  padding: var(--spacing-xxl) 0;
  margin-top: var(--spacing-xxl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.footer-section h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-md);
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: var(--spacing-sm);
}

.footer-section a {
  color: var(--color-text-light);
  font-size: 0.9375rem;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-light);
  font-size: 0.875rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-light { color: var(--color-text-light); }
.mb-0 { margin-bottom: 0; }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* Responsive */
@media (max-width: 768px) {
  html { font-size: 14px; }

  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1.125rem; }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .toc {
    position: relative;
    top: 0;
  }

  nav ul {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Print Styles */
@media print {
  header, footer, .toc { display: none; }
  body { color: #000; }
  a { text-decoration: underline; }
}
