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

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

*/
svg {
  flex-shrink: 0;
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-family-general), Arial, sans-serif;
  background-image:
    repeating-linear-gradient(to left, #d3d3d3 0px 2px, transparent 2px 4px),
    repeating-linear-gradient(to top, #d3d3d3 0px 2px, transparent 2px 4px),
    linear-gradient(to bottom, #e7e7e7 0.01%, #1a1a1a 100%);
  background-size: cover;
  min-inline-size: 320px;
  min-block-size: 100dvb;
  background-attachment: fixed;
}

.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  width: var(--block-width);
  min-height: 368px;
  margin-top: 100px;
  margin-bottom: 100px;
  border: 2px solid #000;
  font-family: var(--font-family-accent), Arial, sans-serif;
  font-weight: 400;
  line-height: 100%;
  letter-spacing: 0;
  text-transform: uppercase;
  background-color: #fff;
}

.header__html {
  font-size: calc(49px + ((clamp(375px, 100vw, 700px) - 375px) / (325 / 16)));
  line-height: calc(49px + ((clamp(375px, 100vw, 700px) - 375px) / (325 / 16)));
}

.header__title {
  font-size: clamp(14px, 2.77vw, 23px);
}

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

.card {
  width: var(--block-width);
  border: 2px solid #000;
  background-color: #fff;
  box-sizing: border-box;
}

.card__title {
  padding: 6px 12px;
  vertical-align: middle;
  font-size: 18px;
  line-height: 100%;
  letter-spacing: 0;
  font-variation-settings:
    "wght" 715,
    "slnt" 0;
}

.image__container {
  position: relative;
}

.card__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
  object-fit: cover;
}

.filter__hue-rotate_grayscale {
  filter: hue-rotate(-90deg) grayscale(0.6);
}

.filter__brightness {
  filter: brightness(200%);
}

.filter__contrast {
  filter: contrast(40%);
}

.filter__blur {
  filter: blur(0.1rem);
}

.filter__opacity {
  filter: opacity(0.9);
}

.filter__grayscale {
  filter: grayscale(0.9);
}

.filter__saturate {
  filter: saturate(140%);
}

.filter__sepia {
  filter: sepia(80%);
}

.card__image-watermark {
  position: absolute;
  top: 25px;
  right: 25px;
  opacity: 50%;
  font-family: var(--font-family-accent), Arial, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 100%;
  letter-spacing: 0;
  text-transform: uppercase;
  mix-blend-mode: hard-light;
  -webkit-text-stroke: 1px #fff;
}

@supports (-webkit-text-stroke: 4px #fff) {
  .card__image-watermark {
    -webkit-text-stroke: 1px #fff;
  }
}

.card__content {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 25px;
  padding: 25px;
}

.card__content div {
  align-self: end;
}

.card__text {
  font-size: 18px;
  line-height: 21px;
  letter-spacing: 0;
  font-variation-settings:
    "wght" 410,
    "slnt" 0;
}

.like__container {
  display: flex;
  flex-direction: row;
  gap: 5px;
  height: 38px;
}

.button__general {
  border: 2px solid #000;
  font-family: var(--font-family-accent), Arial, sans-serif;
  background-color: #fff;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: center;
  position: relative;
  box-shadow: none;
  outline: none;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  cursor: pointer;
  isolation: isolate;
}

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

.button__save {
  flex-direction: row;
  padding: 15px 20px;
}

.button__close {
  width: 100%;
  padding: 10.5px;
  box-sizing: border-box;
}

.button__text {
  font-weight: 400;
  font-size: 14px;
  line-height: 90%;
  letter-spacing: 0;
  white-space: nowrap;
}

.card__icon-button {
  border: 2px solid transparent;
  padding: 0;
  outline: none;
  background: none;
  transition: border 0.3s ease;
  cursor: pointer;
}

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

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

.contour {
  fill: var(--contour-color);
  transition: fill 0.1s linear 0s;
}

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

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

.sparks {
  opacity: 0;
  fill: var(--sparks-color);
}

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

.heart {
  transform-origin: center;
}

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

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

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

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

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

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

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

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

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

.save__container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: var(--block-width);
  margin-bottom: 100px;
}

.button__save:first-child {
  gap: 3.5px;
}

.save__symbol {
  --fill-color: #fff;
  width: 21px;
  height: 21px;
  position: relative;
  z-index: 2;
  fill: var(--fill-color, #fff);
  transition: fill 0.5s ease-in-out;
  mix-blend-mode: difference;
}

.save__dialog-window {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
  width: clamp(341px, (341px + (100vw - 375px) / (1440 - 375) * (353 - 341)), 353px);
  border: 2px solid #000;
  padding: 30px;
  background-color: #fff;
  box-sizing: border-box;
}

dialog:not([open]) {
  display: none;
}

.save__info {
  display: flex;
  width: 100%;
  flex-direction: row;
  align-items: center;
  gap: 20px;
}

.save__dialog-window .save__symbol {
  width: 39px;
  height: 39px;
}

.save__dialog-window .button__text {
  font-size: 14px;
  font-family: var(--font-family-accent), Arial, sans-serif;
  line-height: 150%;
  text-transform: uppercase;
  white-space: wrap;
}

.button__close .button__text {
  line-height: 100%;
  text-transform: uppercase;
}

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

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

.button__general span {
  position: relative;
  z-index: 2;
  color: var(--text-color, #fff);
  mix-blend-mode: difference;
}

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

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

@media (width <= 375px) {
  .header {
    min-height: 327px;
  }

  .button__save {
    flex-direction: column;
  }

  .button__save:first-child {
    gap: 8px;
  }

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

  .save__dialog-window {
    padding: 28px 38px;
  }
}
