/* stylelint-disable rule-empty-line-before */
/* Здесь вы напишете основную часть стилей страницы.

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

*/

.page {
  min-inline-size: 320px;
  display: grid;
  justify-self: center;
  gap: 100px;
  min-block-size: 100dvb;
  font-family: var(--font-main);
  font-weight: var(--font-weight-text);
  font-variation-settings: 'wght' var(--font-weight-text);
  background-image: var(--page-background);
  background-size: cover;
  background-attachment: fixed;
}

.header {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-accent);
  margin-top: 100px;
  background-color: #fff;
  width: var(--header-width);
  height: var(--header-height);
  border: 2px solid #000;
}

.logo-group {
  display: flex;
  gap: 20px;
  flex-direction: column;
  align-items: center;
}

.header__logo {
  font-size: clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem);
}

.header__title {
  font-size: clamp(0.875rem, 0.6769rem + 0.8451vw, 1.4375rem);
  text-transform: uppercase;
}

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

.card-list {
  display: grid;
  gap: 50px;
}

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

.card__title {
  padding: 4px 10px;
  font-size: 18px;
  font-variation-settings: "wght" 715;
}

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

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

.card__label {
  position: absolute;
  top: 25px;
  right: 25px;
  opacity: 0.5;
  mix-blend-mode: hard-light;
  font-family: var(--font-accent), monospace; /* или другой пиксельный */
  font-size: 14px;
  text-transform: uppercase;
}

@supports (-webkit-text-stroke: 1px white) {
  .card__label {
    color: black;
    -webkit-text-stroke: 1px var(--label-stroke-color);
  }
}

@supports not (-webkit-text-stroke: 1px white) {
  .card__label {
    color: black;
    text-shadow: -1px -1px 0 var(--label-stroke-color),
      1px -1px 0 var(--label-stroke-color), -1px 1px 0 var(--label-stroke-color),
      1px 1px 0 var(--label-stroke-color);
  }
}

.content__text {
  padding: 25px 25px 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 117%;
}

.card__buttons {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  align-items: center;
  margin: 22px 25px 24px 0;
}

.card__icon-button {
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;

  border: 2px solid transparent;

  transition: border-color 0.3s ease;
  outline: none;
}

.card__like-button {
  background: transparent;
  font-family: var(--font-accent);
  border: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.button__text {
  font-family: var(--font-accent);
  font-size: 14px;
  line-height: 90%;
  position: relative;
  mix-blend-mode: difference;
  color: white;
  transition: color 0.3s ease;
}

.card__button-text--like {
  padding: 10px 35px;
}

.main__save-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: clamp(306px, 296px + 2.72vw, 335px);
  margin-bottom: 100px;
  background-color: #fff;
}

.main__icon-save {
  margin-top: 17px;
  mix-blend-mode: difference;
  color: #fff;
  position: relative;
  z-index: 1;
  fill: currentColor;
}

.button__text--save {
  padding-bottom: 17px;
}

.modal {
  display: none;
  padding: 0;
  border: 2px solid #000;
  width: clamp(341px, 341px + 1.127vw, 353px);
  text-transform: uppercase;
}

.modal[open] {
  display: grid;
  gap: 30px;
  padding: 28px;
}

.modal__content {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 20px;
  font-family: var(--font-accent);
  font-size: 14px;
  line-height: 150%;
}

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

.modal__button {
  border: 2px solid #000;
  background: transparent;
  padding: 7.25px 0;
}

.filter-grayscale {
  filter: grayscale(100%);
}

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

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

.filter-brightness {
  filter: brightness(120%);
}

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

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

.filter-multi-color {
  filter: invert(80%) sepia(30%) hue-rotate(180deg) saturate(150%);
}

.filter-blur-brightness {
  filter: blur(1px) brightness(110%);
}

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

.card__icon-button:focus-visible {
  border-color: #000;
}

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

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

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

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

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

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

.sparks {
  opacity: 0;
}

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

.like-icon: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 {
  transform-origin: center;
  animation: heart-scale 0.3s ease-in 0.1s 1;
}

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

.button {
  border: 2px solid #000;
  transition: box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

.button::before {
  content: '';
  position: absolute;
  inset: 0;

  background-color: black;

  transform: scaleX(0);
  transform-origin: left;

  transition: transform 0.5s ease-in-out;
}

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

@media (width >= 1440px) {
  .main__save-button {
    flex-direction: row;
    align-items: center;
  }

  .main__icon-save {
    margin: 17px 0;
    width: 21px;
    height: 21px;
  }

  .button__text--save {
    padding: 0;
  }
}
