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

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

*/

.page {
  position: relative;
  z-index: 1;
  min-inline-size: 320px;
  min-block-size: 100dvb;
  font-family: var(--main-font-family, "Inter-Variable"), Arial, sans-serif;
  font-variation-settings: var(--main-font-weight-card);
  color: var(--accent-color, #000);
  padding-block-start: 100px;
  background-attachment: fixed; /*новое*/
  background-color: var(--background-color-main, #fff);
  background-image: var(--page-background-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.header {
  display: grid;
  max-height: 427px;
  font-family: var(--accent-font-family, "PressStart2P"), Arial, sans-serif;
  text-transform: uppercase;
  line-height: normal;
  padding-inline: 0; /* обнуляю горизонтальный паддинг */
}

/*пересмотреть высоту на декстопе*/
.header__card {
  display: flex; /* использую flexbox для простоты центрирования */
  flex-direction: column;
  justify-content: center; /* центрирую содержимое по вертикали */
  align-items: center; /* центрирую по горизонтали */
  margin-inline: auto;
  inline-size: 100%;
  width: 100%;
  text-align: center;
  gap: 20px;
  border: 2px solid var(--accent-color, #000);
  background: var(--background-color-main, #fff);
  max-inline-size: 700px;
  max-width: 375px;
  margin-block-end: 100px;
  padding: 122px 16px; /* вертикальные отступы, чтобы контент не прилипал к краям */
}

/* надпись html; адаптивный заголовок, но не подходит для планшетов!!*/
.logo__header {
  font-size: clamp(49px, calc(49px + (65 - 49) * ((100vw - 375px) / (1024 - 375))), 65px);
  margin: 0;
  padding-inline: 20px;
}

.logo__header:focus {
  outline: none;
}

/* надпись закрывающий тег; адаптивный заголовок */
.header__title {
  font-size: clamp(14px, calc(14px + (23 - 14) * ((100vw - 375px) / (1024 - 375))), 23px);
  margin: 0;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.content {
  position: relative;
  z-index: 1;
}

.content__cards-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  gap: 50px;
  list-style: none;
}

.content__cards-list-item {
  background: var(--background-color-main, #fff);
}

.card {
  display: flex;
  max-width: 375px;
  flex-direction: column;
  border: 2px solid var(--accent-color, #000);
}

.card__title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 10px;
  font-family: var(--main-font-family, "Inter-Variable"), Arial, sans-serif;
  word-break: normal;
  font-size: 1.125rem;
  line-height: normal;
  text-align: left;
  font-weight: 715;
  border-block-end: 2px solid var(--accent-color, #000);
}

.card__image-wrapper {
  position: relative;
  margin: 0;
  min-height: 371px; /* изменить значение на 696 для декстопа */
}

/* здесь должен быть селектор для лейбла */
.card__label {
  position: absolute;
  z-index: 1;
  opacity: 0.5;
  mix-blend-mode: hard-light;
  font-size: 14px;
  font-family: var(--accent-font-family, "PressStart2P"), Arial, sans-serif;
  color: var(--accent-color, #000);
  line-height: normal;
  inset-inline-end: 25px; /* отступ от конечного края строчной оси */
  inset-block-start: 25px;
  text-shadow: -1px 0 var(--text-stroke-color), 0 1px var(--text-stroke-color), 1px 0 var(--text-stroke-color), 0 -1px var(--text-stroke-color);
}

/* запрос возможностей; инструмент progressive enhancement*/
@supports ((-webkit-text-stroke: 1px var(--text-stroke-color, #fff)) or (text-stroke: 1px var(--text-stroke-color, #fff))) {
  .card__label {
    /*изм название селектора*/
    -webkit-text-stroke: 1px var(--text-stroke-color, #fff);
    text-shadow: none; /*добавлено*/
  }
}

.card-image {
  display: block; /* делаем блочным элементом */
  object-fit: cover; /* изображен будет полностью покрывать область контейнера */
  object-position: center; /* ценрирую изображение */
  inline-size: 100%; /* займет 100% ширины родителя */
  block-size: 100%; /* 100% высоты родителя */
  border-block-end: 2px solid var(--accent-color, #000); /* рисую нижнюю границу */
  aspect-ratio: 1 / 1; /* всегда квадратное изображение */
}

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

.filter-invert {
  filter: invert(0.1) grayscale(10%);
}

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

.filter-blur {
  filter: blur(2px);
}

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

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

.card__conten {
  display: flext;
  flex-direction: column;
}

.card__content-text {
  display: grid;
  gap: 28px;
  padding: 25px;
  font-size: 18px;
  line-height: 21px;
}

.card__paragraph {
  text-align: start;
  word-wrap: normal;
}

.card__content-buttons {
  display: flex;
  justify-content: end; /* по главной оси */
  align-items: stretch; /* по поперечной оси */
  padding: 0 25px 25px 0;
  border-bottom: 0px solid var(--accent-color, #000);
  gap: 5px;
}

.card__icon-button {
  display: flex;
  min-width: 43px;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

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

.like-icon {
  position: relative;
  border: 2px solid transparent;
  padding: 0;
  font-family: var(--accent-font-family, "PressStart2P"), Arial, sans-serif;
  font-size: 14px;
  background: var(--background-color-main, #fff);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 12.6px;
  overflow: hidden;
}

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

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

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

.sparks {
  opacity: 0;
}

.is-liked .contour {
  fill: var(--animation-fill-core, #ff0000);
}

.button {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--accent-color, #000);
  font-family: var(--accent-font-family, "PressStart2P"), Arial, sans-serif;
  font-size: 14px;
  color: var(--accent-color, #000);
  background: var(--background-main-color, #fff);
  transition: box-shadow 0.3s ease;
  cursor: pointer;
  overflow: hidden;
  line-height: 12.6px;
  transition: color 0.5s ease-in-out, background-color 0.5s ease-in-out;
}

.button:focus {
  outline: none;
}

/*!добавлено после третьего ревью*/
.button:focus-visible {
  box-shadow: 2px 2px 0 var(--accent-color, #000);
}

/* общие стили для текста внутри кнопок */
.button__text {
  /* ! объединенный класс для текста кнопок */
  line-height: 90%;
  font-family: var(--accent-font-family, "PressStart2P"), Arial, sans-serif;
  font-size: 14px;
}

/*стили для кнопки like*/
.card__like-button {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 130px;
  padding: 0;
  min-height: 38px;
  line-height: 38px;
  /*добавлено после третьего ревью*/
  background-color: var(--background-main-color, #fff); /* белый фон */
  color: var(--accent-color, #000); /* чёрный текст */
  border: 1px solid currentColor; /* чёрный контур */
}

/*селектор добавлен после третьего ревью*/
.card__like-button:hover {
  background-color: var(--accent-color, #000); /* Чёрный фон */
  color: var(--background-main-color, #fff); /* Белый текст */
}

/* стили для кнопки "Сохранить на память" */
.button--save {
  /* ! стилизация кнопки сохранения */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column; /* оставляем вертикальное расположение */
  max-height: 84px; /* возвращаем исходную высоту */
  max-width: 306px;
  margin: 0 auto; /* центрируем кнопку */
  gap: 8px;
  padding: 17px 20px 17px; /* устанавливаем padding: 20px сверху/снизу, 17px слева/справа */
  margin-top: 50px;
  margin-bottom: 100px;
}

.button--save .button__text {
  line-height: 90%;
  font-family: var(--accent-font-family);
  font-size: 14px;
  white-space: nowrap; /* добавляем это свойство, чтобы текст не переносился */
  border: transparent;
}

/* Стили для иконок внутри кнопок */
.button__icon {
  /* ! общий класс для иконок кнопок */
  height: 28px;
  max-width: 28px;
  padding: 0;
  fill: var(--blend-content-color, #fff);
  mix-blend-mode: difference;
}

.modal[open] {
  position: fixed;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px 40px;
  background-color: var(--background-main-color, #fff);
  border: 2px solid var(--accent-color, #000);
  max-width: 341px;
  max-height: 191px;
  overflow-y: hidden;
  overflow-x: hidden;
}

.modal::backdrop {
  background-color: rgb(0 0 0 / 0.75); /* opacity создаю */
}

.modal__content {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding-bottom: 20px;
}

.modal-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 20px;
}

.modal__icon { /*вчера иконки отображались в live server, сегодня уже нет, хотя ничего не трогала, надеюсь так только на моем пк*/
  flex-shrink: 0;
  height: 39px;
  width: 39px;
  padding: 0;
  fill: var(--blend-content-color, #fff);
  mix-blend-mode: difference;
}

.modal__title {
  margin: 0;
  padding-left: 0;
  line-height: 150%;
  font-family: var(--accent-font-family, "PressStart2P"), Arial, sans-serif;
  font-size: 14px;
  color: inherit;
  text-transform: uppercase;
  max-width: 234px; /*добавила*/
}

/* стили для кнопки в модальном окне */
.modal__button {
  min-height: 38px;
  min-width: 261px;
}

/* стили для текста кнопки в модальном окне */
.modal__button-text {
  /* ! Стилизация текста модальной кнопки */
  color: inherit;
  text-transform: uppercase;
}

.blend-botton {
  position: relative;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .header {
    max-height: 468px;
  }

  .header__card {
    max-width: 700px;
    padding: 130px 122.5px;
    font-size: clamp(18px, 2vw, 26px);
  }

  .logo__header {
    font-size: 65px;
  }

  .card {
    max-width: 700px;
  }

  .modal[open] {
    max-width: 353px;
    padding: 30px;
  }

  .button--save {
    flex-direction: row; /* иконка теперь будет слева от текста */
    max-width: 355px; /* устанавливаем ширину 355px */
    min-height: 55px; /* Устанавливаем высоту 55px */
    padding: 13.5px 19px;
    font-size: 14px;
  }

  .button__icon {
    /* ! адаптация иконки кнопки для десктопа */
    width: 21px;
    height: 21px;
    padding: 0;
  }

  .modal-content {
    padding: 30px;
  }

  .modal-flex {
    gap: 20px;
  }

  .modal__icon {
    height: 39px;
    width: 39px;
  }

  .modal__button {
    min-width: 293px;
  }
}
