/* Здесь вы напишете основную часть стилей страницы.

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в HTML некоторые классы были названы особым образом:
✦ like-icon — для svg-иконки анимированного сердца
✦ card__like-button — для кнопки Like рядом с иконкой
✦ card__icon-button — для кнопки, оборачивающей иконку
✦ card__icon-button — для кнопки, оборачивающей иконку
✦ is-liked — для обозначения состояния лайкнутой иконки в виде сердца
✦ button__text — для обозначения текстового элемента внутри кнопки

*/

.page {
  min-inline-size: 320px;
  min-block-size: 100dvb;
  font-family: var(--font-main);
  font-variation-settings: "wght" var(--page-text-weight);
  background-image: var(--background-gradient);
  background-attachment: fixed;
  background-size: cover;
  padding: var(--page-padding);
}

.header {
  display: flex;
  flex-direction: column;
  justify-self: center;
  justify-content: center;
  gap: 20px;
  width: var(--container-width);
  background: #fff;
  border: 2px solid #000;
  font-family: var(--font-accent);
  padding: clamp(122px, calc(119.183px + 0.751vw), 130px)
    clamp(16px, calc(-21.324px + 9.953vw), 122px);
}

.header__logo {
  display: flex;
  justify-content: center;
  font-weight: var(--header-text-weight);
  font-size: var(--header-logo-text-size);
}

.header__title {
  display: flex;
  justify-content: center;
  font-weight: var(--header-text-weight);
  font-size: var(--header-title-text-size);
  text-transform: uppercase;
}

.content {
  display: flex;
  flex-direction: column;
  justify-self: center;
  justify-content: center;
  align-items: center;
  width: var(--container-width);
  gap: 52px;
  padding: var(--content-padding);
}

.content__card {
  background: #fff;
  border: 2px solid #000;
}

.content__card-title {
  font-family: var(--font-main);
  font-weight: var(--card-title-weight);
  font-variation-settings: "wght" var(--card-title-weight);
  font-size: 18px;
  line-height: 109%;
  letter-spacing: 0;
  padding: 3px 10px;
}

.content__card-image_container {
  position: relative;
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
}

.content__card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content__card-label {
  position: absolute;
  top: 25px;
  right: 25px;
  font-family: var(--font-accent);
  font-weight: 400;
  font-size: 14px;
  line-height: 100%;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 50%;
  mix-blend-mode: hard-light;
  text-shadow:
    -1px -1px var(--card-label-text-shadow),
    0px -1px var(--card-label-text-shadow),
    1px -1px var(--card-label-text-shadow),
    1px 0px var(--card-label-text-shadow),
    1px 1px var(--card-label-text-shadow),
    0px 1px var(--card-label-text-shadow),
    -1px 1px var(--card-label-text-shadow);
}

@supports (
  (text-stroke: 1px var(--card-label-text-shadow)) or
    (-webkit-text-stroke: 1px var(--card-label-text-shadow))
) {
  .content__card-label {
    -webkit-text-stroke: 1px var(--card-label-text-shadow);
    text-stroke: 1px var(--card-label-text-shadow);
    text-shadow: none;
  }
}

.content__card-text {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 25px;
  font-family: var(--font-main);
  font-weight: var(--card-text-weight);
  font-size: 18px;
  line-height: 21px;
  letter-spacing: 0;
}

.button__text {
  position: relative;
  z-index: 999;
  color: var(--button-text-color);
  mix-blend-mode: difference;
}

.button_common {
  position: relative;
  background: #fff;
  border: 2px solid #000;
  font-family: var(--font-accent);
  font-weight: 400;
  font-size: 14px;
  line-height: 90%;
  letter-spacing: 0;
  cursor: pointer;
}

.button_common:focus {
  outline: none;
  box-shadow: 2px 2px 0px #000;
  transition: box-shadow 0.3s ease;
}

.button_common::before {
  content: "";
  position: absolute;
  transform: scale(0, 1);
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transition: 0.5s ease-in-out;
  background: #000;
}

.button_common:hover::before {
  transform: scale(1);
}

.card__buttons {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 7px;
}

.card__icon-button {
  display: flex;
  align-content: center;
  width: 38px;
  height: 38px;
  background: none;
  border: 2px solid rgb(0 0 0 / 0);
  padding: 0;
  transition: border 0.3s ease;
  cursor: pointer;
}

.card__icon-button:focus {
  outline: none;
}

.card__icon-button:focus-visible {
  border: 2px solid #000;
}

.card__icon-button .like-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__like-button {
  width: 130px;
  height: 38px;
}

.button__save {
  display: flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-height: 55px;
  padding: 20.5px 20px;
}

.button__save .floppy-icon {
  flex-shrink: 0;
  width: 21px;
  height: 21px;
  color: var(--button-text-color);
  mix-blend-mode: difference;
}

.dialog__save[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-items: center;
  gap: 30px;
  padding: 28px;
  max-width: 353px;
  border: 2px solid #000;
}

.dialog__save[open]::backdrop {
  background-color: rgb(0 0 0 / 0.75);
}

.dialog__save[open] .dialog__content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.dialog__save .floppy-icon {
  flex-shrink: 0;
  width: 39px;
  height: 39px;
}

.dialog__save .dialog__text {
  font-family: var(--font-accent);
  font-weight: var(--header-text-weight);
  font-size: 14px;
  line-height: 150%;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dialog__save .dialog__button {
  width: 293px;
  height: 38px;
  text-transform: uppercase;
}

.img_contrast {
  filter: grayscale(65%);
}

.img_saturate {
  filter: saturate(300%);
}

.img_hue-rotate {
  filter: hue-rotate(30deg);
}

.img_invert {
  filter: invert(1);
}

.img_sepia {
  filter: sepia(80%);
}

.img_blur {
  filter: blur(1rem);
  padding: 12px;
}

.img_mixed {
  filter: hue-rotate(90deg) contrast(2) sepia(0.5) brightness(1.5);
}

@media (width <= 375px) {
  .button__save {
    flex-direction: column;
    gap: 8px;
    padding: 15px 20px;
    min-width: 306px;
    min-height: 84px;
  }

  .button__save .floppy-icon {
    width: 28px;
    height: 28px;
  }

  .dialog__save[open] {
    gap: 30px;
    padding: 30px 35px;
  }

  .dialog__save[open] .dialog__button {
    width: 261px;
    height: 38px;
  }
}

.like-icon .contour {
  fill: var(--contour-color);
  transition: fill 0.1s linear 0s;
}

.like-icon .sparks {
  fill: var(--animation-fill-color);
  opacity: 0;
}

.like-icon .core {
  fill: transparent;
  transition: fill 0.3s linear 0.03s;
}

.like-icon .main-body {
  fill: transparent;
  transition: fill 0.3s linear 0s;
}

.like-icon:hover .core {
  fill: #000;
  transition: fill 0.3s linear 0s;
}

.like-icon:hover .main-body {
  fill: #000;
  transition: fill 0.3s linear 0.05s;
}

.like-icon:active .core {
  fill: var(--animation-fill-color);
  transition: fill 0.3s linear 0s;
}

.like-icon:active .main-body {
  fill: var(--animation-fill-color);
  transition: fill 0.3s linear 0.05s;
}

.like-icon.is-liked .contour {
  fill: var(--animation-fill-color);
  transition: fill 0.3s linear 0.06s;
}

.like-icon.is-liked .main-body {
  fill: var(--animation-fill-color);
  transition: fill 0.3s linear 0.05s;
}

.like-icon.is-liked .core {
  fill: var(--animation-fill-color);
  transition: fill 0.3s linear 0s;
}

.like-icon.is-liked .heart {
  transform-origin: center;
  animation: bigger 0.3s ease-in;
  animation-delay: 0.1s;
}

.like-icon.is-liked .sparks {
  animation: sparking 0.3s ease-in;
  animation-delay: 0.3s;
}