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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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" 400;
  background-image: var(--background);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.header {
  inline-size: clamp(375px, calc(30.5154639vw + 260.568px), 700px);
  block-size: clamp(327px, calc(3.84741784vw + 312.57291565px), 368px);
  margin-inline: auto;
  text-align: center;
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  border: 2px solid var(--accent-color);
  margin-block: 100px;
}

.title {
  font-family: var(--accent-font), serif;
  font-size: clamp(0.875rem, 0.6769rem + 0.8451vw, 1.4375rem);
  position: relative;
}

.title-html {
  font-family: var(--accent-font), serif;
  font-size: clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem);
}

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

.card {
  border: 2px solid var(--accent-color);
  inline-size: clamp(375px, calc(30.5154639vw + 260.568px), 698px);
  padding-bottom: 25px;
  position: relative;
}

.card__title {
  padding-inline: 10px;
  padding-block: 3px;
  font-size: 18px;
  font-variation-settings: "wght" 700;
}

.card__image {
  inline-size: clamp(375px, calc(30.51760563vw + 256.55650633px), 696px);
  block-size: clamp(375px, calc(30.51760563vw + 256.55650633px), 696px);
  margin-bottom: 25px;
  position: relative;
  z-index: 1;
}

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

.card__image-label {
  position: absolute;
  top: 25px;
  right: 13px;
  font-size: 14px;
  z-index: 2;
  background: transparent;
  mix-blend-mode: hard-light;
  font-family: var(--accent-font), serif;
  color: var(--accent-color);
  opacity: 0.5;
  text-shadow:
    -1px 0 var(--background-color),
    0 1px var(--background-color),
    1px 0 var(--background-color),
    0 -1px var(--background-color);
}

@supports ((text-stroke: 1px #fff) or (-webkit-text-stroke: 1px #fff)) {
  .card__image-label {
    -webkit-text-stroke: 1px var(--background-color);
    text-stroke: 1px var(--background-color);
    text-shadow: none;
  }
}

.card__content {
  font-size: 18px;
  line-height: 21px;
  padding: 0 25px 0 25px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.like-button-wrapper {
  inline-size: 169px;
  block-size: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  align-self: end;
}

.card__like-button {
  cursor: pointer;
  background-color: transparent;
  font-family: var(--accent-font), serif;
  font-size: 14px;
  line-height: 90%;
  border: 2px solid var(--accent-color);
  display: flex;
  justify-content: center;
  align-items: center;
  block-size: 100%;
  inline-size: 123px;
}

.card__icon-button {
  background: transparent;
  cursor: pointer;
  block-size: 100%;
  border: 2px solid transparent;
}

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

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

.footer {
  margin-inline: auto;
  margin-bottom: 100px;
  margin-top: 50px;
  inline-size: clamp(306px, calc((100vw - 375px) * 29 / 1065 + 306px), 335px);
  border: 2px solid var(--accent-color);
}

.save-button {
  inline-size: 100%;
  background-color: transparent;
  font-family: var(--accent-font), serif;
  font-size: 14px;
  line-height: 90%;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  block-size: 55px;
}

.dialog {
  font-family: var(--accent-font);
  font-size: 14px;
  line-height: 150%;
  text-transform: uppercase;
  inline-size: clamp(341px, calc(339.69px + 0.35vw), 353px);
  block-size: 191px;
  padding-block: 30px;
  padding-inline: 40px;
  background-color: var(--background-color);
  border: 2px solid var(--accent-color);
}

.dialog[open] {
  display: grid;
  grid-template-columns: min-content 1fr;
  grid-template-rows: min-content 1fr;
  gap: 20px;
  align-items: center;
}

.dialog__button {
  font-family: var(--accent-font);
  font-size: 14px;
  text-transform: uppercase;
  line-height: 90%;
  grid-column: span 2;
  inline-size: clamp(257px, calc(244.32px + 0.99vw), 293px);
  block-size: 38px;
  background: transparent;
  border: 2px solid var(--accent-color);
}

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

.first {
  filter: brightness(150%);
}

.second {
  filter: blur(4.0625rem);
}

.third {
  filter: opacity(0.8);
}

.fourth {
  filter: contrast(20%);
}

.fifth {
  filter: grayscale(0.8);
}

.sixth {
  filter: saturate(180%);
}

.seventh {
  filter: sepia(180%);
}

.eight {
  filter: invert(0.8) opacity(0.3);
}

.button {
  background-color: var(--background-color);
  cursor: pointer;
  position: relative;
  z-index: 0;
}

.button:focus {
  outline: none;
}

.button:focus-visible {
  box-shadow: 2px 2px 0px 0px var(--accent-color);
  transition: box-shadow 0.3s ease;
}

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

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

.button__text {
  color: var(--background-color);
  mix-blend-mode: difference;
  position: relative;
  z-index: 2;
}

.save-button svg {
  color: var(--background-color);
  position: relative;
  z-index: 2;
  mix-blend-mode: difference;
}

.sparks {
  opacity: 0;
}

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

.card__icon-button:hover .core {
  fill: var(--contour-color);
  transition: fill 0.3s linear;
}

.card__icon-button:active .core {
  fill: var(--animation-fill-color);
  transition: fill 0.3s linear;
}

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

.card__icon-button:hover .main-body {
  fill: var(--contour-color);
  transition: fill 0.3s 0.05s linear;
}

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

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

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

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

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

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

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

@media (width <= 375px) {
  .header,
  .card,
  .card__image {
    inline-size: 100dvi;
  }

  .save-button {
    block-size: 84px;
    flex-direction: column;
  }
}
