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

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

*/

.page {
  min-inline-size: 320px;
  min-block-size: 100dvb;
  font-family: var(--main-font), sans-serif;
  font-variation-settings: "wght" var(--description-font-weight);
  background-image: var(--grid-gradient);
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 0;
}

.frame {
  background-color: var(--reverse-accent-color);
  border: 2px solid var(--accent-color);
}

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

.header {
  inline-size: clamp(375px, 48.6vw, 700px);
  max-block-size: 368px;
  flex-direction: column;
  font-family: var(--accent-font), sans-serif;
  text-transform: uppercase;
  gap: 20px;
  padding: 130px 0;
  margin-block-end: 98px;
}

.header__heading {
  font-size: clamp(49px, 5vw, 65px);
}

.header_heading-description {
  font-size: clamp(14px, 2vw, 23px);
}

.main {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.card {
  inline-size: clamp(375px, 48.6vw, 700px);
  display: flex;
  flex-direction: column;
}

.card-heading {
  margin-inline: 10px;
  margin-block: 4px;
  font-variation-settings: "wght" var(--heading-font-weight);
  font-size: 18px;
}

.card__label {
  position: relative;
  max-inline-size: 100%;
  max-block-size: 100%;
  border-top: 2px solid var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
}

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

.card__label-text {
  position: absolute;
  top: 25px;
  right: 25px;
  color: var(--accent-color);
  paint-order: stroke fill;
  mix-blend-mode: hard-light;
  filter: opacity(50%);
  text-transform: uppercase;
  font-family: var(--accent-font), sans-serif;
  font-size: 14px;

  z-index: 1;
}

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

.card-description {
  display: flex;
  flex-direction: column;
  margin-block: 25px;
  margin-inline: 25px;
  gap: 25px;
  font-size: 18px;
}

.button {
  color: var(--reverse-accent-color);
  font-family: var(--accent-font), sans-serif;
  font-size: 14px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}

.card-button {
  display: flex;
  margin-inline-end: 25px;
  margin-block-end: 25px;
  align-self: self-end;
  justify-content: center;
  gap: 4px;
}

.card__like-button {
  inline-size: 130px;
  block-size: 38px;
}

.button-modal {
  gap: 8px;
}

.button-modal.button-modal-open {
  padding: 15px 18px;
  max-inline-size: clamp(306px, 25vw, 335px);
}

.button-modal.button-modal-save {
  padding-block: 10px;
  width: 100%;
}

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

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

.dialog-description-container {
  display: flex;
  gap: 20px;
}

.dialog-class {
  width: 353px;
  padding: 30px;
}

.dialog-content {
  gap: 30px;
  flex-direction: column;
}

.svg-icon {
  color: var(--accent-color);
}

.svg-icon.svg-icon-save {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  color: var(--reverse-accent-color);
}

.svg-icon.svg-icon-ok {
  width: 39px;
  height: 39px;
  flex-shrink: 0;
}

.filter-sepia .card-image {
  filter: sepia(80%);
}

.filter-contrast .card-image {
  filter: contrast(180%);
}
.filter-hue-rotate .card-image {
  filter: hue-rotate(200deg);
}
.filter-saturate-brightness .card-image {
  filter: saturate(30%) brightness(110%);
}
.filter-grayscale .card-image {
  filter: grayscale(50%);
}
.filter-blur .card-image {
  filter: blur(4px);
}
.filter-brightness .card-image {
  filter: brightness(70%);
}
.filter-invert .card-image {
  filter: invert(100%);
}

.card__like-button:focus-visible,
.button-modal:focus-visible {
  outline: none;
  box-shadow: 2px 2px 0 var(--accent-color);
}

.button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--accent-color);
  transform: translateX(-100%);
  transform-origin: left;
  transition: transform 0.5s ease-in-out;
}
.button.card__icon-button::before {
  content: none;
}
.button:hover::before {
  transform: translateX(0);
}

.button .button__text {
  position: relative;
  z-index: 1;
  mix-blend-mode: difference;
}

.button .svg-icon {
  position: relative;
  z-index: 1;
  mix-blend-mode: difference;
}

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

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

.card__icon-button:focus-visible {
  outline: none;
  border: solid 2px var(--accent-color);
}

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

.sparks {
  opacity: 0;
}

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

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

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

.contour {
  /* fast transition */
  transition: fill 0.1s linear;
}

.like-icon {
  transform-origin: center;
}

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

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

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

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

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

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

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

@media (width <= 375px) {
  .header {
    margin-block-end: 100px;
    max-block-size: 327px;
    justify-content: center;
  }

  .button-modal {
    flex-direction: column;
  }

  .svg-icon.svg-icon-save {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
}
