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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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" var(--main-font-weight-normal);

  background-image: var(--grid-gradient);
  background-attachment: fixed;
  background-size: cover;

  margin: 102px auto;
}

.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.logo-container {
  margin-bottom: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;

  font-family: var(--accent-font), fantasy;
  background-color: #fff;
  border: 2px solid #000;
  width: var(--width-main);
  padding-top: clamp(7.5rem, 7.28rem + 0.939vw, 8.125rem);
  padding-bottom: clamp(7.5rem, 7.28rem + 0.939vw, 8.125rem);
}

.logo-title {
  font-size: clamp(3.063rem, 2.71rem + 1.502vw, 4.063rem);
}

.logo-text {
  text-transform: uppercase;
  font-size: clamp(0.875rem, 0.677rem + 0.845vw, 1.438rem);
}

.main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: var(--main-font), sans-serif;
  gap: 50px;
}

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

.card-header {
  padding: 4px 10px;
  font-size: 18px;
  font-variation-settings: "wght" var(--main-font-weight-bold);
}

.card-image-container {
  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;
  aspect-ratio: 1 / 1;
}

.card-image-label {
  position: absolute;
  top: 25px;
  right: 25px;
  opacity: 0.5;
  font-family: var(--accent-font), fantasy;
  font-weight: var(--main-font-weight-normal);
  font-size: 14px;
  text-shadow: 0 0 1px var(--lable-outline);
  mix-blend-mode: hard-light;
}

@supports (-webkit-text-stroke: 1px var(--lable-outline)) {
  .card-image-label {
    -webkit-text-stroke: 1px var(--lable-outline);
    text-shadow: none;
  }
}

.card-content-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 25px;
  font-size: 18px;
  line-height: 21px;
  font-variation-settings: "wght" var(--main-font-weight-normal);
}

.card-buttons-container {
  display: flex;
  justify-content: end;
  gap: 4px;
}

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

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

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

.sparks {
  opacity: 0;
}

.contour {
  fill: #000;
  transition: fill 0.1s linear 0s;
}
.core {
  transition: fill 0.3s linear 0.03s;
  fill: #fff;
}
.main-body {
  transition: fill linear 0.3s;
  fill: #fff;
}

.heart:hover .core {
  fill: #000;
  transition: fill 0.3s linear 0s;
}

.heart:hover .main-body {
  fill: #000;
  transition: fill 0.3s linear 0.05s;
}

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

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

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

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

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

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

.button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  border: 2px solid #000;
  background-color: #fff;
  transition: box-shadow 0.3s ease;
  cursor: pointer;
}

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

.button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: #000;
  transition: width 0.5s ease-in-out;
}

.button:hover::before {
  width: 100%;
}

.button__text {
  position: relative;
  font-family: var(--accent-font), fantasy;
  font-weight: var(--accent-font-weight);
  font-size: 14px;
  line-height: 90%;
  color: #fff;
  mix-blend-mode: difference;
  text-wrap-mode: nowrap;
}

.button .button__text {
  transition: color 0.5s ease-in-out;
}

.button:hover .button__text {
  color: #fff;
}

.save-button {
  gap: 8px;
  padding: 15px 18px;
}

.floppy-icon {
  color: #fff;
  width: 21px;
  height: 21px;
  mix-blend-mode: difference;
}

.dialog[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;

  border: solid 2px #000;
  padding: 30px;
  background-color: #fff;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(21.313rem, 21.048rem + 1.127vw, 22.063rem);
  margin: 0;
}

.dialog[open] .dialog-container {
  display: flex;
  flex-direction: row;
  justify-content: left;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.dialog[open] .floppy-icon {
  width: 39px;
  height: 39px;
  flex-shrink: 0;
}

.dialog-text {
  font-family: var(--accent-font), fantasy;
  font-size: 14px;
  font-variation-settings: "wght" var(--accent-font-weight);
  text-transform: uppercase;
  line-height: 150%;
}

.dialog-button {
  height: 38px;
  width: 100%;
  text-transform: uppercase;
}

.dialog::backdrop {
  background-color: rgba(0, 0, 0, 1);
  opacity: 0.75;
}

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

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

.filter-smurf-color {
  filter: blur(1.4px) contrast(2.3) brightness(1.3) grayscale(0.58)
    hue-rotate(197deg) saturate(1.4);
}

.filter-accent-blue {
  filter: blur(1.6px) grayscale(0.23) hue-rotate(20deg) invert(0.12)
    saturate(2.3) contrast(2.8) sepia(0.08) brightness(0.6);
}
.filter-accent-fire {
  filter: contrast(3) blur(10px) saturate(3);
}
.filter-neon-invert {
  filter: contrast(3) blur(2.4px) saturate(3) brightness(0.5);
}
.filter-hue {
  filter: hue-rotate(225deg);
}
.filter-opacity {
  filter: blur(3px);
}

@media (width <= 376px) {
  .save-button {
    flex-direction: column;
    min-height: 84px;
    width: 306px;
  }

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