/* =====================================================
   credentials-timeline.css — A4.2
   Vertical timeline with gold spine + reveal-on-scroll
   ===================================================== */
@layer components {

  .credentials-timeline-section {
    background: linear-gradient(180deg, var(--white) 0%, var(--gold-50) 100%);
    padding-block: clamp(3rem, 6vw, 5rem);
  }

  .credentials-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    max-width: 760px;
    margin-inline: auto;
  }

  /* Vertical spine (the timeline line) */
  .credentials-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 80px; /* spine offset from year-column edge */
    width: 2px;
    background: linear-gradient(
      to bottom,
      transparent 0%,
      var(--gold-300) 5%,
      var(--gold-500) 50%,
      var(--gold-300) 95%,
      transparent 100%
    );
  }

  .cred-item {
    position: relative;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1.25rem;
    padding-block: 0.85rem;
  }

  /* Gold dot on the spine */
  .cred-item::before {
    content: "";
    position: absolute;
    inset-inline-end: 73px;
    top: 1.5rem;
    width: 16px;
    height: 16px;
    background: var(--gold-500);
    border: 3px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--gold-500), 0 4px 8px rgba(201, 168, 76, 0.35);
    z-index: 1;
    transition: transform var(--motion) var(--ease-spring);
  }
  .cred-item:hover::before {
    transform: scale(1.3);
    background: var(--navy-500);
    box-shadow: 0 0 0 2px var(--navy-500), 0 6px 12px rgba(27, 58, 107, 0.35);
  }

  .cred-year {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 1.1rem;
    padding-inline-end: 1.5rem;
    font-size: var(--text-lg);
    font-weight: var(--fw-bold);
    color: var(--gold-700);
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--tracking-tight);
  }

  .cred-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--motion) var(--ease-spring), box-shadow var(--motion) var(--ease-out);
  }
  @media (hover: hover) and (pointer: fine) {
    .cred-card:hover {
      transform: translateX(-4px); /* slide toward content in RTL */
      box-shadow: var(--shadow-md);
      border-color: var(--gold-300);
    }
  }

  .cred-card.cred-highlight {
    background: linear-gradient(135deg, rgba(201,168,76,0.06) 0%, rgba(201,168,76,0.02) 100%);
    border-color: var(--gold-500);
    border-inline-start: 4px solid var(--gold-500);
  }

  .cred-name {
    margin: 0 0 0.25rem;
    font-size: var(--text-base);
    font-weight: var(--fw-bold);
    color: var(--navy-700);
    line-height: var(--leading-snug);
  }

  .cred-issuer {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--gray-600);
    line-height: var(--leading-snug);
  }

  /* Mobile compaction */
  @media (max-width: 640px) {
    .credentials-timeline { max-width: 100%; }
    .credentials-timeline::before { inset-inline-end: 60px; }
    .cred-item {
      grid-template-columns: 60px 1fr;
      gap: 0.85rem;
    }
    .cred-item::before { inset-inline-end: 53px; }
    .cred-year {
      padding-inline-end: 1rem;
      font-size: var(--text-base);
    }
    .cred-card { padding: 0.85rem 1rem; }
    .cred-name { font-size: var(--text-sm); }
    .cred-issuer { font-size: var(--text-xs); }
  }
}
