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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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), sans-serif;
  font-variation-settings: 'wght' var(--main-text-weight);
  background-image: var(--bg-gradient);
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  /*padding: 100px 0; */
}

.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  font-family: var(--font-accent), fantasy;
  text-transform: uppercase;
  padding: var(--header-padding) 0;
  inline-size: var(--content-wdth);
  background-color: #fff;
  outline: 2px solid #000;
  margin-block: 100px;

}

.header__title {
  font-size: var(--title-font-size);

}
.header__subtitle {
  font-size: var(--subtitle-font-size);
}

.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
  margin-bottom: 100px;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 53px;
}

.card__item {
  inline-size: var(--content-wdth);
  background-color: #fff;
  border: 2px solid #000;
}

.card__title {
  font-size: 18px;
  padding: 4px 10px;
  font-variation-settings: 'wght' var(--title-weight);
}

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

.card__img {
  display: block;
  block-size: 100%;
  inline-size: 100%;
  min-height: 371px;
  background-repeat: no-repeat;
}

.card-label {
  position: absolute;
  font-family: var(--font-accent), fantasy;
  font-size: 14px;
  text-transform: uppercase;
  top: 25px;
  right: 25px;
  mix-blend-mode: hard-light;
  text-shadow: 1px 1px 0 rgb(255 255 255), -1px -1px 0 rgb(255 255 255);
  opacity: 50%;
}

.card__item-grayscale .card__img {
  filter: grayscale(0.7);
}

.card__item-saturate .card__img {
  filter: saturate(4);
}

.card__item-hue_rotate .card__img {
  filter: hue-rotate(40deg);
}

.card__item-invert .card__img {
  filter: invert(0.8);
}

.card__item-sepia .card__img {
  filter: sepia(1);
}

.card__item-blur .card__img {
  filter: blur(8px);
}

.card__item-multi .card__img {
  filter: sepia(0.2) hue-rotate(80deg) blur(2px) brightness(1.4) contrast(0.55);
}

@supports (-webkit-text-stroke: 1px rgb(255 255 255)) {
  .card-label {
    text-shadow: none;
    -webkit-text-stroke: 1px rgb(255 255 255);
  }
}

.card__description {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 25px 25px;
}

.card-text {
  font-size: 18px;
  line-height: 21px;
  font-variation-settings: 'wght' var(--main-text-weight);
  /*padding: 20px 25px 0px;*/
  }

.card-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0px 25px 25px;
  gap: 6px;
}

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

.card__icon-button {
  display: flex;
  justify-content: center;
  align-items: center;
  outline: none;
  border: none;
  padding-inline: 0px;
  padding-block: 0px;
  background-color: #fff;
  transition: box-shadow 0.3s ease;
  height: 38px;
}

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

.card__icon-button:focus-visible {
  box-shadow: 0 0 0 2px #000;
}

.like-icon {
  display: flex;
  justify-content: center;
  align-items: center;
}

.contour {
  transition: fill 0.1s linear;
}

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

}

.core {
  transition: fill 0.3s 0.03s linear;
}

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

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

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

.main-body {
  transition: fill 0.3s linear;
}

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

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

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

.sparks {
  opacity: 0;
}

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

.like-icon.is-liked .sparks {
  animation: sparks 0.3s 0.3s ease-in;
  transform-origin: center;
}

.button {
  font-family: var(--font-accent), fantasy;
  font-size: 14px;
  line-height: 90%;
  color: #000;
  border: 2px solid #000;
  background-color: #fff;
  cursor: pointer;
  z-index: 1;
  transition: box-shadow 0.3s ease, scale 0.5s ease-in-out;
  position: relative;
}

.button:focus {
  outline: none;
}

.button:focus-visible {
  box-shadow: 2px 2px 0 #000;
}

.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 101%;
  background-color: #000;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease-in-out;
  z-index: 0;
}

.button:hover::before {
  transform: scaleX(1);
}

.button>span {
  position: relative;
  z-index: 1;
  color: #fff;
  mix-blend-mode: difference;
}

.floppy-icon,
.button__text {
    mix-blend-mode: difference;
    color: #fff;
    stroke: #fff;
    fill: #fff;
}

.button-save {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  inline-size: 335px;
  block-size: 55px;
}

.dialog__window[open] {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 30px;
  max-inline-size: 353px;
  inset: 0;
  border: 2px solid #000;
}

.popup__content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.popup-text {
  font-family: var(--font-accent), fantasy;
  text-transform: uppercase;
  font-size: 14px;
  line-height: 150%;
  font-weight: 400;
}

.popup__button {
  text-transform: uppercase;
  min-height: 38px;
  width: 100%;
  font-size: 14px;
  line-height: 90%;
  font-weight: 400;
}

.dialog__window::backdrop {
  background-color: rgb(0 0 0 / 0.75);
}

@media (width <= 375px) {
  .header__subtitle {
    font-size: 14px;
  }
  .main {
    gap: 47px;
  }
  .cards {
    gap: 50px;
  }
  .card__description {
    gap: 24px;
    padding: 25px 25px 1px;
  }
   .card-buttons {
    margin: 25px 25px 24px;
  }
  .button-save {
    flex-direction: column;
    inline-size: 306px;
    block-size: 84px;
    margin-top: 0px;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .floppy-icon {
    min-inline-size: 28px;
    min-block-size: 28px;
  }
  .dialog__window[open] {
    padding: 30px 40px;
    min-inline-size: 341px;
  }
}