/* ============================================================
   Author Byline Component
   Standardized Tier 1 / Tier 2 attribution for
   Rev. Dr. LaVeena B. Archers, PhD, DNM
   All instances link to /credentials
   ============================================================ */

/* ─── Shared ─────────────────────────────────────────────── */

.author-byline {
  font-family: var(--font-body, inherit);
  color: var(--color-text-secondary, #4b5563);
  line-height: 1.5;
}

.author-byline__link {
  color: var(--color-brand, #7c3aed);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
  text-underline-offset: 2px;
}

.author-byline__link:hover,
.author-byline__link:focus-visible {
  color: var(--color-brand-dark, #5b21b6);
  text-decoration: underline;
  text-decoration-color: currentColor;
}

.author-byline__link:focus-visible {
  outline: 2px solid var(--color-brand, #7c3aed);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─── Tier 1 — compact one-line byline ───────────────────── */

.author-byline--tier1 {
  display: inline;
  font-size: 0.875rem; /* 14px */
}

.author-byline--tier1 .author-byline__prefix {
  color: var(--color-text-secondary, #6b7280);
  margin-right: 0.15em;
}

/* When used in article byline / footer context */
.article-byline .author-byline--tier1,
.page-footer .author-byline--tier1,
footer .author-byline--tier1 {
  font-size: 0.8125rem; /* 13px */
}

/* Dictionary attribution — slightly smaller */
.dictionary-attribution .author-byline--tier1 {
  font-size: 0.8125rem;
}

/* ─── Tier 2 — full author bio block ────────────────────── */

.author-byline--tier2 {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-surface-subtle, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.75rem;
  margin: 2rem 0;
}

/* Avatar (optional) */
.author-byline__avatar {
  flex-shrink: 0;
}

.author-byline__avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border, #e5e7eb);
}

/* Body */
.author-byline__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

/* Name line */
.author-byline__name {
  margin: 0;
  font-size: 0.9375rem; /* 15px */
}

.author-byline__name .author-byline__link {
  font-weight: 600;
}

/* Bio paragraph */
.author-byline__bio {
  margin: 0;
  font-size: 0.875rem; /* 14px */
  color: var(--color-text-secondary, #4b5563);
  line-height: 1.6;
}

/* "View Full Credentials →" CTA */
.author-byline__cta {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-brand, #7c3aed);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.author-byline__cta:hover,
.author-byline__cta:focus-visible {
  color: var(--color-brand-dark, #5b21b6);
  text-decoration: underline;
}

.author-byline__cta:focus-visible {
  outline: 2px solid var(--color-brand, #7c3aed);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─── Dark mode ───────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  .author-byline {
    color: var(--color-text-secondary-dark, #9ca3af);
  }

  .author-byline--tier2 {
    background: var(--color-surface-subtle-dark, #1f2937);
    border-color: var(--color-border-dark, #374151);
  }

  .author-byline__bio {
    color: var(--color-text-secondary-dark, #9ca3af);
  }
}

[data-theme="dark"] .author-byline {
  color: var(--color-text-secondary-dark, #9ca3af);
}

[data-theme="dark"] .author-byline--tier2 {
  background: var(--color-surface-subtle-dark, #1f2937);
  border-color: var(--color-border-dark, #374151);
}

[data-theme="dark"] .author-byline__bio {
  color: var(--color-text-secondary-dark, #9ca3af);
}

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 480px) {
  .author-byline--tier2 {
    flex-direction: column;
    padding: 1rem;
  }

  .author-byline__avatar img {
    width: 48px;
    height: 48px;
  }
}
