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

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

*/

.page {
  display: grid;
  justify-content: center;
  background-image: var(--bg-image);
  background-size: cover;
  min-inline-size: 320px;
  min-block-size: 100dvb;
  background-attachment: fixed;
  font-family: var(--font-famaly-text), sans-serif;
  font-variation-settings: "wght" var(--font-weight-regular);
}

.header {
  display: grid;
  gap: 20px;
  text-align: center;
  border: 2px solid #000;
  background-color: #fff;
  box-sizing: border-box;
  inline-size: var(--width-block);
  padding: clamp(7.5rem, 6.9159rem + 2.4922vw, 8rem) clamp(1rem, -1.3548rem + 10.0469vw, 7.6875rem);
  margin-block-start: 100px;
  margin-block-end: 100px;
}

.header__logo {
  font-family: var(--font-famaly-text-accent), fantasy;
  font-weight: var(--font-weight-text-pixel);
  font-size: clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem);
  text-transform: uppercase;
  line-height: 100%;
}

.header__title {
  font-family: var(--font-famaly-text-accent), fantasy;
  font-weight: var(--font-weight-text-pixel);
  font-size: clamp(0.875rem, 0.6769rem + 0.8451vw, 1.4375rem);
  text-transform: uppercase;
  line-height: 100%;
}

main {
  display: grid;
  gap: 50px;
}

.card {
  inline-size: var(--width-block);
  border: 2px solid #000;
  background-color: #fff;
  padding-block-end: 25px;
}

.card__content {
  display: grid;
  gap: 25px;
}

.card__title {
  font-family: inherit;
  font-variation-settings: "wght" var(--font-weight-bold);
  font-size: 18px;
  padding: 4px 10px;
}

.card__block-image {
  position: relative;
  border-block-start: 2px solid;
  border-block-end: 2px solid;
}

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

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

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

.card__image_filter_brightness {
  filter: brightness(100%);
}

.card__image_filter_inversion {
  filter: contrast(50%) saturate(158%);
}

.card__image_filter_grayscale {
  filter: sepia(60%);
}

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

.card__image_filter-hue {
  filter: saturate(150%);
}

.card__image_filter_contrast {
  filter: contrast(100%);
}

.card__image_filter_saturate {
  filter: saturate(150%);
}

.card__block-text {
  display: grid;
  gap: 25px;
  padding-inline: 25px;
}

.card__text {
  color: #000;
  font-family: var(--font-famaly-text);
  font-variation-settings: "wght" var(--font-weight-regular);
  font-size: 18px;
  line-height: 1.2;
}

.card__block-button {
  display: flex;
  align-items: center;
  justify-self: right;
  margin-inline-end: 25px;
  gap: 5px;
}

.card__icon-button {
  background-color: transparent;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  max-block-size: 38px;
  transition: border 0.3s ease;
}

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

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

.card__like-button {
  width: 130px;
  height: 38px;
  font-weight: var(--font-weight-text-pixel);
  font-size: 14px;
  line-height: 90%;
}

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

.button:focus {
  outline: none;
}

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

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

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

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

.sparks {
  opacity: 0;
}

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

.contour {
  transition: fill linear 0.1s;
}

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

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

.like-icon:hover .core {
  fill: var(--contour-heart);
  transition: fill linear 0.3s 0s;
}

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

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

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

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

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

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

.section__button-save {
  margin-block-end: 100px;
}

.floppy__icon-save {
  position: relative;
  z-index: 2;
  mix-blend-mode: difference;
  fill: #fff;
  width: 21px;
  justify-self: center;
}

.button__save {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  gap: 8px;
  background-color: #fff;
  justify-self: center;
}

.button__text {
  z-index: 2;
  position: relative;
  color: #fff;
  font-family: var(--font-famaly-text-accent), fantasy;
  font-weight: var(--font-weight-text-pixel);
  font-size: 14px;
  line-height: 90%;
  mix-blend-mode: difference;
}

.dialog__window {
  padding: 30px clamp(2.5rem, 2.7201rem + -0.939vw, 1.875rem);
  width: clamp(21.3125rem, 21.0484rem + 1.1268vw, 22.0625rem);
  justify-content: center;
}

.dialog__window[open] {
  display: grid;
  gap: 30px;
}

.dialog__window[open]::backdrop {
  background-color: rgb(0, 0, 0, 0.75);
}

.dialog__window div {
  display: grid;
  grid-template-columns: min-content 1fr;
  align-items: center;
  gap: 12px;
}

.dialog__window__button {
  display: flex;
  justify-content: center;
  padding: 12.5px;
}

.dialog__window__text {
  font-family: var(--font-famaly-text-accent), fantasy;
  font-weight: var(--font-weight-text-pixel);
  font-size: 14px;
  text-transform: uppercase;
  line-height: 150%;
}

.dialog__window__ok {
  text-transform: uppercase;
}

.dialog__window__floppy-icon {
  width: 39px;
}

@media (width <= 375px) {
  .button__save {
    display: grid;
    padding: 15px 18px;
  }

  .floppy__icon-save {
    width: 2rem;
  }
}