/* Notifications cascade (experimental) — top-right drift-in cards + counter.
   Cards inherit the site's body font for coherence; the counter uses a
   compact sans for legible numerals. Desktop-only for now. */

.notif-root {
    position: fixed;
    top: 0;
    right: var(--notif-margin, 22px);
    height: 100vh;
    z-index: 4;
    /* explicit width — children are absolute / display:none, so the root has no
       in-flow content to size itself from; JS overrides with the real gutter */
    width: 340px;
    max-width: calc(100vw - 44px);
    pointer-events: none;
}

.notif-count {
    position: absolute;
    top: var(--notif-margin, 22px);
    right: 0;
    z-index: 2;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border: none;
    border-radius: 11px;
    background: #e2002a;
    color: #fff;
    font: 500 12px/22px -apple-system, "Helvetica Neue", Arial, sans-serif;
    text-align: center;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.notif-count:hover { transform: scale(1.12); }
.notif-count:active { transform: scale(0.96); }
/* When open, the dot becomes a close button matching the main menu's close.png */
.notif-root.is-open .notif-count {
    width: 24px;
    height: 24px;
    min-width: 0;
    padding: 0;
    color: transparent;
    background-color: transparent;
    background-image: url("/img/close.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    box-shadow: none;
}

/* Notification center — the full history, shown when the dot is clicked.
   Spans the full viewport height; content scrolls under the floating dot. */
.notif-center {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    /* clear the dot at the top, breathe at the bottom */
    padding: calc(var(--notif-margin, 22px) + 34px) 0 var(--notif-margin, 22px);
    overflow-y: auto;
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* legacy Edge */
}
.notif-center[hidden] { display: none; }  /* `display:flex` would otherwise override the hidden attr */
.notif-center::-webkit-scrollbar { display: none; }  /* WebKit */
.notif-center .notif-card { pointer-events: auto; }

.notif-stack {
    position: absolute;
    top: calc(var(--notif-margin, 22px) + 34px);
    right: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.notif-card {
    box-sizing: border-box;
max-width: 100%;
pointer-events: none;
background: rgba(0, 0, 0, 0.66);
font-family: Arial;
-webkit-backdrop-filter: blur(8px);
backdrop-filter: blur(8px);
/* border: 1px solid rgba(0, 0, 0, 0.33); */
border-radius: 12px;
padding: 8px;
color: whitesmoke;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.2);
    font-size: 15px;
    line-height: 1.4;
    transform: translateX(125%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.18, 0.85, 0.25, 1), opacity 0.5s ease;
}

.notif-card.show { transform: translateX(0); opacity: 1; }
.notif-card.leave { transform: translateX(125%); opacity: 0; }

.notif-card.has-link {
    pointer-events: auto;
    cursor: pointer;
    text-decoration: none;
    color: #181818;
}
.notif-card.has-link:hover { border-color: rgba(0, 0, 0, 0.4); }

.notif-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: rgba(255,255,255,0.3) 0.08rem solid;
}
.notif-cap { margin-top: 8px; font-size: 13px; opacity: 0.75; }

@media (prefers-reduced-motion: reduce) {
    .notif-card { transform: none; transition: opacity 0.35s ease; }
    .notif-card.leave { transform: none; }
}

@media (max-width: 767px) {
    .notif-root { display: none; }
}
