/* ------------------------------------ *\
  CONTENTS
\* ------------------------------------ */

/**
 * CONTENTS..............You’re reading it!
 * BASE STYLE .............................
 * IMAGE OFFSET ...........................
 * ZOOM MODAL .............................
 * FILTERS ................................
 * MEDIA QUERIES ..........................
*/

/* ------------------------------------ *\
  ==BASE STYLE
\* ------------------------------------ */
.paragraph.paragraph--type--image {
  margin: 0;
  border: 0;
  align-self: center;
  display: inline-block;
  width: 100%;
}

/* ------------------------------------ *\
  ==ZOOM MODAL
\* ------------------------------------ */
button.image-zoom {
  border: 0;
  background: transparent;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 10;
  padding: 0;
}

.image__content {
  position: relative;
}

button.image-zoom i {
  background-color: var(--bs-white);
  padding: 0.7rem;
}

.image__legend {
  position: absolute;
  bottom: -1px;
  right: 0;
  z-index: 10;
  background-color: var(--bs-white);
  font-size: 0.875rem;
  min-width: fit-content;
  max-width: 100%;
  padding: 0 1rem;
  text-align: right;
}

.image__container {
  position: relative;
}

.modal-content.image-modal {
  background: transparent;
  border: 0;
  padding: 0;
}

.modal-content.image-modal .modal-header {
  border: 0;
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 50;
}

.modal-content.image-modal .modal-header .btn-close {
  background-color: #fff;
  border-radius: 50%;
}

.modal-content.image-modal .image-description {
  background: #ffffff8f;
  border-radius: 0 0 5px 5px;
  padding: 1rem;
}

.image-modal-dialog {
  max-width: 80%;
  width: max-content;
}

.image-modal-dialog .modal-body .image-legend {
  background-color: #fff;
  font-size: 1.5rem;
  padding: 0.25rem 1rem;
  width: 100%;
}

main
  .paragraph--type--image:not(.image--offset, .image--notzoomed)
  .media--view-mode-paragraph--type--image:not(
    .image--offset,
    .image--notzoomed
  ):where(:focus, :hover, :active)
  img {
  transform: scale(1.2);
}

.paragraph--type--image:not(.image--offset, .image--notzoomed)
  .media--view-mode-paragraph--type--image
  img {
  transition: all 1s;
}

.paragraph--type--image:not(.image--offset)
  .media--view-mode-paragraph--type--image {
  overflow: hidden;
}

/* ------------------------------------ *\
  ==DESCRIPTION / LEGEND
\* ------------------------------------ */
.paragraph--type--image .image-description,
.paragraph--type--image .image-legend {
  width: fit-content;
  display: inline-block;
  position: relative;
}

.paragraph--type--image .image-description {
  background: transparent;
  color: var(--bs-black);
  border: 0;
}

.paragraph--type--image .image-description:where(:hover, :active, :focus) {
  color: var(--bs-blue);
}

/* ------------------------------------ *\
  ==FILTERS
\* ------------------------------------ */
.img-filter .field--type-image:after {
  position: absolute;
  content: '';
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.img-filter .field--type-image {
  position: relative;
  flex: 0 0;
}

.img-filter.filter--blue .field--type-image:after {
  background: radial-gradient(rgb(31 99 222 / 20%), rgb(31 99 222 / 50%));
}

.img-filter.filter--yellow .field--type-image:after {
  background: linear-gradient(254deg, #ffff8580, #ffff8530);
}

.image--offset.img-filter .field--type-image:after {
  width: clamp(1rem, calc(100% + 10.5rem), 30rem);
}

/* ------------------------------------ *\
  ==MEDIA QUERIES
\* ------------------------------------ */

/* `md` applies to small devices (landscape phones, less than 768px) */
@media screen and (max-width: 767.98px) {
  .paragraph--type--image.image--offset {
    display: none;
  }

  .image-modal-dialog {
    max-width: 97%;
  }
}

/* Large devices (desktops, less than 1200px) */
@media screen and (max-width: 1199.98px) {
  .layout__region--first .image--offset img {
    max-width: 150%;
  }

  .layout__region--first .image--offset {
    transform: translateX(-1rem) translateY(-50%);
  }
}

/* X-Large devices (large desktops, less than 1400px) */
@media screen and (max-width: 1399.98px) {
  .layout__region--first .image--offset img {
    max-width: clamp(1rem, calc(100% + 10rem), 30rem);
  }

  .layout__region--first .image--offset {
    transform: translateX(-1rem) translateY(-50%);
  }

  .image--offset.img-filter:after {
    width: clamp(1rem, calc(100% + 10rem), 30rem);
  }
}
