/* ============================================================
   BRAINFLOOD DEVELOPERS BLOG — Shared Styles
   Layered on top of the precompiled Tailwind in /style.css.
   Only adds article-prose + card hover polish + share-bar styling.
   ============================================================ */

/* ── Brand button shimmer (mirrors the rule from marketing/index.html
       inline <style> so blog CTAs match the home page) ── */
.btn-shimmer {
  background: linear-gradient(90deg, #7c3aed, #a855f7, #7c3aed);
  background-size: 200% auto;
}
.btn-shimmer:hover { animation: shimmer 2s linear infinite; }
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-shimmer:hover { animation: none; }
}

/* Smooth scroll for in-article anchors */
.blog-root { scroll-behavior: smooth; }

/* Reserve space for the fixed dev-banner + main nav (defined in /css/nav.css). */
body {
    padding-top: calc(var(--banner-h, 32px) + 4rem);
}
@media (min-width: 768px) {
    body { padding-top: calc(var(--banner-h, 32px) + 5rem); }
}

/* ── Hero gradient mesh (post hero + index hero) ── */
.blog-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(40% 50% at 20% 20%, rgba(244, 114, 182, 0.18), transparent 70%),
    radial-gradient(40% 50% at 80% 30%, rgba(124, 58, 237, 0.22), transparent 70%),
    radial-gradient(50% 60% at 50% 90%, rgba(34, 211, 238, 0.14), transparent 70%);
  filter: blur(40px);
  z-index: -1;
  animation: hero-drift 18s ease-in-out infinite alternate;
}
@keyframes hero-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(2%, -2%) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .blog-hero::before { animation: none; }
}

/* ── Card grid (blog index) ── */
.blog-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.blog-card:hover {
  transform: translateY(-3px);
  border-color: rgba(144, 97, 255, 0.4) !important;
  box-shadow: 0 12px 40px -12px rgba(124, 58, 237, 0.45);
}
.blog-card .card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
}
.blog-card .card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
  pointer-events: none;
}

/* Tag pills */
.blog-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(144, 97, 255, 0.12);
  color: #b49cff;
  border: 1px solid rgba(144, 97, 255, 0.2);
}

/* ── Article prose ── */
.article-prose {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #cbd5e1;
}
.article-prose h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
  margin: 3rem 0 0.75rem;
  position: relative;
  padding-bottom: 0.5rem;
}
.article-prose h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 56px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f472b6 0%, #7c3aed 50%, #22d3ee 100%);
}
.article-prose h2:first-child { margin-top: 0; }
.article-prose h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 2rem 0 0.5rem;
}
.article-prose p { margin: 0 0 1.25rem; }
.article-prose p:last-child { margin-bottom: 0; }
.article-prose ul, .article-prose ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}
.article-prose ul li, .article-prose ol li { margin-bottom: 0.4rem; }
.article-prose ul li::marker { color: #9061ff; }
.article-prose strong { color: #ffffff; font-weight: 600; }
.article-prose em { color: #e2e8f0; }
.article-prose a {
  color: #b49cff;
  text-decoration: underline;
  text-decoration-color: rgba(180, 156, 255, 0.4);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.article-prose a:hover {
  color: #ffffff;
  text-decoration-color: #ffffff;
}
.article-prose code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'Fira Code', ui-monospace, SFMono-Regular, monospace;
  color: #e2e8f0;
}
.article-prose blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  border-left: 3px solid #7c3aed;
  background: rgba(124, 58, 237, 0.07);
  border-radius: 0 8px 8px 0;
  color: #e2e8f0;
  font-style: italic;
}

/* Pull quote — for callouts */
.pull-quote {
  margin: 2rem 0;
  padding: 1.5rem 1.75rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.08) 0%, rgba(124, 58, 237, 0.08) 50%, rgba(34, 211, 238, 0.08) 100%);
  border: 1px solid rgba(144, 97, 255, 0.2);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.5;
}

/* ── Share bar ── */
/* Icon-only buttons at every width. Full platform name surfaces via the
   native tooltip (title attribute on each button) on hover. */
.share-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

/* "Share" leadin — small label rendered before the icon row. */
.share-leadin {
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  margin-right: 0.3rem;
  user-select: none;
  letter-spacing: 0.005em;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s, transform 0.15s;
  cursor: pointer;
  flex-shrink: 0;
}
.share-btn .share-label { display: none; }
.share-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}
/* Brand-color tint on hover, driven by data-color on each button.
   Falls back to the neutral white if the color isn't set. */
.share-btn:hover { color: var(--share-color, #ffffff); }
.share-btn[data-color] { --share-color: attr(data-color color, #ffffff); }
.share-btn[data-color="#ffffff"]:hover { color: #ffffff; }
.share-btn[data-color="#1877f2"]:hover { color: #4d96ff; border-color: rgba(24, 119, 242, 0.4); }
.share-btn[data-color="#0a66c2"]:hover { color: #2e8be6; border-color: rgba(10, 102, 194, 0.4); }
.share-btn[data-color="#ff4500"]:hover { color: #ff6a33; border-color: rgba(255, 69, 0, 0.4); }
.share-btn[data-color="#0085ff"]:hover { color: #4ea7ff; border-color: rgba(0, 133, 255, 0.4); }
.share-btn[data-color="#e4405f"]:hover { color: #ff6e8a; border-color: rgba(228, 64, 95, 0.4); }
.share-btn[data-color="#25d366"]:hover { color: #4be88c; border-color: rgba(37, 211, 102, 0.4); }
.share-btn[data-color="#26a5e4"]:hover { color: #4fbef0; border-color: rgba(38, 165, 228, 0.4); }
.share-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.share-btn .share-label {
  white-space: nowrap;
}
/* When the Copy button confirms, briefly expand it to show "Copied!" */
.share-btn.copied {
  width: auto;
  padding: 0 0.75rem;
  gap: 0.4rem;
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.4);
  color: #34d399;
}
.share-btn.copied:hover { color: #34d399; }
.share-btn.copied .share-label { display: inline; font-size: 0.8rem; }


/* ── Footer CTA card on every post ── */
.post-cta {
  margin-top: 4rem;
  padding: 2.5rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(34, 211, 238, 0.1) 100%);
  border: 1px solid rgba(144, 97, 255, 0.3);
  text-align: center;
}

/* ── Index hero animated brand mark ── */
.brand-bolt {
  display: inline-block;
  background: linear-gradient(90deg, #f472b6, #7c3aed, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: brand-shift 6s ease-in-out infinite alternate;
}
@keyframes brand-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-bolt { animation: none; }
}

/* ── Mobile tweaks ── */
@media (max-width: 640px) {
  .article-prose { font-size: 1rem; }
  .article-prose h2 { font-size: 1.5rem; margin-top: 2.5rem; }
  .post-cta { padding: 1.75rem; }
}
