/* BresciaPC Core - Bacheca Annunci [Fase 8B]
   Pannello Novità (dal dock), striscia festività, popup urgente, archivio /novita/. */

/* ── Badge tipo (condiviso pannello/archivio) ── */
.bpc-ann-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ann-c, #0059b3);
  background: var(--ann-bg, #e8f1fd);
}
.bpc-ann-badge svg { width: 13px; height: 13px; }

/* ── Voce "Novità" nel dock + contatore ── */
.bpc-dock__item--news { position: relative; }
.bpc-ann-chip {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
/* Pallino sul bottone del dock chiuso */
.bpc-ann-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #e11d48;
  border: 2px solid #fff;
  animation: bpcAnnPulse 2.2s ease infinite;
}
@keyframes bpcAnnPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* ── Striscia festività (una riga, discreta) ── */
.bpc-ann-strip {
  background: #fdf0dc;
  color: #92400e;
  border-bottom: 1px solid rgba(146, 64, 14, .14);
}
.bpc-ann-strip__in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.bpc-ann-strip__ico { display: inline-flex; flex: 0 0 auto; }
.bpc-ann-strip__ico svg { width: 16px; height: 16px; }
.bpc-ann-strip__txt {
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bpc-ann-strip__txt:hover { text-decoration: underline; color: inherit; }
.bpc-ann-strip__close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: .75;
}
.bpc-ann-strip__close:hover { opacity: 1; background: rgba(146, 64, 14, .1); }
.bpc-ann-strip__close svg { width: 14px; height: 14px; }

/* ── Pannello Novità ── */
.bpc-ann-panel { position: fixed; inset: 0; z-index: var(--z-hub-overlay, 99995); width:100%; max-width:none; max-height:none; margin:0; padding:0; border:0; background:transparent; color:inherit; }
.bpc-ann-panel::backdrop { background: transparent; }
.bpc-ann-panel[hidden] { display: none; }
.bpc-ann-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 14, .45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.bpc-ann-panel__sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .22);
  animation: bpcAnnUp .28s cubic-bezier(.32, .72, .27, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes bpcAnnUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (min-width: 768px) {
  .bpc-ann-panel__sheet {
    left: auto;
    right: 24px;
    bottom: 92px;
    width: 400px;
    max-height: min(72vh, 620px);
    border-radius: 18px;
  }
  .bpc-ann-panel--left .bpc-ann-panel__sheet { right: auto; left: 24px; }
}
.bpc-ann-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #ececf1;
  font-size: 16px;
}
.bpc-ann-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: #f2f2f5;
  color: #3a3a41;
  cursor: pointer;
}
.bpc-ann-panel__close:hover { background: #e7e7ec; }
.bpc-ann-panel__close svg { width: 15px; height: 15px; }
.bpc-ann-panel__list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px;
  display: grid;
  gap: 12px;
}
.bpc-ann-panel__foot {
  padding: 10px 16px 14px;
  border-top: 1px solid #ececf1;
  text-align: center;
}
.bpc-ann-panel__foot a {
  font-weight: 700;
  font-size: 14px;
  color: #0059b3;
  text-decoration: none;
}
.bpc-ann-panel__foot a:hover { text-decoration: underline; }

/* Card annuncio */
.bpc-ann-card {
  border: 1px solid #ececf1;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.bpc-ann-card__img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
}
.bpc-ann-card__body { padding: 12px 14px 14px; }
.bpc-ann-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.bpc-ann-card__meta time { font-size: 12px; color: #7a7a85; }
.bpc-ann-card__title {
  margin: 0 0 4px;
  font-size: 15.5px;
  line-height: 1.35;
  font-weight: 800;
  color: #141419;
}
.bpc-ann-card__txt {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #4b4b55;
}
.bpc-ann-card__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.bpc-ann-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}
.bpc-ann-btn--main { background: #0066cc; color: #fff; }
.bpc-ann-btn--main:hover { background: #0059b3; color: #fff; }
.bpc-ann-btn--wa { background: #e5f6eb; color: #146c2e; }
.bpc-ann-btn--wa:hover { background: #d3efdd; color: #146c2e; }
.bpc-ann-btn--tel { background: #f2f2f5; color: #141419; }
.bpc-ann-btn--tel:hover { background: #e7e7ec; color: #141419; }
.bpc-ann-card__more {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: #0059b3;
  text-decoration: none;
  white-space: nowrap;
}
.bpc-ann-card__more:hover { text-decoration: underline; }

/* ── Popup urgente ── */
.bpc-ann-pop { position: fixed; inset: 0; z-index: 99992; }
.bpc-ann-pop[hidden] { display: none; }
.bpc-ann-pop__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 14, .5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.bpc-ann-pop__card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 420px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  padding: 26px 22px 22px;
  text-align: center;
  animation: bpcAnnUp .26s cubic-bezier(.32, .72, .27, 1);
}
.bpc-ann-pop__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: #f2f2f5;
  color: #3a3a41;
  cursor: pointer;
}
.bpc-ann-pop__close svg { width: 15px; height: 15px; }
.bpc-ann-pop__ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #fdeaea;
  color: #b91c1c;
  margin-bottom: 10px;
}
.bpc-ann-pop__ico svg { width: 24px; height: 24px; }
.bpc-ann-pop__title { margin: 0 0 6px; font-size: 19px; font-weight: 800; color: #141419; }
.bpc-ann-pop__txt { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: #4b4b55; }
.bpc-ann-pop__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Archivio /novita/ + singolo ── */
.bpc-ann-arch {
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 18px 60px;
}
.bpc-ann-arch__head { text-align: center; margin-bottom: 26px; }
.bpc-ann-arch__head h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4.6vw, 38px);
  font-weight: 800;
  letter-spacing: -.02em;
}
.bpc-ann-arch__head p { margin: 0 auto; max-width: 560px; color: #5b5b66; font-size: 15.5px; }
.bpc-ann-arch__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}
.bpc-ann-arch__grid .bpc-ann-card { box-shadow: 0 4px 18px rgba(20, 20, 25, .05); }
.bpc-ann-arch__grid .bpc-ann-card__img { height: 160px; }
.bpc-ann-arch__empty {
  text-align: center;
  padding: 50px 16px;
  color: #5b5b66;
  border: 1px dashed #d9d9e0;
  border-radius: 16px;
}
.bpc-ann-arch__nav { margin-top: 26px; text-align: center; }
.bpc-ann-arch__nav .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  margin: 0 3px;
  border-radius: 10px;
  border: 1px solid #e2e2e8;
  color: #141419;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.bpc-ann-arch__nav .page-numbers.current { background: #0066cc; border-color: #0066cc; color: #fff; }

.bpc-ann-single {
  max-width: 760px;
  margin: 0 auto;
  padding: 34px 18px 60px;
}
.bpc-ann-single__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.bpc-ann-single__meta time { font-size: 13.5px; color: #7a7a85; }
.bpc-ann-single h1 {
  margin: 0 0 16px;
  font-size: clamp(25px, 4.4vw, 36px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.bpc-ann-single__img {
  width: 100%;
  border-radius: 16px;
  margin: 0 0 18px;
}
.bpc-ann-single__content { font-size: 16px; line-height: 1.7; color: #2c2c33; }
.bpc-ann-single__content p { margin: 0 0 14px; }
.bpc-ann-single__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid #ececf1;
}
.bpc-ann-single__back {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
  color: #0059b3;
  text-decoration: none;
}
.bpc-ann-single__back:hover { text-decoration: underline; }

/* ── Dark mode (stesso schema del dock) ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bpc-ann-panel__sheet,
  :root:not([data-theme="light"]) .bpc-ann-card,
  :root:not([data-theme="light"]) .bpc-ann-pop__card { background: #1c1c22; }
  :root:not([data-theme="light"]) .bpc-ann-panel__head,
  :root:not([data-theme="light"]) .bpc-ann-panel__foot { border-color: #33333b; }
  :root:not([data-theme="light"]) .bpc-ann-card { border-color: #33333b; }
  :root:not([data-theme="light"]) .bpc-ann-panel__head strong,
  :root:not([data-theme="light"]) .bpc-ann-card__title,
  :root:not([data-theme="light"]) .bpc-ann-pop__title,
  :root:not([data-theme="light"]) .bpc-ann-single h1 { color: #f2f2f4; }
  :root:not([data-theme="light"]) .bpc-ann-card__txt,
  :root:not([data-theme="light"]) .bpc-ann-pop__txt,
  :root:not([data-theme="light"]) .bpc-ann-single__content { color: #c9c9d1; }
  :root:not([data-theme="light"]) .bpc-ann-panel__close,
  :root:not([data-theme="light"]) .bpc-ann-pop__close,
  :root:not([data-theme="light"]) .bpc-ann-btn--tel { background: #2a2a31; color: #e6e6ea; }
  :root:not([data-theme="light"]) .bpc-ann-badge { filter: saturate(.9) brightness(1.05); }
  :root:not([data-theme="light"]) .bpc-ann-dot { border-color: #1c1c22; }
  :root:not([data-theme="light"]) .bpc-ann-strip { background: #2b2113; color: #f0c380; border-color: #4a3a1e; }
  :root:not([data-theme="light"]) .bpc-ann-arch__empty { border-color: #3a3a41; color: #a7a7b0; }
  :root:not([data-theme="light"]) .bpc-ann-arch__nav .page-numbers { border-color: #3a3a41; color: #e6e6ea; }
  :root:not([data-theme="light"]) .bpc-ann-single__cta { border-color: #33333b; }
}
[data-theme="dark"] .bpc-ann-panel__sheet,
[data-theme="dark"] .bpc-ann-card,
[data-theme="dark"] .bpc-ann-pop__card { background: #1c1c22; }
[data-theme="dark"] .bpc-ann-panel__head,
[data-theme="dark"] .bpc-ann-panel__foot { border-color: #33333b; }
[data-theme="dark"] .bpc-ann-card { border-color: #33333b; }
[data-theme="dark"] .bpc-ann-panel__head strong,
[data-theme="dark"] .bpc-ann-card__title,
[data-theme="dark"] .bpc-ann-pop__title,
[data-theme="dark"] .bpc-ann-single h1 { color: #f2f2f4; }
[data-theme="dark"] .bpc-ann-card__txt,
[data-theme="dark"] .bpc-ann-pop__txt,
[data-theme="dark"] .bpc-ann-single__content { color: #c9c9d1; }
[data-theme="dark"] .bpc-ann-panel__close,
[data-theme="dark"] .bpc-ann-pop__close,
[data-theme="dark"] .bpc-ann-btn--tel { background: #2a2a31; color: #e6e6ea; }
[data-theme="dark"] .bpc-ann-dot { border-color: #1c1c22; }
[data-theme="dark"] .bpc-ann-strip { background: #2b2113; color: #f0c380; border-color: #4a3a1e; }
[data-theme="dark"] .bpc-ann-arch__empty { border-color: #3a3a41; color: #a7a7b0; }
[data-theme="dark"] .bpc-ann-arch__nav .page-numbers { border-color: #3a3a41; color: #e6e6ea; }
[data-theme="dark"] .bpc-ann-single__cta { border-color: #33333b; }

@media (prefers-reduced-motion: reduce) {
  .bpc-ann-panel__sheet,
  .bpc-ann-pop__card { animation: none; }
  .bpc-ann-dot { animation: none; }
}


/* Dialog reset + tema scuro. */
.bpc-ann-pop { width:100%; max-width:none; max-height:none; margin:0; padding:0; border:0; background:transparent; color:inherit; }
.bpc-ann-pop::backdrop { background:transparent; }
.bpc-ann-panel__close:focus-visible,
.bpc-ann-pop__close:focus-visible,
.bpc-ann-strip__close:focus-visible { outline:3px solid var(--bspc-blue-primary,#0066cc); outline-offset:2px; }
[data-theme="dark"] .bpc-ann-panel__sheet,
[data-theme="dark"] .bpc-ann-card,
[data-theme="dark"] .bpc-ann-pop__card { background:var(--bspc-modal-bg,#1c1c1f); color:var(--bspc-text-primary,#f5f5f7); border-color:var(--bspc-border-light,#303038); }
[data-theme="dark"] .bpc-ann-panel__head,
[data-theme="dark"] .bpc-ann-panel__foot { border-color:var(--bspc-border-light,#303038); }
[data-theme="dark"] .bpc-ann-card__title,
[data-theme="dark"] .bpc-ann-pop__title { color:var(--bspc-text-primary,#f5f5f7); }
[data-theme="dark"] .bpc-ann-card__txt,
[data-theme="dark"] .bpc-ann-card__meta time,
[data-theme="dark"] .bpc-ann-pop__txt { color:var(--bspc-text-secondary,#b7b7bd); }
@media (prefers-reduced-motion: reduce) {
  .bpc-ann-dot,.bpc-ann-panel__sheet,.bpc-ann-pop__card { animation:none !important; }
}
