@use '../../../abstracts' as helper;

.container {
  margin-inline: auto;
  background: var(--clr-bg-accent);
  box-shadow: var(--clr-shadow);
  border-radius: 5px;
  overflow: hidden; // for background image
  display: grid;

  grid-template-columns: minmax(25rem, 30rem) 1fr;

  @include helper.bp('bp-900') {
    grid-template-columns: none;
    grid-template-rows: 30rem min-content;
  }

  @include helper.bp('bp-700') {
    grid-template-rows: 25rem min-content;
  }
}

.imageContainer {
  display: flex; // for bringing out image__NA out of blur

  position: relative;
  height: auto;
  width: auto;
  overflow: hidden;

  background-size: cover;
  background-position: top;
  place-items: center;

  @include helper.bp('bp-900') {
    padding: var(--spacer-2);
    isolation: isolate;

    // for adding layer of color on top of background image
    &::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(
        to top,
        var(--clr-bg-accent) 10%,
        transparent
      );
      backdrop-filter: blur(8px);
    }
  }
}

.image {
  object-fit: cover;
  object-position: center;

  @include helper.bp('bp-900') {
    z-index: 1;
    object-fit: contain;

    outline: 3px solid var(--clr-fill);
    outline-offset: 5px;

    max-height: 100%;
    margin: auto;

    // overrriding nex/future/image defaults
    height: initial !important;
    width: initial !important;
    position: relative !important;
  }

  &__NA {
    z-index: 1;
    fill: var(--clr-fill-muted);
  }
}

.info {
  padding: var(--spacer-2) var(--spacer-4);
  display: flex;
  flex-direction: column;
  gap: var(--spacer-2);

  @include helper.bp('bp-900') {
    text-align: center;
    align-items: center;
  }
  @include helper.bp('bp-450') {
    gap: var(--spacer-1);
  }
}

.title {
  line-height: 1;
}

.meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;

  & * + *::before {
    content: '\00b7';
    padding-inline: var(--spacer-0);
    font-weight: 900;
    line-height: 0;
    font-size: var(--fs-5);
  }

  @include helper.bp('bp-900') {
    justify-content: center;
  }
}

.ratings {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacer-0) var(--spacer-3);

  @include helper.bp('bp-900') {
    justify-content: center;
  }
}

.rating {
  font-size: var(--fs-5);

  display: grid;
  grid-template-columns: repeat(2, max-content);
  place-items: center;
  gap: 0 var(--spacer-0);

  &__num {
    grid-column: 1 / 2;
    font-size: 1.8em;
    font-weight: var(--fw-medium);
    // line-height: 1;
  }

  &__icon {
    --dim: 1.8em;
    grid-column: -2 / -1;
    line-height: 1;
    height: var(--dim);
    width: var(--dim);
    display: grid;
    place-content: center;
    fill: var(--clr-fill);
  }

  &__text {
    grid-column: 1 / -1;
    font-size: 0.9em;
    line-height: 1;

    color: var(--clr-text-muted);
  }
}

.link {
  @include helper.prettify-link(var(--clr-link));
}

.genres,
.overview,
.crewType {
  &__heading {
    font-weight: var(--fw-bold);
  }
}
