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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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-family, sans-serif);
  font-variation-settings: "wght" var(--moregular-wght, 410),
    "wdth" var(--wdth, 100);
  background-image: var(--bg-grad);
  background-size: cover;
  background-attachment: fixed;
  background-repeat: repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  /* gap: 50px; */
}

.header {
  margin-block: 100px 94px;
  padding-inline: clamp(16px, calc(10vw - 21.5px), 122.5px);
  padding-block: clamp(122px, calc(0.751vw + 119.18px), 130px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-transform: uppercase;
}

.header,
.card__label,
.button__text,
.dialog__text {
  font-family: var(--accent-family, monospace);
  font-weight: var(--regular-wght, 400);
  color: var(--accent-color, #000);
}

.container {
  inline-size: clamp(375px, calc(30.52vw + 260.56px), 700px);
}

.frame {
  border: 2px solid var(--accent-color, #000);
  background: var(--stroke-color, #fff);
}

.header__title {
  font-size: clamp(3.0625rem, 1.9087rem + 4.9231vw, 4.0625rem);
  padding-block-end: 20px;
}

.header__description {
  font-size: clamp(0.875rem, 0.226rem + 2.7692vw, 1.4375rem);
}

.main {
  display: flex;
  flex-direction: column;
  gap: 49px;
}

/* card */

.card__title {
  font-variation-settings: "wght" var(--morbold-wght, 715);
  font-size: 18px;
  color: var(--accent-color, #000);
  padding: 5px 10px;
}

.card__wrapper {
  position: relative;
  border-block: 2px solid var(--accent-color, #000);
}

.card__image {
  display: block;
  inline-size: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.filter-sepia {
  filter: sepia(0.1);
}

.filter-blur {
  filter: blur(1.2px) grayscale(0.65);
}

.filter-contrast {
  filter: contrast(1.2);
}

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

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

.filter-invert {
  filter: invert(0.7);
}

.filter-animation {
  animation: imageHueRotate 5s ease-in-out infinite;
}

.filter-saturate {
  filter: saturate(1.1);
}

.card__label {
  position: absolute;
  inset-inline-end: 25px;
  inset-block-start: 25px;
  font-family: var(--accent-family, monospace);
  font-weight: var(--regular-wght, 400);
  font-size: 14px;
  text-transform: uppercase;
  color: var(--accent-color, #000);
  mix-blend-mode: hard-light;
  opacity: 0.5;
  text-shadow: -1px 0 var(--stroke-color, #fff), 0 1px var(--stroke-color, #fff),
    1px 0 var(--stroke-color, #fff), 0 -1px var(--stroke-color, #fff);
}

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

.card__description {
  padding: 25px 26px 23px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.card__text {
  font-size: 18px;
  line-height: 21px;
  color: var(--accent-color, #000);
}

/* кнопки */

.card__button-wrapper {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  align-items: center;
  padding: 0 25px 25px 0;
}

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

.card__icon-button {
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
  background-color: transparent;
  inline-size: 41px;
  padding: 0;
}

.button-decor {
  transition: box-shadow 0.3s ease;
  color: var(--accent-color, #000);
  position: relative;
  overflow: hidden;
}

.decor-like-button {
  inline-size: 130px;
  block-size: 38px;
}

.button__text {
  line-height: 90%;
  font-size: 14px;
}

.main__dialog-button-wrapper {
  margin-block-end: 100px;
  display: flex;
  justify-content: center;
}

.decor-save-button {
  padding: 15px 19px;
  gap: 9px;
}

/* dialog */

.dialog {
  display: none;
  padding: 28px;
  flex-direction: column;
  gap: 30px;
}

.dialog[open] {
  display: flex;
}

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

.dialog__description {
  display: flex;
  gap: 17px;
  align-items: center;
}

.dialog__description .card__save-icon {
  inline-size: 39px;
  block-size: 39px;
}

.dialog__text {
  inline-size: 234px;
  line-height: 150%;
  text-transform: uppercase;
  font-size: 14px;
}

.decor-ok-button {
  padding: 7px 131px;
}

.button__decor-text {
  text-transform: uppercase;
}

/* состояния */

.button:focus {
  outline: none;
}

.card__icon-button:focus-visible {
  border-color: var(--accent-color, #000);
}

.button-decor:focus-visible {
  box-shadow: 2px 2px 0 var(--accent-color, #000);
}

.button-decor::before {
  z-index: 0;
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-color, #000);
  transform: translateX(-100%);
  transition: transform 0.5s ease-in-out;
}

.button-decor:hover::before {
  transform: translateX(0);
}

.button-decor .button__text,
.button-decor .card__save-icon {
  position: relative;
  z-index: 1;
  mix-blend-mode: difference;
  color: var(--stroke-color, #fff);
}

.decor-save-button .card__save-icon {
  width: 21px;
  height: 21px;
  display: block;
}

.card__save-icon use {
  fill: currentColor;
  stroke: none;
}

/* декор сердца */

.sparks {
  opacity: 0;
}

.contour {
  transition: fill 0.1s linear 0s;
}

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

.core {
  fill: transparent;
  transition: fill 0.3s linear 0.03s;
}
/* hover */

.like-icon:hover .core {
  fill: var(--accent-color, #000);
  transition-delay: 0s;
}

.like-icon:hover .main-body {
  fill: var(--accent-color, #000);
  transition-delay: 0.05s;
}

/* active */

.like-icon:active .core {
  fill: var(--animation-fill-color, #ff0000);
  transition-delay: 0s;
}

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

/* is-liked */

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

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

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

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

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

@media (width <= 375px) {
  .container {
    inline-size: 100%;
    max-inline-size: 375px;
  }

  .header {
    padding-inline: clamp(14px, calc(3.636vw + 2.364px), 16px);
    padding-block: clamp(104px, calc(32.727vw - 0.727px), 122px);
  }

  .card__title {
    padding: 7px 10px;
  }

  .card__description {
    padding: 22px 25px 22px;
  }

  .decor-save-button {
    flex-direction: column;
  }

  .decor-save-button .card__save-icon {
    width: 28px;
    height: 28px;
  }
}
