/* ═══════════════════════════════════════════════════════════════════
   AURALIS · InfoPanel reusable component (Task O)
   ───────────────────────────────────────────────────────────────────
   Glass background, champagne title, markdown body, FAQ accordion,
   citations footer. Used: card expand, NoisePicker info, About.
   ═══════════════════════════════════════════════════════════════════ */

.info-panel {
  padding: 18px 18px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  color: var(--text);
}
.info-panel--compact { padding: 14px 14px 12px; }

[data-theme="light"] .info-panel,
:root:not([data-theme]) .info-panel {
  background: var(--surface);
  box-shadow: var(--shadow-card-sm);
  border: none;
}
[data-theme="dark"] .info-panel {
  background:
    linear-gradient(235deg, hsl(var(--hue1) 50% 12% / .6), hsl(var(--hue1) 50% 12% / 0) 50%),
    linear-gradient(hsl(220 25% 6% / .85));
  backdrop-filter: blur(8px);
}

/* ═══ HEADER ═══ */
.ip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.ip-header-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: hsl(38 80% 55%); /* champagne */
}
[data-theme="dark"] .ip-header-icon { color: hsl(38 80% 70%); }
.ip-header-icon svg { width: 20px; height: 20px; }
.ip-title {
  flex: 1;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.005em;
  color: hsl(38 70% 35%); /* champagne text (WCAG-safe light) */
  margin: 0;
}
[data-theme="dark"] .ip-title { color: hsl(38 80% 75%); }

/* ═══ BODY ═══ */
.ip-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.ip-body p {
  margin-bottom: 10px;
}
.ip-body p:last-child { margin-bottom: 0; }
.ip-body strong { font-weight: 800; color: var(--text); }
.ip-body em { font-style: italic; }
.ip-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ip-body a:hover { color: hsl(var(--hue1) 70% 60%); }

.ip-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ip-list li {
  padding-left: 18px;
  position: relative;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
}
.ip-list li::before {
  content: '•';
  position: absolute;
  left: 4px;
  top: 0;
  color: hsl(38 70% 50%); /* champagne bullet */
  font-weight: 800;
}
[data-theme="dark"] .ip-list li::before { color: hsl(38 80% 70%); }

/* ═══ EXPANDABLE BODY ═══ */
.ip-body--collapsible {
  position: relative;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}
.ip-body--collapsible[data-collapsed="true"] {
  max-height: 96px;
}
.ip-body--collapsible[data-collapsed="true"]::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, var(--surface) 100%);
}
[data-theme="dark"] .ip-body--collapsible[data-collapsed="true"]::after {
  background: linear-gradient(180deg, transparent 0%, hsl(220 25% 6% / 0.95) 100%);
}
.ip-body--collapsible[data-collapsed="false"] {
  max-height: 2000px;
}
.ip-body--collapsible[data-collapsed="false"]::after { display: none; }

.ip-expand-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin-top: 8px;
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.ip-expand-toggle:hover,
.ip-expand-toggle:focus-visible {
  background: hsl(var(--hue1) 20% 35% / 0.12);
  outline: none;
}
.ip-expand-icon {
  display: grid;
  place-items: center;
  transition: transform var(--dur) var(--ease);
}
.ip-expand-icon svg { width: 14px; height: 14px; }
.ip-expand-toggle[aria-expanded="true"] .ip-expand-icon {
  transform: rotate(180deg);
}

/* ═══ FAQ ACCORDION ═══ */
.ip-faq {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}
[data-theme="light"] .ip-faq,
:root:not([data-theme]) .ip-faq {
  border-top-color: hsl(220 18% 86%);
}
[data-theme="dark"] .ip-faq {
  border-top-color: hsl(220 20% 14%);
}
.ip-faq-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.ip-faq-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ip-faq-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ip-faq-item.is-open {
  background: hsl(var(--hue1) 20% 35% / 0.06);
}
[data-theme="dark"] .ip-faq-item.is-open {
  background: hsl(var(--hue1) 30% 18% / 0.3);
}
.ip-faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  letter-spacing: -0.005em;
}
.ip-faq-q:hover,
.ip-faq-q:focus-visible { outline: none; color: var(--accent); }
.ip-faq-q-text { flex: 1; }
.ip-faq-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: transform var(--dur) var(--ease);
}
.ip-faq-icon svg { width: 14px; height: 14px; }
.ip-faq-q[aria-expanded="true"] .ip-faq-icon {
  transform: rotate(180deg);
  color: var(--accent);
}
.ip-faq-a {
  padding: 0 12px 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  animation: ipFaqOpen 0.2s ease;
}
.ip-faq-a p { margin-bottom: 8px; }
.ip-faq-a p:last-child { margin-bottom: 0; }
@keyframes ipFaqOpen {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ CITATIONS ═══ */
.ip-citations {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}
[data-theme="light"] .ip-citations,
:root:not([data-theme]) .ip-citations {
  border-top-color: hsl(220 18% 86%);
}
[data-theme="dark"] .ip-citations {
  border-top-color: hsl(220 20% 14%);
}
.ip-citations-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.ip-citations-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ip-citations-list li {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.ip-citation-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ip-citation-link:hover { color: hsl(var(--hue1) 70% 60%); }
.ip-citation-text { color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  .ip-body--collapsible,
  .ip-faq-a,
  .ip-expand-icon,
  .ip-faq-icon { transition: none; animation: none; }
}
