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

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

*/

/*FILTERS*/

.filter-blur {
  filter: blur(3px);
}

.filter-mixed {
  filter:contrast(175%) brightness(3%);
}

.filter-grayscale {
  filter: grayscale(80%);
}

.filter-hue-rotate {
  filter: hue-rotate(0.5turn);
}

.filter-invert {
  filter: invert(100%);
}

.filter-opacity {
  filter: opacity(40%);
}

.filter-saturate {
  filter: saturate(390%)
}


.page {
  min-inline-size: 320px;
  min-block-size: 100dvb;
  background-image: var(--background-gradient);
  background-attachment: fixed;
  background-size: cover;
  font-family: var(--main-font), sans-serif;
  font-variation-settings: 'wght' var(--font-weight);
  color: #1a1a1a;
}

.header {
  width: 100%;
  display: flex;
  justify-content: center;
}

.header__block {
  margin-top: 100px;
  margin-bottom: 96px;
  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(--accent-font), sans-serif;

  display: flex;
  flex-direction: column;
  justify-items: center;
  align-items: center;
  gap: 20px;
  background-color: #fff;
  border: 2px solid #000;
}

.inline-width {
  min-width: calc(var(--inline-width) + 4px);
}

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

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

.main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 50px;
  margin-bottom: 100px;
}

.main__card {
  width: var(--inline-width);
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border: 2px solid #000;
}

.main__card-title {
  padding: 4px 10px;
  font-variation-settings: 'wght' var(--title-weight);
  font-size: 18px;
  border-bottom: 2px solid #000;
}

.card__cover {
  position: relative;
}

.span {
  position: absolute;
  top: 25px;
  right: 25px;
  z-index: 1;

  font-family: var(--accent-font), sans-serif;
  font-size: 14px;
  mix-blend-mode: hard-light;
  text-shadow: -1px 0 #fff, 0 1px #fff, 1px 0 #fff, 0 -1px #fff;
  color: #000;
  text-transform: uppercase;
  opacity: 50%;
}

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

.main__card-image {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  aspect-ratio: 1/1;
}

.card__description {
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  border-top: 2px solid #000;
}

.card__description-text {
  font-size: 18px;
  line-height: 21px;
}

.card__buttons {
  display: grid;
  align-self: flex-end;
  align-items: start;
  grid-template-columns: max-content fit-content(130px);
  gap: 7px;
}

.card__icon-button {
  padding: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background-color: #fff;
  transition: outline 0.3s ease;
}

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

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

.like-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.like-icon:hover .core {
  fill: #000;
  transition: fill 0.3s linear;
}

.like-icon:hover .main-body {
  fill: #000;
  transition: fill 0.3s linear 0.05s;
}

.like-icon:active .core {
  fill: rgba(255, 0, 0, 1);
  transition: fill 0.3s linear;
}

.like-icon:active .main-body {
  fill: rgba(255, 0, 0, 1);
  transition: fill 0.3s linear 0.05s;
}

.like-icon.is-liked .core {
  fill: rgba(255, 0, 0, 1);
  transition: fill 0.3s linear;
}

.like-icon.is-liked .main-body {
  fill: rgba(255, 0, 0, 1);
  transition: fill 0.3s linear 0.05s;
}

.like-icon.is-liked .contour {
  fill: rgba(255, 0, 0, 1);
  transition: fill 0.3s linear 0.06s;
}

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

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

.contour {
  transition: fill 0.1s linear;
}

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

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

.sparks {
  opacity: 0;
}

.button {
  position: relative;
  z-index: 0;
  border: 2px solid #000;
  background-color: #fff;
  transition: box-shadow 0.3s ease, color 0.5s ease-in-out;
  overflow: hidden;
  cursor: pointer;
}

button::before {
  content: "";
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  background-color: #000;
  transform: translateX(-100%);
  transition: transform 0.5s ease-in-out;
}

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

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

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

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

.save__button {
  padding: 16px 18px 14px 18px;
}

.save__span {
  gap: 8px;
}

.icon__save {
  max-width: 21px;
  height: auto;
}

.dialog[open] {
  padding: 28px;
  max-width: clamp(21.3125rem, 21.0484rem + 1.1268vw, 22.0625rem);
  display: grid;
  align-items: center;
  justify-content: start;
  gap: 30px 20px;
  grid-template-columns: max-content minmax(202px, 234px);
  border: 2px solid #000;
  text-transform: uppercase;
  opacity: 1;
}


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

.dialog__button {
  padding: 10.5px;
  grid-column: 1 / 3;
  text-transform: uppercase;
}

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

@media (width < 376px) {
  .header__block {
    margin-bottom: 100px;
    padding-bottom: calc(clamp(7.625rem, 7.0481rem + 2.4615vw, 8.125rem) - 4px);
  }

  .inline-width {
    min-width: 100%;
  }

  .icon__save {
    max-width: 28px;
    height: auto;
  }

  .save__span {
    flex-direction: column;
  }

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