/*
 * A notification, read in full — the pop-up (notification-detail.js)
 * ==================================================================
 * Loaded from this checkout's override asset root; platform.css is untouched. Every
 * selector is .ndetail*, used nowhere else. Centred on a computer; a sheet from the
 * bottom on a phone, scrolling inside itself when the message is long.
 */

.ndetail-overlay {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(9, 20, 45, .45);
}

/* The page behind does not scroll while it is open. */
html.ndetail-open-page,
html.ndetail-open-page body {
  overflow: hidden;
}

.ndetail {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(13, 27, 62, .28);
  padding: 1.1rem 1.2rem 1rem;
  color: #1f2d4d;
  -webkit-overflow-scrolling: touch;
}

.ndetail__head {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}

.ndetail__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f1f44;
  overflow-wrap: anywhere;
}

.ndetail__x {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: -.25rem -.35rem 0 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 1rem;
  cursor: pointer;
}

.ndetail__x:hover {
  background: #f1f4f9;
  color: #0f1f44;
}

.ndetail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .5rem;
  margin: .45rem 0 .8rem;
  font-size: .8rem;
  color: #64748b;
}

.ndetail__chip {
  display: inline-flex;
  align-items: center;
  padding: .1rem .55rem;
  border-radius: 999px;
  background: #eef3fb;
  color: #2e4a86;
  font-size: .74rem;
  font-weight: 600;
}

.ndetail__chip--unread {
  background: #fff4e5;
  color: #9a5b00;
}

.ndetail__chip--read {
  background: #e9f6ee;
  color: #17693a;
}

.ndetail__message {
  margin: 0 0 .9rem;
  padding: .75rem .85rem;
  border-radius: 12px;
  background: #f7f9fe;
  border: 1px solid #eef2f9;
  font-size: .92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ndetail__facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: .3rem .9rem;
  margin: 0 0 .9rem;
  font-size: .84rem;
}

.ndetail__facts dt {
  color: #64748b;
  font-weight: 600;
}

.ndetail__facts dd {
  margin: 0;
  color: #1f2d4d;
  overflow-wrap: anywhere;
}

.ndetail__action {
  margin: 0 0 .9rem;
}

.ndetail__foot {
  display: flex;
  justify-content: flex-end;
  padding-top: .75rem;
  border-top: 1px solid #eef2f9;
}

.ndetail__close {
  min-width: 96px;
}

/* --- the lists' ways in --------------------------------------------------------- */

/* The alert and the pill on My Notifications: buttons that look as they did. */
.ndetail-open {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ndetail-open--status {
  display: inline-block;
  width: auto;
}

.ndetail-open--alert:hover strong,
.ndetail-open--alert:focus-visible strong {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ndetail-open--status:hover .badge,
.ndetail-open--status:hover > * {
  filter: brightness(.96);
  box-shadow: 0 0 0 2px rgba(20, 48, 107, .12);
}

.ndetail-open:focus-visible {
  outline: 2px solid #2f6fbf;
  outline-offset: 2px;
  border-radius: 8px;
}

.ndetail-bell-item,
table.ndetail-admin-table > tbody > tr[data-ndetail] {
  cursor: pointer;
}

table.ndetail-admin-table > tbody > tr[data-ndetail]:hover > td {
  background: #f7f9fe;
}

.ndetail-bell-item:focus-visible,
table.ndetail-admin-table > tbody > tr[data-ndetail]:focus-visible {
  outline: 2px solid #2f6fbf;
  outline-offset: -2px;
}

/* --- phones: a sheet from the bottom ------------------------------------------- */

@media (max-width: 600px) {
  .ndetail-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .ndetail {
    width: 100%;
    max-height: 86vh;
    border-radius: 18px 18px 0 0;
    padding: 1rem 1rem calc(.9rem + env(safe-area-inset-bottom, 0px));
  }

  .ndetail__title {
    font-size: 1rem;
  }

  .ndetail__close {
    width: 100%;
    min-height: 44px;
  }

  .ndetail__x {
    width: 40px;
    height: 40px;
  }
}
