/**
 * ============================================
 * AI Agency Framework — SPOKE ARTICLE STYLES
 * ============================================
 * Premium Editorial Experience
 * /ai-impact/jobs/project-managers/
 * ============================================
 */

/* ===== READING PROGRESS ===== */
.reading-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 1000;
  background: transparent;
}

.reading-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-cyan-500), var(--gradient-neural-2));
  box-shadow: 0 0 8px var(--accent-glow);
  transition: width 0.1s linear;
}

/* ===== BREADCRUMB ===== */
.spoke-breadcrumb {
  position: fixed;
  top: 72px; left: 0; right: 0;
  z-index: 299;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-default);
  padding: var(--space-2) 0;
}

/* ===== HERO ===== */
.spoke-hero {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 500px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.spoke-hero__image {
  position: absolute;
  inset: -5%;
  width: 110%; height: 110%;
  z-index: 0;
}

.spoke-hero__image img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.spoke-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(10,10,15,0.2) 0%, rgba(10,10,15,0.6) 50%, var(--bg-primary) 100%);
}

.spoke-hero__content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--section-px) var(--space-16);
}

.spoke-hero__eyebrow {
  margin-bottom: var(--space-4);
  opacity: 0.8;
}

.spoke-hero__title {
  font-family: var(--font-headline);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tighter);
  color: var(--text-primary);
  margin: 0 0 var(--space-6);
  max-width: 800px;
}

.spoke-hero__meta {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.spoke-hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
}

/* ===== ARTICLE LAYOUT ===== */
.article-layout {
  padding: var(--space-16) 0 var(--section-py);
}

.article-layout__grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--space-16);
  align-items: start;
}

/* ===== ARTICLE BODY ===== */
.article-body {
  max-width: 720px;
}

.article-lead {
  font-size: clamp(1.125rem, 1.5vw, 1.375rem);
  line-height: 1.8;
  color: var(--text-primary);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--border-default);
}

.article-section {
  margin-bottom: var(--space-12);
}

.article-h2 {
  font-family: var(--font-headline);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-default);
}

.article-body p {
  font-size: clamp(1rem, 1.1vw, 1.125rem);
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}

/* Scroll highlight on headings */
.article-h2[data-highlight-text] {
  background: linear-gradient(90deg, var(--accent-primary) 50%, var(--text-primary) 50%);
  background-size: 200% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== INLINE IMAGES ===== */
.article-figure {
  margin: var(--space-10) calc(-1 * var(--space-8));
  position: relative;
  overflow: hidden;
}

.article-figure__image {
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.article-figure__image img {
  width: 100%;
  height: auto;
  display: block;
  will-change: transform;
}

.article-figure__caption {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-3) var(--space-4);
  letter-spacing: var(--tracking-wide);
  line-height: var(--leading-relaxed);
}

/* ===== PULL QUOTES ===== */
.article-pullquote {
  margin: var(--space-12) 0;
  padding: var(--space-8) var(--space-8);
  border-left: 3px solid var(--accent-primary);
  background: linear-gradient(90deg, rgba(0,240,255,0.04), transparent);
  position: relative;
}

.article-pullquote::before {
  content: '"';
  position: absolute;
  top: var(--space-2);
  left: var(--space-4);
  font-family: var(--font-headline);
  font-size: 6rem;
  color: var(--accent-primary);
  opacity: 0.15;
  line-height: 1;
  pointer-events: none;
}

.article-pullquote p {
  font-family: var(--font-headline);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: var(--weight-medium);
  font-style: italic;
  line-height: var(--leading-snug);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  position: relative;
  z-index: 1;
}

.article-pullquote cite {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--text-muted);
}

/* ===== DATA TABLES ===== */
.article-table-wrapper {
  margin: var(--space-8) 0;
  overflow-x: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--card-radius);
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.article-table thead th {
  background: var(--bg-elevated);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.article-table tbody td {
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-default);
  transition: background-color 0.15s ease;
}

.article-table tbody tr:last-child td {
  border-bottom: none;
}

.article-table tbody tr:hover td {
  background: var(--surface-active);
}

.article-table tbody tr:nth-child(even) td {
  background: rgba(250,248,245,0.02);
}

.article-table tbody tr:nth-child(even):hover td {
  background: var(--surface-active);
}

/* ===== CODE BLOCKS ===== */
.article-code {
  margin: var(--space-8) 0;
  background: var(--color-space-200);
  border: 1px solid var(--border-default);
  border-radius: var(--card-radius);
  overflow: hidden;
}

.article-code__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  background: var(--color-space-300);
  border-bottom: 1px solid var(--border-default);
}

.article-code__lang {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
}

.article-code__copy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all 0.2s ease;
}

.article-code__copy:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.article-code__copy--success {
  border-color: var(--color-success);
  color: var(--color-success);
}

.article-code pre {
  padding: var(--space-4) var(--space-5);
  overflow-x: auto;
  margin: 0;
}

.article-code code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-primary);
}

/* Syntax highlighting */
.code-kw { color: #ff79c6; }
.code-fn { color: #8be9fd; }
.code-str { color: #f1fa8c; }
.code-num { color: #bd93f9; }
.code-cmt { color: #6272a4; font-style: italic; }
.code-param { color: #ffb86c; }

/* ===== STATS ROW ===== */
.article-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin: var(--space-8) 0;
  padding: var(--space-6);
  background: var(--surface-glass);
  border: 1px solid var(--border-default);
  border-radius: var(--card-radius);
}

.article-stat-item {
  text-align: center;
}

.article-stat-item__num {
  display: block;
  font-family: var(--font-headline);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: var(--weight-bold);
  color: var(--accent-primary);
  line-height: var(--leading-none);
  margin-bottom: var(--space-2);
}

.article-stat-item__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: var(--leading-snug);
}

/* ===== TOC SIDEBAR ===== */
.article-toc {
  position: sticky;
  top: 130px;
}

.article-toc__inner {
  background: var(--surface-glass);
  backdrop-filter: var(--blur-lg);
  border: 1px solid var(--border-default);
  border-radius: var(--card-radius);
  overflow: hidden;
}

.article-toc__toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--text-primary);
  cursor: pointer;
}

.article-toc__content {
  padding: var(--space-5);
}

.article-toc__title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-default);
}

.article-toc__list {
  list-style: none;
  counter-reset: toc;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.article-toc__list li {
  counter-increment: toc;
}

.article-toc__link {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all 0.2s var(--ease-smooth);
}

.article-toc__link::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  min-width: 18px;
}

.article-toc__link:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.article-toc__link--active {
  color: var(--accent-primary);
  background: var(--surface-active);
  border-left-color: var(--accent-primary);
}

.article-toc__link--active::before {
  color: var(--accent-primary);
}

/* ===== SILO NAV ===== */
.article-silo-nav {
  margin-top: var(--space-16);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-default);
}

.article-silo-nav__up {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.article-silo-nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  transition: all 0.2s var(--ease-smooth);
  max-width: fit-content;
}

.article-silo-nav__link:hover {
  color: var(--accent-primary);
  border-color: var(--border-hover);
  background: var(--surface-active);
}

.article-silo-nav__link svg {
  transition: transform 0.2s ease;
}

.article-silo-nav__link:hover svg {
  transform: translateX(-3px);
}

.article-silo-nav__link--primary {
  color: var(--accent-primary);
  border-color: var(--border-active);
}

/* ===== RELATED SPOKES ===== */
.related-spokes {
  padding: var(--section-py) 0;
  border-top: 1px solid var(--border-default);
}

.related-spokes__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.related-spoke-card {
  background: var(--surface-glass);
  border: 1px solid var(--border-default);
  border-radius: var(--card-radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease-cinematic),
              border-color 0.3s var(--ease-smooth),
              box-shadow 0.3s var(--ease-smooth);
}

.related-spoke-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-elevated);
}

.related-spoke-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.related-spoke-card__image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.related-spoke-card__image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-cinematic);
}

.related-spoke-card:hover .related-spoke-card__image img {
  transform: scale(1.05);
}

.related-spoke-card__content {
  padding: var(--space-5);
}

.related-spoke-card__title {
  font-family: var(--font-headline);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin-top: var(--space-2);
}

/* ===== FLOATING SHARE BAR ===== */
.share-bar {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  padding: var(--space-2);
  z-index: 500;
  backdrop-filter: var(--blur-lg);
  box-shadow: var(--shadow-lg);
  transition: bottom 0.4s var(--ease-cinematic);
}

.share-bar--visible {
  bottom: var(--space-6);
}

.share-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.share-bar__btn:hover {
  background: var(--surface-active);
  color: var(--accent-primary);
}

.share-bar__label {
  font-size: var(--text-xs);
}

/* ===== COPY TOAST ===== */
.copy-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: var(--space-3) var(--space-6);
  background: var(--bg-elevated);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent-primary);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease-cinematic);
  z-index: 600;
}

.copy-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== FOOTER ===== */
.spoke-footer {
  padding: var(--space-12) 0;
  border-top: 1px solid var(--border-default);
}

.spoke-footer__grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spoke-footer__nav {
  display: flex;
  gap: var(--space-6);
}

.spoke-footer__link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  text-decoration: none;
  transition: color 0.2s ease;
}

.spoke-footer__link:hover {
  color: var(--accent-primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .article-layout__grid {
    grid-template-columns: 1fr;
  }

  .article-toc {
    position: relative;
    top: 0;
    order: -1;
    margin-bottom: var(--space-8);
  }

  .article-toc__toggle {
    display: flex;
  }

  .article-toc__content {
    max-height: 0;
    overflow: hidden;
    padding: 0 var(--space-5);
    transition: max-height 0.3s ease, padding 0.3s ease;
  }

  .article-toc__content--open {
    max-height: 500px;
    padding: var(--space-5);
  }

  .article-toc__toggle svg {
    transition: transform 0.3s ease;
  }

  .article-toc__toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }

  .article-figure {
    margin: var(--space-8) 0;
  }

  .related-spokes__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .spoke-hero {
    height: 55vh;
    min-height: 350px;
  }

  .spoke-hero__title {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }

  .spoke-hero__meta {
    gap: var(--space-3);
  }

  .article-pullquote {
    padding: var(--space-6) var(--space-5);
    margin: var(--space-8) 0;
  }

  .article-pullquote::before {
    font-size: 4rem;
  }

  .article-stats-row {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .article-table-wrapper {
    margin: var(--space-6) calc(-1 * var(--section-px));
    border-radius: 0;
  }

  .related-spokes__grid {
    grid-template-columns: 1fr;
  }

  .share-bar--visible {
    bottom: var(--space-4);
  }

  .spoke-footer__grid {
    flex-direction: column;
    gap: var(--space-6);
    text-align: center;
  }
}

/* ===== AUTHOR BYLINE LINK ===== */
.spoke-hero__author {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: var(--weight-medium);
}

.spoke-hero__author:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .related-spoke-card,
  .article-code__copy {
    transition: none;
  }

  .share-bar {
    transition: none;
  }
}

/* spoke-hero__figure and caption added by optimize_spoke_seo.py */
.spoke-hero__figure {
  margin: 0;
}
.spoke-hero__caption {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-3) var(--space-4);
  letter-spacing: var(--tracking-wide);
  line-height: var(--leading-relaxed);
}
