/* ===================================
   BLOG – Global Styles & Utilities
   =================================== */

/* ─── Layout ─── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.container--prose {
  max-width: var(--max-w-prose);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

/* ─── Grid ─── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--sp-8); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-6); }

/* ─── Typography utilities ─── */
.text-gradient {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ─── Spacing utilities ─── */
.mt-auto { margin-top: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ─── Background grid pattern ─── */
.bg-grid {
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(rgba(2,132,199,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(2,132,199,0.04) 1px, transparent 1px);
}

/* ─── Hero gradient overlay ─── */
.bg-hero { background: var(--grad-hero); }

/* ─── Section spacing ─── */
section { padding-block: var(--sp-16); }

/* ─── Divider ─── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-block: var(--sp-8);
}

/* ─── Tag colors ─── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag--cyan    { background: rgba(0,212,255,0.10);   color: var(--cyan);    border: 1px solid rgba(0,212,255,0.22);   }
.tag--indigo  { background: rgba(129,140,248,0.10); color: var(--indigo);  border: 1px solid rgba(129,140,248,0.22); }
.tag--emerald { background: rgba(52,211,153,0.10);  color: var(--emerald); border: 1px solid rgba(52,211,153,0.22);  }
.tag--amber   { background: rgba(251,191,36,0.10);  color: var(--amber);   border: 1px solid rgba(251,191,36,0.22);  }
.tag--rose    { background: rgba(251,113,133,0.10); color: var(--rose);    border: 1px solid rgba(251,113,133,0.22); }
.tag--violet  { background: rgba(167,139,250,0.10); color: var(--violet);  border: 1px solid rgba(167,139,250,0.22); }
.tag--orange  { background: rgba(251,146,60,0.10);  color: var(--orange);  border: 1px solid rgba(251,146,60,0.22);  }

/* ─── Button primary ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all var(--t-base);
  cursor: pointer;
}

.btn--primary {
  background: var(--grad-accent);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 600;
  box-shadow: 0 0 20px rgba(242,143,59,0.25);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 4px 32px rgba(242,143,59,0.40); }

.btn--ghost {
  border: 1px solid var(--border-a);
  color: var(--accent);
  background: transparent;
}
.btn--ghost:hover { background: var(--accent-dim); }

/* ─── Animated underline link ─── */
.link-underline {
  color: var(--accent);
  position: relative;
}
.link-underline::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-base);
}
.link-underline:hover::after { transform: scaleX(1); }

/* ─── Code blocks ─── */
pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.65;
  margin-block: var(--sp-6);
  position: relative;
}

pre::before {
  content: attr(data-lang);
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-4);
  font-size: var(--text-xs);
  color: var(--text-dim);
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:not(pre) > code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.15em 0.45em;
  color: var(--cyan);
  font-size: 0.875em;
}

/* ─── Blockquote ─── */
blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--sp-4) var(--sp-6);
  margin-block: var(--sp-6);
  background: var(--accent-dim);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-style: italic;
  color: var(--text-muted);
}

blockquote strong { color: var(--text); }

/* ─── Article prose styles ─── */
.prose h2 {
  font-size: clamp(var(--text-xl), 3vw, var(--text-2xl));
  font-weight: 700;
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
  color: var(--text);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  font-size: clamp(var(--text-lg), 2.5vw, var(--text-xl));
  font-weight: 600;
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
  color: var(--text);
}

.prose p {
  font-size: clamp(var(--text-base), 1.5vw, var(--text-lg));
  line-height: var(--lead-relaxed);
  color: var(--text-muted);
  margin-bottom: var(--sp-5);
}

.prose p strong { color: var(--text); }

.prose ul, .prose ol {
  padding-left: var(--sp-6);
  margin-bottom: var(--sp-5);
}
.prose ul { list-style: none; padding-left: 0; }
.prose ul li {
  padding-left: var(--sp-6);
  position: relative;
  font-size: var(--text-base);
  line-height: var(--lead-relaxed);
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}
.prose ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.prose ol { list-style: decimal; }
.prose ol li {
  font-size: var(--text-base);
  line-height: var(--lead-relaxed);
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
  padding-left: var(--sp-2);
}
.prose ol li::marker { color: var(--accent); font-weight: 600; }

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--accent-2); }

/* ─── Highlight box ─── */
.highlight-box {
  background: var(--accent-dim);
  border: 1px solid var(--border-a);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  margin-block: var(--sp-6);
}

.highlight-box--indigo {
  background: var(--accent-2-dim);
  border-color: rgba(129,140,248,0.22);
}

/* ─── Stat cards ─── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-4);
  margin-block: var(--sp-6);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  text-align: center;
}

.stat-card__num {
  display: block;
  font-size: var(--text-3xl);
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--sp-2);
}

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

/* ─── References ─── */
.references {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin-top: var(--sp-10);
}

.references h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-4);
  border-bottom: none !important;
  margin-top: 0 !important;
}

.references ol { list-style: decimal; padding-left: var(--sp-6); }

.references li {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
  line-height: var(--lead-relaxed);
}

.references li a { color: var(--accent); }

/* ─── Editorial utilities ─── */

/* Full-width horizontal rule — section divider */
.section-rule {
  border: none;
  border-top: var(--border-rule-h);
  margin-bottom: var(--sp-6);
}

/* Eyebrow label — small uppercase category badge above card titles */
.eyebrow {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}
.eyebrow--ai         { color: var(--cat-ai); }
.eyebrow--llm        { color: var(--cat-llm); }
.eyebrow--data       { color: var(--cat-data); }
.eyebrow--python     { color: var(--cat-python); }
.eyebrow--career     { color: var(--cat-career); }
.eyebrow--soccer     { color: var(--cat-soccer); }
.eyebrow--basketball { color: var(--cat-basketball); }

/* Cover image container — ratio-locked responsive wrapper */
.post-card__cover {
  position: relative;
  width: 100%;
  padding-top: var(--cover-ratio);
  overflow: hidden;
  background: var(--bg-2);
  flex-shrink: 0;
}

.post-card__cover img,
.post-card__cover svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t-slow);
}

.post-card:hover .post-card__cover img,
.post-card:hover .post-card__cover svg {
  transform: scale(1.04);
}

/* Serif helper — for selectively applying Georgia to headings */
.serif { font-family: var(--font-serif); }

/* Post page title uses serif for editorial feel */
.post-header__title { font-family: var(--font-serif); }

/* 4-column grid for wider screens */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-col-gap, var(--sp-8));
}

/* ─── Page transitions ─── */
@keyframes fadeIn    { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes shimmer   { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* Orb float — hero decorative blobs */
@keyframes float {
  0%, 100% { transform: translate(0,    0)    scale(1);    }
  33%       { transform: translate(-14px, -20px) scale(1.05); }
  66%       { transform: translate(12px,   9px) scale(0.96); }
}

/* Pulse ring — live dot no eyebrow */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0   rgba(242,143,59, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(242,143,59, 0);    }
  100% { box-shadow: 0 0 0 0   rgba(242,143,59, 0);    }
}

/* Gradient shift — animated gradient backgrounds */
@keyframes gradient-shift {
  0%, 100% { background-position: 0%   50%; }
  50%       { background-position: 100% 50%; }
}

/* Scan line — tech aesthetic overlay */
@keyframes scan {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(200vh); }
}

.animate-fade  { animation: fadeIn    var(--t-slow) both; }
.animate-slide { animation: slideDown var(--t-base) both; }

/* Scroll-reveal: elements start invisible and slide up */
[data-animate] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease-out-expo), transform 0.55s var(--ease-out-expo);
}
[data-animate].visible { opacity: 1; transform: none; }

/* Stagger delays para grids — JS adiciona via JS ou nth-child CSS */
[data-animate]:nth-child(2) { transition-delay: 0.07s; }
[data-animate]:nth-child(3) { transition-delay: 0.14s; }
[data-animate]:nth-child(4) { transition-delay: 0.21s; }
[data-animate]:nth-child(5) { transition-delay: 0.28s; }
[data-animate]:nth-child(6) { transition-delay: 0.35s; }

/* ─── Heading font (KoHo) ─── */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); }

/* ─── Gradient text — brand orange → steel ─── */
.text-brand {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
