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

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

*/

/*Filters*/
.filter-contrast {
  filter: contrast(1.2);
}

.filter-sepia {
  filter: sepia(85%);
}

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

.filter-invert {
  filter: invert(100%);
}

.filter-blur {
  filter: blur(3px);
}

.filter-mix {
  filter: brightness(1.2) contrast(0.5);
}

.filter-grayscale {
  filter: grayscale(1);
}

.filter-brightness {
  filter: brightness(0.9);
}

.page {
  min-inline-size: 320px;
  min-block-size: 100dvb;
  font-family: var(--main-font, sans-serif);
  font-variation-settings: 'wght' var(--main-font-weight);
  background-image: var(--background-page-gradient);
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
  padding: 100px 0;
}

.header {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--accent-font, monospace);
  background-color: var(--base-bg-color, #fff);
  width: var(--container-width);
  block-size: 372px;
  margin: 0 auto 87px;
  border: var(--base-border);
}

.header__heading {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-transform: uppercase;
  text-align: center;
}

.header__heading--main {
  font-size: clamp(49px, 8.5vw, 65px);
}

.header__heading--main:focus-within {
  outline: none;
}

.header__heading--sub {
  font-size: clamp(14px, 3.5vw, 23px);
}

.main {
  display: flex;
  flex-direction: column;
  gap: 50px;
  margin: 0 auto;
  width: var(--container-width);
}

.card {
  font-size: var(--base-font-size);
  background-color: var(--base-bg-color, #fff);
  border: var(--base-border);
}

.card__title {
  padding: 5px 10px;
  font-variation-settings: 'wght' var(--main-font-heading-weight);
  font-size: inherit;
  line-height: 1.1;
  border-bottom: var(--base-border);
}

.card__image-block {
  position: relative;
  border-bottom: var(--base-border);
}

.card__img {
  display: block;
  object-fit: cover;
  object-position: center;
  aspect-ratio: 1 / 1;
}

.card__label {
  position: absolute;
  top: 25px;
  right: 25px;
  font-family: var(--accent-font, monospace);
  font-size: 14px;
  text-transform: uppercase;
  mix-blend-mode: hard-light;
  opacity: 0.5;
  text-shadow: 0 0 1px #fff;
  font-weight: 400;
}

@supports ((text-stroke: 1px #fff) or (-webkit-text-stroke: 1px #fff)) {
  .card__label {
    -webkit-text-stroke: 1px #fff;
    text-stroke: 1px #fff;
    text-shadow: none;
  }
}

.card__content {
  padding: 25px;
}

.card__text {
  display: flex;
  flex-direction: column;
  gap: 25px;
  line-height: 1.17;
}

.card__buttons {
  display: flex;
  justify-content: end;
  align-items: center;
  padding-top: 25px;
  gap: 5px;
}

/*Buttons*/

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

.button {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-family: var(--accent-font, monospace);
  line-height: 1;
  font-size: 14px;
  background-color: #fff;
  border: var(--base-border);
}

.button:focus-visible {
  outline: none;
  box-shadow: 2px 2px 0 var(--accent-color);
}

.button::before {
  content: '';
  position: absolute;
  inset: 0;
  transform: translate(-100%);
  background-color: var(--accent-color);
  transform-origin: left;
  transition: transform 0.5s ease-in-out;
  z-index: 0;
}

.button__text {
  z-index: 1;
  color: var(--button-text-color);
  transition: none;
  mix-blend-mode: difference;
}

.button:hover::before {
  transform: translate(0);
}

.icon {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  background-color: transparent;
}

.save-button {
  gap: 5px;
  padding: 15px 20px;
}

.save-button__icon {
  z-index: 1;
  transition: none;
  color: var(--svg-button-color);
  mix-blend-mode: difference;
  width: 21px;
  height: 21px;
}

.card__like-button {
  min-width: 130px;
  min-height: 38px;
  padding: 9px 17px;
}

.card__icon-button {
  padding: 0;
  height: 38px;
  border: 2px solid transparent;
  transition: border 0.3s ease;
}

.card__icon-button:focus,
.card__icon-button:focus-visible {
  outline: none;
  border: var(--base-border);
}
/*Анимация сердца*/

.like-icon .contour {
  transition: fill 0.1s linear;
}

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

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

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

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

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

.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 .core {
  fill: var(--animation-fill-color);
  transition: fill 0.3s linear;
}

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

.like-icon.is-liked .heart {
  transform-origin: center;
  animation: zoom-heart 0.3s 0.1s ease-in;
}
.like-icon .sparks {
  opacity: 0;
}

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

.close-button {
  padding: 9px 17px;
  width: 100%;
}

/*Dialog*/

.save-dialog {
  padding: 30px;
  width: var(--save-dialog-width);
  border: var(--base-border);
}

.save-dialog__wrapper {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.save-dialog__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  gap: 20px;
  font-family: var(--accent-font, monospace);
}

.save-dialog__text {
  font-size: inherit;
  line-height: 1.5;
}

.save-dialog__icon {
  flex-shrink: 0;
}

.save-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
}

@media (width <= 375px) {
  .page {
    min-inline-size: auto;
  }

  .page, .header, .main {
    width: 100%;
  }

  .save-button {
    flex-direction: column;
    gap: 8px;
  }

  .header {
    block-size: 327px;
    margin: 0 auto 101px;
  }

  .header__heading--main {
    font-size: clamp(25px, 25px + 6.4vw, 49px);
  }

  .save-button__icon {
    width: 28px;
    height: 28px;
  }
}