/* ID Federal Halloween v3.8.7
 * Central proporcional: painel horizontal/retangular, sem compressao de texto.
 * Responsividade por CSS/container query; sem zoom e sem transform:scale.
 */

:root{
  --idf-v387-shell-max:1120px;
  --idf-v387-page-gap:clamp(12px,2vw,30px);
  --idf-v387-pad-x:clamp(14px,1.4vw,20px);
  --idf-v387-pad-y:clamp(12px,1vw,16px);
  --idf-v387-gap:clamp(12px,1.25vw,18px);
  --idf-v387-sidebar:220px;
  --idf-v387-card-gap:clamp(10px,1vw,14px);
}

/* O bloco fica mais baixo e horizontal. Nao alterar tamanho da fonte global. */
body.idf-halloween-active.idf-hw-central-v33 :is(
  .idf-v385-shell,
  .central-wrap,
  .central-wrapper,
  .marketing-dashboard,
  .marketing-wrapper,
  .portal-container,
  .portal-main,
  .marketing-main
){
  width:min(var(--idf-v387-shell-max),calc(100vw - (2 * var(--idf-v387-page-gap)))) !important;
  max-width:calc(100vw - (2 * var(--idf-v387-page-gap))) !important;
  min-width:0 !important;
  margin-left:auto !important;
  margin-right:auto !important;
  box-sizing:border-box !important;
}

body.idf-halloween-active.idf-hw-central-v33 .idf-v385-shell{
  container-type:inline-size;
  container-name:idf-central-387;
  padding-left:var(--idf-v387-pad-x) !important;
  padding-right:var(--idf-v387-pad-x) !important;
  padding-top:var(--idf-v387-pad-y) !important;
  padding-bottom:var(--idf-v387-pad-y) !important;
}

/* Mantem formulario e galeria lado a lado no desktop/notebook. */
body.idf-halloween-active.idf-hw-central-v33 .idf-v385-layout{
  display:grid !important;
  grid-template-columns:minmax(205px,var(--idf-v387-sidebar)) minmax(0,1fr) !important;
  gap:var(--idf-v387-gap) !important;
  align-items:start !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}

/* Sidebar estreita, mas sem esmagar texto/campos. */
body.idf-halloween-active.idf-hw-central-v33 .idf-v385-sidebar{
  width:100% !important;
  max-width:var(--idf-v387-sidebar) !important;
  min-width:205px !important;
  box-sizing:border-box !important;
  padding:12px !important;
  overflow:visible !important;
}

body.idf-halloween-active.idf-hw-central-v33 .idf-v385-sidebar :is(input,select,textarea,button){
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}

/* Nao encolher tipografia: apenas reduzir espacos verticais. */
body.idf-halloween-active.idf-hw-central-v33 .idf-v385-sidebar :is(label,p,small,h2,h3){
  line-height:1.25 !important;
}
body.idf-halloween-active.idf-hw-central-v33 .idf-v385-sidebar :is(p,label){
  margin-top:6px !important;
  margin-bottom:4px !important;
}
body.idf-halloween-active.idf-hw-central-v33 .idf-v385-sidebar :is(input,select,textarea){
  min-height:34px !important;
  padding:6px 8px !important;
}

body.idf-halloween-active.idf-hw-central-v33 .idf-v385-main{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow:visible !important;
  box-sizing:border-box !important;
}

/* Filtros em uma faixa horizontal compacta. */
body.idf-halloween-active.idf-hw-central-v33 .idf-v385-main :is(.filters,.filterbar,.art-filters,[class*="filter"]){
  max-width:100% !important;
  box-sizing:border-box !important;
}

/* Duas artes por linha no uso normal. A imagem e reduzida proporcionalmente,
 * nunca achatada, cortada ou forçada a aspecto quadrado. */
body.idf-halloween-active.idf-hw-central-v33 .idf-v385-gallery{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:var(--idf-v387-card-gap) !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  align-items:start !important;
  box-sizing:border-box !important;
}

body.idf-halloween-active.idf-hw-central-v33 .idf-v385-art-card{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
  padding:8px !important;
}

body.idf-halloween-active.idf-hw-central-v33 :is(
  .idf-v385-art-image,
  .idf-v385-art-card > img,
  .idf-v385-art-card picture > img
){
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  height:auto !important;
  max-height:none !important;
  aspect-ratio:auto !important;
  object-fit:contain !important;
  object-position:center top !important;
}

/* Preserva a proporcao da paisagem. */
html body.idf-halloween-active.idf-hw-central-v33,
html body.idf-halloween-active.idf-hw-demo-central.idf-hw-central-v33{
  background-size:100% auto !important;
  background-position:center top !important;
  background-repeat:no-repeat !important;
}

/* Container menor: ainda mantem o retangulo horizontal, apenas afina sidebar. */
@container idf-central-387 (max-width:860px){
  body.idf-halloween-active.idf-hw-central-v33 .idf-v385-layout{
    grid-template-columns:195px minmax(0,1fr) !important;
    gap:12px !important;
  }
  body.idf-halloween-active.idf-hw-central-v33 .idf-v385-sidebar{
    min-width:195px !important;
    max-width:195px !important;
    padding:10px !important;
  }
}

/* Somente quando realmente nao cabe lado a lado, o formulario vai para cima. */
@container idf-central-387 (max-width:640px){
  body.idf-halloween-active.idf-hw-central-v33 .idf-v385-layout{
    grid-template-columns:1fr !important;
  }
  body.idf-halloween-active.idf-hw-central-v33 .idf-v385-sidebar{
    min-width:0 !important;
    max-width:none !important;
  }
  body.idf-halloween-active.idf-hw-central-v33 .idf-v385-gallery{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}

@container idf-central-387 (max-width:440px){
  body.idf-halloween-active.idf-hw-central-v33 .idf-v385-gallery{
    grid-template-columns:1fr !important;
  }
}

/* Viewport mobile usa wallpaper proprio. */
@media (max-width:700px){
  :root{
    --idf-v387-page-gap:8px;
    --idf-v387-pad-x:10px;
    --idf-v387-pad-y:10px;
  }
  html body.idf-halloween-active.idf-hw-central-v33,
  html body.idf-halloween-active.idf-hw-demo-central.idf-hw-central-v33{
    background-image:url('./halloween-central-v33-mobile.webp') !important;
    background-size:100% auto !important;
  }
}

@media (min-width:1600px){
  :root{--idf-v387-shell-max:1180px;}
}
