/**
 * HealthBlog Pro — Healthcare Components CSS
 * Version: 5.1.0
 *
 * Styles for all medical/health-specific UI components:
 * - Freshness banners
 * - Clinical callouts (normal / warning / danger)
 * - Study callouts & stat highlights
 * - Expert tips
 * - Product cards with pros/cons
 * - Dosage tables
 * - Citation references
 * - Warning boxes
 * - Medical Reviewer badge
 * - Healthcare dashboard widgets
 *
 * @package HealthBlog_Pro
 */

/* =====================================================
   FRESHNESS BANNERS
   ===================================================== */
.hb-freshness-banner {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md, 8px);
  margin-bottom: 1.5rem;
  font-size: var(--text-sm, .9rem);
  line-height: 1.6;
  border-left: 4px solid currentColor;
}

.hb-freshness-banner.hb-freshness-outdated {
  background: #fff8e1;
  color: #e65100;
  border-left-color: #ff6f00;
}

.hb-freshness-banner.hb-freshness-current {
  background: #f1f8e9;
  color: #33691e;
  border-left-color: #558b2f;
}

.hb-freshness-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: .1rem;
}

.hb-freshness-text {
  flex: 1;
}

.hb-freshness-text a {
  color: inherit;
  text-decoration: underline;
}

/* =====================================================
   CLINICAL CALLOUTS
   ===================================================== */
.hb-clinical-callout {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md, 8px);
  margin: 1.5rem 0;
  border: 1px solid transparent;
}

/* Type: normal */
.hb-clinical-normal {
  background: #e8f5e9;
  border-color: #a5d6a7;
  color: #1b5e20;
}

/* Type: warning */
.hb-clinical-warning {
  background: #fff8e1;
  border-color: #ffe082;
  color: #e65100;
}

/* Type: danger */
.hb-clinical-danger {
  background: #fce4ec;
  border-color: #f48fb1;
  color: #b71c1c;
}

.hb-clinical-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.hb-clinical-body {
  flex: 1;
}

.hb-clinical-label {
  display: block;
  font-weight: 700;
  font-size: var(--text-sm, .875rem);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .25rem;
}

.hb-clinical-value {
  display: block;
  font-size: var(--text-lg, 1.1rem);
  font-weight: 700;
  margin-bottom: .15rem;
}

.hb-clinical-context {
  display: block;
  font-size: var(--text-sm, .875rem);
  opacity: .85;
}

/* =====================================================
   STUDY CALLOUT
   ===================================================== */
.hb-study-callout {
  background: #f3f8ff;
  border: 1px solid #90caf9;
  border-left: 4px solid #1565c0;
  border-radius: var(--radius-md, 8px);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.hb-study-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}

.hb-study-icon {
  font-size: 1.25rem;
}

.hb-study-title {
  color: #1565c0;
  font-size: var(--text-base, 1rem);
}

.hb-study-meta {
  font-size: var(--text-sm, .875rem);
  color: var(--color-text-muted, #666);
  margin-bottom: .75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.hb-study-finding {
  font-size: var(--text-base, 1rem);
  line-height: 1.6;
  color: var(--color-text, #1a1a1a);
}

/* =====================================================
   STAT HIGHLIGHT
   ===================================================== */
.hb-stat-highlight {
  text-align: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid #a5d6a7;
  margin: 1.5rem 0;
}

.hb-stat-number {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--color-primary, #2e7d32);
  line-height: 1;
  margin-bottom: .25rem;
}

.hb-stat-label {
  font-size: var(--text-base, 1rem);
  color: var(--color-text, #1a1a1a);
  font-weight: 600;
  margin-bottom: .5rem;
}

.hb-stat-source {
  font-size: var(--text-sm, .875rem);
  color: var(--color-text-muted, #666);
  font-style: normal;
}

/* =====================================================
   WARNING BOX
   ===================================================== */
.hb-warning-box {
  border-radius: var(--radius-md, 8px);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid transparent;
}

.hb-warning-caution {
  background: #fffde7;
  border-color: #fff176;
}

.hb-warning-danger {
  background: #fce4ec;
  border-color: #f48fb1;
}

.hb-warning-info {
  background: #e3f2fd;
  border-color: #90caf9;
}

.hb-warning-header {
  font-weight: 700;
  margin-bottom: .5rem;
  font-size: var(--text-base, 1rem);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.hb-warning-body {
  font-size: var(--text-sm, .875rem);
  line-height: 1.7;
}

.hb-warning-body p:last-child {
  margin-bottom: 0;
}

/* =====================================================
   EXPERT TIP
   ===================================================== */
.hb-expert-tip {
  background: var(--color-bg-alt, #f8faf8);
  border: 1px solid var(--color-border, #e0e8e0);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.hb-expert-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

.hb-expert-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.hb-expert-id {
  display: flex;
  flex-direction: column;
}

.hb-expert-name {
  font-size: var(--text-base, 1rem);
  font-weight: 700;
  color: var(--color-text, #1a1a1a);
}

.hb-expert-creds {
  font-size: var(--text-sm, .875rem);
  color: var(--color-text-muted, #666);
}

.hb-expert-body {
  font-size: var(--text-base, 1rem);
  line-height: 1.7;
}

.hb-expert-body p:last-child {
  margin-bottom: 0;
}

/* =====================================================
   PRODUCT CARD
   ===================================================== */
.hb-product-card {
  border: 1px solid var(--color-border, #e0e8e0);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  margin: 1.5rem 0;
  background: var(--color-bg-card, #fff);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  position: relative;
}

.hb-product-badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: var(--color-accent, #ff7043);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .2rem .6rem;
  border-radius: var(--radius-full, 999px);
  z-index: 1;
}

.hb-product-image {
  width: 100%;
  max-height: 260px;
  overflow: hidden;
  background: var(--color-bg-alt, #f8faf8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hb-product-image img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  padding: 1rem;
}

.hb-product-body {
  padding: 1.25rem 1.5rem;
}

.hb-product-name {
  font-size: var(--text-xl, 1.2rem);
  font-weight: 700;
  margin-bottom: .25rem;
  color: var(--color-text, #1a1a1a);
}

.hb-product-subtitle {
  font-size: var(--text-sm, .875rem);
  color: var(--color-text-muted, #666);
  margin-bottom: .75rem;
}

.hb-product-rating {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
}

.hb-stars {
  color: #f59e0b;
  font-size: 1.1rem;
  letter-spacing: .05em;
}

.hb-rating-text {
  font-size: var(--text-sm, .875rem);
  color: var(--color-text-muted, #666);
}

.hb-product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.hb-spec {
  background: var(--color-bg-alt, #f8faf8);
  border: 1px solid var(--color-border, #e0e8e0);
  border-radius: var(--radius-full, 999px);
  padding: .2rem .75rem;
  font-size: var(--text-xs, .8rem);
}

.hb-product-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 480px) {
  .hb-product-pros-cons {
    grid-template-columns: 1fr;
  }
}

.hb-pros,
.hb-cons {
  background: var(--color-bg-alt, #f8faf8);
  border-radius: var(--radius-md, 8px);
  padding: .75rem 1rem;
}

.hb-pros-heading,
.hb-cons-heading {
  font-size: var(--text-sm, .875rem);
  font-weight: 700;
  margin-bottom: .5rem;
}

.hb-pros ul,
.hb-cons ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hb-pros li,
.hb-cons li {
  font-size: var(--text-sm, .875rem);
  padding: .2rem 0;
  border-bottom: 1px solid var(--color-border, #e0e8e0);
}

.hb-pros li:last-child,
.hb-cons li:last-child {
  border-bottom: none;
}

.hb-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border, #e0e8e0);
}

.hb-product-price {
  font-size: var(--text-xl, 1.2rem);
  font-weight: 800;
  color: var(--color-primary, #2e7d32);
}

.hb-product-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.25rem;
  background: var(--color-primary, #2e7d32);
  color: #fff;
  border-radius: var(--radius-md, 8px);
  font-weight: 700;
  font-size: var(--text-sm, .875rem);
  text-decoration: none;
  transition: background .2s ease, transform .15s ease;
}

.hb-product-btn:hover {
  background: var(--color-primary-dark, #1b5e20);
  color: #fff;
  transform: translateY(-1px);
}

/* =====================================================
   DOSAGE TABLE
   ===================================================== */
.hb-dosage-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}

.hb-dosage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm, .875rem);
  background: var(--color-bg-card, #fff);
}

.hb-dosage-table th {
  background: var(--color-primary, #2e7d32);
  color: #fff;
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}

.hb-dosage-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--color-border, #e0e8e0);
  vertical-align: middle;
}

.hb-dosage-table tr:last-child td {
  border-bottom: none;
}

.hb-dosage-table tbody tr:nth-child(even) {
  background: var(--color-bg-alt, #f8faf8);
}

.hb-dosage-note {
  font-size: var(--text-sm, .875rem);
  color: var(--color-text-muted, #666);
  margin-top: .5rem;
  font-style: italic;
}

/* =====================================================
   CITATION REFERENCES
   ===================================================== */
.hb-citation-ref {
  font-size: .7em;
  vertical-align: super;
  color: var(--color-primary, #2e7d32);
  font-weight: 700;
  cursor: pointer;
}

.hb-citation-ref a {
  color: inherit;
  text-decoration: none;
}

.hb-citation-ref:hover {
  text-decoration: underline;
}

.hb-references {
  border-top: 2px solid var(--color-border, #e0e8e0);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
}

.hb-references-title {
  font-size: var(--text-lg, 1.1rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.hb-references-list {
  padding-left: 1.5rem;
  font-size: var(--text-sm, .875rem);
  line-height: 1.7;
}

.hb-references-list li {
  margin-bottom: .5rem;
  color: var(--color-text-muted, #666);
}

.hb-references-list a {
  color: var(--color-primary, #2e7d32);
}

.hb-citation-item {
  border: 1px solid var(--color-border, #e0e8e0);
  padding: .75rem 1rem;
  margin: .5rem 0;
  background: var(--color-bg-alt, #f8faf8);
  border-radius: var(--radius-sm, 4px);
  font-size: var(--text-sm, .875rem);
}

/* =====================================================
   MEDICAL REVIEWER BADGE (in single.php article-meta)
   ===================================================== */
.article-meta-reviewed {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: var(--text-xs, .8rem);
  background: #e8f5e9;
  color: #1b5e20;
  padding: .25rem .75rem;
  border-radius: var(--radius-full, 999px);
  border: 1px solid #a5d6a7;
  white-space: nowrap;
  flex-shrink: 0;
}

.article-meta-reviewed a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* =====================================================
   HEALTHCARE DASHBOARD WIDGET (admin)
   ===================================================== */
.hb-dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.hb-dash-card {
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
  border: 1px solid #ddd;
}

.hb-dash-card.hb-green {
  background: #f1f8e9;
  border-color: #c5e1a5;
}

.hb-dash-card.hb-orange {
  background: #fff8e1;
  border-color: #ffe0b2;
}

.hb-dash-card.hb-red {
  background: #fce4ec;
  border-color: #f8bbd0;
}

.hb-dash-num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: .25rem;
}

.hb-dash-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .75;
}

/* =====================================================
   DARK MODE OVERRIDES
   ===================================================== */
[data-color-scheme="dark"] .hb-freshness-banner.hb-freshness-outdated {
  background: #2d1f00;
  color: #ffb74d;
}

[data-color-scheme="dark"] .hb-freshness-banner.hb-freshness-current {
  background: #1b2e1b;
  color: #a5d6a7;
}

[data-color-scheme="dark"] .hb-clinical-normal {
  background: #1b2e1b;
  border-color: #388e3c;
  color: #a5d6a7;
}

[data-color-scheme="dark"] .hb-clinical-warning {
  background: #2d2000;
  border-color: #ff8f00;
  color: #ffcc02;
}

[data-color-scheme="dark"] .hb-clinical-danger {
  background: #2d0a13;
  border-color: #c62828;
  color: #ef9a9a;
}

[data-color-scheme="dark"] .hb-study-callout {
  background: #0d1b2e;
  border-color: #1565c0;
}

[data-color-scheme="dark"] .hb-product-card {
  background: var(--color-bg-card, #1a271a);
  border-color: var(--color-border, #2a3f2a);
}

[data-color-scheme="dark"] .hb-dosage-table {
  background: var(--color-bg-card, #1a271a);
}

[data-color-scheme="dark"] .hb-dosage-table th {
  background: var(--color-primary-dark, #1b5e20);
}

[data-color-scheme="dark"] .article-meta-reviewed {
  background: #1b2e1b;
  border-color: #388e3c;
  color: #a5d6a7;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 600px) {
  .hb-dash-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hb-clinical-callout {
    flex-direction: column;
    gap: .5rem;
  }

  .hb-expert-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .hb-dash-grid {
    grid-template-columns: 1fr;
  }
}
