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

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

*/

.page {
  display: flex;
  flex-direction: column;
  min-inline-size: 320px;
  min-block-size: 100dvb;
  background-image: var(--background-image);
  background-size: cover;
  background-attachment: fixed;
  font-family: var(--main-font), Arial, sans-serif;
  font-variation-settings: "wght" var(--text-weight);
}

.header {
  width: var(--content-width);
  background-color: white;
  padding: 130px 0;
  margin: 98px auto 96px;
  border: 2px solid black;
  text-align: center;
}

.header__logo {
  font-family: var(--accent-font), Arial, sans-serif;
  font-size: clamp(49px, 4vw, 65px);
}

.header__title {
  font-family: var(--accent-font), Arial, sans-serif;
  font-size: clamp(14px, 1.5vw, 23px);
  text-transform: uppercase;
  margin-top: 20px;
}

.main {
  width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 51px;
}

.card {
  background-color: white;
  border: 2px solid black;
}

.card__title {
  font-variation-settings: "wght" var(--title-weight);
  padding: 4px;
  margin-left: 6px;
  font-size: 18px;
}

.card__image {
  width: 100%;
  display: block;
  filter: grayscale(50%) contrast(150%) brightness(110%);
}

.button {
  display: flex;
  flex-direction: row;
  background: #fff;
  position: relative;
  cursor: pointer;
  padding-inline: 3px;
}

.card__like-button:before {
  content: '';
  background: #fff;
  position: absolute;
  mix-blend-mode: difference;
  z-index: 1;
  inset: 0;
  transform: translateX(-100%);
  transition: transform 0.5s ease-in-out;
}

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

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

.button__text {
  overflow: hidden;
  display: block;
  padding: 9px 20px;
  position: relative;
  mix-blend-mode: difference;
  min-width: 130px;
  z-index: 2;
  color: #fff;
  font-family: var(--accent-font), Arial, sans-serif;
}

.button__icon {
  position: relative;
  z-index: 2;
  mix-blend-mode: difference;
  color: white;
}

.card__icon-button {
  display: flex;
  justify-self: flex-end;
  align-self: flex-end;
}

.card__like-button {
  min-width: 130px;
  overflow: hidden;
  border: 2px solid #000;
  padding: 1px 0 0 0;
}

.card__like-button, .save-button {
  font-family: var(--accent-font), Arial, sans-serif;
  font-size: 14px;
  justify-self: flex-end;
  align-self: flex-end;
  padding-bottom: 3px;
}

.like-icon {
  display: flex;
  justify-self: flex-end;
  align-self: flex-end;
  overflow: visible;
  width: 39px;
  height: 36px;
  margin-right: 10px;
  border: none;
  background: none;
  cursor: pointer;
}

.like-icon .core {
  fill: transparent;
  transition: fill 0s steps(1);
}

.like-icon .main-body {
  fill: transparent;
  transition: fill 0s steps(1);
}

.like-icon .contour {
  fill: var(--contour-color);
  transition: fill 0.1s linear;
}

.sparks {
  fill: transparent;
}

.card__icon-button:hover .core {
  fill: var(--contour-color);
  transition: fill 0s steps(1) 0s;
}

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

.card__icon-button:active .core {
  fill: var(--animation-fill-color);
  transition: fill 0s steps(1) 0s;
}

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

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

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

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

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

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

.filter__neon {
   filter: contrast(140%) saturate(150%);
}

.filter__vintage {
  filter: sepia(80%) contrast(110%);
}

.filter__ultra-neon {
  filter: saturate(220%) contrast(130%) brightness(110%);
}

.filter__purple {
  filter: hue-rotate(25deg) contrast(140%) saturate(120%);
}

.filter__pastel {
  filter: brightness(110%) contrast(90%) saturate(70%);
}

.filter__sepia {
  filter: sepia(60%) brightness(90%) contrast(120%);
}

.filter__blur {
  filter: blur(3px) brightness(105%);
}

.filter__retro {
  filter: hue-rotate(120deg) saturate(130%) contrast(110%);
}

.card__content {
  padding: 0 23px 22px 23px;
}

.card__buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 22px;
}

.card__text {
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 21px;
  padding-top: 25px;
}

.card__text-place {
  margin-bottom: 23px;
  font-size: 18px;
  line-height: 21px;
  padding-top: 19px;
  padding-bottom: 1px;
}

.card__image-wrapper {
  position: relative;
}

.card__label {
  position: absolute;
  right: 25px;
  top: 25px;
  opacity: 0.5;
  mix-blend-mode: hard-light;
  font-family: var(--accent-font), Arial, sans-serif;
  text-transform: uppercase;
  font-size: 14px;
  -webkit-text-stroke: 1px var(--label-stroke-color);
}

.dialog {
  max-width: 350px;
  border: 2px solid black;
  padding: 30px;
  display: none;
  font-family: var(--accent-font), Arial, sans-serif;
  font-size: 14px;
}

.dialog[open] {
  display: block;
  min-width: 353px;
}

.dialog img {
  mix-blend-mode: difference;
}

.dialog[open] .dialog__content {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 20px;
}

.dialog__text {
  font-family: var(--accent-font), Arial, sans-serif;
  line-height: 1.5;
  text-transform: uppercase;
}

.dialog__button {
  width: 100%;
  margin-top: 20px;
  justify-content: center;
  border: 2px solid black;
}

.dialog__button .button__text {
  border: none;
}

.dialog__button .button__text::before {
  display: none;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

.save-button {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-self: center;
  margin-bottom: 100PX;
}

.save-button .button__text {
  padding: 14px 14px;
}

.save-button svg {
  mix-blend-mode: difference;
}

@supports not (-webkit-text-stroke: 1px black) {
  .card__label {
    text-shadow:
      -1px -1px 0 var(--label-stroke-color),
       1px -1px 0 var(--label-stroke-color),
      -1px 1px 0 var(--label-stroke-color),
       1px 1px 0 var(--label-stroke-color);
  }
}

@media (width <= 376px) {
  .dialog__text {
    font-size: 14px;
  }

  .header {
    padding-top: 122px;
    padding-bottom: 120px;
    margin-bottom: 100px;
  }

  .card__title {
    padding-top: 4px;
  }

  .card__content {
    padding: 4px 25px 22px 25px;
  }

  .save-button .button__text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .save-button svg {
    min-width: 28px;
    min-height: 28px;
  }
}

