/* =========================================================
   LAYOUTS (página padrão / página detalhe)
   ========================================================= */

.app{
  height: 100dvh;
  min-height: 100dvh;
  width: 100%;
  display:flex;
  flex-direction:column;
  padding: 0;
  overflow-x: hidden;
}

/* Cabeçalho padrão */
.header{
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
.header-inner{
  height: 100%;
  display:flex;
  align-items:center;
  gap: var(--space-3);
}
.brand{
  display:flex;
  align-items:center;
  gap: var(--space-3);
  font-weight: var(--fw-700);
  letter-spacing: 0.2px;
}
.brand-mark{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--c-accent);
  box-shadow: var(--shadow-1);
}

/* Corpo */
.main{
  flex:1;
  min-height: 0;
  width: 100%;
  padding: var(--space-5) 0 calc(var(--footer-safe-h, calc(var(--footer-h) + env(safe-area-inset-bottom))) + var(--space-6));
  overflow-y: auto;
  overflow-x: hidden;
}

/* Rodapé padrão */
.footer{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  height: var(--footer-safe-h, calc(var(--footer-h) + env(safe-area-inset-bottom)));
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}
.footer .container{
  width: 100%;
  height: 100%;
}
.footer .install-app-fab{
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.footer .admin-adjustments-nav-btn{
  background: transparent;
  color: #e0468b;
  border-color: #e0468b;
}
.footer .admin-adjustments-nav-btn:hover{
  background: transparent;
  color: #e0468b;
  border-color: #e0468b;
}
.footer .admin-adjustments-nav-btn:active{
  background: transparent;
}
.footer .admin-adjustments-nav-btn.is-active{
  background: transparent;
  color: #e0468b;
  border-color: #e0468b;
}
.footer-inner{
  height: 100%;
  box-sizing: border-box;
  padding-bottom: env(safe-area-inset-bottom);
  display:flex;
  align-items:center;
  justify-content:space-around;
  gap: var(--space-3);
}

.scroll-top-btn{
  position: fixed;
  right: calc(var(--space-4) + env(safe-area-inset-right));
  bottom: calc(var(--footer-safe-h, calc(var(--footer-h) + env(safe-area-inset-bottom))) + var(--space-4));
  z-index: 46;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease, background 120ms ease, border-color 120ms ease;
}
.scroll-top-btn.is-visible{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-top-btn-arrow{
  font-size: 1.1rem;
  line-height: 1;
  font-weight: var(--fw-700);
}


/* Banner de detalhe (opcional) */
.detail-hero{
  position: relative;
  background: transparent;
  border-bottom: none;
  overflow: hidden;
  margin-bottom: 0;
}
.detail-hero-frame{
  position: relative;
  width: 100%;
  max-width: none;
  min-height: min(clamp(120px, 18vh, 220px), var(--detail-hero-max-height, 30vh));
  max-height: var(--detail-hero-max-height, 30vh);
  height: var(--detail-hero-rendered-height, auto);
  padding: 0;
  overflow: hidden;
}
.detail-hero-media{
  position:relative;
  height: 100%;
}
.detail-hero-media .detail-media-position-toggle{
  top: 12px;
  right: 56px;
  z-index: 6;
}
.detail-hero-height-handle{
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 6;
  min-width: 88px;
  height: 22px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.38);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
}
.detail-hero-frame.is-height-edit-active .detail-hero-height-handle{
  display: inline-flex;
}
.detail-hero-height-handle-grip{
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.9;
}
.detail-hero-height-handle-value{
  font-size: var(--fs-11);
  font-weight: var(--fw-700);
  line-height: 1;
}
.detail-hero-frame.is-height-resizing .detail-hero-height-handle{
  background: rgba(0, 0, 0, 0.92);
}
.detail-hero-media img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}
.detail-hero-overlay{
  position:absolute;
  inset:0;
  pointer-events: none;
  background: linear-gradient(180deg, #00000033 0%, #00000066 55%, #000000AA 100%);
}
.detail-hero-controls{
  position:absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  z-index: 1;
}
.detail-hero-controls .icon-btn{
  background: transparent;
  border-color: transparent;
  color: var(--neutral-0);
}
.detail-hero-controls .icon-btn:hover,
.detail-hero-controls .icon-btn:active{
  background: transparent;
}
.detail-hero-content{
  position:absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  z-index: 1;
  padding: 0 0 12px;
  color: var(--neutral-0);
}
.detail-hero-main{
  min-width: 0;
}
.detail-hero-meta-line{
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.detail-hero-user-status{
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #FFFFFF33;
  background: #0000005C;
  color: #FFFFFF;
  font-size: var(--fs-12);
  font-weight: var(--fw-600);
  line-height: 1;
  white-space: nowrap;
}
.detail-hero--plain{
  background: var(--neutral-100);
}
.detail-hero--plain .detail-hero-content{
  color: var(--neutral-900);
}
.detail-hero--plain .detail-hero-title{
  text-shadow: none;
}
.detail-hero--plain .detail-hero-meta{
  color: var(--neutral-700);
  text-shadow: none;
}
.detail-hero--plain .detail-hero-user-status{
  border-color: var(--c-border);
  background: var(--c-surface);
  color: var(--neutral-900);
}
.detail-hero--plain .detail-hero-controls .icon-btn{
  background: transparent;
  border-color: transparent;
  color: var(--neutral-900);
}
.detail-hero--compact{
  height: 120px;
}
.detail-hero--compact .detail-hero-frame{
  height: 120px;
}

.detail-stack{
  margin-top: 0;
}

.detail-page .main > .detail-hero + .container > .detail-stack{
  margin-top: 0;
}

.detail-page .main{
  padding-top: 0;
}

.detail-page .container{
  padding-left: 0;
  padding-right: 0;
}

.page-agenda .main,
.page-agenda .container,
.page-agenda .container > .stack{
  min-width: 0;
}

.page-agenda .container{
  overflow-x: clip;
}

html.is-standalone .header{
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-h) + env(safe-area-inset-top));
}

html.is-standalone .detail-hero-controls{
  top: calc(12px + env(safe-area-inset-top));
}

html.is-standalone .main{
  padding-bottom: calc(var(--footer-safe-h, calc(var(--footer-h) + env(safe-area-inset-bottom))) + var(--space-6));
}

.detail-fullbleed{
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}
.detail-hero-title{
  font-size: var(--fs-22);
  font-weight: var(--fw-700);
  line-height: var(--lh-tight);
  text-shadow: 0 6px 18px #00000066;
}
.detail-hero-meta{
  font-size: var(--fs-12);
  color: #FFFFFFCC;
  text-shadow: 0 4px 14px #00000066;
  min-width: 0;
}

.detail-cast-trigger{
  margin-bottom: var(--space-4);
  display:flex;
}
.detail-cast-trigger-btn{
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  gap: var(--space-2);
  border-color: var(--c-border);
  background: var(--c-surface-2);
}
.detail-cast-trigger-btn span{
  line-height: 1.2;
}
.detail-cast-trigger-icon svg{
  width: 20px;
  height: 20px;
}
.detail-platform-trigger{
  margin-bottom: var(--space-2);
  display:flex;
}
.detail-platform-trigger-btn{
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  gap: var(--space-2);
  border-color: var(--c-border);
  background: var(--c-surface-2);
}

/* Pequenos ajustes responsivos */
@media (min-width: 720px){
  .footer-inner{ justify-content:center; gap: var(--space-8); }
  .main{ padding-top: var(--space-6); }
  .detail-page .main{ padding-top: 0; }
}

.detail-hero--compact{
  height: 120px;
}
.detail-hero--compact .detail-hero-frame{
  height: 120px;
  max-height: none;
}
