/* =============================================================
   ARK LABS — BLOG STYLES
   Covers the blog index (/developers/blog/) and individual
   post pages at /developers/blog/[slug]/.
   ============================================================= */

/* =============================================================
   1. BLOG INDEX — HERO
   ============================================================= */
.blog-hero {
  position: relative;
  padding: 96px 60px 72px;
  background:
    radial-gradient(1200px 400px at 15% -10%, rgba(0,174,232,0.16), transparent 60%),
    radial-gradient(900px 380px at 90% 10%, rgba(0,174,232,0.08), transparent 65%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: white;
  overflow: hidden;
}
.blog-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
  pointer-events: none;
}
.blog-hero-inner {
  position: relative;
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 60px; align-items: end;
}
.blog-hero .section-tag { color: var(--cyan); margin-bottom: 18px; }
.blog-hero .section-tag .bar { background: var(--cyan); }
.blog-hero h1 {
  font-size: 3.4em; font-weight: 800; line-height: 1.04;
  letter-spacing: -1.2px; margin-bottom: 18px; color: white;
}
.blog-hero h1 .accent { color: var(--cyan); font-style: italic; font-weight: 800; }
.blog-hero .lede {
  font-size: 1.12em; line-height: 1.65;
  color: rgba(255,255,255,0.78); max-width: 560px; margin-bottom: 28px;
}
.blog-hero .hero-meta {
  display: flex; gap: 28px; flex-wrap: wrap;
  font-size: 0.82em; color: rgba(255,255,255,0.65);
  letter-spacing: 1px; text-transform: uppercase;
}
.blog-hero .hero-meta b { color: var(--cyan); font-weight: 700; }

/* Decorative stack on the right of the hero */
.hero-stack {
  position: relative;
  height: 280px;
  display: flex; justify-content: flex-end; align-items: flex-end;
}
.hero-stack .chip {
  position: absolute;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 0.82em;
  color: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px);
  white-space: nowrap;
  display: flex; align-items: center; gap: 10px;
}
.hero-stack .chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.hero-stack .chip-1 { top: 0; right: 10%; transform: rotate(-2deg); }
.hero-stack .chip-2 { top: 70px; right: 40%; transform: rotate(1deg); background: rgba(0,174,232,0.12); border-color: rgba(0,174,232,0.3); }
.hero-stack .chip-3 { top: 150px; right: 5%; transform: rotate(-1deg); }
.hero-stack .chip-4 { bottom: 10px; right: 30%; transform: rotate(2deg); background: rgba(0,174,232,0.08); border-color: rgba(0,174,232,0.25); }

/* =============================================================
   2. BLOG INDEX — FILTER BAR
   ============================================================= */
.blog-toolbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 20px 60px;
  position: sticky; top: 68px; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.92);
}
.blog-toolbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.topic-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.topic-pill {
  font-family: inherit;
  font-size: 0.82em; font-weight: 600;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border);
  background: white; color: var(--steel);
  cursor: pointer; transition: all 0.18s ease;
}
.topic-pill:hover { color: var(--navy); border-color: var(--cyan); }
.topic-pill.is-active {
  background: var(--navy); color: white; border-color: var(--navy);
}
.blog-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px;
  min-width: 260px;
}
.blog-search input {
  border: 0; background: transparent; outline: none;
  font-family: inherit; font-size: 0.88em;
  width: 100%; color: var(--navy);
}
.blog-search input::placeholder { color: var(--steel); }
.blog-search .icon { color: var(--steel); font-size: 0.9em; }

/* =============================================================
   3. BLOG INDEX — FEATURED POST
   ============================================================= */
.blog-feed { padding: 64px 60px 40px; background: var(--white); }
.blog-feed-inner { max-width: 1200px; margin: 0 auto; }

.feed-heading {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.feed-heading h2 {
  font-size: 1.35em; font-weight: 800; color: var(--navy);
  letter-spacing: -0.3px;
}
.feed-heading .count {
  font-size: 0.82em; color: var(--steel); font-weight: 500;
}

.featured-card {
  display: grid; grid-template-columns: 1.1fr 1fr;
  background: linear-gradient(135deg, var(--navy) 0%, #12355C 100%);
  color: white;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 56px;
  box-shadow: 0 20px 60px -20px rgba(12,35,64,0.35);
}
.featured-card:hover { transform: translateY(-3px); box-shadow: 0 28px 70px -20px rgba(12,35,64,0.45); }
.featured-art {
  position: relative;
  min-height: 380px;
  background:
    radial-gradient(600px 300px at 70% 30%, rgba(0,174,232,0.55), transparent 60%),
    radial-gradient(400px 250px at 30% 80%, rgba(0,174,232,0.25), transparent 65%),
    linear-gradient(135deg, #08182B 0%, #0C2340 100%);
  overflow: hidden;
}
.featured-art::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 28px 28px;
}
.featured-art .orb {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(0,174,232,0.4);
  box-shadow: 0 0 50px rgba(0,174,232,0.25), inset 0 0 40px rgba(0,174,232,0.12);
}
.featured-art .orb-1 { width: 320px; height: 320px; top: 30px; right: -60px; }
.featured-art .orb-2 { width: 180px; height: 180px; bottom: 40px; left: 40px; border-color: rgba(0,174,232,0.6); }
.featured-art .orb-3 { width: 80px; height: 80px; top: 50%; left: 40%; background: radial-gradient(circle, rgba(0,174,232,0.5), transparent 70%); border: 0; }
.featured-art .tag-float {
  position: absolute; top: 20px; left: 20px;
  background: rgba(0,174,232,0.15); color: var(--cyan);
  border: 1px solid rgba(0,174,232,0.4);
  padding: 6px 12px; border-radius: 6px;
  font-size: 0.72em; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
}
.featured-body {
  padding: 48px 52px;
  display: flex; flex-direction: column; justify-content: center;
}
.featured-body .kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.72em; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 18px;
}
.featured-body .kicker .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(0,174,232,0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,174,232,0.6); }
  70% { box-shadow: 0 0 0 10px rgba(0,174,232,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,174,232,0); }
}
.featured-body h3 {
  font-size: 2.1em; font-weight: 800; line-height: 1.1;
  letter-spacing: -0.8px; margin-bottom: 14px; color: white;
}
.featured-body p {
  color: rgba(255,255,255,0.72); font-size: 1em; line-height: 1.65;
  margin-bottom: 24px;
}
.featured-body .post-meta {
  display: flex; gap: 18px; align-items: center;
  font-size: 0.82em; color: rgba(255,255,255,0.6); margin-bottom: 24px;
}
.featured-body .post-meta span { display: inline-flex; align-items: center; gap: 6px; }
.featured-body .read-more {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--cyan); font-weight: 700; font-size: 0.92em;
  letter-spacing: 0.3px;
}
.featured-body .read-more .arrow {
  display: inline-block; transition: transform 0.2s ease;
}
.featured-card:hover .read-more .arrow { transform: translateX(4px); }

/* =============================================================
   4. BLOG INDEX — POST GRID
   ============================================================= */
.post-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.post-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative; overflow: hidden;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px -16px rgba(12,35,64,0.18);
  border-color: var(--cyan);
}
.post-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--cyan);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s ease;
}
.post-card:hover::before { transform: scaleX(1); }

.post-card .tag-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.post-tag {
  font-size: 0.68em; font-weight: 700; letter-spacing: 1.8px;
  text-transform: uppercase; padding: 4px 9px; border-radius: 5px;
  background: var(--cyan-light); color: var(--cyan-dark);
}
.post-tag[data-topic="architecture"] { background: #EEF1F9; color: #3A4E7A; }
.post-tag[data-topic="performance"] { background: var(--green-light); color: var(--green); }
.post-tag[data-topic="product"] { background: #FDF1E8; color: var(--amber); }
.post-tag[data-topic="policy"] { background: #F7E9EA; color: #B4534C; }

.post-card h3 {
  font-size: 1.15em; font-weight: 800; color: var(--navy);
  line-height: 1.3; letter-spacing: -0.3px; margin-bottom: 10px;
  flex-grow: 0;
}
.post-card p {
  color: var(--steel); font-size: 0.92em; line-height: 1.6;
  margin-bottom: 22px; flex-grow: 1;
}
.post-card .post-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8em; color: var(--steel);
  border-top: 1px solid var(--border-light); padding-top: 14px;
}
.post-card .reading-time { display: inline-flex; align-items: center; gap: 6px; }

/* Topic filter hide state */
.post-card.is-hidden, .featured-card.is-hidden { display: none; }

/* =============================================================
   5. BLOG INDEX — NEWSLETTER / CTA
   ============================================================= */
.blog-cta {
  margin-top: 72px;
  background: linear-gradient(135deg, var(--light-blue) 0%, #E6F7FD 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center;
  position: relative; overflow: hidden;
}
.blog-cta::after {
  content: ""; position: absolute;
  right: -80px; top: -80px; width: 260px; height: 260px;
  border-radius: 50%; border: 2px solid var(--cyan);
  opacity: 0.15; pointer-events: none;
}
.blog-cta h3 {
  font-size: 1.6em; font-weight: 800; color: var(--navy);
  line-height: 1.2; letter-spacing: -0.5px; margin-bottom: 10px;
}
.blog-cta p { color: var(--steel); font-size: 0.98em; line-height: 1.6; }
.blog-cta form {
  display: flex; gap: 10px; align-items: stretch;
}
.blog-cta input[type="email"] {
  flex: 1;
  font-family: inherit; font-size: 0.95em;
  padding: 14px 18px;
  border: 1px solid var(--border); border-radius: 10px;
  background: white; color: var(--navy);
}
.blog-cta input[type="email"]:focus { outline: 2px solid var(--cyan); border-color: var(--cyan); }
.blog-cta button {
  font-family: inherit; font-size: 0.92em; font-weight: 700;
  padding: 14px 22px; border-radius: 10px;
  border: 0; background: var(--navy); color: white; cursor: pointer;
  transition: background 0.2s ease;
}
.blog-cta button:hover { background: var(--cyan); }

.empty-state {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 24px;
  color: var(--steel); font-size: 0.95em;
  border: 1px dashed var(--border); border-radius: 14px;
  background: var(--bg-warm);
}

/* =============================================================
   6. INDIVIDUAL POST PAGE
   ============================================================= */
.post-hero {
  padding: 72px 60px 48px;
  background: linear-gradient(180deg, var(--light-blue) 0%, var(--white) 100%);
}
.post-hero-inner { max-width: 820px; margin: 0 auto; }
.post-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82em; color: var(--steel); margin-bottom: 24px;
}
.post-breadcrumb a { color: var(--steel); text-decoration: none; }
.post-breadcrumb a:hover { color: var(--cyan); }
.post-breadcrumb .sep { color: var(--border); }

.post-hero .tag-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.post-hero h1 {
  font-size: 2.8em; font-weight: 800; color: var(--navy);
  line-height: 1.12; letter-spacing: -1px; margin-bottom: 20px;
}
.post-hero .deck {
  font-size: 1.18em; color: var(--steel); line-height: 1.6;
  max-width: 720px; margin-bottom: 36px;
}
.post-hero .byline {
  display: flex; align-items: center; gap: 14px;
  padding-top: 28px; border-top: 1px solid var(--border);
  font-size: 0.92em;
}
.byline .avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--cyan) 100%);
  color: white; font-weight: 800; font-size: 0.95em;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0.5px;
}
.byline .author-name { color: var(--navy); font-weight: 700; }
.byline .meta-sub { color: var(--steel); font-size: 0.88em; }
.byline .dot { width: 3px; height: 3px; background: var(--steel); border-radius: 50%; display: inline-block; margin: 0 8px; vertical-align: middle; }

/* Layout with sticky TOC */
.post-layout {
  padding: 48px 60px 96px;
  background: white;
}
.post-layout-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 240px 1fr; gap: 64px; align-items: flex-start;
}
.post-toc {
  position: sticky; top: 96px;
  font-size: 0.86em;
}
.post-toc .toc-label {
  font-size: 0.72em; font-weight: 700; letter-spacing: 2px;
  color: var(--cyan); text-transform: uppercase; margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}
.post-toc .toc-label .bar { width: 16px; height: 2px; background: var(--cyan); border-radius: 1px; }
.post-toc ol { list-style: none; padding: 0; margin: 0; }
.post-toc li { margin-bottom: 10px; }
.post-toc a {
  color: var(--steel); text-decoration: none;
  line-height: 1.45; display: inline-block; padding-left: 12px;
  border-left: 2px solid var(--border-light);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.post-toc a:hover, .post-toc a.is-current { color: var(--navy); border-left-color: var(--cyan); }

/* Article body typography */
.post-article {
  max-width: 720px;
  font-size: 1.05em;
  color: #1F2D3F;
  line-height: 1.75;
}
.post-article h2 {
  font-size: 1.55em; font-weight: 800; color: var(--navy);
  margin-top: 56px; margin-bottom: 18px; letter-spacing: -0.4px;
  line-height: 1.25;
  scroll-margin-top: 100px;
}
.post-article h2:first-child { margin-top: 0; }
.post-article h3 {
  font-size: 1.18em; font-weight: 700; color: var(--navy);
  margin-top: 32px; margin-bottom: 10px; letter-spacing: -0.2px;
}
.post-article p { margin-bottom: 18px; }
.post-article p > strong { color: var(--navy); }
.post-article ul, .post-article ol {
  margin: 0 0 22px 22px; padding: 0;
}
.post-article li { margin-bottom: 10px; line-height: 1.7; }
.post-article li strong { color: var(--navy); }
.post-article a { color: var(--cyan-dark); text-decoration: none; border-bottom: 1px solid rgba(0,144,192,0.3); }
.post-article a:hover { color: var(--cyan); border-bottom-color: var(--cyan); }

.post-article blockquote {
  margin: 32px 0;
  padding: 24px 28px;
  border-left: 4px solid var(--cyan);
  background: var(--light-blue);
  border-radius: 0 10px 10px 0;
  font-size: 1.08em; line-height: 1.65; color: var(--navy);
  font-weight: 500;
}

/* Callout card used for case studies, key takeaways, examples */
.callout {
  margin: 32px 0;
  padding: 24px 28px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-left: 4px solid var(--cyan);
  border-radius: 10px;
}
.callout .callout-label {
  font-size: 0.72em; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--cyan-dark); margin-bottom: 10px;
}
.callout h4 {
  font-size: 1.08em; font-weight: 800; color: var(--navy);
  margin-bottom: 8px; letter-spacing: -0.2px;
}
.callout p:last-child { margin-bottom: 0; }
.callout.numbers { background: linear-gradient(180deg, #F3FAFE 0%, white 100%); }
.callout-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 12px;
}
.callout-stats .stat-val {
  font-size: 1.9em; font-weight: 800; color: var(--cyan-dark);
  line-height: 1; margin-bottom: 4px; letter-spacing: -0.5px;
}
.callout-stats .stat-desc { font-size: 0.88em; color: var(--steel); }

/* Inline "share / save" rail at the bottom of articles */
.post-footer-rail {
  margin-top: 56px; padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.88em; color: var(--steel);
}
.post-footer-rail .tags { display: flex; gap: 8px; flex-wrap: wrap; }
.post-footer-rail .share { display: flex; gap: 10px; }
.post-footer-rail .share a {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px;
  text-decoration: none; color: var(--steel); font-weight: 600;
  transition: all 0.15s ease;
}
.post-footer-rail .share a:hover { color: var(--cyan); border-color: var(--cyan); }

/* Next/prev post navigation */
.post-navigation {
  margin-top: 56px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.post-navigation a {
  padding: 22px 24px;
  border: 1px solid var(--border); border-radius: 14px;
  text-decoration: none; background: white;
  display: block; transition: all 0.2s ease;
}
.post-navigation a:hover { border-color: var(--cyan); transform: translateY(-2px); }
.post-navigation .nav-label {
  font-size: 0.72em; font-weight: 700; color: var(--cyan);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px;
}
.post-navigation .nav-title {
  font-size: 1em; font-weight: 700; color: var(--navy); line-height: 1.35;
}
.post-navigation .nav-right { text-align: right; }

/* CTA card after post body */
.post-cta-card {
  margin-top: 56px;
  padding: 36px 40px;
  background: linear-gradient(135deg, var(--navy) 0%, #12355C 100%);
  border-radius: 18px; color: white;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.post-cta-card h4 {
  font-size: 1.3em; font-weight: 800; letter-spacing: -0.4px; margin-bottom: 6px;
}
.post-cta-card p { color: rgba(255,255,255,0.72); font-size: 0.95em; }
.post-cta-card .btn-primary {
  background: var(--cyan); color: var(--navy); font-weight: 700;
  padding: 14px 22px; border-radius: 10px; text-decoration: none;
  white-space: nowrap; transition: background 0.15s ease;
}
.post-cta-card .btn-primary:hover { background: white; }

/* =============================================================
   7. RESPONSIVE
   ============================================================= */
@media (max-width: 1024px) {
  .blog-hero { padding: 72px 24px 56px; }
  .blog-hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .blog-hero h1 { font-size: 2.6em; }
  .hero-stack { display: none; }

  .blog-toolbar { padding: 14px 24px; position: static; }
  .blog-toolbar-inner { flex-direction: column; align-items: stretch; }
  .blog-search { min-width: 0; }

  .blog-feed { padding: 48px 24px; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-art { min-height: 220px; }
  .featured-body { padding: 32px 28px; }
  .featured-body h3 { font-size: 1.5em; }

  .post-grid { grid-template-columns: 1fr; }
  .blog-cta { grid-template-columns: 1fr; padding: 32px 28px; }
  .blog-cta form { flex-direction: column; }

  .post-hero { padding: 56px 24px 32px; }
  .post-hero h1 { font-size: 2em; }
  .post-layout { padding: 32px 24px 64px; }
  .post-layout-inner { grid-template-columns: 1fr; gap: 24px; }
  .post-toc { position: static; order: -1; }
  .post-article { font-size: 1em; }
  .post-article h2 { font-size: 1.35em; margin-top: 40px; }
  .post-navigation { grid-template-columns: 1fr; }
  .post-cta-card { flex-direction: column; align-items: flex-start; padding: 28px; }
  .callout-stats { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .blog-hero h1 { font-size: 2.1em; }
  .post-hero h1 { font-size: 1.7em; }
  .featured-body h3 { font-size: 1.25em; }
}
