/**
 * mahana-card — universal reusable card primitive
 *
 * Drop-in card with: title, lede, N stat cells, top-right action, bottom-right
 * meta-icon, optional swipeable pages (botanicals → gins, agent → tasks, etc).
 *
 * Variants: .light (default, paper/cream) · .dark (forest/gold) · .glass (frosted)
 * Sizes:    .sm  · default · .lg
 *
 * Use anywhere — botanikk overlay, admin promote, inline agent UI, gin detail.
 */

.mc-card {
  --mc-bg: #ffffff;
  --mc-fg: #1a1a1a;
  --mc-meta: rgba(0,0,0,0.5);
  --mc-rule: rgba(0,0,0,0.08);
  --mc-accent: #4a7bd6;
  --mc-stat-bg: rgba(0,0,0,0.04);
  --mc-radius: 22px;
  --mc-shadow: 0 8px 28px -8px rgba(0,0,0,0.18);

  position: relative;
  background: var(--mc-bg);
  color: var(--mc-fg);
  border-radius: var(--mc-radius);
  padding: 20px 22px 18px;
  box-shadow: var(--mc-shadow);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

/* Dark variant — forest + gold, matches 1907 brand */
.mc-card.mc-dark {
  --mc-bg: linear-gradient(160deg, #1a2018 0%, #0e1612 100%);
  --mc-fg: #f3e9d3;
  --mc-meta: rgba(243,233,211,0.55);
  --mc-rule: rgba(214,184,106,0.15);
  --mc-accent: #d4a843;
  --mc-stat-bg: rgba(214,184,106,0.08);
  --mc-shadow: 0 12px 32px -10px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(214,184,106,0.18);
}

/* Glass — sage paper, matches botanikk cards */
.mc-card.mc-glass {
  --mc-bg: linear-gradient(180deg, rgba(212,227,205,0.92), rgba(196,216,189,0.88));
  --mc-fg: #1d3e2d;
  --mc-meta: rgba(29,62,45,0.5);
  --mc-rule: rgba(29,62,45,0.12);
  --mc-accent: #c19a4b;
  --mc-stat-bg: rgba(255,255,255,0.4);
}

.mc-card.mc-lg { padding: 28px 30px 24px; --mc-radius: 26px; }
.mc-card.mc-sm { padding: 14px 16px 12px; --mc-radius: 16px; gap: 10px; }

/* HEADER */
.mc-card .mc-head {
  display: flex; align-items: flex-start; gap: 12px;
}
.mc-card .mc-titles { flex: 1; min-width: 0; }
.mc-card .mc-title {
  font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.mc-card.mc-sm .mc-title { font-size: 16px; }
.mc-card.mc-lg .mc-title { font-size: 26px; }
.mc-card .mc-lede {
  font-size: 14px; line-height: 1.45; color: var(--mc-meta);
  margin: 0;
}
.mc-card.mc-sm .mc-lede { font-size: 12.5px; }
.mc-card .mc-action {
  flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--mc-accent); color: #fff;
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--mc-accent) 50%, transparent);
  transition: transform .15s ease, box-shadow .15s ease;
}
.mc-card .mc-action:hover { transform: scale(1.05); }
.mc-card .mc-action:active { transform: scale(0.96); }
.mc-card.mc-dark .mc-action { color: #1a1208; }

/* STATS ROW */
.mc-card .mc-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
}
.mc-card .mc-stat {
  background: var(--mc-stat-bg);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.mc-card .mc-stat-value {
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 4px;
}
.mc-card .mc-stat-value .mc-unit {
  font-size: 11px; font-weight: 500; color: var(--mc-meta);
}
.mc-card .mc-stat-icon {
  font-size: 13px; color: var(--mc-meta); margin-bottom: 2px;
}
.mc-card .mc-stat-label {
  font-size: 11px; color: var(--mc-meta); line-height: 1.3;
}

/* PAGES (swipeable) */
.mc-card .mc-pages {
  position: relative; overflow: hidden;
  border-top: 1px solid var(--mc-rule);
  padding-top: 14px; margin-top: 4px;
}
.mc-card .mc-pages-track {
  display: flex; transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.mc-card .mc-page {
  flex: 0 0 100%; min-width: 0;
  padding: 0 2px;
}
.mc-card .mc-page-title {
  font-size: 15px; font-weight: 600; margin: 0 0 4px;
}
.mc-card .mc-page-meta {
  font-size: 12px; color: var(--mc-meta); margin: 0 0 8px;
}
.mc-card .mc-page-image {
  width: 100%; aspect-ratio: 16/10;
  display: flex; align-items: center; justify-content: center;
  background: var(--mc-stat-bg);
  border-radius: 12px; margin-bottom: 10px;
  overflow: hidden;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.08));
}
.mc-card .mc-page-image img {
  max-width: 78%; max-height: 88%;
  object-fit: contain;
}
.mc-card .mc-page-tasting {
  font-size: 13px; line-height: 1.5; color: var(--mc-fg);
  margin: 8px 0; font-style: italic;
  font-family: 'Cormorant Garamond', Georgia, serif;
}
.mc-card .mc-page-pricebar {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--mc-rule);
}
.mc-card .mc-page-price {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px; font-weight: 600; color: var(--mc-accent);
}
.mc-card .mc-page-cta {
  color: var(--mc-accent); font-size: 12px; font-weight: 600;
  text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px;
}
.mc-card .mc-page-chips {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.mc-card .mc-chip {
  background: var(--mc-stat-bg);
  padding: 4px 9px; border-radius: 100px;
  font-size: 11px; font-weight: 500;
}
.mc-card .mc-pages-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px;
}
.mc-card .mc-dots {
  display: flex; gap: 5px;
}
.mc-card .mc-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mc-rule);
  cursor: pointer; transition: background .15s ease, transform .15s ease;
}
.mc-card .mc-dot.active {
  background: var(--mc-accent); transform: scale(1.2);
}
.mc-card .mc-page-btn {
  background: none; border: 0; cursor: pointer;
  color: var(--mc-meta); font-size: 14px; padding: 4px 8px;
  transition: color .15s ease;
}
.mc-card .mc-page-btn:hover { color: var(--mc-fg); }
.mc-card .mc-page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* FOOTER (meta icon row) */
.mc-card .mc-foot {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 8px;
  font-size: 11px; color: var(--mc-meta);
}
.mc-card .mc-foot-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--mc-stat-bg);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s ease;
  border: 0; color: inherit;
}
.mc-card .mc-foot-icon:hover { background: var(--mc-rule); }
