/**
 * public/cubic-layout.css
 *
 * Tenderpoints Hub — Modular Cubic & Bento-Grid Visual Architecture System.
 *
 * Features:
 *   - CSS Grid track scaling with container queries (@container)
 *   - Aspect-ratio constraints (1:1 square micro-cards, 2:1 wide exhibits, 2:2 hero modules)
 *   - Spring physics micro-interactions via cubic-bezier(0.16, 1, 0.3, 1)
 *   - Obsidian glassmorphic depth with accessible multi-color glow borders
 *   - Standardized clinical laboratory panel and KaTeX equation formatting
 */

/* Container Query Parent Wrapper */
.cubic-container {
  container-type: inline-size;
  width: 100%;
}

/* Master Cubic Grid */
.cubic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  width: 100%;
}

@media (min-width: 640px) {
  .cubic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cubic-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .cubic-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Base Cubic Card */
.cubic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--card-glass-bg, rgba(26, 21, 54, 0.85));
  border: 1px solid var(--obsidian-border, #3B3370);
  border-radius: 1.25rem;
  padding: 1.25rem;
  box-shadow: var(--card-shadow, 0 4px 20px -2px rgba(0, 0, 0, 0.5));
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 220ms ease,
              box-shadow 220ms ease,
              background-color 220ms ease;
}

.cubic-card:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: var(--violet, #A78BFA);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(167, 139, 250, 0.4),
              0 0 24px -4px rgba(139, 92, 246, 0.25);
}

/* Geometric Aspect Ratios */
.cubic-card-1x1 {
  aspect-ratio: 1 / 1;
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .cubic-card-2x1 {
    grid-column: span 2;
  }
  .cubic-card-1x2 {
    grid-row: span 2;
  }
}

@media (min-width: 1024px) {
  .cubic-card-3x1 {
    grid-column: span 3;
  }
  .cubic-card-featured {
    grid-column: span 2;
    grid-row: span 2;
  }
}

/* Color-Coded Ambient Glow Variations */
.cubic-glow-violet:hover {
  border-color: #A78BFA;
  box-shadow: 0 16px 32px -8px rgba(167, 139, 250, 0.3), 0 0 0 1px rgba(167, 139, 250, 0.5);
}

.cubic-glow-emerald:hover {
  border-color: #34D399;
  box-shadow: 0 16px 32px -8px rgba(52, 211, 153, 0.3), 0 0 0 1px rgba(52, 211, 153, 0.5);
}

.cubic-glow-rose:hover {
  border-color: #FB7185;
  box-shadow: 0 16px 32px -8px rgba(251, 113, 133, 0.3), 0 0 0 1px rgba(251, 113, 133, 0.5);
}

.cubic-glow-amber:hover {
  border-color: #FBBF24;
  box-shadow: 0 16px 32px -8px rgba(251, 191, 36, 0.3), 0 0 0 1px rgba(251, 191, 36, 0.5);
}

.cubic-glow-cyan:hover {
  border-color: #38BDF8;
  box-shadow: 0 16px 32px -8px rgba(56, 189, 248, 0.3), 0 0 0 1px rgba(56, 189, 248, 0.5);
}

/* Clinical Badge & Metadata Pills */
.cubic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.cubic-badge-violet {
  background: rgba(167, 139, 250, 0.15);
  color: #DDD6FE;
  border-color: rgba(167, 139, 250, 0.3);
}

.cubic-badge-emerald {
  background: rgba(52, 211, 153, 0.15);
  color: #A7F3D0;
  border-color: rgba(52, 211, 153, 0.3);
}

.cubic-badge-rose {
  background: rgba(244, 63, 94, 0.15);
  color: #FECDD3;
  border-color: rgba(244, 63, 94, 0.3);
}

.cubic-badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #FDE68A;
  border-color: rgba(245, 158, 11, 0.3);
}

/* Structured Clinical Laboratory Panel */
.lab-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  background: rgba(10, 9, 21, 0.6);
  border: 1px solid var(--obsidian-border, #3B3370);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
}

.lab-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lab-row:last-child {
  border-bottom: none;
}

.lab-label {
  color: var(--muted, #A9A3BD);
}

.lab-value {
  font-weight: 700;
  color: var(--offwhite, #F4F1EA);
}

.lab-high {
  color: #F87171;
  font-weight: 800;
}

.lab-low {
  color: #60A5FA;
  font-weight: 800;
}

/* Clinical Formula & Math Box */
.clinical-formula-box {
  background: rgba(30, 27, 75, 0.4);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.75rem;
  padding: 0.875rem 1.25rem;
  margin: 0.75rem 0;
  color: #DDD6FE;
  font-size: 0.9375rem;
  text-align: center;
  overflow-x: auto;
}

/* Container Query Adaptations */
@container (max-width: 320px) {
  .cubic-card {
    padding: 1rem;
  }
  .cubic-card-title {
    font-size: 0.9375rem;
  }
  .cubic-badge {
    font-size: 0.625rem;
    padding: 0.2rem 0.5rem;
  }
}
