/* Notion Cards Grid Layout — PediaNotes Practical
   Applied when note has cssclasses: notion-cards in frontmatter */

.note-content.notion-cards ul {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  gap: 1rem !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 1rem 0 !important;
}

.note-content.notion-cards ul li {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  min-height: 120px;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border, #334155);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
}

.note-content.notion-cards ul li:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* Background image fills the card */
.note-content.notion-cards ul li img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 0 !important;
  max-width: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

/* Link fills the card, text at bottom with gradient scrim */
.note-content.notion-cards ul li a {
  position: relative;
  z-index: 1;
  display: flex !important;
  align-items: flex-end;
  width: 100%;
  min-height: 120px;
  padding: 0.75rem 1rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.80) 0%,
    rgba(0, 0, 0, 0.25) 55%,
    rgba(0, 0, 0, 0.0) 100%
  ) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 0.875rem !important;
  text-decoration: none !important;
  border-radius: 12px;
  line-height: 1.3;
}

/* Stretch link to cover full card */
.note-content.notion-cards ul li a::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
}

/* Cards without images — use solid accent background */
.note-content.notion-cards ul li:not(:has(img)) {
  background: var(--bg-secondary, #1e293b);
}

.note-content.notion-cards ul li:not(:has(img)) a {
  background: transparent !important;
  color: var(--text-normal) !important;
  align-items: center;
  padding: 1rem;
}

/* Responsive: stack on mobile */
@media (max-width: 640px) {
  .note-content.notion-cards ul {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
  }
}

/* Back navigation arrow (← [[Link|Home]]) */
.note-content.notion-cards p:last-child {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
