/* Biberfan Announcements: strip, popup and slide-in. Colours and type come from the theme's own variables, with fallbacks. */
.bf-ann {
  --ann-paper: var(--paper, #e4e2d0); --ann-ink: var(--ink, #1f1d1a); --ann-rule: var(--rule, rgba(31, 29, 26, .28));
  --ann-accent: var(--accent, #6b3a1f); --ann-muted: var(--muted, #5d594f);
  position: relative; box-sizing: border-box; color: var(--ann-ink); background: var(--ann-paper);
  font-family: var(--serif, Georgia, serif); line-height: 1.45; overflow: hidden;
}
.bf-ann *, .bf-ann *::before, .bf-ann *::after { box-sizing: border-box; }
.bf-ann-bg { position: absolute; inset: 0; background: center / cover no-repeat; opacity: .15; pointer-events: none; }
.bf-ann-body { position: relative; }
.bf-ann-title { display: block; margin: 0 0 .35em; font-weight: 600; color: var(--ann-ink); }
.bf-ann-text p { margin: 0 0 .6em; }
.bf-ann-text p:last-child { margin-bottom: 0; }
.bf-ann-text a { color: var(--ann-accent); }
.bf-ann-ctas { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 0; }
.bf-ann-cta {
  display: inline-block; font-family: var(--serif, Georgia, serif); font-size: 1rem; letter-spacing: .06em; line-height: 1.3;
  text-decoration: none; padding: .55rem 1.3rem; border: 1px solid var(--ann-ink); border-radius: 2px; transition: background .2s, color .2s;
}
.bf-ann-cta--primary { background: var(--ann-ink); color: var(--ann-paper); }
.bf-ann-cta--primary:hover { background: transparent; color: var(--ann-ink); }
.bf-ann-cta--secondary { background: transparent; color: var(--ann-ink); }
.bf-ann-cta--secondary:hover { background: var(--ann-ink); color: var(--ann-paper); }
.bf-ann-close {
  position: absolute; top: .5rem; right: .5rem; z-index: 1; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0;
  border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--ann-ink); cursor: pointer;
}
.bf-ann-close:hover { border-color: var(--ann-rule); background: rgba(31, 29, 26, .06); }
.bf-ann :focus-visible { outline: 2px solid var(--ann-accent); outline-offset: 2px; }

/* ---- strip: across the top of the page, above the header; it pushes the page down rather than covering it */
.bf-ann--strip { border-bottom: 1px solid var(--ann-rule); max-height: 0; transition: max-height .45s ease; }
.bf-ann--strip.is-in { max-height: 24rem; }
.bf-ann--strip .bf-ann-body {
  max-width: var(--wrap, 78rem); margin: 0 auto; padding: .7rem calc(var(--gutter, 1.5rem) + 2.6rem) .7rem var(--gutter, 1.5rem);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem 1.2rem; font-size: 1.05rem; text-align: center;
}
.bf-ann--strip .bf-ann-title { display: inline; margin: 0 .4em 0 0; }
.bf-ann--strip .bf-ann-text, .bf-ann--strip .bf-ann-text p { display: inline; margin: 0; }
.bf-ann--strip .bf-ann-text p + p::before { content: ' '; }
.bf-ann--strip .bf-ann-ctas { margin: 0; gap: .5rem; }
.bf-ann--strip .bf-ann-cta { padding: .3rem .9rem; font-size: .95rem; }
.bf-ann--strip .bf-ann-close { top: 50%; transform: translateY(-50%); right: calc(var(--gutter, 1.5rem) - .6rem); }

/* ---- popup: centred over a dimmed page */
dialog.bf-ann--popup {
  width: min(34rem, calc(100vw - 2rem)); max-height: min(85vh, 42rem); margin: auto; padding: 0;
  border: 1px solid var(--ann-rule); border-radius: 4px; box-shadow: 0 20px 60px rgba(31, 29, 26, .35); overflow: auto;
}
dialog.bf-ann--popup::backdrop { background: rgba(31, 29, 26, .45); }
dialog.bf-ann--popup[open] { animation: bf-ann-pop .3s ease-out; }
.bf-ann--popup .bf-ann-body { padding: 2rem 2rem 1.8rem; font-size: 1.15rem; }
.bf-ann--popup .bf-ann-title { font-size: 1.6rem; line-height: 1.2; margin-right: 2rem; }
@keyframes bf-ann-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---- slide-in: a card at the lower right; across the bottom on phones */
.bf-ann--slide {
  position: fixed; right: 1.25rem; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); z-index: 70; width: min(24rem, calc(100vw - 2.5rem));
  border: 1px solid var(--ann-rule); border-radius: 4px; box-shadow: 0 12px 40px rgba(31, 29, 26, .28);
  transform: translateX(calc(100% + 2rem)); transition: transform .45s cubic-bezier(.2, .7, .3, 1);
}
.bf-ann--slide.is-in { transform: none; }
.bf-ann--slide .bf-ann-body { padding: 1.3rem 1.4rem 1.3rem; font-size: 1.05rem; }
.bf-ann--slide .bf-ann-title { font-size: 1.3rem; line-height: 1.2; margin-right: 2rem; }
@media (max-width: 600px) {
  .bf-ann--slide { left: .75rem; right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); width: auto; transform: translateY(calc(100% + 1.5rem)); }
}

@media (prefers-reduced-motion: reduce) {
  .bf-ann--strip, .bf-ann--slide { transition: none; }
  dialog.bf-ann--popup[open] { animation: none; }
}
html.bf-gaming .bf-ann { display: none !important; }                /* never over Ritornello or The Secret Concert */
@media print { .bf-ann { display: none !important; } }
