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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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(--font-weight-card-text);
  font-size: 18px;
  color: #000;
  background-image: var(--background-gradient);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

.header {
  padding-block: 100px 94px;
}

.header__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border: 2px solid #000;
  background-color: #fff;
  padding: clamp(120px, 15vh, 130px) clamp(16px, 8vw, 122.5px);
}

.container {
  margin-inline: auto;
  inline-size: clamp(375px, 48.6%, 700px);
}

.header__logo {
  font-family: var(--font-accent), fantasy;
  font-weight: 400;
  font-size: clamp(3.0625rem, 2.1975rem + 2.0725vw, 4.0625rem);
  text-transform: uppercase;
}

.header__title {
  font-family: var(--font-accent), fantasy;
  font-weight: 400;
  font-size: clamp(0.875rem, 0.3881rem + 1.1658vw, 1.4375rem);
  text-transform: uppercase;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 46px;
  height: fit-content;
}

.card {
  border: 2px solid #000;
  background-color: #fff;
}

.card__title {
  font-variation-settings: 'wght' var(--font-weight-card-title);
  font-size: 18px;
  padding: 4px 10px;
}

.card__image-wrapper {
  position: relative;
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
}

.card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.card__image-watermark {
  position: absolute;
  top: 27px;
  right: 25px;
  font-family: var(--font-accent), fantasy;
  font-weight: 400;
  font-size: 14px;
  text-transform: uppercase;
  opacity: 0.5;
  mix-blend-mode: hard-light;
  -webkit-text-stroke: 1px var(--watermark-color);
  text-shadow:
    1px 1px 0 var(--watermark-color),
    -1px -1px 0 var(--watermark-color),
    1px -1px 0 var(--watermark-color),
    -1px 1px 0 var(--watermark-color);
}

@supports (text-stroke: 1px var(--watermark-color)) {
  .card__image-watermark {
    text-stroke: 1px var(--watermark-color);
    text-shadow: none;
  }
}

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

.filter-saturate {
  filter: saturate(300%);
}

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

.filter-invert {
  filter: invert(0.8);
}

.filter-sepia {
  filter: sepia(90%);
}

.filter-blur {
  filter: blur(0.8rem);
}

.filter-hue-rotate {
  filter: hue-rotate(100deg) saturate(80%) opacity(0.7);
}

.card__content {
  display: flex;
  flex-direction: column;
  gap: 25px;
  background-color: #fff;
  padding: 25px;
}

.card__text {
  display: flex;
  flex-direction: column;
  gap: 25px;
  line-height: 117%;
}

.card__buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.card__icon-button {
  height: 38px;
  width: 40px;
  padding-inline: 0px;
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__like-button {
  width: 130px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.button {
  border: 2px solid #000;
  font-family: var(--font-accent), fantasy;
  font-weight: 400;
  font-size: 14px;
  line-height: 90%;
  color: #000;
  background: #fff;
  transition: box-shadow 0.3s ease;
  position: relative;
  z-index: 1;
  cursor: pointer;
}

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

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

.button:hover::before {
  transform: scaleX(1);
}

.button__text,
.save-controls__save-button .floppy {
  mix-blend-mode: difference;
  z-index: 1;
  color: #fff;
}

.save-controls {
  padding-block: 50px 98px;
  display: flex;
  justify-content: center;
}

.save-controls__save-button {
  width: 335px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #fff;
}

.modal[open] {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  inline-size: 357px;
  max-inline-size: 100%;
}

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

.modal__container {
  display: flex;
  gap: 20px;
  align-items: center;
}

.modal__text {
  font-family: var(--font-accent), fantasy;
  font-weight: 400;
  font-size: 14px;
  line-height: 150%;
  text-transform: uppercase;
  max-inline-size: 14em;
}

.modal__button {
  text-transform: uppercase;
  padding: 12.5px 0;
}

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

.modal__container .floppy {
  width: 39px;
  height: 39px;
}

.sparks {
  opacity: 0;
}

.contour {
  fill: var(--contour-color);
  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 {
  cursor: pointer;
}

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

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

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

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

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

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

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

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

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

@media (width <= 375px) {
  .header {
    padding-block: 100px 100px;
  }

  .main {
    gap: 48px;
  }

  .save-controls__save-button {
    width: 306px;
    height: 84px;
    flex-direction: column;
  }

  .floppy {
    width: 28px;
    height: 28px;
  }
}