/**
 * HELP ENTRY CARD — PL-2.1B First User Experience
 *
 * Lightweight inline card on the Homepage.
 * Compact, rounded, white with blue accent.
 * Not a popup. Not a modal. Not an advertisement.
 *
 * Design Specs:
 *   - Height: ~90–120px
 *   - No layout shift (margin/padding included in min-height)
 *   - Responsive (Mobile First)
 *   - Dark Mode compatible via CSS variables
 *   - Accessible: focus state, ARIA labels, contrast AA
 *
 * @package XOS\HelpCenter
 * @version 1.0.0
 * @since   PL-2.1B
 */

/* ─── BLOCK: HELP ENTRY CARD ──────────────────────────── */
.hec-card {
  display: none; /* Hidden by default; JS reveals */
  margin: 0 auto;
  max-width: var(--ep12-container-max, 768px);
  padding: 0 16px;
  box-sizing: border-box;
}

/* Visible state — toggled by JS */
.hec-card.is-visible {
  display: block;
}

/* Fade-in transition (no layout shift) */
.hec-card.is-visible .hec-card-inner {
  animation: hecFadeIn 0.4s ease;
}

@keyframes hecFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── CARD INNER ──────────────────────────────────────── */
.hec-card-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  min-height: 88px;
  max-height: 120px;
  background: var(--md-surface, #ffffff);
  border-radius: 14px;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.06),
    0 4px 16px rgba(0,0,0,0.04);
  border: 1px solid var(--md-outline-variant, #e5e7eb);
  border-left: 4px solid var(--md-primary, #2563eb);
  box-sizing: border-box;
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

/* Hover: subtle lift */
.hec-card-inner:hover {
  box-shadow:
    0 2px 6px rgba(0,0,0,0.08),
    0 8px 24px rgba(0,0,0,0.06);
  border-color: var(--md-primary, #2563eb);
}

/* ─── ICON ─────────────────────────────────────────────── */
.hec-icon-wrap {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 12px;
}

.hec-icon {
  font-size: 22px;
  line-height: 1;
}

/* ─── CONTENT ──────────────────────────────────────────── */
.hec-content {
  flex: 1;
  min-width: 0; /* Prevent overflow */
}

.hec-headline {
  margin: 0 0 4px;
  font-size: 0.9375rem; /* 15px */
  font-weight: 700;
  line-height: 1.3;
  color: var(--md-on-surface, #1f2937);
  letter-spacing: -0.01em;
}

.hec-description {
  margin: 0;
  font-size: 0.8125rem; /* 13px */
  font-weight: 400;
  line-height: 1.45;
  color: var(--md-on-surface-variant, #6b7280);
}

/* ─── ACTION BUTTON ────────────────────────────────────── */
.hec-action {
  flex-shrink: 0;
}

.hec-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 0.875rem; /* 14px */
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
  background: var(--md-primary, #2563eb);
  border: none;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.hec-btn:hover {
  background: #1d4ed8; /* blue-700 */
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.hec-btn:focus-visible {
  outline: 2px solid var(--md-primary, #2563eb);
  outline-offset: 3px;
  border-radius: 10px;
}

.hec-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.hec-btn-icon {
  font-size: 10px;
}

/* ─── RESPONSIVE — TABLET ──────────────────────────────── */
@media (min-width: 640px) {
  .hec-card {
    padding: 0 20px;
  }

  .hec-card-inner {
    padding: 16px 24px;
    gap: 16px;
    border-radius: 16px;
  }

  .hec-headline {
    font-size: 1rem; /* 16px */
  }

  .hec-description {
    font-size: 0.875rem; /* 14px */
  }

  .hec-btn {
    padding: 10px 20px;
    font-size: 0.9375rem;
  }
}

/* ─── RESPONSIVE — DESKTOP ─────────────────────────────── */
@media (min-width: 1024px) {
  .hec-card {
    padding: 0 24px;
  }

  .hec-card-inner {
    padding: 18px 28px;
    min-height: 96px;
    max-height: 120px;
  }

  .hec-headline {
    font-size: 1.0625rem; /* 17px */
  }
}

/* ─── RESPONSIVE — MOBILE SMALL (< 360px) ──────────────── */
@media (max-width: 359px) {
  .hec-card-inner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    min-height: 80px;
    max-height: none;
  }

  .hec-action {
    width: 100%;
  }

  .hec-btn {
    width: 100%;
    justify-content: center;
  }

  .hec-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .hec-icon {
    font-size: 18px;
  }
}

/* ─── DARK MODE ────────────────────────────────────────── */
/* Uses existing XEGHEP dark mode selector pattern */
.ep12-dark .hec-card-inner,
body.dark .hec-card-inner,
.dark .hec-card-inner,
[data-theme="dark"] .hec-card-inner {
  background: #1e293b;       /* slate-800 */
  border-color: #334155;     /* slate-700 */
  box-shadow:
    0 1px 3px rgba(0,0,0,0.3),
    0 4px 16px rgba(0,0,0,0.2);
  border-left-color: #3b82f6; /* blue-500 */
}

.ep12-dark .hec-headline,
body.dark .hec-headline,
.dark .hec-headline,
[data-theme="dark"] .hec-headline {
  color: #f1f5f9; /* slate-100 */
}

.ep12-dark .hec-description,
body.dark .hec-description,
.dark .hec-description,
[data-theme="dark"] .hec-description {
  color: #94a3b8; /* slate-400 */
}

.ep12-dark .hec-icon-wrap,
body.dark .hec-icon-wrap,
.dark .hec-icon-wrap,
[data-theme="dark"] .hec-icon-wrap {
  background: rgba(59, 130, 246, 0.15);
}

.ep12-dark .hec-card-inner:hover,
body.dark .hec-card-inner:hover,
.dark .hec-card-inner:hover,
[data-theme="dark"] .hec-card-inner:hover {
  border-color: #3b82f6;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.4),
    0 8px 24px rgba(0,0,0,0.3);
}

/* ─── REDUCED MOTION ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hec-card.is-visible .hec-card-inner {
    animation: none;
  }

  .hec-btn {
    transition: none;
  }
}

/* ─── PRINT ────────────────────────────────────────────── */
@media print {
  .hec-card {
    display: none !important;
  }
}