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

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

*/

.page {
  font-family: var(--font-text, 'Inter'), sans-serif;
  font-weight: var(--text-weight, 400);
  font-size: 18px;
  background-image: var(--bg);
  background-attachment: fixed;
  min-inline-size: 320px;
  min-block-size: 100dvb;
}

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

.header__card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  height: 7em;
  margin: 0 auto;
  margin: 100px auto 80px;
  border: 2px solid #000;
  background-color: white;
  inline-size: clamp(23.4375rem, 16.2852rem + 30.5164vw, 43.75rem);
  max-inline-size: 700px;
}

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

.header__subtitle {
  font-size: clamp(0.875rem, 0.6769rem + 0.8451vw, 1.4375rem);
  text-transform: uppercase;
}

.card {
  margin: 20px auto 0;
  border: 2px solid #000;
  background-color: #fff;
  inline-size: clamp(23.4375rem, 16.2852rem + 30.5164vw, 43.75rem);
  max-inline-size: 700px;
}

.card__title {
  margin: 3px 10px;
  font-weight: var(--bold-weight);
  font-size: inherit;
}

.card__image {
  position: relative;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__image-label {
  position: absolute;
  top: 25px;
  right: 13px;
  opacity: 0.5;
  font-family: var(--font-accent);
  font-size: 14px;
  text-shadow: 0 1px 0 #fff, 1px 0 0 #fff, 0 -1px 0 #fff, -1px 0 0 #fff;
  mix-blend-mode: hard-light;
}

.filter1 {
  filter: brightness(90%);
}

.filter2 {
  filter: saturate(50%);
}

.filter3 {
  filter: hue-rotate(-90deg) invert(20%);
}

.filter4 {
  filter: hue-rotate(-180deg) saturate(200%);
}

.filter5 {
  filter: sepia(1) brightness(0.8);
}

.filter6 {
  filter: grayscale(1) invert(1);
}

.filter7 {
  filter: blur(7px);
}

.filter8 {
  filter: invert(1) hue-rotate(90deg) contrast(2) brightness(200%);
}

.card__text {
  display: grid;
  gap: 27px;
  margin: 25px;
}

.button__text {
  font-family: var(--font-accent);
  font-size: 14px;
  line-height: 0.9;
}

.card__controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin: 0 25px 25px;
}

.card__icon-button {
  height: 39px;
  border: none;
  border: 2px solid transparent;
  padding: 0;
  outline: none;
  background-color: transparent;
  transition: border 0.3s ease;
  cursor: pointer;
}

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

.card__icon-button:focus-visible {
  border: 2px solid #000;
}

.card__icon-button .core {
  fill: transparent;
  transition: fill 0.3s ease 0.03s;
}

.card__icon-button .main-body {
  fill: transparent;
  transition: fill 0.3s ease;
}

.card__icon-button:hover .core {
  fill: var(--contour-color);
  transition: fill 0.3s ease;
}

.card__icon-button:hover .main-body {
  fill: var(--contour-color);
  transition: fill 0.3s ease 0.05s;
}


.card__icon-button:active .core {
  fill: var(--animation-fill-color);
  transition: fill 0.3s ease;
}

.card__icon-button:active .main-body {
  fill: var(--animation-fill-color);
  transition: fill 0.3s ease 0.05s;
}

.like-icon.is-liked .core {
  fill: var(--animation-fill-color);
}

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

.like-icon.is-liked .contour {
  fill: var(--animation-fill-color);
  transition: fill 0.3s ease 0.3s;
}

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

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


.like-icon {
  height: 36px;
}


.sparks {
  opacity: 0;
}

.card__like-button {
  width: 118px;
  margin: 0;
  padding: 8px 0;
}

.save-button {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: clamp(19.125rem, 18.4868rem + 2.723vw, 20.9375rem);
  margin: 54px auto 102px;
  padding: 15px 10px;

}

dialog {
  width: clamp(21.3125rem, 21.0484rem + 1.1268vw, 22.0625rem);
  border: 2px solid #000;
  padding: 30px;
  background-color: #fff;
}

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

dialog svg {
  display: block;
  min-width: 39px;
}

.dialog__content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;

}

.dialog__text {
  font-family: var(--font-accent);
  font-size: 14px;
  line-height: 1.5;
  text-transform: uppercase;
}

.dialog__btn {
  width: 100%;
  margin-top: 30px;
  padding: 13px;
  text-transform: uppercase;
}

.button {
  position: relative;
  border: 2px solid #000;
  overflow: hidden;
  font-family: var(--font-accent);
  font-size: 14px;
  background-color: #fff;
  transition: box-shadow 0.3s ease;
  cursor: pointer;
}

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

.button::after {
  content: ' ';
  position: absolute;
  inset: 0 0;
  z-index: 0;
  width: 100%;
  background-color: #000;
  transition: transform 0.5s ease-in-out;
  transform: translateX(-101%);
}

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

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

.floppy {
  position: relative;
  z-index: 2;
  filter: invert(1);
  mix-blend-mode: difference;
}

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