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

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

*/

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-main, sans-serif);
  background-color: var(--bg-color, #fff);
  background-image: var(--background-image, repeating-linear-gradient(to right, #d3d3d3, #d3d3d3 2px, rgb(211 211 211 / 0) 2px, rgb(211 211 211 / 0) 4px), 
    repeating-linear-gradient(to bottom, #d3d3d3, #d3d3d3 2px, rgb(211 211 211 / 0) 2px, rgb(211 211 211 / 0) 4px),
    linear-gradient(to bottom, #e7e7e7 0.01%, #1a1a1a 100%));
  background-size: cover;
  background-attachment: fixed;
  font-variation-settings: "wght" var(--font-weight-main, 410);
  min-inline-size: 320px;
  min-block-size: 100dvb;
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-block-start: 98px;
  margin-block-end: calc(100px - 4px);
  border: var(--border-main, 2px solid #000);
  padding-top: clamp(7.625rem, 7.0481rem + 2.4615vw, 8.125rem);
  padding-bottom: clamp(7.625rem, 7.0481rem + 2.4615vw, 8.125rem);
  font-family: var(--font-accent, 'PressStart2P');
  text-transform: uppercase;
  background-color: var(--bg-color, #fff);
  inline-size: min(calc(var(--page-width, clamp(23.4375rem, 16.2911rem + 30.5164vw, 43.75rem)) + 4px), 100%);
  font-weight: 400;
}

.header__title {
  font-size: var(--header-title-font-size, clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem));
}

.header__subtitle {
  font-size: var(--header-subtitle-font-size, clamp(0.875rem, 0.6769rem + 0.8451vw, 1.4375rem));
}

.card-container {
  display: flex;
  flex-direction: column;
  gap: 50px;
  width: var(--page-width, clamp(23.4375rem, 16.2911rem + 30.5164vw, 43.75rem));
}

.card {
  border: var(--border-main, 2px solid #000);
  background-color: var(--bg-color, #fff);
}

.card__title {
  border-bottom: var(--border-main, 2px solid #000);
  padding: 0.25rem 0.625rem;
  font-size: 18px;
  font-variation-settings: "wght" var(--font-weight-title, 715);
}

.card__image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
}

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

.card__content {
  display: flex;
  flex-direction: column;
  gap: 25px;
  border-top: var(--border-main, 2px solid #000);
  padding: 25px;
}

.card__text {
  font-size: 18px;
  line-height: 21px;

}

.card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.contour {
  transition: fill 0.1s linear;
}

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

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

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

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

.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;
}

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

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

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

.like-icon.is-liked {
  transform-origin: center;
}

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

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

.sparksInHeart {
  opacity: 0;
}

.button__text {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--button-text-color, #fff);
  font-family: var(--font-accent, 'PressStart2P');
  font-size: 14px;
  line-height: 0.9;
  mix-blend-mode: difference;
}

.button {
  position: relative;
  z-index: 1;
  border: var(--border-main, 2px solid #000);
  overflow: hidden;
  background-color: var(--bg-color, #fff);
  transition: box-shadow 0.3s ease;
  cursor: pointer;
}

.button:focus {
  outline: none;
}

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

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

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

.card__like-button {
  padding: 10.5px 0;
  inline-size: 130px;
}

.card__icon-button {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid transparent;
  padding: 0;
  outline: none;
  background-color: transparent;
  transition: border-color 0.3s ease;
  inline-size: 38px;
  block-size: 38px;
  cursor: pointer;
}

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

.card_label {
  position: absolute;
  top: 25px;
  right: 25px;
  z-index: 1;
  opacity: 0.5;
  font-family: var(--font-accent, 'PressStart2P');
  font-size: 14px;
  text-transform: uppercase;
  color: var(--accent-color, #000);
  text-shadow:
    -1px 0 var(--bg-color, #fff),
    1px 0 var(--bg-color, #fff),
    0 -1px var(--bg-color, #fff),
    0 1px var(--bg-color, #fff);
  mix-blend-mode: hard-light;
}

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

.card__image_invert {
  filter: invert(0.9);
}

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

.card__image_filtered {
  filter: brightness(0.7) contrast(1.2) sepia(0.3);
}

.card__image_gray {
  filter: grayscale(1);
}

.card__image_saturated {
  filter: saturate(2.5);
}

.card__image_sepia {
  filter: sepia(0.8);
}

.card__image_blur {
  filter: blur(2px);
}


.card__image_bright {
  filter: brightness(0.8);
}

.save_button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 50px auto 100px auto;
  padding: 15px 18px;
}

.save__img {
  position: relative;
  z-index: 1;
  width: 21px;
  height: 21px;
  color: var(--button-text-color, #fff);
  mix-blend-mode: difference;
}

.dialog {
  display: none;
  border: var(--border-main, 2px solid #000);
  padding: 28px;
  text-transform: uppercase;
  background-color: var(--bg-color, #fff);
  max-inline-size: clamp(21.3125rem, 21.0484rem + 1.1268vw, 22.0625rem);
}

.dialog[open] {
  display: flex;
}

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

.save__group {
  gap: 8px;
}

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

.dialog__save-img {
  display: block;
  flex-shrink: 0;
  width: 39px;
  height: 39px;
}

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

.dialog__title {
  font-family: var(--font-accent, 'PressStart2P');
  font-size: 14px;
  line-height: 150%;
}

.dialog__button {
  padding-block: 10.5px;
  text-transform: uppercase;
}

@media (width <=375px) {
  .dialog__save-img {
    width: 28px;
    height: 28px;
  }
  .save__img {
    width: 28px;
    height: 28px;
  }

  .save__group {
    flex-direction: column;
  }

  .header {
    width: var(--page-width, clamp(23.4375rem, 16.2911rem + 30.5164vw, 43.75rem));
    margin-block-start: 100px;
    margin-block-end: 100px;
    padding-bottom: calc(clamp(7.625rem, 7.0481rem + 2.4615vw, 8.125rem) - 4px);
  }

  .dialog[open] {
    padding: 28px 38px;
  }
}