/* automateglobal.ca - blog article styles
   Uses site.css CSS variables so articles inherit the site brand:
   --accent, --accent-tint, --ink-70, --ink-60, --bg-warm, --line, --r-md, --shadow-md */

.ag-article {
  max-width: 760px;
  margin: 0 auto;
  color: var(--ink-70, #333);
  font-size: 17px;
  line-height: 1.75;
}
.ag-article p { margin: 0 0 1.1rem; font-size: 17px; }
.ag-article h2 {
  font-size: clamp(24px, 3vw, 32px);
  margin: 2.5rem 0 1rem;
  padding-top: 1rem;
  color: var(--ink, #0b1a12);
  letter-spacing: -0.01em;
}
.ag-article h3 {
  font-size: 20px;
  margin: 1.75rem 0 0.6rem;
  color: var(--ink, #0b1a12);
  font-weight: 700;
}
.ag-article a {
  color: var(--accent, #0F5C3C);
  text-decoration: underline;
  text-decoration-color: var(--accent-tint, #d7efe3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}
.ag-article a:hover {
  text-decoration-color: var(--accent, #0F5C3C);
}
.ag-article .ag-byline {
  color: var(--ink-60, #666);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  margin: 1rem 0 0;
}

/* Hero image */
.ag-article .ag-hero,
.ag-article figure {
  margin: 1.5rem 0 2rem;
}
.ag-article .ag-hero img,
.ag-article figure img {
  width: 100%;
  height: auto;
  border-radius: var(--r-md, 12px);
  display: block;
  box-shadow: var(--shadow-md, 0 4px 24px rgba(0,0,0,0.08));
}
.ag-article figcaption {
  font-size: 14px;
  color: var(--ink-60, #666);
  text-align: center;
  margin-top: 0.75rem;
  font-style: italic;
}

/* TL;DR callout — uses accent tint for brand match */
.ag-article .ag-tldr {
  background: var(--accent-tint, #e8f5ee);
  border-left: 3px solid var(--accent, #0F5C3C);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  border-radius: 0 var(--r-md, 12px) var(--r-md, 12px) 0;
}
.ag-article .ag-tldr strong {
  color: var(--accent, #0F5C3C);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 0.5rem;
}
.ag-article .ag-tldr p { margin: 0; font-size: 16px; }

/* Tables — brand green header */
.ag-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 15px;
  border: 1px solid var(--line, #e6e6e6);
  border-radius: var(--r-md, 12px);
  overflow: hidden;
}
.ag-article th {
  background: var(--ink, #0b1a12);
  color: #fff;
  text-align: left;
  padding: 0.875rem 1rem;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.ag-article td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--line, #e6e6e6);
  transition: background-color 200ms ease;
}
.ag-article tbody tr:last-child td { border-bottom: none; }
.ag-article tbody tr:hover td { background: var(--bg-warm, #faf7f2); }

/* Data viz bar chart — uses brand gradient */
.ag-article .ag-chart {
  background: var(--bg-warm, #faf7f2);
  border: 1px solid var(--line, #e6e6e6);
  padding: 1.75rem;
  border-radius: var(--r-md, 12px);
  margin: 2rem 0;
}
.ag-article .ag-chart h3 { margin-top: 0; }
.ag-article .ag-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 90px;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.85rem;
  font-size: 14px;
}
.ag-article .ag-bar-label {
  font-weight: 600;
  color: var(--ink, #0b1a12);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
}
.ag-article .ag-bar-track {
  background: #fff;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line, #e6e6e6);
}
.ag-article .ag-bar-fill {
  background: linear-gradient(90deg, var(--accent, #0F5C3C), #5BC995);
  height: 100%;
  width: 0;
  border-radius: 3px;
}
.ag-article .ag-bar-value {
  text-align: right;
  color: var(--accent, #0F5C3C);
  font-weight: 700;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
}

/* FAQ accordion */
.ag-article details {
  background: #fff;
  border: 1px solid var(--line, #e6e6e6);
  border-radius: 8px;
  margin-bottom: 0.6rem;
  padding: 1rem 1.25rem;
  transition: box-shadow 200ms ease, border-color 200ms ease;
}
.ag-article details[open] {
  box-shadow: 0 2px 12px rgba(15, 92, 60, 0.07);
  border-color: #5BC995;
}
.ag-article summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--ink, #0b1a12);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 16px;
}
.ag-article summary::-webkit-details-marker { display: none; }
.ag-article summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--accent-tint, #e8f5ee);
  color: var(--accent, #0F5C3C);
  border-radius: 50%;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  transition: transform 200ms ease;
}
.ag-article details[open] summary::before { content: "−"; }
.ag-article details p {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line, #e6e6e6);
  color: var(--ink-70, #333);
  font-size: 15px;
}

/* Image credits block (shown at bottom of article) */
.ag-article .ag-credits {
  margin-top: 3rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-warm, #faf7f2);
  border-radius: var(--r-md, 12px);
  font-size: 13px;
  color: var(--ink-60, #666);
}
.ag-article .ag-credits h3 {
  margin: 0 0 0.5rem;
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-60, #666);
}
.ag-article .ag-credits ul {
  padding-left: 1.25rem;
  margin: 0;
}
.ag-article .ag-credits li { margin-bottom: 0.3rem; }

/* Animations (respect reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  .ag-article .ag-hero img { animation: ag-blog-fade-in 800ms ease-out both; }
  .ag-article .ag-bar-fill {
    animation: ag-blog-bar-grow 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
  }
  .ag-article .ag-tldr { animation: ag-blog-pulse 2.4s ease-out 1; }
  @keyframes ag-blog-fade-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes ag-blog-bar-grow { from { width: 0; } to { width: var(--w, 50%); } }
  @keyframes ag-blog-pulse {
    0% { box-shadow: 0 0 0 0 rgba(15, 92, 60, 0.25); }
    50% { box-shadow: 0 0 0 10px rgba(15, 92, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(15, 92, 60, 0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .ag-article .ag-bar-fill { width: var(--w, 50%); }
}

/* Mobile */
@media (max-width: 640px) {
  .ag-article .ag-bar-row { grid-template-columns: 90px 1fr 70px; gap: 0.5rem; }
  .ag-article .ag-bar-label { font-size: 12px; }
}

/* ============ Enterprise article layout: sidebar, TOC, progress, author, related ============ */

/* Reading progress bar - fixed top */
.ag-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 9999;
  pointer-events: none;
}
.ag-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent, #0F5C3C), #5BC995);
  transition: width 50ms linear;
}

/* Breadcrumb */
.ag-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-60, #666);
  margin-bottom: 20px;
}
.ag-breadcrumb a {
  color: var(--ink-60, #666);
  text-decoration: none;
  transition: color 0.15s;
}
.ag-breadcrumb a:hover { color: var(--accent, #0F5C3C); }
.ag-breadcrumb .current { color: var(--accent, #0F5C3C); font-weight: 700; }
.ag-breadcrumb span { opacity: 0.5; }

/* Article hero - override generic .page-hero spacing */
.ag-article-hero { padding: 72px 0 48px; }
.ag-article-hero h1 { font-size: clamp(32px, 4.2vw, 52px); margin-bottom: 20px; max-width: 820px; }
.ag-article-hero .eyebrow {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(15, 92, 60, 0.08);
  color: var(--accent, #0F5C3C);
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* 2-col article layout */
.ag-article-section { padding: 56px 0 72px; background: #fff; }
.ag-article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 56px;
  align-items: start;
}
.ag-article-layout .ag-article {
  max-width: 720px;
  margin: 0;
}

/* Sidebar */
.ag-sidebar { position: relative; }
.ag-sidebar-sticky {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.ag-toc h4,
.ag-share h4 {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60, #666);
  margin: 0 0 14px;
  font-weight: 700;
}
.ag-toc {
  background: var(--bg-warm, #faf7f2);
  padding: 20px 22px;
  border-radius: var(--r-md, 12px);
  border: 1px solid var(--line, #e6e6e6);
}
.ag-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}
.ag-toc li {
  counter-increment: toc;
  position: relative;
  padding: 4px 0 4px 24px;
}
.ag-toc li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: var(--ink-60, #666);
  letter-spacing: 0.04em;
}
.ag-toc a {
  color: var(--ink-70, #333);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.45;
  display: block;
  transition: color 0.15s;
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -10px;
}
.ag-toc a:hover { color: var(--accent, #0F5C3C); }
.ag-toc a.active {
  color: var(--accent, #0F5C3C);
  font-weight: 600;
  border-left-color: var(--accent, #0F5C3C);
}

/* Share buttons */
.ag-share-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ag-share-buttons a,
.ag-share-buttons button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid var(--line, #e6e6e6);
  border-radius: 8px;
  color: var(--ink-70, #333);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.ag-share-buttons a:hover,
.ag-share-buttons button:hover {
  border-color: var(--accent, #0F5C3C);
  color: var(--accent, #0F5C3C);
}

/* Author card */
.ag-author-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  padding: 28px;
  margin: 48px 0 0;
  background: var(--bg-warm, #faf7f2);
  border: 1px solid var(--line, #e6e6e6);
  border-radius: var(--r-md, 12px);
}
.ag-author-avatar {
  width: 56px;
  height: 56px;
  background: #fff;
  border: 1px solid rgba(15, 92, 60, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ag-author-avatar svg { width: 32px; height: 32px; }
.ag-author-body { min-width: 0; }
.ag-author-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60, #666);
  font-weight: 700;
  margin-bottom: 4px;
}
.ag-author-name { font-size: 18px; margin: 0 0 2px; color: var(--ink, #0b1a12); }
.ag-author-role { font-size: 13px; color: var(--ink-60, #666); margin: 0 0 10px; }
.ag-author-bio { font-size: 14px; color: var(--ink-70, #333); line-height: 1.6; margin: 0 0 10px; }
.ag-author-link { color: var(--accent, #0F5C3C); font-weight: 600; font-size: 13px; text-decoration: none; }
.ag-author-link:hover { text-decoration: underline; }

/* Related articles */
.ag-related {
  padding: 72px 0;
  background: var(--bg-warm, #faf7f2);
  border-top: 1px solid var(--line, #e6e6e6);
}
.ag-related-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.ag-related-head h2 { font-size: clamp(24px, 2.6vw, 32px); margin: 0; letter-spacing: -0.01em; }
.ag-related-head .ag-related-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, #0F5C3C);
  font-weight: 700;
  display: block;
  margin-bottom: 10px;
}
.ag-related-head a {
  color: var(--accent, #0F5C3C);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.ag-related-head a:hover { text-decoration: underline; }
.ag-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.ag-related-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line, #e6e6e6);
  border-radius: var(--r-md, 12px);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.ag-related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(13, 31, 23, 0.08);
  border-color: rgba(15, 92, 60, 0.25);
}
.ag-related-image {
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  background-color: #e8e8e8;
}
.ag-related-body { padding: 20px 22px 24px; }
.ag-related-meta {
  display: flex;
  gap: 7px;
  align-items: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-60, #666);
  margin-bottom: 10px;
  text-transform: uppercase;
  font-weight: 600;
}
.ag-related-meta .cat { color: var(--accent, #0F5C3C); }
.ag-related-meta .sep { opacity: 0.4; }
.ag-related-title { font-size: 17px; margin: 0 0 8px; line-height: 1.3; color: var(--ink, #0b1a12); }
.ag-related-excerpt { font-size: 14px; color: var(--ink-70, #333); line-height: 1.55; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Mobile */
@media (max-width: 900px) {
  .ag-article-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .ag-article-layout .ag-article { max-width: none; }
  .ag-sidebar-sticky {
    position: static;
    flex-direction: column;
  }
  .ag-toc { order: -1; }
  .ag-share { display: none; }
  .ag-author-card {
    grid-template-columns: 1fr;
    text-align: left;
  }
}

/* ============ Enterprise article CTA (end of article) ============ */
.ag-article-cta {
  position: relative;
  padding: 88px 0;
  background: linear-gradient(135deg, #07110C 0%, #0F5C3C 100%);
  color: #fff;
  overflow: hidden;
}
.ag-article-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(91, 201, 149, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 201, 149, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
  pointer-events: none;
}
.ag-article-cta .container {
  position: relative;
  z-index: 1;
}
.ag-article-cta-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 64px;
  align-items: center;
}
.ag-article-cta-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(91, 201, 149, 0.1);
  border: 1px solid rgba(91, 201, 149, 0.25);
  border-radius: 999px;
  color: #5BC995;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 20px;
}
.ag-article-cta-headline {
  color: #fff;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  max-width: 540px;
}
.ag-article-cta-subtext {
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
  line-height: 1.6;
  max-width: 540px;
  margin: 0 0 28px;
}
.ag-article-cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.ag-article-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: #5BC995;
  color: #07110C;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(91, 201, 149, 0.3);
}
.ag-article-cta-primary:hover {
  background: #7dd4a9;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(91, 201, 149, 0.45);
  color: #07110C;
}
.ag-article-cta-primary svg {
  transition: transform 0.2s ease;
}
.ag-article-cta-primary:hover svg {
  transform: translateX(3px);
}
.ag-article-cta-secondary {
  display: inline-flex;
  align-items: center;
  padding: 14px 22px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.ag-article-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.ag-article-cta-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.ag-article-cta-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.65);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.ag-article-cta-meta-item svg { color: #5BC995; }

/* Right side: contact card */
.ag-article-cta-aside {
  display: flex;
  justify-content: flex-end;
}
.ag-article-cta-card {
  background: rgba(91, 201, 149, 0.06);
  border: 1px solid rgba(91, 201, 149, 0.2);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 320px;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}
.ag-article-cta-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(91, 201, 149, 0.15) 0%, transparent 70%);
  pointer-events: none;
}
.ag-article-cta-card-avatar {
  width: 52px;
  height: 52px;
  background: rgba(91, 201, 149, 0.1);
  border: 1px solid rgba(91, 201, 149, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.ag-article-cta-card-avatar svg { width: 32px; height: 32px; }
.ag-article-cta-card-tag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5BC995;
  font-weight: 700;
  margin-bottom: 4px;
}
.ag-article-cta-card-name {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}
.ag-article-cta-card-role {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin-bottom: 20px;
}
.ag-article-cta-card-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}
.ag-article-cta-card-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13.5px;
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.15s ease;
}
.ag-article-cta-card-contact:hover { color: #5BC995; }
.ag-article-cta-card-contact svg {
  color: #5BC995;
  opacity: 0.8;
  flex-shrink: 0;
}

/* Mobile stack */
@media (max-width: 900px) {
  .ag-article-cta { padding: 56px 0; }
  .ag-article-cta-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .ag-article-cta-aside {
    justify-content: center;
  }
  .ag-article-cta-card {
    max-width: 100%;
  }
  .ag-article-cta-meta {
    gap: 14px;
  }
}
