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

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

*/

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}

.page {
  padding-inline: var(--content-padding);
  font-family: var(--font-main), sans-serif;
  background-image: var(--background-gradient);
  background-size: cover;
  background-attachment: fixed;
  min-inline-size: 320px;
  min-block-size: 100dvb;
  font-variation-settings: "wght" var(--font-weight-text);
}

.block-width-limiter {
  margin: 0 auto;
  inline-size: var(--container-width);
}

.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  box-sizing: content-box;
  margin-block-start: 99px;
  margin-block-end: 95px;
  border: 2px solid #000;
  padding-block: clamp(7.5rem, 0.939vw + 7.28rem, 8.125rem);
  background-color: #fff;
}

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

.logo {
  font-family: var(--font-accent), fantasy;
  font-weight: var(--font-weight-main);
  font-size: clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem);
}

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

.card__image {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
}

.card__label {
  position: absolute;
  top: 26px;
  right: 25px;
  opacity: 0.5;
  color: rgba(0, 0, 0);
  font-family: var(--font-accent), fantasy;
  font-size: 14px;
  text-shadow: -1px 0 var(--text-shadow-color), 0 1px var(--text-shadow-color),
    1px 0 var(--text-shadow-color), 0 -1px var(--text-shadow-color);
  mix-blend-mode: hard-light;
}

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

.content {
  display: flex;
  flex-direction: column;
  gap: 50px;
  margin-block-end: 50px;
}

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

.card__description > p:first-child {
  margin-bottom: 25px;
}

.card__title {
  padding: 4px 10px;
  font-family: var(--font-main), sans-serif;
  font-size: 18px;
  font-variation-settings: "wght" var(--font-weight-title);
}

.card__description {
  padding: 25px;
  font-family: var(--font-main), sans-serif;
  font-size: 18px;
  line-height: 21px;
}

.filter-contrast-brightness {
  filter: contrast(2) brightness(200%);
}

.filter-sepia {
  filter: sepia(0.9);
}

.filter-hue-rotate {
  filter: hue-rotate(210deg);
}

.filter-saturate-contrast {
  filter: saturate(0.2) contrast(1.3);
}

.filter-grayscale-contrast {
  filter: grayscale(1) contrast(1.3);
}

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

.filter-hue-rotate-opacity {
  filter: hue-rotate(110deg) opacity(0.3);
}

.buttons {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding-right: 25px;
  padding-bottom: 25px;
}

.card__like-button {
  width: 130px;
  border: 2px solid #000;
  padding: 10px 0px 6px;
  background-color: transparent;
  cursor: pointer;
}

.save-button {
  align-items: center;
  gap: 8px;
  margin: 0 auto 100px;
  padding-top: 15px;
  padding-right: 18px;
  padding-bottom: 15px;
  padding-left: 18px;
  background-color: #fff;
}

.submit-button {
  grid-column: span 2;
  border: 2px solid #000;
  padding-top: 10px;
  padding-bottom: 10px;
  background-color: #fff;
}

.button {
  position: relative;
  color: var(--button-text-color);
  transition: box-shadow 0.3s ease;
  display: flex;
  justify-content: center;
}

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

.button:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--accent-color);
  transition: transform 0.5s ease-in-out;
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.button:hover {
  color: var(--button-text-color);
}

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

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

.floppy__icon {
  fill: currentColor;
  align-self: center;
}

.button__text {
  font-family: var(--font-accent, "PressStart2P"), fantasy;
  font-size: 14px;
  text-align: center;
}

.button__text_uppercase {
  text-transform: uppercase;
}

.card__icon-button {
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: content-box;
  max-height: 34px;
  border: 2px solid transparent;
  padding: 0;
  background-color: transparent;
  transition: border-color 0.3s ease;
}

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

.card__icon-button:focus-visible {
  border-color: var(--accent-color);
}

.modal {
  display: none;
  grid-template-columns: 39px 234px;
  gap: 30px 20px;
  border: 2px solid #000;
  padding: 28px;
}

.modal[open] {
  display: grid;
}

.modal::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
}

.modal_title {
  line-height: 21px;
  text-align: left;
  text-transform: uppercase;
}

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

.floppy__icon_fixed {
  width: 39px;
  height: 39px;
}

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

.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:hover .core {
  fill: var(--accent-color);
  transition-delay: 0s;
}

.like-icon:hover .main-body {
  fill: var(--accent-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 .contour {
  fill: var(--animation-fill-color);
  transition: fill 0.3s linear 0.06s;
}

.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 {
  animation: heart 0.3s ease-in 0.1s 1;
}

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

@media (width <= 375px) {
  .header {
    box-sizing: border-box;
    margin-block-start: 100px;
    margin-block-end: 100px;
  }

  .save-button {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

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

  .modal {
    grid-template-columns: 39px 202px;
    padding: 30px 36px;
  }
}
