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

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

Кроме этого, не меняйте HTML переключателя тем. Его разметка также гарантирует работу своего скрипта.

*/

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

.filter-multiple {
  filter: contrast(50%) hue-rotate(35deg) saturate(130%);
}

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

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

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

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

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

.page {
  padding-block-start: 100px;
  color: var(--text-color, #000000);
  font-family: var(--page-main-font-family, "Inter", sans-serif);
  background-color: var(--page-background-color, #ffffff);
  background-image: var(--page-background-image, none);
  background-size: cover;
  background-attachment: fixed;
  font-variation-settings: "wght" var(--page-main-font-weight, 400);
  min-inline-size: 320px;
  min-block-size: 100dvb;
}

.page__header {
  margin-block-end: 100px;
}

.modal {
  border: 2px solid var(--text-color, #000000);
  padding: 25px 30px;
  color: var(--text-color, #000000);
  font-family: var(--page-accent-font-family, "PressStart2P", fantasy);
  line-height: 1.5;
  text-transform: uppercase;
  background: var(--page-background-color, #ffffff);
  max-inline-size: 355px;
}

.modal[open] {
  display: grid;
  /* Safari fix */
  grid-template-rows: repeat(2, min-content);
  gap: 30px;
}

.modal::backdrop {
  opacity: 0.75;
  background: var(--color-black, #000000);
}

.modal__content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal__icon {
  flex-shrink: 0;
  inline-size: 39px;
  block-size: 39px;
}

.modal__button {
  inline-size: 100%;
}

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

.header {
  display: grid;
  justify-items: center;
  justify-content: center;
  font-family: var(--page-accent-font-family, "PressStart2P", fantasy);
  padding-bottom: 128px;
  line-height: normal;
  text-transform: uppercase;
}

.header__title {
  margin-block-start: clamp(7.5rem, 7.1479rem + 1.5023vw, 8.5rem);
  margin-block-end: 20px;
}

.header__subtitle {
  font-size: clamp(0.875rem, 0.6769rem + 0.8451vw, 1.4375rem);
}

.main {
  display: grid;
  justify-items: center;
  gap: 57px;
  padding-block-end: 105px;
}

.cards-list {
  display: grid;
  gap: 52px;
}

.card {
  margin-inline: auto;
  border: 2px solid var(--text-color, #000000);
  background: var(--page-background-color, #ffffff);
  max-inline-size: 696px;
}

.card__header {
  border-block-end: 2px solid var(--text-color, #000000);
  padding: 4px 10px;
}

.card__title {
  font-size: 18px;
  line-height: normal;
  font-variation-settings: "wght" var(--headings-font-weight, 700);
}

.card__img-wrapper {
  position: relative;
  /* overflow - для коррекции эффектов filter blur */
  overflow: hidden;
}

.card__img-label {
  position: absolute;
  z-index: 1;

  opacity: 0.5;

  color: var(--text-color, #000000);
  font-family: var(--page-accent-font-family, "PressStart2P", fantasy);

  font-size: 14px;
  line-height: normal;

  text-transform: uppercase;
  text-shadow: 0 0 1px var(--page-background-color, #ffffff);
  inset-inline-end: 13px;
  inset-block-start: 24px;

  mix-blend-mode: hard-light;
}

.card__img {
  display: block;
  object-fit: cover;
  object-position: center;
  inline-size: 100%;
  aspect-ratio: 1 / 1;
}

.card__content {
  display: grid;
  gap: 27px;
  border-block-start: 2px solid var(--text-color, #000000);
  padding: 25px 30px 0 25px;
  font-size: 18px;
  line-height: calc(21 / 18);
}

.card__footer {
  display: flex;
  justify-content: end;
  align-items: stretch;
  gap: 5px;
  padding: 25px 25px 23px 25px;
}

.card__icon-button {
  display: grid;
  border: 2px solid transparent;
  padding: 0;
  background: transparent;
  transition: border-color 0.3s ease;
  cursor: pointer;
  appearance: none;
}

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

.card__icon-button:focus-visible {
  border-color: var(--text-color, #000000);
}

.button {
  position: relative;
  z-index: 1;
  border: 2px solid var(--text-color, #000000);
  padding: 10px 36px;
  font-family: var(--page-accent-font-family, "PressStart2P", fantasy);
  font-size: 14px;
  text-transform: inherit;
  background: var(--page-background-color, #ffffff);
  transition: box-shadow 0.3s ease;
  cursor: pointer;
  appearance: none;
}

.button:focus {
  outline: none;
}

.button:focus-visible {
  box-shadow: 2px 2px 0px 0px var(--text-color, #000000);
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--text-color, #000000);
  transition: transform 0.5s ease-in-out;
  transform: scaleX(0);
  transform-origin: left;
  inline-size: 100%;
  block-size: 100%;
}

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

.button--save {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
}

.button__text,
.button__icon {
  color: var(--button-text-color, #ffffff);
  mix-blend-mode: difference;
}

.button__icon {
  block-size: 22px;
  inline-size: 22px;
}

.like-icon {
  block-size: 36px;
  inline-size: 39px;
}

/* 376 взято так как в фигме на 375 уже стоят определенные стили, а при использовании width <= 375px 375 все еще включает в себя стили для значений больше 375 ???? */
@media (width < 376px) {
  .modal {
    padding: 28px 34px 28px 40px;
    max-inline-size: 340px;
  }

  .button--save {
    flex-direction: column;
  }

  .button__icon {
    block-size: 28px;
    inline-size: 28px;
  }
}

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