/* "N new" badges for Research Openings, Happening Soon and study group messages (see new-badges.js). */
.new-badge { display: inline-block; margin-left: .35rem; padding: .05rem .45rem; border-radius: 999px; background: #b21f2d; color: #fff; font-size: .72rem; font-weight: 800; line-height: 1.5; vertical-align: .1em; white-space: nowrap; text-decoration: none; }
.new-badge .visually-hidden, .new-badge-hidden-text { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* On a homepage card: its own link in the top-right corner, above the card's full-size link. */
.feature-grid > .content-card { position: relative; }
.feature-grid > .content-card > .new-card-badge { position: absolute; top: .8rem; right: .8rem; z-index: 2; grid-area: auto; margin: 0; color: #fff; font-size: .74rem; }
.feature-grid > .content-card > .new-card-badge:hover, .feature-grid > .content-card > .new-card-badge:focus-visible { background: #8f1823; color: #fff; }
.feature-grid > .content-card > .new-card-badge:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.new-card-badge[hidden] { display: none; }
/* The phone card layout styles every direct link as the card's arrow; the badge is not that link. */
.feature-grid > .content-card > .new-card-badge::before, .feature-grid > .content-card > .new-card-badge::after { content: none; }

/* On the navy "Open group chat" button. */
.button.primary .new-badge { background: #fff; color: #b21f2d; }

/* A small dot when the menu is closed: on the phone menu button and on More. */
.new-dot { position: absolute; top: .3rem; right: .3rem; width: .65rem; height: .65rem; border: 2px solid #fff; border-radius: 50%; background: #b21f2d; }
.new-dot[hidden] { display: none; }
.mobile-menu-toggle { position: relative; }
.nav-menu summary .new-dot { position: static; display: inline-block; margin-left: .3rem; vertical-align: .15em; border: 0; }
.nav-menu summary .new-dot[hidden] { display: none; }

/* Phone cards are compact rows with no free corner: the badge sits on the top edge, like a tab. */
@media (max-width: 760px) {
  .feature-grid > .content-card > .new-card-badge { top: -.6rem; right: 2.4rem; box-shadow: 0 0 0 2px var(--paper, #f8fafc); }
}

/* Desktop menu: no spare width, so the badge is a number bubble over the link's corner. */
@media (min-width: 1241px) {
  .desktop-nav-links > a[data-new-target] { position: relative; }
  .desktop-nav-links > a > .new-badge { position: absolute; top: -1.05rem; right: -.3rem; min-width: 1.15rem; margin: 0; padding: 0 .3rem; font-size: .66rem; line-height: 1.15rem; text-align: center; }
  .desktop-nav-links > a > .new-badge .new-word { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
