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

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

*/

.page {
  font-family: var(--main-font), sans-serif;
  font-size: var(--font-size);
  background-image: var(--background-image);
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  min-inline-size: 320px;
  min-block-size: 100dvb;
  font-variation-settings: "wght" var(--main-font-weight);
}

.header {
  margin-top: 98px;
  margin-inline: auto;
  border: 2px solid var(--accent-color);
  padding: clamp(122px, calc(122px + 8 * (100vw - 375px) / (1440 - 375)), 130px)
    clamp(16px, calc(16px + 106.5 * (100vw - 375px) / 1065), 122.5px);
  font-family: var(--accent-font), serif;
  font-weight: var(--accent-font-weight);
  text-align: center;
  text-transform: uppercase;
  background-color: var(--main_color);
  inline-size: var(--inline-size);
}

.header_title {
  margin-bottom: 20px;
  font-size: clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem);
}

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

.main {
  margin-top: 96px;
  margin-bottom: 100px;
}

/* Контейнер карточки */
.card {
  margin-bottom: 50px;
  margin-inline: auto;
  border: 2px solid var(--accent-color);
  background-color: var(--main_color);
  inline-size: var(--inline-size);
}

.card_title {
  margin: 4px 10px;
  font-size: var(--font-size);
  font-variation-settings: "wght" var(--weight-title);
}

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

.image_filter__grayscale {
  filter: grayscale(0.7);
}

.image_filter__saturate {
  filter: saturate(300%) opacity(0.9);
}

.image_filter__hue-rotate {
  filter: hue-rotate(0.1turn);
}

.image_filter__invert {
  filter: invert(0.7);
}

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

.image_filter__blur {
  filter: blur(0.2rem);
}

.image_filter__hue-rotate-green {
  filter: hue-rotate(0.3turn) blur(0.1rem) opacity(0.7);
}

.image_wrapper {
  position: relative;
  border-top: 2px solid var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
  margin: 0;
}

.watermark {
  position: absolute;
  top: 25px;
  right: 25px;
  z-index: 1;
  opacity: 50%;
  font-family: var(--accent-font), serif;
  font-weight: var(--accent-font-weight);
  font-size: var(--font-size-button);
  text-shadow:
    -1px 0 var(--main_color),
    0 1px var(--main_color),
    1px 0 var(--main_color),
    0 -1px var(--main_color);
  mix-blend-mode: hard-light;
}

@supports (
  (text-stroke: 1px var(--main_color)) or (-webkit-text-stroke: 1px var(--main_color))) {
  .watermark {
    text-shadow: none;
    -webkit-text-stroke: 1px var(--main_color);
    text-stroke: 1px var(--main_color);
  }
}

.card_text {
  margin: 25px 25px 0;
  line-height: 21px;
  font-variation-settings: "wght" var(--main-font-weight);
}

.card_text p {
  margin-top: 25px;
}

.container_button {
  display: flex;
  justify-content: end;
  align-items: center;
  margin: 25px 25px 25px 0;
}

/* Сердце */
.card__icon-button {
  border: none;
  background-color: inherit;
  transition: border 0.3s ease;
  cursor: pointer;
  height: 38px;
}

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

.card__icon-button:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: -4.5px;
}

.heart {
  transform-origin: center;
}

/* Кнопка "Like"*/
.card__like-button {
  width: 130px;
  height: 38px;
  border: 2px solid var(--accent-color);
  background-color: inherit;
  cursor: pointer;
}

/*Текст кнопки "Like"*/
.button__text {
  position: relative;
  z-index: 1;
  color: var(--accent-color);
  font-family: var(--accent-font), serif;
  font-weight: var(--accent-font-weight);
  font-size: var(--font-size-button);
}

/* Кнопка с дискетой */
.button__memory {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-inline: auto;
  border: 2px solid var(--accent-color);
  background-color: var(--main_color);
  cursor: pointer;
  /* inline-size: clamp(19.125rem, 18.4868rem + 2.723vw, 20.9375rem); */
  inline-size: clamp(19.125rem, 19.125rem + 2.0139vw, 20.9375rem);
  block-size: 85px;
}

.floppy {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}

.dialog {
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
  inline-size: clamp(21.3125rem, 21.0484rem + 1.1268vw, 22.0625rem);
  block-size: 191px;
}

.dialog::backdrop {
  backdrop-filter: brightness(30%);
}

.dialog:not([open]) {
  opacity: 0;
  pointer-events: none;
}

.dialog__title {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 19px;
}

/* Иконка дискеты */
.dialog__floppy {
  flex-shrink: 0;
  color: var(--accent-color);
  inline-size: 39px;
  block-size: 39px;
  stroke-width: 0;
}

.dialog__text {
  font-family: var(--accent-font), serif;
  font-weight: var(--accent-font-weight);
  font-size: var(--font-size-button);
  line-height: 150%;
  text-transform: uppercase;
}

.dialog__button {
  border: 2px solid var(--accent-color);
  background-color: inherit;
  cursor: pointer;
  block-size: 38px;
  inline-size: clamp(16.3125rem, 15.6083rem + 3.0047vw, 18.3125rem);
}

.dialog__button span {
  text-transform: uppercase;
}

.button {
  position: relative;
  box-shadow: 0 0 0 0 var(--accent-color);
  outline: none;
  transition: box-shadow 0.3s ease;
}

.button:focus {
  box-shadow: 2px 2px 0 0 var(--accent-color);
  outline: none;
  overflow: hidden;
}

/* плавно слева направо появляется псевдоэлемент */
.button::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--accent-color);
  transition: 0.5s ease-in-out;
  transform: scaleX(0);
  transform-origin: left;
}

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

.button__text,
.floppy {
  position: relative;
  z-index: 1;
  color: var(--main_color);
  mix-blend-mode: difference;
}

@media (width >= 1440px) {
  .button__memory {
    flex-direction: row;
    block-size: 55px;
  }

  .floppy {
    width: 21px;
    height: 21px;
  }

  .dialog__title {
    margin: 0 13px;
  }
}
