/* Notices from the administration: bell in the header, a dropdown list and a
   short toast for a new notice. Same graphite surfaces and cyan accent as the
   panel; tone colors reuse the panel's good/warn/error tokens. */
.site-notices { position: relative; display: inline-flex; flex: 0 0 auto; }
.site-notice-bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; min-height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 10px;
  background: var(--raised); color: var(--text); cursor: pointer; transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
/* Same look and size as the theme and language buttons at every width; cyan only while something is unread. */
[data-theme="light"] .site-notice-bell { background: #e9edf2; border-color: #dce3eb; }
.site-notice-bell[hidden] { display: none; }
.site-notice-bell svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.site-notice-bell:hover, .site-notice-bell[aria-expanded="true"] { filter: brightness(1.08); }
.site-notice-bell.has-unread { color: #79dce9; border-color: rgba(103, 212, 229, .28); background: rgba(103, 212, 229, .09); }
.site-notice-bell.has-unread:hover { filter: none; background: rgba(103, 212, 229, .17); border-color: rgba(103, 212, 229, .55); }
[data-theme="light"] .site-notice-bell.has-unread { color: #087d91; border-color: rgba(8, 125, 145, .25); background: rgba(8, 125, 145, .07); }
.site-notice-bell.has-unread svg { animation: site-notice-ring .9s ease-in-out 1; transform-origin: 50% 15%; }
@keyframes site-notice-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(7deg); } 80% { transform: rotate(-4deg); } }
.site-notice-bell:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.site-notice-badge {
  position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 19px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.site-notice-badge[hidden] { display: none; }

.site-notice-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: min(400px, calc(100vw - 24px));
  max-height: min(70vh, 620px); overflow: auto; padding: 6px 0 8px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--text); box-shadow: 0 18px 48px #0000004d; text-align: left;
}
.site-notice-panel[hidden] { display: none; }
.site-notice-panel:focus { outline: none; }
.site-notice-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.site-notice-panel-head { position: sticky; top: -6px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-notice-panel-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.site-notice-link, .site-notice-more { border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 2px; border-radius: 6px; }
.site-notice-link:hover, .site-notice-more:hover { text-decoration: underline; }
.site-notice-link:focus-visible, .site-notice-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.site-notice-more { display: block; margin: 6px auto 0; }
.site-notice-more:disabled { opacity: .55; cursor: default; text-decoration: none; }
.site-notice-empty { margin: 0; padding: 30px 16px; color: var(--muted); text-align: center; font-size: 13px; }
.site-notice-error { margin: 10px 16px 0; color: var(--error); font-size: 12px; }
.site-notice-list { list-style: none; margin: 0; padding: 0; }
.site-notice { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.site-notice:last-child { border-bottom: 0; }
.site-notice.unread { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.site-notice.unread::before { content: ""; position: absolute; left: 6px; top: 22px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.site-notice-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.site-notice-head strong { font-size: 14px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.site-notice-head time { flex: 0 0 auto; color: var(--faint); font-size: 11px; white-space: nowrap; }

.site-notice-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.site-notice-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-tone="success"] .site-notice-icon, .site-notice-icon[data-tone="success"] { background: var(--good-bg); color: var(--good); }
[data-tone="warning"] .site-notice-icon, .site-notice-icon[data-tone="warning"] { background: var(--warn-bg); color: var(--warn); }
[data-tone="danger"] .site-notice-icon, .site-notice-icon[data-tone="danger"] { background: color-mix(in srgb, var(--error) 16%, transparent); color: var(--error); }

/* Rendered notice text (also used by the admin preview). */
.site-notice-body { color: var(--muted); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.site-notice-body > :first-child { margin-top: 0; }
.site-notice-body > :last-child { margin-bottom: 0; }
.site-notice-body p { margin: 0 0 8px; }
.site-notice-body h4 { margin: 12px 0 6px; color: var(--text); font-size: 14px; font-weight: 650; }
.site-notice-body strong { color: var(--text); font-weight: 650; }
.site-notice-body ul, .site-notice-body ol { margin: 0 0 8px; padding-left: 20px; }
.site-notice-body li { margin: 2px 0; }
.site-notice-body li::marker { color: var(--accent); }
.site-notice-body blockquote { margin: 0 0 8px; padding: 6px 0 6px 12px; border-left: 3px solid var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 5%, transparent); border-radius: 0 8px 8px 0; }
.site-notice-body code { padding: 1px 5px; border-radius: 5px; background: var(--raised); color: var(--text); font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; }
.site-notice-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.site-notice-body hr { margin: 10px 0; border: 0; border-top: 1px solid var(--line); }

.site-notice-toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start;
  width: min(360px, calc(100vw - 32px)); padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text);
  box-shadow: 0 18px 48px #00000055; font: inherit; text-align: left; cursor: pointer; opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease;
}
.site-notice-toast.visible { opacity: 1; transform: none; }
.site-notice-toast[hidden] { display: none; }
.site-notice-toast:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.site-notice-toast-copy { display: grid; gap: 3px; min-width: 0; }
.site-notice-toast-copy strong { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.site-notice-toast-copy span { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .site-notice-panel { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; max-height: calc(100vh - 88px); }
  .site-notice-toast { left: 16px; right: 16px; width: auto; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) { .site-notice-bell, .site-notice-toast { transition: none; } .site-notice-bell.has-unread svg { animation: none; } }
