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

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

*/

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

.header {
  width: var(--content-width);
  background: #fff;
  border: 2px solid #000;
  margin: 100px auto 100px auto;
  padding: clamp(1rem, 10vw, 2rem) clamp(1rem, 5vw, 2rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.5rem);
  min-height: clamp(327px, 50vh, 368px);
  box-sizing: border-box;
}

.header__title {
  font-family: var(--font-accent), system-ui, sans-serif;
  font-size: clamp(2rem, 8vw, 4rem);
  text-transform: uppercase;
}

.header__subtitle {
  font-family: var(--font-accent), system-ui, sans-serif;
  font-size: clamp(14px, 3vw, 23px);
  line-height: 1;
  text-transform: uppercase;
  margin-top: 1rem;
  justify-self: center;
}

.card {
  width: clamp(300px, 100% - 2rem, 700px);
  background: #fff;
  border: 2px solid #000;
  margin: 0 auto 50px auto;
}

.card__title {
  font-family: var(--font-main), system-ui, sans-serif;
  font-variation-settings: "wght" var(--title-weight);
  font-size: 18px;
  padding: 5px 10px;
  border-bottom: 2px solid #000;
}

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

.card__image {
  display: block;
  width: calc(100% - 4px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.card__label {
  position: absolute;
  top: 30px;
  right: 20px;
  font-family: var(--font-accent), system-ui, sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  color: #000;
  mix-blend-mode: hard-light;
  opacity: 0.7;
  text-shadow:
    -1px 0 #fff,
    0 1px #fff,
    1px 0 #fff,
    0 -1px #fff;
}

@supports (-webkit-text-stroke: 1px #fff) {
  .card__label {
    text-shadow: none;
    -webkit-text-stroke: 1px #fff;
  }
}

.card__content {
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.card__text {
  display: flex;
  flex-direction: column;
  gap: 25px;
  font-size: 18px;
  line-height: 1.17;
}

.card__like-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.card__like-button {
  min-width: 130px;
}

.button {
  position: relative;
  background: var(--button-bg, #fff);
  border: 2px solid #000;
  padding: 9px 17px;
  cursor: pointer;
  font-family: var(--font-accent), system-ui, sans-serif;
  font-size: 14px;
  line-height: 0.9;
  color: #000;
  transition: box-shadow 0.3s ease;
  overflow: hidden;
}

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

.button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  transform: translateX(-100%);
  transition: transform 0.5s ease-in-out;
  z-index: 0;
}

.button:hover::before {
  transform: translateX(0);
}

.button__text {
  position: relative;
  z-index: 1;
  mix-blend-mode: difference;
  color: #fff;
}

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

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

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

.save-button {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 50px auto;
  padding-block: 17px;
}

.floppy-icon {
  width: 21px;
  height: 21px;
  mix-blend-mode: difference;
}

.dialog {
  background: #fff;
  border: 2px solid #000;
  padding: 30px;
  max-width: 353px;
  margin: auto;
}

.dialog[open] {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

.dialog__content {
  display: flex;
  gap: 20px;
  align-items: center;
}

.dialog__text {
  font-family: var(--font-accent), system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-transform: uppercase;
}

.dialog__button {
  width: 100%;
}

.dialog__floppy {
  filter: invert(1);
  flex-shrink: 0;
}

.like-icon {
  width: 39px;
  height: 36px;
  display: block;
  pointer-events: visible;
}

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

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

.filter-brightness {
  filter: brightness(1.5);
}

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

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

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

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

.filter-multiple {
  filter: grayscale(0.5) blur(1px) contrast(120%);
}

@media (width <= 375px) {
  .header {
    width: 375px;
    min-height: 327px;
    padding: 0;
    margin: 100px auto 100px auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .header__title {
    font-size: 49px;
    line-height: 49px;
    margin-top: 122px;
  }

  .header__subtitle {
    font-size: 14px;
    line-height: 14px;
    margin-bottom: 92px;
  }

  .card {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .card__title {
    font-size: 18px;
    padding: 4px 10px;
  }

  .card__label {
    top: 20px;
    right: 10px;
    font-size: 12px;
  }

  .card__image-wrapper {
    padding: 0;
    margin: 0;
    border-bottom: 2px solid #000;
  }

  .card__image {
    width: 371px;
    height: 371px;
    margin: 0 auto;
    object-fit: cover;
  }

  .card__content {
    padding: 25px;
    padding-bottom: 24px;
  }

  .card__text {
    font-size: 18px;
    gap: 25px;
    line-height: 21px;
  }

  .card__like-buttons {
    gap: 6px;
  }

  .save-button {
    width: 306px;
    padding: 15px 20px;
    margin: 0 auto;
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .floppy-icon {
    width: 28px;
    height: 28px;
  }

  .dialog {
    max-width: 341px;
    padding: 30px 40px;
  }

  .dialog__content {
    flex-direction: row;
    gap: 20px;
  }

  .dialog__text {
    font-size: 12px;
  }

  .save-button .button__text {
    width: 300px;
  }
}
