/* =========================================================
   UniSST V247 — CONFIGURAÇÃO GERAL DE INTERFACE
   Camada final controlada pelo administrador.
   - mesma geometria antes/depois do login
   - pôster vertical padrão = 70% da baseline V245
   - controles seguros para cards, gaps, carrosséis e hero
   ========================================================= */

/* aliases finais para impedir regras históricas de reintroduzir tamanhos */
html body.ui-config-v247.prime-artwork-v245.course-cards-compact-v243.streaming-system-v220{
  --v245-card-w:var(--v247-card-w)!important;
  --v245-card-h:var(--v247-card-h)!important;
  --v245-poster-w:var(--v247-poster-w)!important;
  --v245-poster-h:var(--v247-poster-h)!important;
  --pv-card-w:var(--v247-card-w)!important;
  --pv-card-h:var(--v247-card-h)!important;
  --pv-poster-w:var(--v247-poster-w)!important;
  --pv-poster-h:var(--v247-poster-h)!important;
  --pv-super-focus-w:var(--v247-super-w)!important;
  --u112-card-w:var(--v247-card-w)!important;
  --u112-card-h:var(--v247-card-h)!important;
  --u112-poster-w:var(--v247-poster-w)!important;
  --u112-poster-h:var(--v247-poster-h)!important;
  --v241-card-w:var(--v247-card-w)!important;
  --v241-card-h:var(--v247-card-h)!important;
  --v241-poster-w:var(--v247-poster-w)!important;
  --v241-poster-h:var(--v247-poster-h)!important;
  --v242-card-w:var(--v247-card-w)!important;
  --v242-card-h:var(--v247-card-h)!important;
  --v242-poster-w:var(--v247-poster-w)!important;
  --v242-poster-h:var(--v247-poster-h)!important;
  --v243-card-w:var(--v247-card-w)!important;
  --v243-card-h:var(--v247-card-h)!important;
  --v243-poster-w:var(--v247-poster-w)!important;
  --v243-poster-h:var(--v247-poster-h)!important;
  --v243-gap:var(--v247-gap)!important;
  --v243-super-w:var(--v247-super-w)!important;
  --v245-hover-scale:var(--v247-hover-scale)!important;
  --v220-radius:var(--v247-radius)!important;
  --pv-rail-gap:var(--v247-gap)!important;
  --v220-gap:var(--v247-gap)!important;
  --stream-section-gap:var(--v247-row-gap)!important;
  --stream-gutter:var(--v247-gutter)!important;
}

html body.ui-config-v247 :is(
  .v078-reference-home,.pv-public-showcase,[data-v239-home-card-contract],
  .v217-streaming-rails,.prime-experience-v205
){
  --pv-card-w:var(--v247-card-w)!important;
  --pv-card-h:var(--v247-card-h)!important;
  --pv-poster-w:var(--v247-poster-w)!important;
  --pv-poster-h:var(--v247-poster-h)!important;
  --pv-super-focus-w:var(--v247-super-w)!important;
  --v241-card-w:var(--v247-card-w)!important;
  --v241-card-h:var(--v247-card-h)!important;
  --v241-poster-w:var(--v247-poster-w)!important;
  --v241-poster-h:var(--v247-poster-h)!important;
  --v242-card-w:var(--v247-card-w)!important;
  --v242-card-h:var(--v247-card-h)!important;
  --v243-card-w:var(--v247-card-w)!important;
  --v243-card-h:var(--v247-card-h)!important;
  --v243-poster-w:var(--v247-poster-w)!important;
  --v243-poster-h:var(--v247-poster-h)!important;
  --v243-gap:var(--v247-gap)!important;
}

/* cards horizontais */
html body.ui-config-v247 :is(
  a[data-course-preview="1"].v220-reference-card.v220-landscape-card,
  .v078-reference-home a.reference-landscape-card,
  .v078-reference-home .reference-standard-rail a.course-card,
  .pv-public-landscape-rail .pv-public-course-card,
  .pv205-card-rail>a[data-course-preview="1"],
  .pv203-card-rail>a[data-course-preview="1"],
  .pv205-card-rail>a.pv205-title-card,
  .pv203-card-rail>a.pv203-title-card
){
  flex:0 0 var(--v247-card-w)!important;
  flex-basis:var(--v247-card-w)!important;
  width:var(--v247-card-w)!important;
  min-width:var(--v247-card-w)!important;
  max-width:var(--v247-card-w)!important;
  height:var(--v247-card-h)!important;
  min-height:var(--v247-card-h)!important;
  max-height:var(--v247-card-h)!important;
  aspect-ratio:16 / 9!important;
  border-radius:var(--v247-radius)!important;
  box-sizing:border-box!important;
}

/* cards verticais: baseline 70% por padrão, controlável no admin */
html body.ui-config-v247 :is(
  a[data-course-preview="1"].v220-reference-card.v220-poster-card,
  .v078-reference-home .reference-poster-rail>a,
  .v078-reference-home a.prime-poster-card,
  .v078-reference-home a.featured-preview-card,
  .pv-public-poster-rail .pv-public-course-card,
  a.v220-reference-card.v220-grid-card.v220-poster-card
){
  flex:0 0 var(--v247-poster-w)!important;
  flex-basis:var(--v247-poster-w)!important;
  width:var(--v247-poster-w)!important;
  min-width:var(--v247-poster-w)!important;
  max-width:var(--v247-poster-w)!important;
  height:var(--v247-poster-h)!important;
  min-height:var(--v247-poster-h)!important;
  max-height:var(--v247-poster-h)!important;
  aspect-ratio:2 / 3!important;
  border-radius:var(--v247-radius)!important;
  box-sizing:border-box!important;
}

/* gaps em todos os trilhos/grades acadêmicos */
html body.ui-config-v247 :is(
  .course-rail,.public-course-rail,.v217-course-rail,.pv-public-course-rail,
  .pv205-card-rail,.pv203-card-rail,.learning-course-rail,.related-courses,
  .playlist-path-rail-v214
){
  gap:var(--v247-gap)!important;
  column-gap:var(--v247-gap)!important;
}
html body.ui-config-v247 :is(
  .catalog-grid,.prime-catalog-grid,.catalog-20-grid,.catalog-24-grid,
  .library-page .catalog-grid,.course-playlist-grid
){
  gap:var(--v247-gap)!important;
  column-gap:var(--v247-gap)!important;
}

/* espaçamento vertical entre carrosséis */
html body.ui-config-v247 .v217-streaming-rails{padding-bottom:var(--v247-row-gap)!important}
html body.ui-config-v247 .v217-streaming-rail{margin-bottom:var(--v247-row-gap)!important}

/* fileiras/setas acompanham a geometria atual */
html body.ui-config-v247 .v217-landscape-section{min-height:calc(var(--v247-card-h) + 62px)!important}
html body.ui-config-v247 .v217-poster-section{min-height:calc(var(--v247-poster-h) + 62px)!important}
html body.ui-config-v247 .rail-shell>.rail-arrow{
  height:var(--v247-card-h)!important;
  min-height:var(--v247-card-h)!important;
  max-height:var(--v247-card-h)!important;
  width:54px!important;
}
html body.ui-config-v247 :is(
  .v217-poster-section .rail-shell>.rail-arrow,
  .rail-shell:has([data-v220-rail-orientation="poster"])>.rail-arrow,
  .rail-shell:has(.reference-poster-rail)>.rail-arrow
){
  height:var(--v247-poster-h)!important;
  min-height:var(--v247-poster-h)!important;
  max-height:var(--v247-poster-h)!important;
}
html body.ui-config-v247 .rail-shell>.rail-arrow svg{
  width:36px!important;height:36px!important;
  transform:scale(var(--v247-arrow-scale));
  transform-origin:center;
}


html body.ui-config-v247.ui247-arrows-off .rail-shell>.rail-arrow{display:none!important}
html body.ui-config-v247.ui247-hover-off :is(
  a[data-course-preview="1"].v220-reference-card.v220-landscape-card,
  .v078-reference-home a.reference-landscape-card,
  .pv-public-landscape-rail .pv-public-course-card
):is(:hover,:focus-visible,.preview-pending,.preview-active){transform:none!important;filter:none!important;box-shadow:none!important}

/* hover e sombra controláveis */
@media (min-width:681px) and (hover:hover) and (pointer:fine){
  html body.ui-config-v247 :is(
    a[data-course-preview="1"].v220-reference-card.v220-landscape-card,
    .v078-reference-home a.reference-landscape-card,
    .pv-public-landscape-rail .pv-public-course-card
  ):is(:hover,:focus-visible,.preview-pending,.preview-active){
    transform:scale(var(--v247-hover-scale))!important;
    z-index:70!important;
    filter:brightness(1.04)!important;
    box-shadow:0 12px 26px rgba(0,0,0,var(--v247-shadow-scale))!important;
  }

  /* super-preview proporcional ao NOVO tamanho do pôster */
  html body.ui-config-v247:is(.prime-v086,.prime-public-v086) a[data-course-preview="1"].v220-reference-card.v220-poster-card.prime-poster-card.pv-super-focus-active{
    flex:0 0 var(--v247-super-w)!important;
    flex-basis:var(--v247-super-w)!important;
    width:var(--v247-super-w)!important;
    min-width:var(--v247-super-w)!important;
    max-width:var(--v247-super-w)!important;
    height:var(--v247-poster-h)!important;
    min-height:var(--v247-poster-h)!important;
    max-height:var(--v247-poster-h)!important;
    margin:0!important;
    transform:none!important;
    transform-origin:left center!important;
    z-index:75!important;
    box-shadow:0 12px 26px rgba(0,0,0,var(--v247-shadow-scale))!important;
  }
}

/* hero/banner: largura, altura proporcional e raio controláveis */
html body.ui-config-v247 .prime-feature-rotator[data-hero-carousel]{
  width:var(--v247-hero-width)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  border-radius:var(--v247-hero-radius)!important;
  overflow:hidden!important;
}
@media (min-width:1100px){
  html body.ui-config-v247 .prime-feature-rotator[data-hero-carousel]{
    aspect-ratio:var(--v247-hero-desktop-ratio)!important;
    height:auto!important;min-height:0!important;max-height:none!important;
  }
}
@media (min-width:681px) and (max-width:1099px){
  html body.ui-config-v247 .prime-feature-rotator[data-hero-carousel]{
    aspect-ratio:var(--v247-hero-mobile-ratio)!important;
    height:auto!important;min-height:0!important;max-height:none!important;
  }
}

/* gutters compartilhados */
html body.ui-config-v247 :is(
  .v216-filter-wrap,.course-detail-page-v217 .detail-layout,
  .course-detail-page-v217 .related-courses
){
  padding-left:var(--v247-gutter)!important;
  padding-right:var(--v247-gutter)!important;
}

/* mídia continua preenchendo sem distorção */
html body.ui-config-v247 :is(
  .v220-landscape-card,.v220-poster-card,.reference-landscape-card,
  .pv-public-course-card,.pv205-title-card,.pv203-title-card
) :is(img,video,.card-img,.featured-preview-art,.pv205-card-media,.pv203-title-card-media){
  width:100%!important;height:100%!important;object-fit:cover!important;object-position:center!important;
}

/* touch: sem hover/super-preview e sem setas, preservando responsividade */
@media (max-width:680px),(hover:none),(pointer:coarse){
  html body.ui-config-v247 a[data-course-preview="1"].v220-reference-card{transform:none!important;box-shadow:none!important}
  html body.ui-config-v247 a[data-course-preview="1"].v220-poster-card.prime-poster-card.pv-super-focus-active{
    flex:0 0 var(--v247-poster-w)!important;
    width:var(--v247-poster-w)!important;min-width:var(--v247-poster-w)!important;max-width:var(--v247-poster-w)!important;
    height:var(--v247-poster-h)!important;min-height:var(--v247-poster-h)!important;max-height:var(--v247-poster-h)!important;
    aspect-ratio:2 / 3!important;
  }
  html body.ui-config-v247 .rail-shell>.rail-arrow{display:none!important}
}
