/* Text Record Page Grid Component */
.text-record-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 0;
}

.text-record-page-card {
  position: relative;
  height: 300px;
  background: #fefefe;
  border-radius: 2px;
  border-left: 4px solid #9ca3af;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  perspective: 1000px;
  
  /* Paper texture and shadows for realistic page effect */
  background-image: 
    linear-gradient(90deg, transparent 0%, transparent 20px, rgba(0,0,0,0.02) 20px, rgba(0,0,0,0.02) 22px, transparent 22px),
    linear-gradient(0deg, transparent 0%, transparent calc(100% - 2px), rgba(0,0,0,0.03) calc(100% - 2px));
  
  /* Multiple shadows for depth */
  box-shadow: 
    0 1px 3px rgba(0,0,0,0.1),
    0 4px 12px rgba(0,0,0,0.05),
    0 8px 24px rgba(0,0,0,0.03),
    inset 0 0 0 1px rgba(0,0,0,0.05);
}

.text-record-page-card:hover {
  transform: translateY(-4px) rotateX(2deg) rotateY(-1deg);
  border-left-color: #6b7280;
  box-shadow: 
    0 4px 8px rgba(0,0,0,0.12),
    0 8px 24px rgba(0,0,0,0.08),
    0 16px 48px rgba(0,0,0,0.06),
    inset 0 0 0 1px rgba(0,0,0,0.08);
}

.text-record-page-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: linear-gradient(-45deg, transparent 46%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 54%, transparent 58%);
  border-radius: 0 2px 0 0;
  z-index: 1;
}

.text-record-page-card::after {
  content: '';
  position: absolute;
  top: 60px;
  left: 24px;
  right: 24px;
  bottom: 24px;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 23px,
    rgba(0,0,0,0.03) 23px,
    rgba(0,0,0,0.03) 24px
  );
  pointer-events: none;
  z-index: 0;
}

.text-record-page-content {
  position: relative;
  height: 100%;
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.text-record-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  min-height: 48px;
}

.text-record-page-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: #1f2937;
  margin: 0;
  flex: 1;
  margin-right: 12px;
  
  /* Title truncation */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 2;
}

.text-record-page-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.text-record-page-pin {
  color: #f59e0b;
  font-size: 14px;
}

.text-record-page-words {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.text-record-page-preview {
  flex: 1;
  font-size: 14px;
  line-height: 1.6;
  color: #4b5563;
  margin-bottom: 16px;
  
  /* Content truncation with more lines for page effect */
  display: -webkit-box;
  -webkit-line-clamp: 12;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 12;
}

.text-record-page-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.text-record-page-date {
  font-size: 12px;
  color: #9ca3af;
  text-align: right;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .text-record-page-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .text-record-page-card {
    height: 280px;
  }
  
  .text-record-page-content {
    padding: 16px 18px 18px;
  }
  
  .text-record-page-title {
    font-size: 15px;
  }
  
  .text-record-page-preview {
    font-size: 13px;
    -webkit-line-clamp: 6;
    line-clamp: 6;
  }
  
  .text-record-page-card::after {
    top: 50px;
    left: 18px;
    right: 18px;
    bottom: 18px;
  }
}

@media (max-width: 480px) {
  .text-record-page-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .text-record-page-card {
    height: 260px;
  }
  
  .text-record-page-content {
    padding: 14px 16px 16px;
  }
  
  .text-record-page-preview {
    -webkit-line-clamp: 5;
    line-clamp: 5;
  }
  
  .text-record-page-card:hover {
    transform: translateY(-2px) rotateX(1deg);
  }
}
