/* 보리수 알림 (notification centre).
 *
 * Loaded after style.css on every page that carries the header bell, so it
 * inherits the same variables (--brand, --line, --muted, --ink, ...) and the
 * shared classes (.card .link-btn .empty .errors .hint .actions). Nothing here
 * restyles an existing class; every rule is for something only the bell and
 * the /notifications list need.
 *
 * Two deliberate restraints:
 *   - an unread row is marked by a small dot, a slightly warmer background and
 *     a heavier title, not by a colour block. A list of twenty unread items
 *     should still read as a list, not as twenty alarms.
 *   - every text node that carries an API value breaks anywhere, so a long
 *     programme title cannot push the page sideways on a phone. Nothing in the
 *     list has a fixed width.
 */

/* --------------------------------------------------------- header bell */

/* The bell is an ordinary .nav-link; only the badge is new. position:relative
   is on the link so the count can sit on it without leaving the flex row. */
.nav-bell { position: relative; white-space: nowrap; }

.nav-badge {
  display: inline-block;
  margin-left: 6px;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d64545;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  vertical-align: 1px;
  font-variant-numeric: tabular-nums;
}
/* On the active (white) pill the red still reads, but the border keeps the
   two shapes from merging into one blob. */
.nav-link.active .nav-badge { box-shadow: 0 0 0 1px #fff; }

/* ------------------------------------------------------------- toolbar */

.notif-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.notif-summary {
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------------------------------------------------------------- list */

.notif-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

/* Each row is a real link, so the browser's own middle-click / open-in-new-tab
   behaviour keeps working and the destination shows in the status bar. */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  background: #fff;
}
.notif-item:hover { background: #f4f7fa; }
.notif-item:focus-visible { outline: 2px solid #c3d9f5; outline-offset: -2px; }

.notif-item.unread { background: #fbfcfe; }
.notif-item.unread:hover { background: #f0f4fa; }

/* The dot holds its column on both states, so a read row and an unread row
   line up and the list does not shift as items are read. */
.notif-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: transparent;
}
.notif-item.unread .notif-dot { background: var(--brand); }

.notif-main { min-width: 0; flex: 1 1 auto; }

.notif-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.notif-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  background: #eef1f5;
  color: #4a5666;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.notif-item.unread .notif-type { background: #e8eefb; color: #24408a; }

.notif-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.notif-time { margin-left: auto; white-space: nowrap; }

.notif-title {
  display: block;
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;   /* a pasted URL must not widen the page */
}
.notif-item.unread .notif-title { font-weight: 600; }

.notif-body {
  display: block;
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.notif-more { margin-top: 14px; text-align: center; }

/* --------------------------------------------------------------- guest */

.notif-guest { padding: 22px; text-align: center; font-size: 14px; color: var(--muted); }
.notif-guest a { color: var(--brand); font-weight: 600; }

/* -------------------------------------------------------------- mobile */

@media (max-width: 520px) {
  .notif-item { padding: 12px 2px; gap: 8px; }
  /* The timestamp stops fighting the badges for the same row and simply
     follows them; margin-left:auto on a wrapped line pushes it off-screen. */
  .notif-time { margin-left: 0; }
  .notif-toolbar button.primary,
  .notif-toolbar .link-btn { width: 100%; }
}
