/* ==========================================================================
   COMPACT LISTINGS & CARDS GRID
   ========================================================================== */

/* Main Listings Page Wrapper */
.listings-page {
  max-width: 1050px;
  margin: 2rem auto;
  padding: 0 1.25rem;
  box-sizing: border-box;
}

/* Subject Headings */
.subject-heading {
  font-size: 1.75rem;
  color: #0f172a;
  margin: 3rem 0 2rem 0;
}

/* Grid Layout: Exactly 3 Columns on Laptops/Desktops */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

/* Compact Card Box */
.note-card {
  background: #ffffff;
  border: 1px solid #2b2d2f;
  border-radius: 0px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.note-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 255, 94, 0.06);
}

/* Landscape/Rectangular Image Preview (Reduced Height) */
.note-card .card-preview {
  width: 100%;
  aspect-ratio: 16 / 9; /* Creates a horizontal rectangular preview */
  background-color: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  overflow: hidden;
}

.note-card .card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top; /* Anchors image to top edge; cuts off excess from the bottom */
  display: block;

  /* Prevent drag, text selection, and touch interactions */
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none; /* Disables right-click context menu, click events, and dragging */
}

/* Card Body with Tight Padding */
.note-card .card-body {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  flex-grow: 1;
}

.note-card .note-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: #0f172a;
}

/* Compact Button */
.note-card .card-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #059669;
  text-decoration: underline;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.note-card .card-button:hover {
  color: #ff5722;
}

.note-card .arrow-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================== */

/* Tablet adjustment (under 900px) */
@media (max-width: 900px) {
  .notes-grid {
    gap: 1rem;
  }
}

/* Mobile Screens (2 Columns Max) */
@media (max-width: 640px) {
  .listings-page {
    margin: 1.25rem auto;
    padding: 0 0.85rem;
  }

  .subject-heading {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  /* Force exactly 2 columns across on mobile */
  .notes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  /* Tighter padding and text sizes for mobile cards */

  .note-card .card-body {
    padding: 0.65rem 0.75rem;
    gap: 0.5rem;
  }

  .note-card .note-title {
    font-size: 0.85rem;
    line-height: 1.25;
  }

  .note-card .card-button {
    font-size: 0.8rem;
  }
}