/* Expandable Cards - Vertical Expansion Instead of Modal */

/* Freeze body scroll when a card is expanded */
body.card-expanded {
  overflow: hidden !important;
  height: 100vh;
  position: fixed;
  width: 100%;
}

.card {
  transition: all 0.3s ease;
  
  /* Compact height for above-the-fold visibility */
  min-height: auto;
  height: auto;
  
  /* Flexible display for consistent spacing */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  
  /* Better stacking */
  position: relative;
  z-index: 1;
}

/* Removed dimming effect - cards stay visible */

/* When card is expanded */
.card.expanded {
  height: auto;
  min-height: 220px;
  max-height: 600px; /* Expanded state - adjust as needed */
  z-index: 1000;
  box-shadow: 
    0 0 0 2px rgba(255, 255, 255, 0.1),
    0 25px 70px rgba(0, 0, 0, 0.5),
    0 10px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(0) scale(1.02);
  
  /* Enhanced scroll containment */
  overflow: hidden;
  overscroll-behavior: contain;
  overscroll-behavior-y: contain;
  
  /* Card captures all pointer events when expanded */
  pointer-events: auto;
  position: relative;
  isolation: isolate;
  
  /* Subtle glow effect based on card type */
  outline: 2px solid transparent;
  outline-offset: -2px;
}

/* Color-coded glow for expanded cards */
.card.expanded.philosophy {
  box-shadow: 
    0 0 0 2px rgba(46, 236, 184, 0.3),
    0 0 40px rgba(46, 236, 184, 0.15),
    0 25px 70px rgba(0, 0, 0, 0.5);
}

.card.expanded.web3 {
  box-shadow: 
    0 0 0 2px rgba(227, 102, 247, 0.3),
    0 0 40px rgba(227, 102, 247, 0.15),
    0 25px 70px rgba(0, 0, 0, 0.5);
}

.card.expanded.edge {
  box-shadow: 
    0 0 0 2px rgba(254, 199, 72, 0.3),
    0 0 40px rgba(254, 199, 72, 0.15),
    0 25px 70px rgba(0, 0, 0, 0.5);
}

/* Card content wrapper */
.card-content-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Preview content (always visible) */
.card-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow flex shrinking */
}

/* No sticky headers needed - cards are static */

/* Ensure all card text is always visible */
.card .card-text,
.card-text {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  max-height: none !important;
}

/* Show expanded content by default - no expansion needed */
.card-expanded-content {
  max-height: none;
  overflow: visible;
  opacity: 1;
  margin-top: 1rem;
  display: block;
}

/* No scroll indicators needed */

/* No custom scrollbars needed - content is visible */

/* Expanded content styling */
.card-expanded-content h3 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin: 1rem 0 0.5rem 0;
  color: var(--primary);
}

.card-expanded-content h4 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin: 0.75rem 0 0.4rem 0;
  opacity: 0.9;
}

.card-expanded-content p {
  font-size: 0.72rem;
  line-height: 1.5;
  color: #d0dde2;
  margin-bottom: 0.75rem;
}

.card-expanded-content ul {
  margin: 0.5rem 0 0.75rem 1.2rem;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #d0dde2;
}

.card-expanded-content li {
  margin-bottom: 0.4rem;
}

.card-expanded-content strong {
  color: var(--white);
  font-weight: 700;
}

/* Button text changes */
.card-btn .btn-text-collapsed {
  display: inline;
}

.card-btn .btn-text-expanded {
  display: none;
}

.card.expanded .card-btn .btn-text-collapsed {
  display: none;
}

.card.expanded .card-btn .btn-text-expanded {
  display: inline;
}

/* Prevent other cards from being affected */
.cards-grid {
  align-items: start; /* Allow cards to have different heights */
}

/* Smooth grid adjustment */
.cards-grid {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .card {
    height: auto; /* Natural height on mobile */
    min-height: 180px;
  }
  
  .card.expanded {
    max-height: none;
  }
  
  .card.expanded .card-expanded-content {
    max-height: 500px;
  }
}

/* Color-coded expanded sections */
.card.philosophy .card-expanded-content h3 {
  color: var(--philosophy);
}

.card.web3 .card-expanded-content h3 {
  color: var(--web3);
}

.card.edge .card-expanded-content h3 {
  color: var(--transdisciplinary);
}

/* Content is always visible - no animation needed */
.card-expanded-content > * {
  opacity: 1;
}

/* No scroll hints needed - content is static */

