/* =============================================================
   collapsible-section.css — Reusable collapsible section
   ============================================================= */

.collapsible-section {
  border: var(--border-ornate);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
  background: transparent;
}

/* ── Header ───────────────────────────────────────────────────── */
.collapsible-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  background: var(--surface-deep);
  border: none;
  border-bottom: 1px solid rgba(139,26,26,0.14);
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
  transition: background var(--transition-fast);
  gap: 8px;
  position: relative;
}

.collapsible-section__header:hover {
  background: rgba(196,146,42,0.12);
}

/* Open state: warmer background + divider image underline */
.collapsible-section--open .collapsible-section__header {
  background: rgba(196,146,42,0.06);
}
.collapsible-section--open .collapsible-section__header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: url('/assets/ui/sidebar-section-divider.png') no-repeat;
  background-size: 100% 100%;
  opacity: 0.5;
  pointer-events: none;
}

/* ── Title text ───────────────────────────────────────────────── */
.collapsible-section__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

/* Diamond prefix */
.collapsible-section__title::before {
  content: '✦';
  color: var(--gold);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.collapsible-section__icon {
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ── Chevron: ⌄ rotates 180deg when open ─────────────────────── */
.collapsible-section__chevron {
  font-size: 0.8rem;
  color: var(--ink-muted);
  transition: transform 200ms ease;
  flex-shrink: 0;
  display: inline-block;
  line-height: 1;
}

.collapsible-section--open .collapsible-section__chevron {
  transform: rotate(180deg);
}
.collapsible-section:not(.collapsible-section--open) .collapsible-section__chevron {
  transform: rotate(0deg);
}

/* ── Body ─────────────────────────────────────────────────────── */
.collapsible-section__body {
  overflow: hidden;
  transition: max-height 250ms cubic-bezier(0.4,0,0.2,1);
  background: transparent;
  /* Let panel parchment show through — no additional opacity layer */
}

.collapsible-section__body > * {
  padding: 10px 12px;
}

.collapsible-section__body .panel-section-content {
  padding: 10px 12px;
}

/* ── Arcane (spells) variant ──────────────────────────────────── */
.collapsible-section--arcane .collapsible-section__header {
  background: rgba(74,122,155,0.1);
  border-bottom-color: rgba(74,122,155,0.2);
}
.collapsible-section--arcane .collapsible-section__title {
  color: var(--spell-accent);
}
.collapsible-section--arcane .collapsible-section__title::before {
  color: var(--spell-accent);
}
.collapsible-section--arcane .collapsible-section__header:hover {
  background: rgba(74,122,155,0.15);
}
.collapsible-section--arcane {
  border-color: rgba(74,122,155,0.25);
}

/* ── Martial (weapons) variant ────────────────────────────────── */
.collapsible-section--martial .collapsible-section__header {
  background: rgba(139,26,26,0.08);
  border-bottom-color: rgba(139,26,26,0.2);
}
.collapsible-section--martial .collapsible-section__title {
  color: var(--blood);
}
.collapsible-section--martial .collapsible-section__header:hover {
  background: rgba(139,26,26,0.12);
}
