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

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

*/

.page {
  min-inline-size: 320px;
  min-block-size: 100dvb;
  font-family: var(--main-font);
  font-variation-settings: var(--main-weight);
  background-image: var(--page-Bg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}
.wrapper {
  inline-size: var(--wrapper);
}
.button {
  font-family: var(--accent-font);
  line-height: 0.9;
  font-size: 14px;
  border: var(--border-decor);
  block-size: 100%;
  transition: box-shadow 0.3s ease 0s;
  background-color: #fff;
  font-weight: var(--accent-weight);
}
.button__text {
  position: relative;
  z-index: 2;
  color: #fff;
  mix-blend-mode: difference;
}
.header {
  font-family: var(--accent-font);
  margin-block-start: 100px;
  margin-inline: auto;
  padding: var(--header-padding) 0px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  row-gap: 20px;
  background-color: #fff;
  border: var(--border-decor);
  line-height: 1;
}
.header__title {
  font-size: var(--header-title);
  font-weight: var(--accent-weight);
  text-transform: uppercase;
}
.header__subtitle {
  font-size: var(--header-subtitle);
  font-weight: var(--accent-weight);
  text-transform: uppercase;
}
.main {
  margin-block-start: 100px;
}
.content {
  display: grid;
  gap: 50px;
  margin-inline: auto;
}
.content__card {
  background-color: #fff;
  border: var(--border-decor);
}

.content__title {
  font-variation-settings: var(--title-weight);
  padding: 4px 10px;
  font-size: 18px;
}
.content__image-container {
  display: flex;
  position: relative;
  inline-size: 100%;
  border-top: var(--border-decor);
  border-bottom: var(--border-decor);
}
.content__image-label {
  position: absolute;
  top: 25px;
  right: 25px;
  font-family: var(--accent-font);
  line-height: 1;
  opacity: 50%;
  mix-blend-mode: hard-light;
  text-shadow: var(--laybel-decor);
  font-size: 14px;
  mix-blend-mode: hard-light;
}
@supports ((text-stroke: 1px #fff) or (-webkit-text-stroke: 1px #fff)) {
  .content__image-label {
    -webkit-text-stroke: 1px #fff;
    text-stroke: 1px #fff;
    text-shadow: none;
  }
}
.content__image {
  inline-size: 100%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.image-blur {
  filter: blur(5px);
}
.image-grayscale {
  filter: grayscale(80%);
}
.image-saturate {
  filter: saturate(380%);
}
.image-invert {
  filter: invert(300%);
}
.image-sepia {
  filter: sepia(0.8);
}
.image-hue-rotate {
  filter: hue-rotate(0.5turn);
}
.image-filter {
  filter: grayscale(1) blur(5px) contrast(1.5);
}
.content__container {
  font-size: 18px;
  margin: 23.5px 25px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}
.content__button-container {
  display: grid;
  grid-template-columns: repeat(2, min-content);
  align-self: end;
  align-items: center;
  column-gap: 7px;
}
.card__icon-button {
  transition: outline 0.3s ease 0s;
  padding: 0;
  background-color: transparent;
  display: flex;
  align-items: center;
  border: none;
}
.card__like-button {
  inline-size: 130px;
}
.save {
  display: flex;
  justify-content: center;
  margin-block-end: 100px;
  margin-block-start: 50px;
}

.save__button {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 17px 20px;
}
.save__icon {
  mix-blend-mode: difference;
  max-inline-size: 21px;
  block-size: auto;
}
dialog {
  inline-size: 383px;
  max-inline-size: 91%;
  padding: 30px 40px;
  background-color: #fff;
  border: var(--border-decor);
  font-family: var(--accent-font);
}
.dialog__icon {
  mix-blend-mode: difference;
}

dialog[open] {
  display: grid;
  grid-template-columns: min-content 1fr;
  align-items: center;
  column-gap: 20px;
  row-gap: 30px;
}
dialog[open]::backdrop {
  background-color: rgb(0 0 0 / 0.75);
}

.dialog-text {
  grid-column: 2/3;
  font-size: 14px;
  line-height: 1.5;
  text-transform: uppercase;
}
.dialog__button {
  inline-size: 100%;
  grid-column: 1/3;
  justify-self: center;
  block-size: 38px;
  text-transform: uppercase;
}

@media (max-width: 375px) {
  .save__button {
    display: flex;
    flex-direction: column;
  }
  .save__icon {
    max-inline-size: 28px;
    block-size: auto;
  }
}
.button:focus {
  outline: none;
}
.button:focus-visible {
  box-shadow: 2px 2px 0 0 currentColor;
}
.card__icon-button:focus {
  outline: none;
}
.card__icon-button:focus-visible {
  outline: var(--border-decor);
}
.animated-button {
  position: relative;
  z-index: 1;
  overflow: hidden;
  cursor: pointer;
}
.animated-button::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  z-index: -1;
  mix-blend-mode: difference;
  background-color: #fff;
  block-size: 100%;
  inline-size: 100%;
  transition: transform 0.5s ease-in-out;
}
.animated-button:hover::before {
  transform: translateX(0);
}
.like-icon {
  transform-origin: center;
  cursor: pointer;
}

/* defoult */
.like-icon .core {
  transition: fill 0.3s linear 0.03s;
  fill: transparent;
}
.like-icon .main-body {
  transition: fill 0.3s linear 0s;
  fill: transparent;
}
.like-icon .contour {
  fill: var(--animation-hover-color);
  transition: fill 0.1s linear 0s;
}
.like-icon .sparks {
  opacity: 0;
}

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

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

/* Click */
.like-icon.is-liked .contour {
  transition: fill 0.3s linear 0.06s;
  fill: var(--animation-select-color);
}
.like-icon.is-liked .main-body {
  transition: fill 0.3s linear 0.05s;
  fill: var(--animation-select-color);
}
.like-icon.is-liked .core {
  transition: fill 0.3s linear 0s;
  fill: var(--animation-select-color);
}
/* animation */
.is-liked {
  animation-name: scale;
  animation-duration: 0.3s;
  animation-timing-function: ease-in;
  animation-iteration-count: 1;
  animation-delay: 0.1s;
}
.is-liked .sparks {
  animation-name: sparks;
  animation-duration: 0.3s;
  animation-timing-function: ease-in;
  animation-iteration-count: 1;
  animation-delay: 0s;
}
