/* ============================================================
   BakeryOS — blog-article.css
   Requires: common.css (Plus Jakarta Sans, Bootstrap 5, BI icons)
   ============================================================ */

/* ── Token overrides for article context ── */
:root {
  --article-bg:        #f6f8fc;
  --card-bg:           #ffffff;
  --text-main:         #0f172a;
  --text-muted:        #475569;
  --text-light:        #64748b;
  --border-soft:       #e2e8f0;
  --accent:            #2563eb;
  --accent-hover:      #1d4ed8;
  --accent-soft:       #eff6ff;
  --accent-border:     #bfdbfe;
  --success:           #0f766e;
  --success-soft:      #f0fdfa;
  --gold:              #b45309;
  --gold-soft:         #fffbeb;
  --warn-border:       #fcd34d;
  --red:               #dc2626;
  --red-soft:          #fef2f2;
  --red-border:        #fecaca;
  /* primary-600 used by common.css btn classes */
  --primary-600:       #2563eb;
  --primary-700:       #1d4ed8;
}

/* ── Page background ── */
body {
  background:
    radial-gradient(circle at 8% -8%,  rgba(219,234,254,.55) 0%, transparent 40%),
    radial-gradient(circle at 90% 0%,  rgba(254,243,199,.55) 0%, transparent 36%),
    var(--article-bg);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ── Shell ── */
.article-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* ── Topbar ── */
.article-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.article-logo {
  display: block;
  width: auto;
  height: 42px;
  max-width: 220px;
  object-fit: contain;
}

.article-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Hero card ── */
.article-hero {
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fbff 60%, #fffdf7 100%);
  padding: 36px 32px 28px;
  box-shadow: 0 12px 32px rgba(15,23,42,.07);
}

.article-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

.article-title {
  margin: 14px 0 10px;
  color: var(--text-main);
  font-size: clamp(1.75rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.02em;
}

.article-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 760px;
}

.article-meta-row {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-meta-pill {
  border: 1px solid var(--border-soft);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}

/* ── Two-column layout ── */
.article-layout {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 20px;
  align-items: start;
}

/* ── Main article card ── */
.article-main {
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: var(--card-bg);
  padding: 36px 32px;
}

.article-main > p:first-child {
  font-size: 1.05rem;
  color: #334155;
  line-height: 1.85;
}

.article-main h2 {
  margin: 40px 0 12px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -.01em;
  padding-top: 4px;
  border-top: 2px solid var(--accent-soft);
  padding-top: 20px;
}

.article-main h2:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.article-main h3 {
  margin: 24px 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.article-main p,
.article-main li {
  color: #334155;
  line-height: 1.82;
  font-size: 0.97rem;
}

.article-main p { margin-bottom: 14px; }
.article-main p:last-child { margin-bottom: 0; }

.article-main ul,
.article-main ol {
  padding-left: 1.4rem;
  margin-bottom: 16px;
}

.article-main li { margin-bottom: 7px; }

.article-main a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-border);
}
.article-main a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

.article-main strong { color: var(--text-main); font-weight: 700; }

/* ── Callout / highlight boxes ── */
.article-highlight {
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 24px 0;
}

.callout {
  border-radius: 10px;
  padding: 18px 20px;
  margin: 24px 0;
}

.callout-insight {
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
}

.callout-warning {
  background: var(--red-soft);
  border-left: 3px solid var(--red);
}

.callout-success {
  background: var(--success-soft);
  border-left: 3px solid var(--success);
}

.callout-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 7px;
}

.callout-insight  .callout-label { color: var(--gold); }
.callout-warning  .callout-label { color: var(--red); }
.callout-success  .callout-label { color: var(--success); }
.callout p { margin: 0; font-size: 0.93rem; }

/* ── Case-study card ── */
.case-card {
  background: var(--success-soft);
  border: 1px solid #99f6e4;
  border-radius: 14px;
  padding: 24px 26px;
  margin: 24px 0;
}

.case-card-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--success);
  margin-bottom: 12px;
}

.case-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 10px;
}

.case-card p {
  font-size: 0.93rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.case-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.case-stat .stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--success);
  line-height: 1;
}

.case-stat .stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  max-width: 140px;
  line-height: 1.4;
}

/* ── Comparison / data tables ── */
.article-table,
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--card-bg);
}

.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}

.article-table th,
.table-wrap table th {
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  padding: 11px 14px;
  text-align: left;
  white-space: nowrap;
  font-size: 0.82rem;
}

.article-table td,
.table-wrap table td {
  border-top: 1px solid var(--border-soft);
  padding: 10px 14px;
  color: #334155;
  vertical-align: middle;
}

.table-wrap table tr:hover td { background: #f8fafc; }
.table-wrap table tr.highlight-row td { background: var(--accent-soft); }
.table-wrap table tr.best-for-row td {
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
  border-bottom: 2px solid var(--border-soft);
}

/* ── Badges ── */
.badge-yes  { display:inline-block; padding:2px 9px; border-radius:4px; font-size:11px; font-weight:700; background:var(--success-soft); color:var(--success); border:1px solid #99f6e4; }
.badge-no   { display:inline-block; padding:2px 9px; border-radius:4px; font-size:11px; font-weight:700; background:var(--red-soft); color:var(--red); border:1px solid var(--red-border); }
.badge-part { display:inline-block; padding:2px 9px; border-radius:4px; font-size:11px; font-weight:700; background:var(--gold-soft); color:var(--gold); border:1px solid var(--warn-border); }

/* ── Tool cards ── */
.tool-card {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--card-bg);
  padding: 22px 24px;
  margin: 16px 0;
}

.tool-card.featured {
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.tool-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.tool-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.tool-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 10px;
  border-radius: 5px;
  white-space: nowrap;
}

.tag-bakery    { background: var(--accent-soft); color: var(--accent-hover); border: 1px solid var(--accent-border); }
.tag-general   { background: #f1f5f9; color: #475569; border: 1px solid var(--border-soft); }
.tag-enterprise{ background: var(--gold-soft); color: var(--gold); border: 1px solid var(--warn-border); }
.tag-middleware{ background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }

.tool-card > p { font-size: 0.93rem; color: var(--text-muted); margin-bottom: 12px; }

.tool-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.pros-box, .cons-box {
  padding: 14px 16px;
  border-radius: 10px;
}

.pros-box { background: var(--success-soft); border: 1px solid #99f6e4; }
.cons-box { background: var(--red-soft);     border: 1px solid var(--red-border); }

.pc-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
}

.pros-box .pc-label { color: var(--success); }
.cons-box .pc-label { color: var(--red); }

.pros-box ul, .cons-box ul {
  padding-left: 14px;
  margin: 0;
}

.pros-box li, .cons-box li {
  font-size: 0.84rem;
  margin-bottom: 5px;
  color: #334155;
}

.tool-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.tool-meta-item {
  font-size: 0.83rem;
  color: var(--text-light);
}

.tool-meta-item strong {
  color: #334155;
  font-weight: 700;
}

/* ── Decision grid ── */
.decision-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}

.decision-card {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--card-bg);
}

.dc-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-light);
  margin-bottom: 6px;
}

.dc-pick {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 5px;
}

.dc-reason {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── FAQ accordion ── */
.faq-list { margin: 0; }

.faq-item {
  border-bottom: 1px solid var(--border-soft);
}

.faq-item:last-child { border-bottom: none; }

.faq-btn {
  all: unset;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 0;
  cursor: pointer;
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  line-height: 1.45;
}

.faq-btn:hover { color: var(--accent); }

.faq-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, background .2s;
  margin-top: 1px;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  background: var(--accent);
  color: #fff;
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .25s ease;
}

.faq-item.open .faq-answer {
  grid-template-rows: 1fr;
}

.faq-answer-inner {
  overflow: hidden;
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.75;
  padding-bottom: 18px;
}

/* ── CTA block ── */
.article-cta {
  background: linear-gradient(135deg, #1e40af 0%, #0f172a 100%);
  border-radius: 16px;
  padding: 40px 36px;
  text-align: center;
  margin: 36px 0;
}

.article-cta h2 {
  margin: 0 0 10px !important;
  border: none !important;
  padding: 0 !important;
  font-size: 1.6rem !important;
  color: #fff !important;
}

.article-cta p {
  color: rgba(255,255,255,.75);
  font-size: 0.97rem;
  max-width: 440px;
  margin: 0 auto 24px;
}

/* ── Article highlight (generic) ── */
.article-highlight h2 {
  margin: 0 0 8px !important;
  border: none !important;
  padding: 0 !important;
  font-size: 1.1rem !important;
}

/* ── Aside ── */
.article-aside {
  position: sticky;
  top: 80px;
  display: grid;
  gap: 14px;
}

.toc-card,
.cta-card,
.related-card {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #fff;
  padding: 18px;
}

.toc-title,
.card-title {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
}

.toc-list a {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  color: #475569;
  font-size: 0.83rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.45;
  transition: background .12s, color .12s;
}

.toc-list a:hover,
.toc-list a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.cta-card {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--success-soft) 100%);
  border-color: var(--accent-border);
}

.cta-card p,
.related-card p {
  font-size: 0.85rem;
  color: #475569;
  margin: 0 0 12px;
  line-height: 1.6;
}

.related-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.related-list a {
  display: flex;
  gap: 8px;
  color: var(--accent-hover);
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.45;
}

.related-list a::before {
  content: "→";
  color: var(--accent);
  flex-shrink: 0;
}

.related-list a:hover { text-decoration: underline; }

/* ── Footer nav ── */
.article-footer-nav {
  margin-top: 20px;
  border-top: 1px solid var(--border-soft);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.article-footer-nav a {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .12s;
}

.article-footer-nav a:hover { color: var(--accent); }

/* ── Section divider ── */
.section-divider {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 4px 0;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-aside {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .article-hero,
  .article-main {
    padding: 20px 18px;
  }

  .tool-pros-cons,
  .decision-grid {
    grid-template-columns: 1fr;
  }

  .article-aside {
    grid-template-columns: 1fr;
  }

  .article-cta {
    padding: 28px 20px;
  }

  .case-stats {
    gap: 18px;
  }
}

@media (max-width: 480px) {
  .article-title { font-size: 1.65rem; }

  .article-logo {
    height: 36px;
    max-width: 180px;
  }

  .article-actions { width: 100%; }
}