
.notes-toolbar {
  margin: 0 0 1rem;
  display: flex;
  justify-content: center;
}
#notes-search {
  width: 100%;
  max-width: 520px;
  padding: .6rem .8rem;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.notes-grid {
  column-count: auto;
  column-width: 220px;
  column-gap: 12px;
}

.note-card {
  display: inline-block;
  width: 90%;
  margin: 10px;
  break-inside: avoid;
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  cursor: pointer;
  outline: none;
  transition: box-shadow .18s ease;
}
.note-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.note-card:focus { box-shadow: 0 0 0 3px rgba(0,122,255,.25); }

.note-title { font-weight: 600; margin: 2px 0 4px; }


.note-card .note-meta { font-size: .75rem; color: #777; }
.note-meta .note-date { color: inherit; }
.note-meta .note-tags { display: flex; flex-direction: row; align-items: center; gap: 4px; }
.note-meta .note-tag {
  color: #fff;
  background: rgb(141, 168, 176);
  border-radius: 10px;
  padding: 2px 10px;
  font-size: .7rem;
}


.note-excerpt {
  font-size: .8rem;
  color: #333;
  max-height: 6rem;
  overflow: hidden;
  position: relative;
}
.note-excerpt ul { list-style: disc; margin: 0 0 .6rem 1.25rem; padding: 0; }
.note-excerpt ol { list-style: decimal; margin: 0 0 .6rem 1.25rem; padding: 0; }
.note-excerpt li { margin: .25rem 0; }
.note-excerpt p, .note-excerpt h1, .note-excerpt h2, .note-excerpt h3 { margin: 0 0 .5rem; }
.note-excerpt::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2.5rem;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 80%);
}

/* =========================
   Modal
   ========================= */
.note-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
}
.note-modal[open] {
  opacity: 1;
  pointer-events: auto;
}

.note-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  transition: opacity .35s ease;
}
.note-modal[open] .note-modal__backdrop { opacity: 1; }
.note-modal.closing .note-modal__backdrop { opacity: 0; }


.note-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  padding: 0 18px 22px;
  max-width: 720px;
  width: 100%;
  margin: 0 12px;
  max-height: 90%;
  overflow-y: auto;

  transform-origin: center top;
  will-change: transform, opacity;
}

/* animations!!! */
.note-modal[open] .note-modal__dialog {
  animation: modal-in .35s cubic-bezier(.22,.61,.36,1) both;
}
.note-modal.closing .note-modal__dialog {
  animation: modal-out .35s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes modal-in {
  0%   { transform: translateY(10px) scale(.98); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes modal-out {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateY(10px) scale(.985); opacity: 0; }
}

.note-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 10px;
  font-family: "Open Sans", sans-serif;
}
.note-modal__headings {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
.note-modal__title {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.25;
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.note-modal__meta { font-size: .8rem; color: #777; }
.note-modal__close {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  color: #000;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
  flex: 0 0 auto;
}
.note-modal__close:hover,
.note-modal__close:focus {
  color: #111;
  outline: none;
}

.note-modal__content > :first-child { margin-top: 0; }