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

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

*/

.page {
  display: flex;
  min-inline-size: 320px;
  min-block-size: 100vh;
  font-family: var(--main-font-family, sans-serif);
  font-variation-settings: "wght" var(--weight-card-text);
  background-image: var(--background-image);
  background-color: var(--background-color);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  flex-direction: column;
  align-items: center;
}

.header {
  font-family: var(--accent-font-family, sans-serif);
  display: grid;
  justify-content: center;
  background-color: white;
  padding: clamp(7.5rem, 7.3239rem + 0.7512vw, 8rem);
  border: var(--accent-color) solid 2px;
  margin-block-start: 100px;
  margin-block-end: 100px;
  width: clamp(23.438rem, 16.285rem + 30.52vw, 43.75rem);
  justify-self: center;
}

.header__title {
  font-size: clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem);
  line-height: 100%;
}

.header__subtitle {
  font-size: clamp(0.875rem, 0.6769rem + 0.8451vw, 1.4375rem);
  justify-self: center;
  padding-block-start: 20px;
  text-transform: uppercase;
  line-height: 100%;
}

.content {
  display: grid;
  justify-items: center;
  gap: 50px;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.card {
  background-color: var(--background-color);
  border: 2px solid var(--accent-color);
  width: clamp(23.438rem, 16.285rem + 30.52vw, 43.75rem);
}

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

.card__text {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 25px 26px 25px 25px;
  inline-size: 100%;
  font-family: var(--main-font-family, sans-serif);
  font-size: 18px;
  line-height: 21px;
}

.card__img {
  position: relative;
}

.card__img-label {
  position: absolute;
  font-family: var(--accent-font-family, fantasy);
  z-index: 1;
  inset-inline-end: 23px;
  inset-block-start: 27px;
  text-shadow: 0 0 1px var(--background-color);
  font-size: 14px;
  line-height: 100%;
  text-transform: uppercase;
  mix-blend-mode: hard-light;
  opacity: 0.5;
}

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

.card__actions {
  display: flex;
  justify-content: end;
  gap: 4px;
  padding: 0 25px 25px;
}

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

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

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

.button__text {
  position: relative;
  font-family: var(--accent-font-family, fantasy);
  font-size: 14px;
  font-weight: var(--weight-card-text);
  color: var(--button-color);
  mix-blend-mode: difference;
  z-index: 2;
}

.btn {
  position: relative;
  min-block-size: 38px;
  background-color: white;
  border: 2px solid black;
  border-radius: 0;
  transition: box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
}

.btn::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  transform-origin: 0 center;
  transform: scale(0, 1);
  block-size: 100%;
  inline-size: 100%;
  background-color: black;
  transition: transform 0.5s ease-in-out;
  z-index: 1;
}

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

.btn:focus-visible {
  outline: none;
  box-shadow: 2px 2px 0 black;
}

.btn:hover:before {
  transform: scale(1, 1);
}

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

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

.contour {
  transition: fill 0.1s linear;
}

.core {
  transition-delay: 0s;
  animation-name: sizing;
  transition: fill 0.3s 0.03s linear;
}

.like-icon .contour {
  fill: black;
  transition: fill 0.3s 0.06s linear;
}

.like-icon .main-body {
  transition: fill 0.3s linear;
  fill: white;
}

.like-icon .sparks {
  opacity: 0;
}

.like-icon:hover .main-body {
  fill: black;
  transition-delay: 0.05s;
}

.like-icon:hover .core {
  fill: black;
  transition-delay: 0s;
}

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

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

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

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

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

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

.like-icon.is-liked .sparks {
  fill: var(--animation-like-color);
  animation: sparking 0.3s 0.3s ease-in;
  opacity: 0;
  animation-fill-mode: backwards;
}

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

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

.button-container {
  text-align: center;
}

.save-btn {
  inline-size: clamp(306px, calc(306px + 0.0272 * (100vw - 375px)), 335px);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 100px;
  gap: 8px;
  block-size: 55px;
  padding: 16px 1px 15px 0;
}

.button__icon {
  color: black;
  z-index: 1;
  position: relative;
  display: block;
  mix-blend-mode: normal;
  block-size: clamp(1.3125rem, 1.904rem + -0.6573vw, 1.75rem);
  inline-size: clamp(1.3125rem, 1.904rem + -0.6573vw, 1.75rem);
}

.btn:hover .button__icon {
  fill: white;
}

.save-btn .floppy-icon {
  filter: invert(0%);
  transition: filter 0.3s ease;
  z-index: 2;
}

.save-btn:hover .floppy-icon {
  filter: invert(100%);
}

.dialog-window {
  font-family: var(--accent-font-family, fantasy);
  font-size: 14px;
  line-height: 150%;
  text-transform: uppercase;
  align-self: start;
  display: flex;
  justify-content: start;
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap;
  background-color: white;
}

.dialog-window__icon {
  fill: var(--button-color);
  min-inline-size: 39px;
}

.dialog-window__text {
  /* inline-size: auto;
  margin-inline-start: 20px;
  line-height: 21px; */
  line-height: 150%;
  max-inline-size: min(calc(100vi * 0.9), 234px);
}

.dialog-window__close-btn {
  text-transform: uppercase;
  inline-size: 100%;
  margin-top: 30px;
}

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

.filter-drop-shadow {
  filter: drop-shadow(10px 30px 6px rgba(0, 0, 0, 0.5));
}

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

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

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

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

.filter-blur {
  filter: hue-rotate(180deg) blur(0.15rem);
}

#dialog::backdrop {
  background-color: var(--backdrop-background-color);
}

#dialog {
  padding: 30px 40px 30px 40px;
}

@media (width < 376px) {
  .header {
    margin-block-end: 100px;
  }

  .card__title {
    line-height: 120%;
    padding-block: 4px 4px;
  }

  .card__text {
    gap: 25px;
  }

  .save-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* padding: 17px 20px; */
    inline-size: 90%;
    max-inline-size: 306px;
    block-size: auto;
    box-sizing: border-box;
    width: 306px;
  }

  .save-btn .floppy-icon {
    display: block;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
  }

  .save-btn .button__text {
    margin: 0;
    line-height: 1.2;
    font-size: 14px;
    text-align: center;
    white-space: normal;
  }

  .button__icon {
    width: 30px;
    height: 30px;
  }

  .floppy-icon {
    display: inline-block;
  }

  #dialog {
    min-inline-size: 92%;
    padding-block: 30px;
  }
}
