/* Agenda Pro Eventos - frontend */
.apew-events{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,360px));
    justify-content:center;
    gap:24px;
    width:100%;
    max-width:1180px;
    margin:30px auto;
    padding:0 16px;
    box-sizing:border-box;
}
.apew-card-event{
    background:#fff;
    border:1px solid #eee;
    border-radius:18px;
    overflow:hidden;
    box-shadow:0 10px 30px rgba(0,0,0,.08);
    width:100%;
    max-width:360px;
    margin:0 auto;
}
.apew-template-destaque .apew-card-event{background:#141414;color:#fff;border-color:#333}
.apew-art{
    aspect-ratio:4/5;
    background:#f4f4f4;
    overflow:hidden;
    width:100%;
    max-height:450px;
}
.apew-art img{
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:center;
    display:block;
}
.apew-placeholder{height:100%;display:flex;align-items:center;justify-content:center;color:#777}
.apew-info{padding:20px}
.apew-info h3{margin:0 0 12px;font-size:22px;line-height:1.2}
.apew-info p{margin:8px 0}
.apew-details{margin:16px 0}
.apew-reserve-btn,.apew-reserve-form button{background:#1e63ff;color:#fff;border:0;border-radius:999px;padding:12px 22px;font-weight:700;cursor:pointer}
.apew-modal{display:none;position:fixed;inset:0;background:rgba(0,0,0,.65);z-index:999999;padding:20px;overflow:auto}
.apew-modal.is-open{display:flex;align-items:center;justify-content:center}
.apew-modal-box{
    background:#fff;
    color:#111;
    width:min(520px,100%);
    max-height:90vh;
    overflow:auto;
    border-radius:20px;
    padding:26px;
    position:relative;
    box-sizing:border-box;
}
.apew-modal-box .apew-art{
    max-width:260px;
    max-height:325px;
    margin:0 auto 18px;
    border-radius:14px;
}
.apew-close{position:absolute;top:12px;right:14px;border:0;background:#eee;width:36px;height:36px;border-radius:50%;font-size:24px;cursor:pointer}
.apew-reserve-form label{display:block;margin:12px 0;font-weight:600}
.apew-reserve-form input{width:100%;padding:12px;border:1px solid #ddd;border-radius:10px;margin-top:5px;box-sizing:border-box}
.apew-consent{font-size:14px;font-weight:400!important}
.apew-consent input{width:auto;margin-right:8px}
.apew-response{margin-top:12px;font-weight:700}
.apew-response.ok{color:#108a00}.apew-response.err{color:#b00020}

@media (max-width: 480px){
    .apew-events{
        grid-template-columns:minmax(0,1fr);
        padding:0 12px;
    }
    .apew-card-event{
        max-width:340px;
    }
    .apew-info h3{font-size:20px}
}


/* v0.8.0: comportamento com vários eventos */
.apew-events{
    align-items:start;
}
.apew-card-event{
    display:flex;
    flex-direction:column;
}
.apew-info{
    flex:1;
}
.apew-reserve-btn{
    width:100%;
    margin-top:10px;
}
@media (min-width: 900px){
    .apew-events{
        grid-template-columns:repeat(3,minmax(260px,360px));
    }
}
@media (min-width: 600px) and (max-width: 899px){
    .apew-events{
        grid-template-columns:repeat(2,minmax(260px,340px));
    }
}


/* v0.9.0: no celular, eventos em carrossel horizontal */
@media (max-width: 599px){
    .apew-events{
        display:flex;
        overflow-x:auto;
        overflow-y:hidden;
        gap:16px;
        justify-content:flex-start;
        scroll-snap-type:x mandatory;
        -webkit-overflow-scrolling:touch;
        padding:0 16px 18px;
        margin:24px auto;
        max-width:100%;
    }
    .apew-card-event{
        flex:0 0 82%;
        max-width:320px;
        scroll-snap-align:center;
    }
    .apew-events::after{
        content:"";
        flex:0 0 1px;
    }
    .apew-modal-box{
        width:min(440px, 94vw);
        padding:20px;
    }
}


/* v1.0.0: layout mais moderno e compacto */
.apew-card-event{
    border:0;
    border-radius:24px;
    box-shadow:0 18px 50px rgba(17,24,39,.12);
}
.apew-art{
    max-height:390px;
}
.apew-info{
    padding:22px;
}
.apew-badge{
    display:inline-flex;
    align-items:center;
    padding:6px 12px;
    border-radius:999px;
    background:#eef4ff;
    color:#1e63ff;
    font-size:12px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.06em;
    margin-bottom:10px;
}
.apew-template-destaque .apew-badge{
    background:rgba(255,255,255,.12);
    color:#fff;
}
.apew-info h3{
    font-size:24px;
    margin:0 0 16px;
    color:#161616;
}
.apew-template-destaque .apew-info h3{color:#fff}
.apew-meta-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
    margin:14px 0 18px;
}
.apew-meta-item{
    background:#f7f8fb;
    border:1px solid #edf0f5;
    border-radius:16px;
    padding:12px 14px;
}
.apew-template-destaque .apew-meta-item{
    background:rgba(255,255,255,.08);
    border-color:rgba(255,255,255,.12);
}
.apew-meta-item span{
    display:block;
    color:#6b7280;
    font-size:12px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
    margin-bottom:4px;
}
.apew-template-destaque .apew-meta-item span{color:rgba(255,255,255,.72)}
.apew-meta-item strong{
    display:block;
    color:#111827;
    font-size:15px;
    line-height:1.35;
}
.apew-template-destaque .apew-meta-item strong{color:#fff}
.apew-details-modern{
    color:#4b5563;
    font-size:15px;
    line-height:1.65;
    margin:14px 0 18px;
}
.apew-template-destaque .apew-details-modern{color:rgba(255,255,255,.82)}
.apew-details-modern p{
    margin:0 0 10px;
}
.apew-reserve-btn,
.apew-reserve-form button{
    background:linear-gradient(135deg,#145cff,#00a3ff);
    min-height:48px;
    box-shadow:0 12px 26px rgba(30,99,255,.25);
}
.apew-modal-summary{
    background:#f7f8fb;
    border:1px solid #edf0f5;
    border-radius:16px;
    padding:12px 14px;
    margin:10px 0 18px;
}
.apew-modal-summary p{margin:6px 0}
.apew-reserve-form label{
    color:#111827;
}
.apew-reserve-form input{
    min-height:46px;
    background:#fff;
}
@media (min-width: 900px){
    .apew-card-event{
        max-width:340px;
    }
}
@media (max-width: 599px){
    .apew-card-event{
        flex:0 0 84%;
        max-width:330px;
    }
    .apew-info{
        padding:20px;
    }
    .apew-info h3{
        font-size:22px;
    }
    .apew-details-modern{
        font-size:15px;
        line-height:1.6;
    }
}


/* v1.0.1 - visual moderno corrigido, campo de convite e mobile carousel */
.apew-events.apew-template-classico,
.apew-events.apew-template-destaque,
.apew-events{
  --apew-blue:#2563eb;
  --apew-ink:#172033;
  --apew-muted:#667085;
  --apew-line:#edf1f7;
}
.apew-card-event{
  border:0 !important;
  border-radius:24px !important;
  box-shadow:0 18px 45px rgba(15,23,42,.12) !important;
  overflow:hidden !important;
  background:#ffffff !important;
  color:#172033 !important;
}
.apew-info-modern{
  padding:24px !important;
}
.apew-info-modern h3{
  font-size:24px !important;
  letter-spacing:-.03em;
  margin:0 0 18px !important;
  color:#172033 !important;
}
.apew-meta-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin:0 0 18px;
}
.apew-meta-box,
.apew-modal-summary > div{
  border:1px solid #edf1f7;
  background:#f8fafc;
  border-radius:16px;
  padding:12px 13px;
}
.apew-meta-box span,
.apew-modal-summary span{
  display:block;
  font-size:12px;
  line-height:1.2;
  color:#667085;
  text-transform:uppercase;
  letter-spacing:.05em;
  margin-bottom:5px;
  font-weight:800;
}
.apew-meta-box strong,
.apew-modal-summary strong{
  display:block;
  color:#172033;
  font-size:15px;
  line-height:1.35;
}
.apew-details-modern{
  background:#fff;
  border-left:4px solid #2563eb;
  padding:2px 0 2px 14px;
  margin:18px 0 22px !important;
  color:#475467;
}
.apew-details-modern p{
  font-size:16px !important;
  line-height:1.75 !important;
  margin:0 0 12px !important;
}
.apew-reserve-btn,
.apew-reserve-form button{
  background:linear-gradient(135deg,#1d4ed8,#3b82f6) !important;
  border-radius:18px !important;
  padding:15px 22px !important;
  box-shadow:0 12px 28px rgba(37,99,235,.28);
  font-size:16px !important;
}
.apew-modal-box{
  border-radius:26px !important;
  box-shadow:0 30px 90px rgba(15,23,42,.35);
}
.apew-modal-summary{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin:0 0 18px;
}
.apew-reserve-form label{
  color:#172033;
  font-size:14px;
}
.apew-reserve-form input{
  border-radius:14px !important;
  border:1px solid #d0d5dd !important;
  background:#fff !important;
  min-height:48px;
}

@media (max-width: 640px){
  .apew-events{
    display:flex !important;
    overflow-x:auto !important;
    gap:18px !important;
    justify-content:flex-start !important;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    padding:0 18px 18px !important;
    max-width:100% !important;
  }
  .apew-events::-webkit-scrollbar{height:0}
  .apew-card-event{
    flex:0 0 82vw !important;
    max-width:360px !important;
    min-width:280px !important;
    scroll-snap-align:center;
  }
  .apew-meta-grid{
    grid-template-columns:1fr;
  }
  .apew-info-modern{
    padding:20px !important;
  }
  .apew-info-modern h3{
    font-size:22px !important;
  }
}


/* v1.1.0 - cards padronizados com informações/descrição recolhíveis e navegação mobile */
.apew-carousel-wrap{
  position:relative;
  width:100%;
  max-width:1220px;
  margin:28px auto;
}
.apew-card-event{
  height:auto !important;
}
.apew-info-modern{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.apew-info-modern h3{
  min-height:58px;
  margin-bottom:2px !important;
}
.apew-toggle-btn{
  width:100%;
  border:1px solid #e6ebf2;
  background:#f8fafc;
  color:#172033;
  min-height:48px;
  border-radius:16px;
  padding:13px 16px;
  font-size:15px;
  font-weight:900;
  text-align:left;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.apew-toggle-btn::after{
  content:"+";
  width:28px;
  height:28px;
  border-radius:50%;
  background:#2563eb;
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:19px;
  line-height:1;
}
.apew-toggle-btn.is-open{
  background:#eef4ff;
  border-color:#cfe0ff;
}
.apew-toggle-btn.is-open::after{
  content:"−";
}
.apew-collapsible{
  animation:apewFade .18s ease;
}
@keyframes apewFade{
  from{opacity:.4; transform:translateY(-3px)}
  to{opacity:1; transform:translateY(0)}
}
.apew-collapsible .apew-meta-grid{
  margin:0 0 4px !important;
}
.apew-collapsible .apew-details-modern{
  margin:0 0 4px !important;
}
.apew-reserve-btn{
  margin-top:auto !important;
}
.apew-carousel-nav{
  display:none;
}

@media (min-width: 641px){
  .apew-events{
    align-items:start !important;
  }
  .apew-card-event{
    align-self:start;
  }
}

@media (max-width: 640px){
  .apew-carousel-wrap{
    margin:20px auto;
    padding:0 0 8px;
  }
  .apew-carousel-nav{
    display:flex;
    position:absolute;
    top:42%;
    transform:translateY(-50%);
    z-index:5;
    width:42px;
    height:42px;
    border:0;
    border-radius:999px;
    background:#ffffff;
    color:#2563eb;
    box-shadow:0 10px 28px rgba(15,23,42,.22);
    align-items:center;
    justify-content:center;
    font-size:34px;
    line-height:1;
    cursor:pointer;
  }
  .apew-carousel-prev{left:8px}
  .apew-carousel-next{right:8px}
  .apew-events{
    scroll-behavior:smooth;
    padding-left:46px !important;
    padding-right:46px !important;
  }
  .apew-card-event{
    flex-basis:78vw !important;
  }
  .apew-info-modern h3{
    min-height:auto;
  }
}


/* v1.2.0 - carrossel também no desktop/tablet para evitar eventos escondidos abaixo da primeira linha */
.apew-carousel-wrap{
  max-width:1220px !important;
  padding:0 58px !important;
  box-sizing:border-box !important;
  overflow:visible !important;
}

.apew-events,
.apew-events.apew-template-classico,
.apew-events.apew-template-destaque{
  display:flex !important;
  grid-template-columns:none !important;
  flex-wrap:nowrap !important;
  justify-content:flex-start !important;
  align-items:stretch !important;
  gap:24px !important;
  overflow-x:auto !important;
  overflow-y:visible !important;
  scroll-snap-type:x mandatory !important;
  scroll-behavior:smooth !important;
  -webkit-overflow-scrolling:touch !important;
  max-width:100% !important;
  margin:0 auto !important;
  padding:0 0 24px !important;
  box-sizing:border-box !important;
}

.apew-events::-webkit-scrollbar{
  height:8px;
}
.apew-events::-webkit-scrollbar-track{
  background:#f1f5f9;
  border-radius:999px;
}
.apew-events::-webkit-scrollbar-thumb{
  background:#cbd5e1;
  border-radius:999px;
}

.apew-card-event{
  flex:0 0 340px !important;
  max-width:340px !important;
  min-width:340px !important;
  scroll-snap-align:start !important;
}

.apew-carousel-nav{
  display:flex !important;
  position:absolute !important;
  top:38% !important;
  transform:translateY(-50%) !important;
  z-index:9 !important;
  width:48px !important;
  height:48px !important;
  border:0 !important;
  border-radius:999px !important;
  background:#ffffff !important;
  color:#2563eb !important;
  box-shadow:0 12px 32px rgba(15,23,42,.22) !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:38px !important;
  line-height:1 !important;
  cursor:pointer !important;
}

.apew-carousel-prev{left:2px !important}
.apew-carousel-next{right:2px !important}

@media (min-width: 641px){
  .apew-card-event{
    align-self:stretch !important;
  }
  .apew-info-modern{
    height:100% !important;
  }
}

@media (max-width: 640px){
  .apew-carousel-wrap{
    max-width:100% !important;
    padding:0 42px !important;
  }
  .apew-events,
  .apew-events.apew-template-classico,
  .apew-events.apew-template-destaque{
    gap:18px !important;
    padding:0 0 18px !important;
  }
  .apew-card-event{
    flex:0 0 78vw !important;
    min-width:260px !important;
    max-width:340px !important;
    scroll-snap-align:center !important;
  }
  .apew-carousel-nav{
    width:40px !important;
    height:40px !important;
    top:36% !important;
    font-size:32px !important;
  }
  .apew-carousel-prev{left:4px !important}
  .apew-carousel-next{right:4px !important}
}

@media (max-width: 380px){
  .apew-carousel-wrap{
    padding:0 34px !important;
  }
  .apew-card-event{
    flex-basis:80vw !important;
  }
}


/* v1.5.0: contador visível e acordeão confiável */
.apew-live-count{
    display:inline-flex;
    align-items:center;
    gap:4px;
    margin:0 0 14px;
    padding:8px 12px;
    border-radius:999px;
    background:#eef5ff;
    color:#1d4ed8;
    font-size:13px;
    font-weight:800;
}
.apew-template-destaque .apew-live-count{
    background:rgba(37,99,235,.18);
    color:#dbeafe;
}
.apew-collapsible[hidden]{
    display:none!important;
}
.apew-collapsible{
    display:block;
    margin:10px 0 14px;
}
.apew-toggle-btn.is-open{
    background:#eff6ff!important;
    border-color:#bfdbfe!important;
}
