/* Homepage: consistent editorial captions for real film and jury records. */
:root {
  --tm-home-poster-gap: clamp(12px, 1.35vw, 19px);
  --tm-home-poster-ink: #141519;
  --tm-home-poster-muted: #6b6b6e;
  --tm-home-poster-accent: var(--tm-brand-clay, #a45336);
}

/* These blocks share a single layout contract in Arabic and French. */
body.tm-design-system .tm-home-blocks > :is(.tm-home-films, .tm-home-juries) :is(.tm-home-films__inner, .tm-home-juries__inner) {
  min-width: 0;
}
body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-films__carousel-wrap,
body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-juries__carousel-wrap {
  width: min(1240px, 100%) !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin-inline: auto !important;
}
body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-films__carousel,
body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-juries__carousel {
  --tm-bilingual-film-gap: var(--tm-home-poster-gap);
  --tm-home-four-gap: var(--tm-home-poster-gap);
  display: flex !important;
  flex-flow: row nowrap !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  gap: var(--tm-home-poster-gap) !important;
  padding: 5px 0 18px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
body.tm-design-system .tm-home-blocks > :is(.tm-home-films, .tm-home-juries) :is(.tm-home-films__carousel, .tm-home-juries__carousel)::-webkit-scrollbar {
  display: none;
}
body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-film-card,
body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-jury-card {
  display: block !important;
  flex: 0 0 calc((100% - 4 * var(--tm-home-poster-gap)) / 5) !important;
  width: calc((100% - 4 * var(--tm-home-poster-gap)) / 5) !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  scroll-snap-align: start !important;
}
/* Single clickable card, with a standalone image and a caption outside the image. */
body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-film-card__button,
body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-jury-card__button {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  overflow: visible !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--tm-home-poster-ink) !important;
  text-align: start !important;
  cursor: pointer;
}
body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-film-card__button::after,
body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-jury-card__button::after {
  display: none !important;
  content: none !important;
}
body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-film-card__art,
body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-jury-card__art {
  position: relative !important;
  display: block !important;
  flex: 0 0 auto;
  width: 100% !important;
  aspect-ratio: 4 / 5 !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  background: #242329;
  border-radius: 0 !important;
  isolation: isolate;
}
body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-film-card__art > img,
body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-jury-card__art > img {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  filter: none !important;
  transform: none;
  transition: transform .3s ease !important;
}
body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-film-card__art > img {
  object-fit: contain !important;
  object-position: center center !important;
}
body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-jury-card__art > img {
  object-fit: cover !important;
  object-position: center 30% !important;
}
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-film-card__button:hover .tm-home-film-card__art > img,
  body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-jury-card__button:hover .tm-home-jury-card__art > img {
    transform: scale(1.025) !important;
  }
}
/* A clear hierarchy: strong names followed by regular-weight country/role. */
body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-film-card__caption,
body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-jury-card__caption {
  display: flex !important;
  flex: 1 1 auto;
  flex-flow: row wrap;
  align-content: flex-start;
  align-items: baseline;
  column-gap: 9px;
  row-gap: 4px;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 80px;
  padding: 14px 2px 8px !important;
  overflow: visible !important;
  background: transparent !important;
  border-radius: 0 !important;
  color: var(--tm-home-poster-ink) !important;
  text-align: start !important;
}
body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-film-card__name,
body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-jury-card__name {
  display: inline !important;
  min-width: 0 !important;
  max-width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--tm-home-poster-ink) !important;
  font-family: var(--tm-font-heading, inherit);
  font-size: clamp(23px, 1.9vw, 30px) !important;
  font-weight: 900 !important;
  line-height: 1.17 !important;
  letter-spacing: -.02em;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
  text-wrap: pretty;
}
body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-film-card__country,
body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-jury-card__country {
  display: inline !important;
  max-width: 100%;
  color: var(--tm-home-poster-muted) !important;
  font-family: var(--tm-font-body, var(--tm-font-heading, inherit));
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  letter-spacing: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
/* Respect editing controls and category filtering; hidden slides remain hidden. */
body.tm-design-system .tm-home-blocks :is(.tm-home-film-card, .tm-home-jury-card)[hidden],
body.tm-design-system .tm-home-blocks :is(.tm-home-film-card, .tm-home-jury-card).is-hidden {
  display: none !important;
}
body.tm-design-system .tm-home-blocks > :is(.tm-home-films, .tm-home-juries) :is(.tm-home-film-card__button, .tm-home-jury-card__button):focus-visible {
  outline: 3px solid var(--tm-home-poster-accent) !important;
  outline-offset: 3px;
}
/* A small red editorial rule echoes the approved film/jury design. */
body.tm-design-system .tm-home-blocks > :is(.tm-home-films, .tm-home-juries) :is(.tm-home-films__title, .tm-home-juries__title) h2::after {
  display: block;
  content: '';
  width: 40px;
  height: 3px;
  margin-block-start: 9px;
  background: var(--tm-home-poster-accent);
}
@media (min-width: 960px) and (max-width: 1349px) {
  body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-film-card,
  body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-jury-card {
    flex-basis: calc((100% - 3 * var(--tm-home-poster-gap)) / 4) !important;
    width: calc((100% - 3 * var(--tm-home-poster-gap)) / 4) !important;
  }
}
@media (min-width: 700px) and (max-width: 959px) {
  body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-film-card,
  body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-jury-card {
    flex-basis: calc((100% - 2 * var(--tm-home-poster-gap)) / 3) !important;
    width: calc((100% - 2 * var(--tm-home-poster-gap)) / 3) !important;
  }
}
@media (max-width: 699px) {
  body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-films__carousel-wrap,
  body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-juries__carousel-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-films__carousel,
  body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-juries__carousel {
    display: flex !important;
    flex-flow: row nowrap !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 13px !important;
    margin: 0 !important;
    padding: 4px 9px 16px !important;
    scroll-padding-inline: 9px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }
  body.tm-design-system .tm-home-blocks > .tm-home-films .tm-home-film-card,
  body.tm-design-system .tm-home-blocks > .tm-home-juries .tm-home-jury-card {
    flex: 0 0 min(60vw, 246px) !important;
    width: min(60vw, 246px) !important;
    max-width: min(60vw, 246px) !important;
    min-width: 0 !important;
    height: auto !important;
    aspect-ratio: auto !important;
  }
  body.tm-design-system .tm-home-blocks > :is(.tm-home-films, .tm-home-juries) :is(.tm-home-film-card__caption, .tm-home-jury-card__caption) {
    padding: 11px 1px 8px !important;
    min-height: 79px !important;
    column-gap: 6px;
  }
  body.tm-design-system .tm-home-blocks > :is(.tm-home-films, .tm-home-juries) :is(.tm-home-film-card__name, .tm-home-jury-card__name) {
    font-size: clamp(21px, 6.2vw, 28px) !important;
  }
  body.tm-design-system .tm-home-blocks > :is(.tm-home-films, .tm-home-juries) :is(.tm-home-film-card__country, .tm-home-jury-card__country) {
    font-size: 13px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.tm-design-system .tm-home-blocks > :is(.tm-home-films, .tm-home-juries) :is(.tm-home-film-card__art, .tm-home-jury-card__art) > img {
    transition: none !important;
  }
}

/* Tablet controls must stay within the viewport, not bleed outside the rail. */
@media (min-width: 821px) and (max-width: 1349px) {
  body.tm-design-system .tm-home-blocks > :is(.tm-home-films, .tm-home-juries) :is(.tm-home-films__prev, .tm-home-juries__prev) {
    right: 0 !important;
    left: auto !important;
  }
  body.tm-design-system .tm-home-blocks > :is(.tm-home-films, .tm-home-juries) :is(.tm-home-films__next, .tm-home-juries__next) {
    left: 0 !important;
    right: auto !important;
  }
}
