/* ============================================================
   DialogCRM — Blog & Article Styling
   Inherits design tokens and variables from landing.css
   ============================================================ */

/* ---------- Page Layout & Global Overrides for Blog ---------- */
body.blog-page {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.blog-page main {
  flex: 1 0 auto;
}

/* Ensure header is legible without hero video */
.blog-header {
  background: rgba(244, 243, 238, 0.94);
  backdrop-filter: blur(14px) saturate(130%);
  border-bottom: 1px solid var(--border);
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs-nav {
  padding: 100px 0 20px;
}
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13.5px;
  font-family: var(--mono);
  color: var(--muted-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.breadcrumbs a:hover {
  color: var(--accent);
}
.breadcrumbs span.sep {
  color: var(--border-2);
  user-select: none;
}
.breadcrumbs .current {
  color: var(--text);
  font-weight: 500;
  max-width: 480px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Blog Hub (Index) ---------- */
.blog-hero {
  padding: 30px 0 45px;
  text-align: center;
  position: relative;
}
.blog-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-family: var(--mono);
  color: var(--accent);
  margin-bottom: 16px;
}
.blog-hero h1 {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--text);
}
.blog-hero p {
  font-size: clamp(16px, 1.8vw, 18.5px);
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.55;
}

/* Blog Search & Filter Bar */
.blog-controls {
  max-width: 820px;
  margin: 0 auto 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.blog-search-box {
  position: relative;
  width: 100%;
}
.blog-search-input {
  width: 100%;
  padding: 16px 20px 16px 50px;
  border-radius: var(--radius);
  border: 1px solid var(--border-2);
  background: var(--surface);
  font-size: 16px;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.blog-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-t), var(--shadow-soft);
}
.blog-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}
.blog-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.cat-pill {
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.cat-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(43, 73, 240, 0.25);
}

.blog-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1220px;
  margin: 0 auto 24px;
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted-2);
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 70px;
}
@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}
@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* Blog Card */
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
  position: relative;
  text-decoration: none;
  color: inherit;
}
.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.article-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.article-card-category {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-t);
  color: var(--accent);
}
.article-card-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.article-card h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: 12px;
  transition: color .2s var(--ease);
}
.article-card:hover h3 {
  color: var(--accent);
}
.article-card p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 22px;
  flex-grow: 1;
}
.article-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.article-card-author {
  color: var(--muted);
  font-weight: 500;
}
.article-card-read-link {
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap .2s var(--ease);
}
.article-card:hover .article-card-read-link {
  gap: 10px;
}

/* Empty Search State */
.blog-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  grid-column: 1 / -1;
  display: none;
}
.blog-empty h4 {
  font-family: var(--display);
  font-size: 20px;
  margin-bottom: 8px;
}
.blog-empty p {
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Single Article View ---------- */
.article-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  padding: 20px 0 80px;
  align-items: start;
}
@media (max-width: 980px) {
  .article-wrap {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.article-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 56px);
  box-shadow: var(--shadow-soft);
}

.article-hero {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.article-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.article-badge {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--accent-t);
  color: var(--accent);
}
.article-date, .article-readtime {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.article-hero h1 {
  font-family: var(--display);
  font-size: clamp(24px, 3.5vw, 40px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 18px;
}
.article-lead {
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.6;
  color: var(--muted);
  font-weight: 400;
}

/* Article Author Bar */
.article-author-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}
.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}
.author-info .name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text);
}
.author-info .role {
  font-size: 12.5px;
  color: var(--muted-2);
}

/* Article Table of Contents (Mobile & Desktop) */
.article-toc-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 36px;
}
.article-toc-title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.article-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 14.5px;
}
.article-toc-list li {
  position: relative;
  padding-left: 18px;
}
.article-toc-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--accent);
  font-size: 12px;
}
.article-toc-list a {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.article-toc-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Article Content Body */
.article-body {
  font-size: 16.5px;
  line-height: 1.75;
  color: #212631;
}
.article-body h2 {
  font-family: var(--display);
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.3;
  margin: 42px 0 18px;
  color: var(--text);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.article-body h2:first-of-type {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}
.article-body h3 {
  font-family: var(--display);
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.35;
  margin: 28px 0 14px;
  color: var(--text);
}
.article-body p {
  margin-bottom: 20px;
}
.article-body strong {
  font-weight: 600;
  color: var(--text);
}

/* Lists */
.article-body ul, .article-body ol {
  margin: 0 0 24px 24px;
  padding: 0;
}
.article-body li {
  margin-bottom: 10px;
}
.checklist {
  list-style: none !important;
  margin-left: 0 !important;
}
.checklist li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
}
.checklist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--emerald-t);
  color: var(--emerald);
  font-size: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

/* Callouts / Highlighters */
.callout {
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 28px 0;
  font-size: 15.5px;
  line-height: 1.6;
}
.callout-tip {
  background: rgba(43, 73, 240, 0.05);
  border-left: 4px solid var(--accent);
}
.callout-warn {
  background: rgba(199, 122, 8, 0.07);
  border-left: 4px solid var(--amber);
}
.callout-danger {
  background: rgba(214, 69, 61, 0.07);
  border-left: 4px solid var(--red);
}
.callout-success {
  background: rgba(14, 159, 110, 0.07);
  border-left: 4px solid var(--emerald);
}
.callout-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.callout p:last-child {
  margin-bottom: 0;
}

/* Data / Comparison Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 30px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  text-align: left;
}
.article-table th {
  background: var(--surface-2);
  padding: 14px 18px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border-2);
  font-family: var(--display);
  font-size: 13.5px;
}
.article-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.article-table tr:last-child td {
  border-bottom: none;
}
.article-table tr:hover td {
  background: rgba(43, 73, 240, 0.02);
}

/* In-Article FAQ Accordion */
.article-faq-section {
  margin: 48px 0 32px;
  padding: 32px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.article-faq-section h3 {
  font-family: var(--display);
  font-size: 22px;
  margin-bottom: 20px;
  color: var(--text);
}
.article-faq-list .faq-item {
  border-bottom: 1px solid var(--border);
}
.article-faq-list .faq-item:last-child {
  border-bottom: none;
}
.article-faq-list .faq-q {
  font-size: 16px;
  padding: 18px 4px;
}
.article-faq-list .faq-a p {
  font-size: 15px;
  padding: 0 4px 18px;
}

/* Article Sidebar */
.article-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}
.sidebar-widget h4 {
  font-family: var(--display);
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}

/* CTA Card in Article */
.article-cta-box {
  background: linear-gradient(135deg, #101319, #1b212f);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 44px);
  margin: 48px 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.article-cta-box::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(109,135,255,.25), transparent 70%);
  pointer-events: none;
}
.article-cta-box h3 {
  font-family: var(--display);
  font-size: clamp(20px, 2.5vw, 26px);
  margin-bottom: 12px;
  color: #fff;
  position: relative;
}
.article-cta-box p {
  color: #A9B1C2;
  font-size: 15px;
  margin-bottom: 24px;
  max-width: 580px;
  position: relative;
}
.article-cta-box .btn {
  position: relative;
  z-index: 2;
}

/* Related Articles */
.related-section {
  padding: 60px 0 80px;
  border-top: 1px solid var(--border);
}
.related-section h2 {
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  margin-bottom: 30px;
  color: var(--text);
}

/* ============================================================
   Flagship Editorial & Interactive Components (Competing with Giants)
   ============================================================ */

/* Interactive Franchise Loss & Royalty Calculator */
.franchise-calc-box {
  background: linear-gradient(145deg, #101319 0%, #171d28 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 4vw, 44px);
  color: #fff;
  margin: 40px 0;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.franchise-calc-box::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(43,73,240,0.22), transparent 70%);
  pointer-events: none;
}
.franchise-calc-header {
  position: relative;
  z-index: 2;
  margin-bottom: 28px;
}
.franchise-calc-header h3 {
  font-family: var(--display);
  font-size: clamp(20px, 2.4vw, 26px);
  color: #fff;
  margin-bottom: 8px;
}
.franchise-calc-header p {
  color: #A9B1C2;
  font-size: 14.5px;
  margin: 0;
}
.franchise-calc-controls {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}
@media (max-width: 860px) {
  .franchise-calc-controls {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
.calc-ctrl-item label {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  font-family: var(--mono);
  color: #A9B1C2;
  margin-bottom: 10px;
}
.calc-ctrl-item label b {
  color: #7B92FF;
  font-size: 15px;
}
.calc-range {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,0.15);
  outline: none;
  cursor: pointer;
  accent-color: #7B92FF;
}
.franchise-calc-results {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
@media (max-width: 860px) {
  .franchise-calc-results {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
.res-card .lbl {
  font-family: var(--mono);
  font-size: 12px;
  color: #79818F;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.res-card .val {
  font-family: var(--mono);
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 700;
  letter-spacing: -.02em;
}
.res-card.loss .val { color: #f87171; }
.res-card.royalty .val { color: #60a5fa; }
.res-card.gain .val { color: #34d399; }
.res-card .sub {
  font-size: 12.5px;
  color: #A9B1C2;
  margin-top: 4px;
}
.franchise-calc-cta {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.franchise-calc-cta p {
  color: #A9B1C2;
  font-size: 13.5px;
  margin: 0;
  max-width: 440px;
}

/* Comparative Benchmark Matrix */
.comp-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 36px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14.5px;
}
.comp-matrix th {
  background: var(--surface-2);
  padding: 16px 20px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-2);
  text-align: left;
}
.comp-matrix th.col-dialog,
.comp-matrix td.col-dialog {
  background: rgba(43, 73, 240, 0.05);
  font-weight: 600;
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}
.comp-matrix th.col-dialog {
  color: var(--accent);
  border-top: 2px solid var(--accent);
}
.comp-matrix tr:last-child td.col-dialog {
  border-bottom: 2px solid var(--accent);
}
.comp-matrix td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  vertical-align: middle;
}
.comp-matrix tr:last-child td {
  border-bottom: none;
}
.badge-yes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--emerald);
  font-weight: 600;
}
.badge-no {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--red);
  font-weight: 500;
}
.badge-part {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--amber);
  font-weight: 500;
}

/* Real Case Study Component */
.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--emerald);
  border-radius: var(--radius);
  padding: 30px;
  margin: 36px 0;
  box-shadow: var(--shadow-soft);
}
.case-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.case-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--emerald-t);
  color: var(--emerald);
}
.case-card h4 {
  font-family: var(--display);
  font-size: 20px;
  color: var(--text);
  margin-bottom: 8px;
}
.case-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 22px 0;
}
@media (max-width: 700px) {
  .case-metrics-grid {
    grid-template-columns: 1fr;
  }
}
.case-metric-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.case-metric-item .num {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--emerald);
  letter-spacing: -.02em;
}
.case-metric-item .lbl {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* Legal Clause Callout */
.legal-clause-box {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 24px 28px;
  margin: 30px 0;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
  position: relative;
}
.legal-clause-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

