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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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(--font-main), sans-serif;
  font-variation-settings: "wght" var(--text-weight);
  background-image: var(--background-gradient);
  background-size: cover;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header {
  inline-size: var(--container-width);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 100px auto;
  padding: var(--header-block-padding) var(--header-inline-padding);
  background-color: #fff;
  border: 2px solid #000;
  font-family: var(--font-accent), sans-serif;

}

.header_content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.header_title {
  font-size: clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem);
  text-transform: uppercase;
  line-height: 100%
}

.header_subtitle {
  font-size: clamp(0.875rem, 0.6769rem + 0.8451vw, 1.4375rem);
  text-transform: uppercase;
  line-height: 100%
}

.main_content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 50px;
}

.card {
  inline-size: var(--container-width);
  min-block-size: auto;
  max-block-size: auto;
  background-color: #fff;
  border: 2px solid #000;
}

.card_title {
  font-variation-settings: "wght" var(--title-weight);
  font-size: 18px;
  margin: 4px 10px;
  line-height: 22px;
}

.card_image_container {
  position: relative;
}

.card_image {
  display: block;
  object-fit: cover;
  object-position: center;
  width: 100%;
  max-width: 696px;
  max-height: 696px;
}

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

@supports ((-webkit-text-stroke: 1px white) or (text-stroke: 1px white)) {

  .label {
    text-shadow: none;
    -webkit-text-stroke: 1px #FFFFFF;
    text-stroke: 1px #FFFFFF;
  }
}

.card_content {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin: 25px;
}

.card_text {
  font-family: var(--font-main), sans-serif;
  font-variation-settings: "wght" var(--text-weight);
  font-size: 18px;
  line-height: 21px;
}

.card_button {
  display: flex;
  justify-content: flex-end;
  margin: 25px
}

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

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

.card__icon-button:focus-visible {
  border-color: #000;
}

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

.button__text {
  font-family: var(--font-accent), sans-serif;
  font-size: 14px;
  line-height: 90%;
  margin: 0 auto;
}

.save_button {
  block-size: 84px;
  padding: 15px 20px;
  margin-bottom: 100px;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dialog[open] {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  gap: 30px 20px;
  min-inline-size: 341px;
  padding: 30px 40px;
  border: 2px solid #000;
}

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

.dialog__icon {
  grid-row: 1;
  grid-column: 1;
  justify-self: start;
  align-self: center;
}

.dialog_command {
  grid-row: 1;
  grid-column: 2;
  margin: 0;
  align-self: center;
  text-transform: uppercase;
  line-height: 150%;
}

.dialog__button {
  grid-row: 2;
  grid-column:  span 2;
  justify-self: stretch;
  align-self: stretch;
  background: transparent;
  block-size: 38px;
}

.dialog__button span {
  text-transform: uppercase;
}

.button {
  border: 2px solid #000;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  cursor: pointer;
}

.button:focus {
  outline: none;
}

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

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

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

.floppy_icon use {
  fill: currentColor;
}

.button__text, .floppy_icon {
  position: relative;
  z-index: 2;
  color: #fff;
  mix-blend-mode: difference;
}



@media (width > 375px) {
  .dialog[open] {
    padding: 30px;
    inline-size: 341px;
  }

  .save_button {
    flex-direction: row;
    block-size: 55px;
  }

  .floppy_icon {
    width: 21px;
    height: 21px;
  }
}

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

.grayscale {
  filter: grayscale(0.8);
}

.brightness {
  filter: brightness(120%);
}

.sepia {
  filter: sepia(0.5);
}

.contrast {
  filter: contrast(3);
}

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

.multi {
  filter: sepia(0.5) blur(3px) saturate(50%);
}

/* Настройки ЛАЙКА */

.sparks {
  opacity: 0;
}

.contour {
  transition: fill 0.1s linear;
}

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

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

.like-icon:hover .core {
  fill: var(--svg-contour-color);
  transition-delay: 0s;
}

.like-icon:hover .main-body {
  fill: var(--svg-contour-color);
  transition-delay: 0.05s;
}

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

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

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

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

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

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

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