/* ============================================
   Emprendedores USA — Ghost Theme
   Glassmorphism Blue Design System
   ============================================ */

:root {
  /* Brand Colors */
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-300: #93c5fd;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --brand-900: #1e3a8a;

  /* Slate Scale */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  /* Semantic */
  --bg: var(--slate-50);
  --bg-card: rgba(255, 255, 255, 0.6);
  --bg-card-solid: #ffffff;
  --text: var(--slate-900);
  --text-muted: var(--slate-600);
  --border: rgba(255, 255, 255, 0.4);
  --border-dark: var(--slate-200);
  --accent: var(--brand-600);
  --accent-hover: var(--brand-700);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;

  --header-h: 64px;
  --max-width: 1152px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--slate-950);
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-card-solid: var(--slate-900);
    --text: #f1f5f9;
    --text-muted: var(--slate-400);
    --border: rgba(30, 41, 59, 0.4);
    --border-dark: var(--slate-800);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.4);
  }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--brand-500); }

img { max-width: 100%; height: auto; display: block; }

/* === Animated Blob Background === */
.blob-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: blob 7s ease-in-out infinite;
}
.blob-1 { top: 0; left: 25%; width: 384px; height: 384px; background: rgba(147, 51, 234, 0.2); }
.blob-2 { top: 0; right: 25%; width: 384px; height: 384px; background: rgba(59, 130, 246, 0.2); animation-delay: 2s; }
.blob-3 { bottom: -128px; left: 33%; width: 384px; height: 384px; background: rgba(236, 72, 153, 0.2); animation-delay: 4s; }
.blob-4 { top: 50%; right: 50%; width: 320px; height: 320px; background: rgba(99, 102, 241, 0.15); animation-delay: 3s; }
@media (prefers-color-scheme: dark) {
  .blob-1 { background: rgba(147, 51, 234, 0.12); }
  .blob-2 { background: rgba(59, 130, 246, 0.12); }
  .blob-3 { background: rgba(236, 72, 153, 0.12); }
  .blob-4 { background: rgba(99, 102, 241, 0.1); }
}
@keyframes blob {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}

/* === Layout Wrapper === */
.site-wrapper { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* === Header === */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.04);
  transition: all 0.3s;
}
@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(2, 6, 23, 0.6);
    border-bottom: 1px solid rgba(30, 41, 59, 0.4);
  }
}

.site-header-inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
}

.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.1rem;
  color: var(--text); letter-spacing: -0.02em;
}
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.logo-icon svg { width: 20px; height: 20px; }
.logo-text span { color: var(--brand-700); }
@media (prefers-color-scheme: dark) { .logo-text span { color: var(--brand-400); } }

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a {
  color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--brand-600); }
@media (prefers-color-scheme: dark) { .nav-links a:hover { color: var(--brand-400); } }

.nav-cta {
  background: var(--brand-700); color: #fff !important;
  padding: 8px 20px; border-radius: 9999px;
  font-size: 0.85rem; font-weight: 500;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  transition: all 0.3s;
}
@media (prefers-color-scheme: dark) { .nav-cta { background: var(--brand-600); } }
.nav-cta:hover { background: var(--brand-600); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3); }

/* === Main Content === */
.site-main {
  flex: 1;
  padding-top: var(--header-h);
  position: relative; z-index: 1;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Hero Section (Homepage) === */
.hero-section {
  padding: 5rem 0 3rem;
  text-align: left;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 9999px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  color: var(--brand-700);
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 2rem;
}
@media (prefers-color-scheme: dark) {
  .hero-badge { background: rgba(30, 41, 59, 0.5); border-color: rgba(51, 65, 85, 0.6); color: var(--brand-400); }
}
.hero-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-400);
  position: relative;
}
.hero-badge .dot::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%; background: var(--brand-400);
  animation: ping 1.5s ease-in-out infinite;
  opacity: 0.75;
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.75; }
  100% { transform: scale(2.5); opacity: 0; }
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.hero-title .gradient {
  background: linear-gradient(135deg, var(--brand-600), #6366f1);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
@media (prefers-color-scheme: dark) {
  .hero-title .gradient { background: linear-gradient(135deg, var(--brand-400), #818cf8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
}

.hero-desc {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 576px;
  margin-bottom: 2.5rem;
}

/* === Post Grid === */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  padding: 2rem 0 4rem;
}

/* === Post Card === */
.post-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  display: flex; flex-direction: column;
}
@media (prefers-color-scheme: dark) {
  .post-card { border-color: rgba(51, 65, 85, 0.4); }
}
.post-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.post-card-image {
  width: 100%; aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--slate-200);
}
@media (prefers-color-scheme: dark) { .post-card-image { background: var(--slate-800); } }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.post-card:hover .post-card-image img { transform: scale(1.05); }

.post-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }

.post-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 0.75rem; }
.post-card-tag {
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 10px; border-radius: 9999px;
  background: var(--brand-50); color: var(--brand-700);
}
@media (prefers-color-scheme: dark) { .post-card-tag { background: rgba(37, 99, 235, 0.15); color: var(--brand-300); } }

.post-card-title { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--accent); }

.post-card-excerpt { color: var(--text-muted); font-size: 0.9rem; flex: 1; margin-bottom: 1rem; }

.post-card-meta {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.8rem; color: var(--text-muted);
  padding-top: 1rem; border-top: 1px solid var(--border-dark);
}
.post-card-meta .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  overflow: hidden; background: var(--slate-200);
}
@media (prefers-color-scheme: dark) { .post-card-meta .avatar { background: var(--slate-800); } }

/* === Single Post === */
.article-container {
  max-width: 768px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.article-header { margin-bottom: 2.5rem; }

.article-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }

.article-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.article-excerpt {
  font-size: 1.15rem; color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.article-meta {
  display: flex; align-items: center; gap: 1rem;
  font-size: 0.85rem; color: var(--text-muted);
}
.article-meta .avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; }
.article-meta .author-name { font-weight: 600; color: var(--text); }
.article-meta .reading-time { opacity: 0.7; }

.article-feature-image {
  width: 100%; border-radius: var(--radius-lg);
  overflow: hidden; margin-bottom: 2.5rem;
  box-shadow: var(--shadow-lg);
}

/* === Article Content (Ghost editor output) === */
.gh-content {
  font-size: 1.1rem; line-height: 1.75;
}
.gh-content > * + * { margin-top: 1.5em; }
.gh-content h2 { font-size: 1.75rem; font-weight: 700; margin-top: 2.5em; letter-spacing: -0.02em; }
.gh-content h3 { font-size: 1.35rem; font-weight: 600; margin-top: 2em; letter-spacing: -0.01em; }
.gh-content p { color: var(--text); }
.gh-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.gh-content img { border-radius: var(--radius-md); margin: 2em auto; box-shadow: var(--shadow); }
.gh-content blockquote {
  border-left: 4px solid var(--brand-500);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--brand-50);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-muted);
}
@media (prefers-color-scheme: dark) { .gh-content blockquote { background: rgba(37, 99, 235, 0.1); } }
.gh-content ul, .gh-content ol { padding-left: 1.5em; }
.gh-content li { margin-bottom: 0.5em; }
.gh-content pre {
  background: var(--slate-900);
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}
.gh-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9em;
}
.gh-content :not(pre) > code {
  background: var(--slate-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}
@media (prefers-color-scheme: dark) { .gh-content :not(pre) > code { background: var(--slate-800); } }
.gh-content hr { border: none; border-top: 1px solid var(--border-dark); margin: 3em 0; }
.gh-content table { width: 100%; border-collapse: collapse; margin: 2em 0; }
.gh-content th, .gh-content td { padding: 0.75rem 1rem; border: 1px solid var(--border-dark); text-align: left; }
.gh-content th { background: var(--slate-100); font-weight: 600; }
@media (prefers-color-scheme: dark) { .gh-content th { background: var(--slate-800); } }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 32px;
  border-radius: var(--radius-md);
  font-weight: 600; font-size: 1rem;
  transition: all 0.3s;
  cursor: pointer; border: none;
}
.btn-primary {
  background: var(--brand-600); color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { background: var(--brand-700); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4); }

/* === Section Title === */
.section-title {
  font-size: 1.75rem; font-weight: 700;
  text-align: center; letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.section-subtitle {
  text-align: center; color: var(--text-muted);
  font-size: 1.1rem; margin-bottom: 3rem;
}

/* === Newsletter CTA === */
.newsletter-section {
  max-width: var(--max-width);
  margin: 4rem auto;
  padding: 0 1.5rem;
}
.newsletter-card {
  background: var(--bg-card);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
@media (prefers-color-scheme: dark) { .newsletter-card { border-color: rgba(51, 65, 85, 0.4); } }
.newsletter-card h2 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.newsletter-card p { color: var(--text-muted); margin-bottom: 2rem; font-size: 1.1rem; }

/* === Footer === */
.site-footer {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  position: relative; z-index: 1;
}
@media (prefers-color-scheme: dark) {
  .site-footer { background: rgba(2, 6, 23, 0.6); border-top: 1px solid rgba(30, 41, 59, 0.4); }
}
.footer-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  text-align: center;
}
@media (min-width: 768px) { .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; } }

.footer-brand { display: flex; align-items: center; gap: 8px; opacity: 0.8; }
.footer-brand .logo-icon { width: 20px; height: 20px; border-radius: 4px; }
.footer-brand .logo-icon svg { width: 12px; height: 12px; }
.footer-brand span { font-weight: 700; font-size: 0.85rem; }

.footer-copy { font-size: 0.75rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 1.5rem; font-size: 0.85rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

/* === Pagination === */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 1rem;
  padding: 2rem 0 4rem;
}
.pagination a, .pagination span {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500;
}
.pagination a {
  background: var(--bg-card);
  border: 1px solid var(--border-dark);
  color: var(--text);
  transition: all 0.2s;
}
.pagination a:hover { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

/* === Author/Tag Page === */
.archive-header {
  text-align: center;
  padding: 4rem 1.5rem 2rem;
}
.archive-header .avatar-lg { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 1rem; overflow: hidden; }
.archive-header h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.archive-header p { color: var(--text-muted); max-width: 480px; margin: 0 auto; }

/* === Error/404 === */
.error-container {
  max-width: 600px; margin: 0 auto;
  padding: 6rem 1.5rem;
  text-align: center;
}
.error-container h1 { font-size: 4rem; font-weight: 700; color: var(--brand-600); margin-bottom: 1rem; }
@media (prefers-color-scheme: dark) { .error-container h1 { color: var(--brand-400); } }
.error-container p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 2rem; }

/* === Responsive YouTube/Video Embeds === */
.kg-card.kg-embed-card {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin: 2rem 0;
}
.kg-card.kg-embed-card iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-md);
}

/* === Koenig Editor Wide/Full Images === */
.kg-width-wide {
  margin-left: calc(-1 * (100vw - 768px) / 2);
  margin-right: calc(-1 * (100vw - 768px) / 2);
  max-width: 1000px;
  width: 1000px;
}
.kg-width-full {
  width: 100vw;
  margin-left: calc(-1 * (100vw - 768px) / 2);
  margin-right: calc(-1 * (100vw - 768px) / 2);
  max-width: 100vw;
}
.kg-card.kg-width-wide img,
.kg-card.kg-width-full img {
  width: 100%;
  border-radius: var(--radius-lg);
}

/* === Koenig Gallery === */
.kg-gallery-container { display: flex; flex-direction: column; gap: 1rem; margin: 2rem 0; }
.kg-gallery-row { display: flex; gap: 1rem; }
.kg-gallery-image img { border-radius: var(--radius-md); width: 100%; height: 100%; object-fit: cover; }

/* === Koenig Callout === */
.kg-callout-card {
  background: var(--brand-50);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
@media (prefers-color-scheme: dark) { .kg-callout-card { background: rgba(37, 99, 235, 0.1); } }

/* === Responsive === */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .post-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 2.25rem; }
}
