/* ==========================================================================
   1. CORE CONTAINER LAYOUT
   ========================================================================== */

.card-container {
  display: grid;
  /* Automatically calculates columns; drops them to a new row on mobile */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ==========================================================================
   2. MAIN CARD BASE (NON-WINDOW AREA)
   ========================================================================== */

.card {
  background-color:rgb(169, 169, 169); /* Off-white color for the non-window background */
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  /* Card padding top | right | bottom | left */
  padding: 0rem 1.25rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
@media (min-width: 640px) {
  .card.expanded {
    grid-column: span 2; 
  }
}

/* Interactivity animation when hovering anywhere on the card */
.card:hover {
  transform: translateY(-4px);  
  border-color: #007bff;
  /* Makes the window shadow slightly deeper on hover for a lift effect */
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.15); 
}

/* ==========================================================================
   3. INNER WINDOW COMPONENT
   ========================================================================== */

.card-window {
  background-color: #ededed; /* Darkened inside background to maximize shadow visibility */
  border: 2px solid #d7d7d7; /* Darker border rim for extra structural edge contrast */
  border-radius: 8px;
  overflow: hidden;
  /* PADDING top | right | bottom | left w/ spaces between */
  padding: 0 1rem .5rem .5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  
  /* 
    Dual Layer Inset Shadow:
    - Shadow 1: Shunted 10px right and 14px down, highly blurred (20px) and deep black (0.35 opacity)
    - Shadow 2: Shunted 3px right and 4px down for a sharp, dark edge rim shadow
    box-shadow: inset [horizontal-offset] [vertical-offset] [blur-radius] [spread-radius] [color];

  box-shadow: 
    inset 3px 3px 20px rgba(0, 0, 0, 0.25),
    inset 1px 2px 6px rgba(0, 0, 0, 0.15);
  */
  
  
  /* REMOVE any fixed height here if you added one */
  display: flex;
  flex-direction: column; 

}

/* Interactive highlight on the inner window when hovering */
.card:hover .card-window {
  border-color: none; /* Turns blue to emphasize focus */
}

.card-image {
  width: 100%;
  height: 160px;
  object-fit: cover; /* Prevents aspect-ratio stretching or distortion */
  border-bottom: 1px solid #dee2e6; /* Line dividing image and window text */
  display: block;
}

.window-title {
  margin: 12px 12px 0 12px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #212529;
}

/* ==========================================================================
   4. OUTER CONTENT (NON-WINDOW AREA)
   ========================================================================== */

.card-body {
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Pushes button down if adjacent cards have more text */
  box-sizing: border-box;
}

.card-text {
  margin: 0 0 16px 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.95rem;
  color: #495057;
  line-height: 1.5;
  flex-grow: 1; /* Ensures text block fills empty space to keep buttons aligned */
}

.card-btn {
  padding: 10px 16px;
  background-color: #007bff;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  align-self: flex-start; /* Keeps the button matching its content width */
  transition: background-color 0.2s ease;
}

.card-btn:hover {
  background-color: #0056b3;
}
