.notes-intro {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 300;
}

.notes-grid {
  display: flex;
  flex-direction: column;
  gap: 8px; /* tighter, similar to home header spacing */
  width: 100%;
}

.note-card {
  background-color: rgba(20, 20, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  overflow: hidden;
}

.note-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 44px 18px 20px; /* extra right pad for the icon overlay */
  cursor: pointer;
  list-style: none;
  position: relative;
}

.note-card summary::-webkit-details-marker {
  display: none;
}

.note-card summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease, color 0.2s ease;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.note-card[open] summary::after {
  content: "–"; /* en dash minus */
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.75);
}

.note-card[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.note-title {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.note-meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.note-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.note-card[open] {
  background-color: rgba(24, 24, 24, 0.85);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3);
}

.note-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 22px 22px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: none;
}

.note-tldr {
  background-color: rgba(255, 255, 255, 0.04);
  border-left: 3px solid rgba(255, 255, 255, 0.18);
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.note-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-section h4 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
}

.note-section p,
.note-section ul {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.note-section ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-tradeoff {
  font-style: italic;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 6px;
}

.note-media-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* Ensure inline images in notes scale and have rounded corners */
.note-media-row img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

.note-media-placeholder {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 24px 12px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.note-card code {
  font-family: "Fira Code", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background-color: rgba(255, 255, 255, 0.06);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.note-card pre {
  background: transparent; /* let theme set actual background */
  border: 1px solid rgba(255, 255, 255, 0.06); /* subtler border */
  border-radius: 10px;
  padding: 0; /* Prism will pad the inner code */
  overflow-x: auto;
}

.note-card pre code {
  display: block;
  padding: 14px 16px; /* inner padding */
  font-size: 0.9rem;
}

/* Ensure Prism colors are visible on dark background */
/* Force a darker panel than theme's default gray */
.note-card pre code[class*="language-"] {
  color: inherit;
  background: #0d0d0d !important;
}

/* Some Prism themes set background on pre[class*="language-"] too */
pre[class*="language-"] {
  background: #0d0d0d !important;
}

@media (max-width: 600px) {
  .note-card summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .note-media-row {
    grid-template-columns: 1fr;
  }
}

/* Light mode variants inherit from body.light-mode like the rest */
body.light-mode .note-card {
  background-color: rgba(250, 248, 243, 0.92);
  border: 1px solid rgba(180, 160, 140, 0.18);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

body.light-mode .note-card summary::after {
  color: rgba(90, 80, 70, 0.5);
}

body.light-mode .note-card[open] summary::after {
  color: rgba(90, 80, 70, 0.7);
}

body.light-mode .note-card[open] {
  background-color: rgba(255, 253, 247, 0.96);
  border-color: rgba(150, 130, 110, 0.26);
  box-shadow: 0 16px 45px rgba(140, 120, 100, 0.22);
}

body.light-mode .note-meta {
  color: rgba(60, 60, 60, 0.55);
}

body.light-mode .note-card:hover {
  border-color: rgba(150, 130, 110, 0.35);
}

body.light-mode .note-tldr {
  background-color: rgba(240, 235, 228, 0.6);
  border-left: 3px solid rgba(180, 160, 140, 0.35);
  color: rgba(60, 60, 60, 0.85);
}

body.light-mode .note-section h4 {
  color: rgba(60, 60, 60, 0.55);
}

body.light-mode .note-section p,
body.light-mode .note-section ul {
  color: rgba(50, 50, 50, 0.78);
}

body.light-mode .note-media-placeholder {
  border-color: rgba(180, 160, 140, 0.35);
  color: rgba(90, 80, 70, 0.6);
  background-color: rgba(255, 255, 255, 0.6);
}

/* Open state for animation */
.note-card[open] .note-body {
  max-height: 2000px; /* sufficiently large to contain content */
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .note-body { transition: none; }
}

