/* BAET v1.5.1-HF1 — Las vistas Agenda/Calendario son mutuamente excluyentes.
   Esta regla evita que estilos históricos como .agenda-view{display:block}
   anulen el atributo hidden aplicado por JavaScript. */
[data-baet-panel][hidden],
[data-baet-panel].hidden{
  display:none!important;
}

/* BAET — Módulo Calendario Público v1.0.0
   Archivo aislado. No depende de los estilos antiguos de .calendar/.calendar-cell. */

.baet-public-view-switch{
  display:flex;
  align-items:center;
  gap:4px;
  padding:5px;
  border:1px solid #d7e3ed;
  border-radius:16px;
  background:#eaf1f7;
}
.baet-public-view-switch button{
  border:0;
  border-radius:12px;
  background:transparent;
  padding:11px 18px;
  color:#68798e;
  font:inherit;
  font-size:.88rem;
  font-weight:850;
  cursor:pointer;
}
.baet-public-view-switch button.is-active{
  background:#fff;
  color:#071a36;
  box-shadow:0 6px 18px rgba(6,25,52,.08);
}

#baet-public-calendar.baet-calendar-module{
  width:100%;
  overflow:hidden;
  border:1px solid #d6e3ee;
  border-radius:24px;
  background:#fff;
  box-shadow:0 18px 48px rgba(6,25,52,.07);
}
#baet-public-calendar[hidden]{display:none!important}

#baet-public-calendar .baet-calendar-header{
  position:relative;
  min-height:110px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px 84px;
  border-bottom:1px solid #dbe6ef;
  background:linear-gradient(180deg,#fff,#f8fbfe);
}
#baet-public-calendar .baet-calendar-title{
  width:100%;
  text-align:center;
}
#baet-public-calendar .baet-calendar-title span{
  display:block;
  margin-bottom:5px;
  color:#74869a;
  font-size:.69rem;
  line-height:1;
  font-weight:900;
  letter-spacing:.12em;
}
#baet-public-calendar .baet-calendar-title h3{
  margin:0;
  color:#0a1d3a;
  font-size:1.8rem;
  line-height:1.1;
  font-weight:900;
  letter-spacing:-.025em;
}
#baet-public-calendar .baet-calendar-nav{
  position:absolute;
  top:50%;
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  transform:translateY(-50%);
  border:1px solid #d3e0eb;
  border-radius:14px;
  background:#fff;
  color:#123d72;
  box-shadow:0 8px 22px rgba(6,25,52,.06);
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}
#baet-public-calendar .baet-calendar-nav:first-child{left:20px}
#baet-public-calendar .baet-calendar-nav:nth-child(3){right:20px}
#baet-public-calendar .baet-calendar-nav span{
  display:block;
  margin-top:-3px;
  font-size:1.7rem;
  line-height:1;
}
#baet-public-calendar .baet-calendar-nav:hover{
  transform:translateY(-52%);
  border-color:#8fb8e2;
  box-shadow:0 12px 26px rgba(6,25,52,.10);
}

#baet-public-calendar .baet-calendar-month-jump{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  padding:10px 18px;
  border-bottom:1px solid #e0e9f1;
  background:#f8fbfd;
}
#baet-public-calendar .baet-calendar-month-jump label{
  color:#718297;
  font-size:.76rem;
  font-weight:800;
}
#baet-public-calendar .baet-calendar-month-jump select{
  min-width:180px;
  border:1px solid #d3e0eb;
  border-radius:10px;
  background:#fff;
  padding:8px 10px;
  color:#102744;
  font:inherit;
  font-size:.82rem;
  font-weight:750;
  outline:none;
}
#baet-public-calendar .baet-calendar-month-jump select:focus{
  border-color:#0d6efd;
  box-shadow:0 0 0 3px rgba(13,110,253,.10);
}

#baet-public-calendar .baet-calendar-scroll{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  background:#fff;
}
#baet-public-calendar .baet-calendar-grid{
  min-width:760px;
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
}
#baet-public-calendar .baet-calendar-weekday{
  padding:12px 8px;
  border-right:1px solid #dbe6ef;
  border-bottom:1px solid #dbe6ef;
  background:#eef4f9;
  color:#60738a;
  text-align:center;
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
}
#baet-public-calendar .baet-calendar-weekday:nth-child(7){border-right:0}

#baet-public-calendar .baet-calendar-day{
  position:relative;
  min-height:132px;
  padding:10px;
  border-right:1px solid #e0e9f1;
  border-bottom:1px solid #e0e9f1;
  background:#fff;
}
#baet-public-calendar .baet-calendar-day:nth-child(7n){border-right:0}
#baet-public-calendar .baet-calendar-day.is-empty{background:#fbfdff}
#baet-public-calendar .baet-calendar-day.has-events{
  background:linear-gradient(180deg,#fbfeff,#fff);
}
#baet-public-calendar .baet-calendar-day.is-today{
  box-shadow:inset 0 0 0 2px rgba(13,110,253,.16);
}
#baet-public-calendar .baet-calendar-day-number{
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  border-radius:10px;
  color:#172b44;
  font-size:.86rem;
  font-weight:900;
}
#baet-public-calendar .baet-calendar-day.is-today .baet-calendar-day-number{
  background:linear-gradient(135deg,#0d6efd,#17cde0);
  color:#fff;
  box-shadow:0 7px 16px rgba(13,110,253,.20);
}
#baet-public-calendar .baet-calendar-events{
  display:flex;
  flex-direction:column;
  gap:7px;
  margin-top:7px;
}
#baet-public-calendar .baet-calendar-event{
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:8px 9px;
  border:1px solid #d7ebf0;
  border-left:3px solid #11c7d7;
  border-radius:11px;
  background:#ebfafc;
  color:#0c2748;
  box-shadow:none;
  transition:transform .16s ease,box-shadow .16s ease;
}
#baet-public-calendar .baet-calendar-event:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 16px rgba(12,72,96,.08);
}
#baet-public-calendar .baet-calendar-event time{
  color:#0d8aa0;
  font-size:.61rem;
  font-weight:900;
  text-transform:uppercase;
}
#baet-public-calendar .baet-calendar-event strong{
  color:#0a1d3a;
  font-size:.70rem;
  line-height:1.25;
  font-weight:850;
}
#baet-public-calendar .baet-calendar-event span{
  color:#667a8f;
  font-size:.62rem;
  line-height:1.25;
}
#baet-public-calendar .baet-calendar-event.is-past{
  opacity:.78;
  border-left-color:#859bb3;
  background:#f3f6f9;
}

@media(max-width:760px){
  .baet-public-view-switch{width:100%}
  .baet-public-view-switch button{flex:1}

  #baet-public-calendar .baet-calendar-header{
    min-height:92px;
    padding:14px 62px;
  }
  #baet-public-calendar .baet-calendar-title h3{font-size:1.35rem}
  #baet-public-calendar .baet-calendar-nav{
    width:40px;
    height:40px;
    border-radius:12px;
  }
  #baet-public-calendar .baet-calendar-nav:first-child{left:10px}
  #baet-public-calendar .baet-calendar-nav:nth-child(3){right:10px}

  #baet-public-calendar .baet-calendar-month-jump{
    justify-content:space-between;
    padding:9px 12px;
  }
  #baet-public-calendar .baet-calendar-month-jump select{
    min-width:0;
    width:64%;
  }
}

/* BAET v1.11.1 — Calendario móvil responsive.
   En pantallas pequeñas la cuadrícula mensual se transforma en una lista
   de fechas con actividades. Desktop/tablet mantienen la cuadrícula. */
.baet-calendar-mobile-empty{display:none}

@media(max-width:760px){
  #baet-public-calendar.baet-calendar-module{border-radius:18px;overflow:hidden}
  #baet-public-calendar .baet-calendar-header{min-height:84px;padding:12px 56px}
  #baet-public-calendar .baet-calendar-title span{font-size:.62rem}
  #baet-public-calendar .baet-calendar-title h3{font-size:1.22rem}
  #baet-public-calendar .baet-calendar-month-jump{gap:8px;padding:10px 12px}
  #baet-public-calendar .baet-calendar-month-jump label{flex:0 0 auto;font-size:.72rem}
  #baet-public-calendar .baet-calendar-month-jump select{width:auto;flex:1 1 auto;min-width:0;max-width:220px}
  #baet-public-calendar .baet-calendar-scroll{overflow:visible;padding:12px}
  #baet-public-calendar .baet-calendar-grid{min-width:0;display:block}
  #baet-public-calendar .baet-calendar-weekday,
  #baet-public-calendar .baet-calendar-day.is-empty,
  #baet-public-calendar .baet-calendar-day:not(.has-events){display:none}
  #baet-public-calendar .baet-calendar-day.has-events{
    display:grid;grid-template-columns:54px minmax(0,1fr);align-items:start;gap:10px;
    min-height:0;margin:0 0 10px;padding:12px;border:1px solid #dce7f0!important;
    border-radius:16px;background:#fff;box-shadow:0 8px 24px rgba(6,25,52,.05)
  }
  #baet-public-calendar .baet-calendar-day.is-today{box-shadow:inset 0 0 0 2px rgba(13,110,253,.13),0 8px 24px rgba(6,25,52,.05)}
  #baet-public-calendar .baet-calendar-day-number{
    width:54px;height:58px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
    border-radius:14px;background:#eef6fc;color:#0a3970;font-size:1.22rem;line-height:1
  }
  #baet-public-calendar .baet-calendar-day-number::before{
    content:attr(data-month);display:block;color:#0d78ba;font-size:.58rem;line-height:1;font-weight:900;letter-spacing:.08em
  }
  #baet-public-calendar .baet-calendar-day.is-today .baet-calendar-day-number{background:linear-gradient(135deg,#0d6efd,#17cde0);color:#fff}
  #baet-public-calendar .baet-calendar-day.is-today .baet-calendar-day-number::before{color:#fff}
  #baet-public-calendar .baet-calendar-events{min-width:0;margin-top:0;gap:8px}
  #baet-public-calendar .baet-calendar-event{min-width:0;padding:11px 12px;border-radius:13px}
  #baet-public-calendar .baet-calendar-event time{font-size:.68rem}
  #baet-public-calendar .baet-calendar-event strong{font-size:.88rem;line-height:1.32}
  #baet-public-calendar .baet-calendar-event span,
  #baet-public-calendar .baet-calendar-event-facts,
  #baet-public-calendar .baet-calendar-location{font-size:.72rem;line-height:1.35}
  #baet-public-calendar .baet-calendar-event-facts{display:flex;flex-wrap:wrap;gap:5px}
  #baet-public-calendar .baet-calendar-access{align-self:flex-start;font-size:.65rem}
  #baet-public-calendar .baet-calendar-mobile-empty{
    display:flex;flex-direction:column;gap:5px;margin:2px 0;padding:18px;border:1px dashed #cdddea;
    border-radius:14px;background:#f8fbfd;color:#60738a;text-align:center
  }
  #baet-public-calendar .baet-calendar-mobile-empty strong{color:#0a1d3a}
}
@media(max-width:420px){
  #baet-public-calendar .baet-calendar-scroll{padding:10px}
  #baet-public-calendar .baet-calendar-day.has-events{grid-template-columns:48px minmax(0,1fr);gap:8px;padding:10px}
  #baet-public-calendar .baet-calendar-day-number{width:48px;height:54px;border-radius:12px;font-size:1.08rem}
  #baet-public-calendar .baet-calendar-event{padding:10px}
}


/* BAET v1.11.2 — Cambio de mes sin recarga completa.
   Evita saltos de scroll y mantiene el contexto visual del participante. */
#baet-public-calendar{
  overflow-anchor:none;
}
#baet-public-calendar.is-loading{
  cursor:progress;
}
#baet-public-calendar.is-loading .baet-calendar-grid,
#baet-public-calendar.is-loading .baet-calendar-mobile-empty{
  opacity:.58;
  transition:opacity .14s ease;
}
#baet-public-calendar.is-loading .baet-calendar-nav,
#baet-public-calendar.is-loading [data-baet-month-select]{
  pointer-events:none;
  opacity:.58;
}
#baet-public-calendar.baet-calendar-just-updated .baet-calendar-grid,
#baet-public-calendar.baet-calendar-just-updated .baet-calendar-mobile-empty{
  animation:baetCalendarReveal .16s ease-out both;
}
@keyframes baetCalendarReveal{
  from{opacity:.82}
  to{opacity:1}
}
.baet-calendar-sr-status{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
@media(prefers-reduced-motion:reduce){
  #baet-public-calendar.baet-calendar-just-updated .baet-calendar-grid,
  #baet-public-calendar.baet-calendar-just-updated .baet-calendar-mobile-empty{
    animation:none;
  }
}
