/* ════════════════════════════════════════════════════════════════
   AIWriter Gemini — Expert Comment Block  (frontend)  v2.0
   Uses "body .aiw-expert" prefix to beat theme-level specificity.
   Fixes for ASU theme and similar:
     - .entry-content img { max-width:100% } → blows up the 52px photo
     - strong, span { display:inline }       → breaks name/job stacking
     - blockquote styles                     → fights our quote reset
   ════════════════════════════════════════════════════════════════ */

/* ── Card wrapper ─────────────────────────────────────────────── */
body .aiw-expert,
.entry-content .aiw-expert,
.post-content .aiw-expert {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-left: 4px solid #3b82f6 !important;
  border-radius: 0 .625rem .625rem 0 !important;
  padding: 1.25rem 1.5rem !important;
  margin: 2rem 0 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.06) !important;
  transition: box-shadow .2s ease !important;
  quotes: none !important;
  font-style: normal !important;
  color: inherit !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
}

body .aiw-expert:hover,
.entry-content .aiw-expert:hover {
  box-shadow: 0 4px 18px rgba(59,130,246,.13) !important;
}

/* ── Header row ───────────────────────────────────────────────── */
body .aiw-expert .aiw-expert__header,
.entry-content .aiw-expert .aiw-expert__header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: .875rem !important;
  margin: 0 0 .875rem 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* ── Avatar wrapper (locks the avatar to 52px) ────────────────── */
body .aiw-expert .aiw-expert__avatar-wrap,
.entry-content .aiw-expert .aiw-expert__avatar-wrap {
  display: block !important;
  flex: 0 0 52px !important;
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 52px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
  overflow: hidden !important;
}

/* ── Photo — aggressively constrained so theme can't stretch it ─ */
body .aiw-expert .aiw-expert__photo,
body .aiw-expert img.aiw-expert__photo,
.entry-content .aiw-expert .aiw-expert__photo,
.entry-content .aiw-expert img.aiw-expert__photo,
.entry-content img.aiw-expert__photo {
  display: block !important;
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;   /* overrides theme's img { max-width: 100% } */
  height: 52px !important;
  min-height: 52px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid #e2e8f0 !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  box-shadow: none !important;
  flex-shrink: 0 !important;
}

/* ── Initials circle (no-photo fallback) ──────────────────────── */
body .aiw-expert .aiw-expert__initials,
.entry-content .aiw-expert .aiw-expert__initials {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 52px !important;
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 52px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #3b82f6, #6366f1) !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  font-style: normal !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* ── Meta column (name + job stacked) ────────────────────────── */
body .aiw-expert .aiw-expert__meta,
.entry-content .aiw-expert .aiw-expert__meta {
  display: flex !important;
  flex-direction: column !important;
  gap: .15rem !important;
  min-width: 0 !important;
  flex: 1 1 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* strong { display:inline } is the most common theme override — force block */
body .aiw-expert .aiw-expert__name,
body .aiw-expert strong.aiw-expert__name,
.entry-content .aiw-expert .aiw-expert__name,
.entry-content .aiw-expert strong.aiw-expert__name {
  display: block !important;
  font-weight: 700 !important;
  font-size: .92rem !important;
  color: #0f172a !important;
  line-height: 1.3 !important;
  font-style: normal !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: normal !important;
}

body .aiw-expert .aiw-expert__job,
body .aiw-expert span.aiw-expert__job,
.entry-content .aiw-expert .aiw-expert__job,
.entry-content .aiw-expert span.aiw-expert__job {
  display: block !important;
  font-size: .78rem !important;
  color: #64748b !important;
  font-weight: 400 !important;
  font-style: normal !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: normal !important;
}

/* ── Quote — blockquote reset ─────────────────────────────────── */
body .aiw-expert blockquote,
body .aiw-expert .aiw-expert__quote,
body .aiw-expert blockquote.aiw-expert__quote,
.entry-content .aiw-expert blockquote,
.entry-content .aiw-expert .aiw-expert__quote {
  all: unset !important;
  display: block !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 0 0 1.35rem !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-style: italic !important;
  quotes: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  text-indent: 0 !important;
}

body .aiw-expert blockquote::before,
body .aiw-expert .aiw-expert__quote::before,
.entry-content .aiw-expert blockquote::before,
.entry-content .aiw-expert .aiw-expert__quote::before {
  content: '\201C' !important;
  font-size: 3rem !important;
  line-height: 0 !important;
  color: #3b82f6 !important;
  opacity: .2 !important;
  position: absolute !important;
  top: .65rem !important;
  left: 0 !important;
  font-family: Georgia, 'Times New Roman', serif !important;
  font-style: normal !important;
  pointer-events: none !important;
}

body .aiw-expert blockquote p,
body .aiw-expert .aiw-expert__quote p,
.entry-content .aiw-expert blockquote p,
.entry-content .aiw-expert .aiw-expert__quote p {
  all: unset !important;
  display: block !important;
  font-size: .94rem !important;
  font-style: italic !important;
  color: #334155 !important;
  line-height: 1.7 !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: inherit !important;
}

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 580px) {
  body .aiw-expert,
  .entry-content .aiw-expert {
    padding: 1rem !important;
    border-radius: 0 .4rem .4rem 0 !important;
  }

  body .aiw-expert .aiw-expert__avatar-wrap,
  .entry-content .aiw-expert .aiw-expert__avatar-wrap {
    flex: 0 0 42px !important;
    width: 42px !important; min-width: 42px !important; max-width: 42px !important;
    height: 42px !important;
  }

  body .aiw-expert .aiw-expert__photo,
  body .aiw-expert img.aiw-expert__photo,
  .entry-content .aiw-expert img.aiw-expert__photo {
    width: 42px !important; min-width: 42px !important; max-width: 42px !important;
    height: 42px !important;
  }

  body .aiw-expert .aiw-expert__initials,
  .entry-content .aiw-expert .aiw-expert__initials {
    flex: 0 0 42px !important;
    width: 42px !important; min-width: 42px !important; max-width: 42px !important;
    height: 42px !important; font-size: .9rem !important;
  }

  body .aiw-expert blockquote p,
  body .aiw-expert .aiw-expert__quote p,
  .entry-content .aiw-expert blockquote p {
    font-size: .88rem !important;
  }
}

/* ── Dark mode ────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  body .aiw-expert,
  .entry-content .aiw-expert {
    background: #1e293b !important;
    border-color: #334155 !important;
    border-left-color: #60a5fa !important;
  }
  body .aiw-expert .aiw-expert__name,
  .entry-content .aiw-expert .aiw-expert__name  { color: #f1f5f9 !important; }
  body .aiw-expert .aiw-expert__job,
  .entry-content .aiw-expert .aiw-expert__job   { color: #94a3b8 !important; }
  body .aiw-expert blockquote p,
  body .aiw-expert .aiw-expert__quote p,
  .entry-content .aiw-expert blockquote p       { color: #cbd5e1 !important; }
  body .aiw-expert .aiw-expert__photo,
  body .aiw-expert img.aiw-expert__photo,
  .entry-content .aiw-expert .aiw-expert__photo { border-color: #475569 !important; }
}
