/* ─────────────────────────────────────────────────────────────────────────
 * Blog styles — promo/site/blog/*
 * Used by blog/index.html with portal.css, and article pages with pos/landing.css
 * ───────────────────────────────────────────────────────────────────────── */

/* ── Shared base variables (bridge between portal & landing) ── */
.blog-page {
  --blog-accent:        #10B981;
  --blog-accent-light:  rgba(16, 185, 129, 0.1);
  --blog-accent-border: rgba(16, 185, 129, 0.2);
  --blog-text:          var(--text-primary, #F9FAFB);
  --blog-text-muted:    var(--text-secondary, #9CA3AF);
  --blog-surface:       var(--bg-secondary, #0B0F19);
  --blog-surface-alt:   var(--bg-tertiary, #111827);
  --blog-border:        rgba(255, 255, 255, 0.06);
}

/* ── Section badge (pill label above heading) ── */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #10B981;
  margin-bottom: 1.5rem;
  letter-spacing: 0.03em;
}

/* ── Blog Index Hero ── */
.blog-index-hero {
  padding: 160px 0 4rem;
  background: radial-gradient(circle at top center, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
  text-align: center;
  position: relative;
}

.blog-index-hero h1 {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, var(--text-primary, #F9FAFB) 0%, rgba(249,250,251,0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.light .blog-index-hero h1 {
  background: linear-gradient(180deg, #0F172A 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-index-hero p {
  font-size: 1.15rem;
  color: var(--text-secondary, #9CA3AF);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Article Search & Categories ── */
.blog-categories {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  margin: 0 0 0.75rem;
  padding: 0.15rem 0.1rem 0.35rem;
  border: 0;
  scrollbar-width: none;
}

.blog-categories::-webkit-scrollbar {
  display: none;
}

.blog-category-option {
  flex: 0 0 auto;
  cursor: pointer;
}

.blog-category-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.blog-category-option span {
  display: block;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 9999px;
  background: var(--bg-tertiary, #111827);
  color: var(--text-secondary, #9CA3AF);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.blog-category-option:hover span {
  border-color: rgba(16, 185, 129, 0.5);
  color: #10B981;
  transform: translateY(-1px);
}

.blog-category-option input:checked + span {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.16);
  color: #10B981;
}

.blog-category-option input:focus-visible + span {
  outline: 3px solid rgba(16, 185, 129, 0.45);
  outline-offset: 2px;
}

html.light .blog-category-option span {
  background: #FFFFFF;
  border-color: rgba(15, 118, 110, 0.2);
  color: #64748B;
}

html.light .blog-category-option input:checked + span {
  background: #ECFDF5;
  border-color: #059669;
  color: #047857;
}

.blog-search {
  width: min(100%, 620px);
  margin: 2rem auto 0;
  text-align: left;
}

.blog-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0 0.8rem 0 1rem;
  background: var(--bg-tertiary, #111827);
  border: 1px solid rgba(16, 185, 129, 0.24);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-search-input-wrap:focus-within {
  border-color: #10B981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12), 0 10px 30px rgba(0, 0, 0, 0.14);
}

html.light .blog-search-input-wrap {
  background: #FFFFFF;
  border-color: rgba(15, 118, 110, 0.2);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.blog-search-icon {
  flex: 0 0 auto;
  color: #10B981;
  font-size: 1.55rem;
  line-height: 1;
  transform: rotate(-20deg);
}

.blog-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary, #F9FAFB);
  font: inherit;
  font-size: 0.98rem;
}

.blog-search input::placeholder {
  color: var(--text-secondary, #9CA3AF);
  opacity: 0.8;
}

html.light .blog-search input {
  color: #0F172A;
}

.blog-search-clear {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-secondary, #9CA3AF);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.blog-search-clear:hover,
.blog-search-clear:focus-visible {
  background: rgba(16, 185, 129, 0.16);
  color: #10B981;
}

.blog-search-status {
  min-height: 1.25rem;
  margin: 0.7rem 0 0;
  color: var(--text-secondary, #9CA3AF);
  font-size: 0.8rem;
  text-align: center;
}

.blog-share-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 2.25rem;
  margin-top: 0.35rem;
}

.blog-copy-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(16, 185, 129, 0.24);
  border-radius: 8px;
  background: transparent;
  color: #10B981;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.blog-copy-link:hover:not(:disabled) {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.1);
  transform: translateY(-1px);
}

.blog-copy-link:focus-visible {
  outline: 3px solid rgba(16, 185, 129, 0.45);
  outline-offset: 2px;
}

.blog-copy-link:disabled {
  cursor: wait;
  opacity: 0.65;
}

.blog-copy-link.is-copied {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.16);
}

.blog-copy-status {
  min-width: 5.5rem;
  color: #10B981;
  font-size: 0.78rem;
  font-weight: 700;
}

html.light .blog-copy-link {
  border-color: rgba(15, 118, 110, 0.24);
  color: #047857;
}

html.light .blog-copy-link:hover:not(:disabled),
html.light .blog-copy-link.is-copied {
  border-color: #059669;
  background: #ECFDF5;
}

.blog-no-results {
  max-width: 620px;
  margin: -1rem auto 5rem;
  padding: 1.5rem;
  border: 1px dashed rgba(16, 185, 129, 0.3);
  border-radius: 14px;
  color: var(--text-secondary, #9CA3AF);
  text-align: center;
}

.blog-no-results button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #10B981;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.blog-no-results button:focus-visible,
.blog-search input:focus-visible,
.blog-search-clear:focus-visible {
  outline: 3px solid rgba(16, 185, 129, 0.45);
  outline-offset: 2px;
}

.blog-card[hidden] {
  display: none;
}

.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;
}

/* ── Blog Grid ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 4rem 0 5rem;
}

.blog-card {
  padding: 2rem;
  background: var(--bg-tertiary, #111827);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

html.light .blog-card {
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #06B6D4, #10B981);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-6px);
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(16, 185, 129, 0.08);
}

html.light .blog-card:hover {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(16, 185, 129, 0.1);
}

.blog-card:hover::before {
  opacity: 1;
}

.blog-card .badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: rgba(16, 185, 129, 0.1);
  color: #10B981;
  font-size: 0.72rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  align-self: flex-start;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.blog-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.35;
  color: var(--text-primary, #F9FAFB);
  letter-spacing: -0.01em;
}

html.light .blog-card h3 {
  color: #0F172A;
}

.blog-card p {
  color: var(--text-secondary, #9CA3AF);
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0 0 1.5rem;
  flex-grow: 1;
}

html.light .blog-card p {
  color: #475569;
}

.blog-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted, #4B5563);
  margin-bottom: 1.25rem;
}

html.light .blog-card-meta {
  color: #94A3B8;
}

.blog-card a.read-more {
  color: #10B981;
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap 0.2s ease;
}

.blog-card a.read-more::after {
  content: ' →';
  display: inline-block;
  transition: transform 0.25s ease;
}

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

/* ── CTA Section (at bottom of blog index) ── */
.cta-section {
  padding: 5rem 0;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-tertiary, #111827) 0%, var(--bg-primary, #030712) 100%);
  position: relative;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(6, 182, 212, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.cta-section h2 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.cta-section p {
  color: var(--text-secondary, #9CA3AF);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #06B6D4 0%, #10B981 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary, #F9FAFB);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

html.light .btn-outline {
  color: #0F172A;
  border: 1px solid rgba(15, 23, 42, 0.15);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ── Footer (for blog pages using portal.css) ── */
footer {
  background: #020617;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding: 4rem 0 2rem;
  margin-top: 0;
}

html.light footer {
  background: #F8FAFC;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #06B6D4, #10B981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  color: var(--text-secondary, #9CA3AF);
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #4B5563);
  margin-bottom: 1.25rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col ul li a {
  color: var(--text-secondary, #9CA3AF);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-col ul li a:hover {
  color: var(--text-primary, #F9FAFB);
}

html.light .footer-col ul li a {
  color: #475569;
}

html.light .footer-col ul li a:hover {
  color: #0F172A;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 2rem;
  font-size: 0.85rem;
  color: var(--text-muted, #4B5563);
  flex-wrap: wrap;
  gap: 1rem;
}

html.light .footer-bottom {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  color: #94A3B8;
}

.footer-bottom a {
  color: #10B981;
}

/* ── Article-specific styles (used by blog articles with pos/landing.css) ── */
.prose {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.prose h2 {
  font-size: 1.625rem;
  line-height: 1.3;
  margin: 2.5rem 0 0.75rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.prose h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
}

.prose p { margin: 1.25rem 0; }

.prose ul,
.prose ol {
  padding-left: 1.5rem;
  margin: 1.25rem 0;
}

.prose li { margin: 0.5rem 0; }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }

.prose code {
  background: rgba(16, 185, 129, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9em;
  color: var(--emerald-700, #047857);
}

.prose blockquote {
  border-left: 4px solid var(--emerald-500, #10B981);
  padding: 0.75rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

.prose a {
  color: var(--emerald-700, #047857);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose table {
  margin: 1.5rem 0;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(16, 185, 129, 0.15);
  text-align: left;
}

.prose th {
  font-weight: 700;
}

/* ── Article Hero ── */
.blog-hero {
  padding: 6rem 0 2.5rem;
  border-bottom: 1px solid rgba(16, 185, 129, 0.1);
}

.blog-hero .container { max-width: 720px; }

.article-meta {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0 0;
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.article-meta-item {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.article-meta-item::before {
  content: '•';
  color: var(--emerald-500, #10B981);
  font-weight: bold;
}

.article-meta-item:first-child::before { display: none; }

/* ── Mid-article inline CTA ── */
.article-cta-inline {
  background: rgba(16, 185, 129, 0.07);
  border-left: 4px solid var(--emerald-500, #10B981);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

/* ── Related articles ── */
.related-articles {
  margin: 4rem auto 0;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(16, 185, 129, 0.15);
  max-width: 720px;
}

.related-articles h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.related-card {
  padding: 1.25rem;
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 12px;
  transition: all 0.25s ease;
}

.related-card:hover {
  border-color: var(--emerald-500, #10B981);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.15);
}

.related-card h4 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  line-height: 1.4;
}

.related-card p {
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.5;
}

.related-card a {
  text-decoration: none;
  display: block;
}

/* ── Prev / Next Navigation ── */
.prev-next-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2.5rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(16, 185, 129, 0.15);
  max-width: 720px;
}

.prev-next-nav.single-card {
  grid-template-columns: 1fr;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.prev-next-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 12px;
  transition: all 0.25s ease;
  text-decoration: none;
}

.prev-next-card:hover {
  border-color: var(--emerald-500, #10B981);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.15);
}

.prev-next-card.direction-next {
  text-align: right;
  align-items: flex-end;
}

.prev-next-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--emerald-700, #047857);
  margin-bottom: 0.4rem;
}

.prev-next-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

/* ── Navbar (for blog pages using portal.css) ── */
.nav-logo-sm {
  vertical-align: middle;
  border-radius: 4px;
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  .blog-index-hero { padding: 120px 0 2.5rem; text-align: left; }
  .blog-index-hero h1 { font-size: 2rem; }
  .blog-search { margin-top: 1.5rem; }
  .blog-categories { margin-bottom: 0.65rem; }
  .blog-category-option span { padding: 0.4rem 0.75rem; }
  .blog-search-input-wrap { min-height: 3rem; }
  .blog-share-row { justify-content: flex-start; }
  .blog-grid { grid-template-columns: 1fr; padding: 2.5rem 0 3rem; }
  .prose h2 { font-size: 1.4rem; }
  .related-grid { grid-template-columns: 1fr; }
  .prev-next-nav { grid-template-columns: 1fr; }
  .prev-next-card.direction-next { text-align: left; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .cta-buttons { flex-direction: column; align-items: center; }
  .cta-buttons .btn { width: 100%; max-width: 320px; }
}
