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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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(--main-font-family, "Inter-Variable", sans-serif);
  font-variation-settings: "wght" var(--main-font-weight, 410);
  background-image: var(--background-image);
  background-size: cover;
  background-attachment: fixed;
}

.container-decor {
  width: var(--block-width);
  max-inline-size: 700px;
}

.header {
  background-color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 100px auto;
  padding-top: 122px;
  padding-bottom: 119px;
  text-transform: uppercase;
  font-family: var(--accent-font-family, fantasy);
  border: 2px solid var(--accent-color);
}

.header__html-decor {
  font-size: clamp(3.0625rem, 1.9087rem + 4.9231vw, 4.0625rem);
}

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

.section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 50px;
  margin: auto;
}

.card {
  background-color: var(--background-color);
  border: 2px solid var(--accent-color);
}
.card__title {
  font-size: 18px;
  margin: 6px 10px;
  line-height: 120%;
  font-variation-settings: "wght" var(--main-header-weight);
}
.card__block-image {
  display: flex;
  position: relative;
  border-top: 2px solid black;
  border-bottom: 2px solid black;
}

.card__image {
  max-width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  inline-size: 100%;
  object-position: center;
}

.card__icon-button {
  background-color: transparent;
  border: 2px solid transparent;
  outline: none;
  cursor: pointer;
  transition: border-color 0.3s ease;
  max-block-size: 38px;
  max-inline-size: 38px;
  padding: 0px 40px 0px 0px;
  align-self: center;
}

.card__like-button {
  justify-content: center;
  max-width: 130px;
  padding: 11px 36px;
  appearance: none;
  max-block-size: 38px;
}

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

.card__icon-button:focus-visible {
  border-color: black;
}

.card__button {
  display: flex;
  justify-content: end;
  align-items: stretch;
  gap: 5px;
}

.card__image-label {
  position: absolute;
  text-transform: uppercase;
  top: 25px;
  right: 25px;
  mix-blend-mode: hard-light;
  font-family: var(--accent-font-family, Monospace);
  opacity: 50%;
  font-size: 14px;
  color: #000000;

  text-shadow: -1px 0 var(--label-border-color), 0 1px var(--label-border-color),
    1px 0 var(--label-border-color), 0 -1px var(--label-border-color);
}

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

.card__text {
  font-size: 18px;
  font-variation-settings: "wght" var(--main-font-weight);
  line-height: 117%;
}

.card__block-text {
  display: flex;
  flex-direction: column;
  padding: 22px 26px;
  gap: 25px;
}

.save__button {
  display: flex;
  flex-direction: column;
  margin: 50px auto;
  padding: 15px 20px;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--accent-color);
}

.save__button-svg {
  width: 29px;
  height: 28px;
  color: var(--fix-color, white);
  mix-blend-mode: difference;
  z-index: 1;
}

.button__text {
  font-family: var(--accent-font-family);
  font-size: 14px;
  line-height: 90%;
  color: var(--fix-color, white);
  mix-blend-mode: difference;
  z-index: 1;
}

.dialog {
  border: 2px solid black;
  width: clamp(21.3125rem, 22.0654rem + -3.2123vw, 22.0625rem);
  padding: 30px;
  text-transform: uppercase;
}

.dialog__form {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  max-width: 100%;
}

.dialog__text {
  font-family: var(--accent-font-family);
  font-size: 14px;
  line-height: 150%;
  flex: 1;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.dialog__svg {
  width: 39px;
  height: 39px;
  color: var(--fix-color, white);
  mix-blend-mode: difference;
  z-index: 1;
}

.dialog__button {
  width: 100%;
  justify-content: center;
  padding: 11px 36px;
  text-transform: uppercase;
}

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

.button {
  display: flex;
  background-color: white;
  cursor: pointer;
  gap: 12px;
  position: relative;
  border: 2px solid var(--accent-color);
}

.move_button {
  transition: box-shadow 0.3s ease;
}

.move_button:focus {
  outline: none;
}

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

.move_button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--accent-color, #000000);
  transition: transform 0.5s ease-in-out;
  transform: scaleX(0);
  transform-origin: left;
  inline-size: 100%;
  block-size: 100%;
}

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

.heart {
  transform-origin: center;
}

.contour {
  transition: fill 0.1s linear;
}

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

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

.sparks {
  opacity: 0;
}

.like-icon:has(:hover) .core {
  transition-delay: 0s;
  fill: var(--contour-color, black);
}

.like-icon:has(:hover) .main-body {
  transition-delay: 0.05s;
  fill: var(--contour-color, black);
}

.like-icon:has(:active) .core {
  transition-delay: 0s;
  fill: var(--contour-color-done, red);
}

.like-icon:has(:active) .main-body {
  transition-delay: 0.05s;
  fill: var(--contour-color-done, red);
}

.like-icon.is-liked .core {
  fill: var(--contour-color-done, red);
  transition: fill 0.3s linear;
}

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

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

.like-icon.is-liked .heart {
  animation: heart 0.3s ease-in 0.1s;
}

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

.saturate-filter {
  filter: saturate(90%);
  -webkit-filter: saturate(90%);
  -moz-filter: saturate(90%);
}

.hue-rotate-filter {
  filter: hue-rotate(180deg) invert(15%);
  -webkit-filter: hue-rotate(180deg) invert(15%);
  -moz-filter: hue-rotate(180deg) invert(15%);
}

.sepia-filter {
  filter: sepia(55%) hue-rotate(180deg);
  -webkit-filter: sepia(55%) hue-rotate(180deg);
  -moz-filter: sepia(55%) hue-rotate(180deg);
}

.invert-filter {
  filter: invert(0%);
  -webkit-filter: invert(0%);
  -moz-filter: invert(0%);
}

.blur-filter {
  filter: blur(10px) saturate(10%);
  -webkit-filter: blur(10px) saturate(10%);
  -moz-filter: blur(10px) saturate(10%);
}

.grayscale-filter {
  filter: grayscale(90%);
  -webkit-filter: grayscale(90%);
  -moz-filter: grayscale(90%);
}

.contrast-filter {
  filter: contrast(60%) blur(2px) sepia(10%);
  -webkit-filter: contrast(60%) blur(2px) sepia(10%);
  -moz-filter: contrast(60%) blur(2px) sepia(10%);
}

.grayscale-saturate-blur-filter {
  filter: grayscale(90%) blur(5px) saturate(60%);
  -webkit-filter: grayscale(90%) blur(5px) saturate(60%);
  -moz-filter: grayscale(90%) blur(5px) saturate(60%);
}

@media (width >= 376px) {
  .save__button {
    display: flex;
    flex-direction: row;
  }

  .save__button-svg {
    width: 21px;
    height: 21px;
  }
}
