/* ════════════════════════════════════════════════════════════════
   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; }
}


/* ════════════════════════════════════════════════════════════════
   AIWriter Gemini — Company Card Block (frontend) v1.0
   Дизайн: горизонтальна картка з логотипом, зелений акцент.
   ════════════════════════════════════════════════════════════════ */

/* ── Card wrapper ─────────────────────────────────────────────── */
body .aiw-company,
.entry-content .aiw-company,
.post-content .aiw-company {
  display: flex !important;
  flex-direction: column !important;
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  border-left: 4px solid #22c55e !important;
  border-radius: 0 .625rem .625rem 0 !important;
  padding: 1rem 1.25rem !important;
  margin: 1.75rem 0 !important;
  box-shadow: 0 1px 4px rgba(34,197,94,.08) !important;
  transition: box-shadow .2s ease !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  font-style: normal !important;
  quotes: none !important;
}

body .aiw-company:hover,
.entry-content .aiw-company:hover {
  box-shadow: 0 4px 16px rgba(34,197,94,.15) !important;
}

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

/* ── Logo wrapper ─────────────────────────────────────────────── */
body .aiw-company .aiw-company__logo-wrap,
.entry-content .aiw-company .aiw-company__logo-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 80px !important;
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  line-height: 0 !important;
}

/* ── Logo image ───────────────────────────────────────────────── */
body .aiw-company .aiw-company__logo,
body .aiw-company img.aiw-company__logo,
.entry-content .aiw-company .aiw-company__logo,
.entry-content .aiw-company img.aiw-company__logo,
.entry-content img.aiw-company__logo {
  display: block !important;
  width: auto !important;
  max-width: 80px !important;
  height: auto !important;
  max-height: 44px !important;
  object-fit: contain !important;
  margin: 0 auto !important;
  padding: 0 !important;
  float: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
}

/* ── Initials fallback ────────────────────────────────────────── */
body .aiw-company .aiw-company__initials,
.entry-content .aiw-company .aiw-company__initials {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 8px !important;
  background: #16a34a !important;
  color: #fff !important;
  font-size: .9rem !important;
  font-weight: 700 !important;
  letter-spacing: .02em !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
  font-style: normal !important;
}

/* ── Meta block ───────────────────────────────────────────────── */
body .aiw-company .aiw-company__meta,
.entry-content .aiw-company .aiw-company__meta {
  display: flex !important;
  flex-direction: column !important;
  gap: .2rem !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── Company name ─────────────────────────────────────────────── */
body .aiw-company .aiw-company__name,
.entry-content .aiw-company .aiw-company__name,
body .aiw-company strong.aiw-company__name,
.entry-content .aiw-company strong.aiw-company__name {
  display: block !important;
  font-size: .95rem !important;
  font-weight: 600 !important;
  color: #15803d !important;
  font-style: normal !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.3 !important;
}

/* ── Tagline ──────────────────────────────────────────────────── */
body .aiw-company .aiw-company__tagline,
.entry-content .aiw-company .aiw-company__tagline,
body .aiw-company span.aiw-company__tagline,
.entry-content .aiw-company span.aiw-company__tagline {
  display: block !important;
  font-size: .83rem !important;
  color: #166534 !important;
  font-style: normal !important;
  line-height: 1.5 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 580px) {
  body .aiw-company .aiw-company__logo-wrap,
  .entry-content .aiw-company .aiw-company__logo-wrap {
    flex: 0 0 56px !important;
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    height: 36px !important;
  }

  body .aiw-company img.aiw-company__logo,
  .entry-content .aiw-company img.aiw-company__logo {
    max-width: 56px !important;
    max-height: 36px !important;
  }
}

/* ── Dark mode ────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  body .aiw-company,
  .entry-content .aiw-company {
    background: #052e16 !important;
    border-color: #166534 !important;
    border-left-color: #4ade80 !important;
  }

  body .aiw-company .aiw-company__name,
  .entry-content .aiw-company .aiw-company__name {
    color: #86efac !important;
  }

  body .aiw-company .aiw-company__tagline,
  .entry-content .aiw-company .aiw-company__tagline {
    color: #bbf7d0 !important;
  }

  body .aiw-company img.aiw-company__logo,
  .entry-content .aiw-company img.aiw-company__logo {
    filter: brightness(0) invert(1) !important;
    opacity: .85 !important;
  }
}
