/**
 * Layout-stability helpers (CLS). Keep overrides narrow; theme padding-bottom
 * aspect boxes already reserve most poster space — this covers late UI + fonts.
 */

/* Poppins metric-matched fallback — reduces text reflow while webfont swaps in */
@font-face {
  font-family: "Poppins Fallback";
  src: local("Arial");
  size-adjust: 112%;
  ascent-override: 105%;
  descent-override: 35%;
  line-gap-override: 0%;
}

body {
  font-family: Poppins, "Poppins Fallback", Arial, sans-serif;
}

/*
 * Theme already reserves poster space via padding-bottom % boxes.
 * Do NOT also set aspect-ratio here — the two stack and inflate height.
 * Prefer width/height attrs on <img> (added in templates) + absolute fill.
 */
.film-poster-img {
  max-width: 100%;
}

.anis-content .anisc-poster .film-poster {
  width: 100%;
}

/* Hero cover frame: absolute fill before Swiper / lazyload paint */
#slider .deslide-cover-img {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

#slider .deslide-cover-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ShareThis injects buttons async — reserve a row so the block does not grow */
.sharethis-inline-share-buttons {
  min-height: 32px;
  min-width: 180px;
  display: inline-block;
  vertical-align: middle;
}

.share-buttons .share-buttons-block {
  min-height: 52px;
  box-sizing: border-box;
}

/* Keep ShareThis from collapsing then expanding the flex row */
.share-buttons .sbb-social {
  min-height: 32px;
  min-width: 180px;
}

/* Theme ad wrappers (third-party creatives still vary — this is a floor) */
.ad-section {
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-section > * {
  max-width: 100%;
}

/* Continue Watching: empty mount expands after auth — reserve for likely members */
.auth-likely #widget-continue-watching:empty {
  min-height: 300px;
  margin-bottom: 1rem;
}

/* Schedule list filled via AJAX after first paint */
.table_schedule-list.limit-8 {
  min-height: 280px;
}

.table_schedule-date {
  min-height: 72px;
}

/* Home schedule mount starts empty then injects the full widget */
#schedule-block:empty {
  min-height: 420px;
  margin-bottom: 1.5rem;
}

/* Notifications bell: keep slot when auth-likely (inline display:none overridden) */
.auth-likely #user-slot .hr-notifications {
  display: block !important;
  visibility: hidden;
  float: left;
  width: 40px;
  height: 40px;
  margin-right: 10px;
}

.auth-likely #user-slot .hr-notifications.is-ready {
  visibility: visible;
}

/* Discussion avatar box already sized — lock img so decode does not nudge */
#discussion .d_w-icon img {
  width: 320px;
  height: 320px;
  object-fit: contain;
}

/*
 * Expanded discussion: reserve comments mount so AJAX/html swap does not grow the block.
 * Collapsed (#discussion.ds-hide) hides .tab-content — no reserved space when off.
 */
#discussion:not(.ds-hide) #comment-widget {
  min-height: 240px;
  box-sizing: border-box;
}

/* Hero CTA row: fonts/icons can nudge button metrics slightly */
#slider .desi-buttons {
  min-height: 42px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

/* Avoid opacity-only title fades affecting perceived layout (main.js already clears) */
.dynamic-name {
  opacity: 1;
}
