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

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

*/

.page {
  min-inline-size: 375px;
  min-block-size: 100dvb;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--main-font);
  font-variation-settings: "wght" var(--main-weight);
  background-image: var(--background-gradient);
  background-size: cover;
  background-attachment: fixed;
}

.header {
  padding: clamp(7.625rem, 7.449rem + 0.751vw, 8.125rem) 0;
  margin: 100px 0;
  border: var(--border);
  background-color: var(--bg-color);
  width: var(--content-width);
  display: flex;
  justify-content: center;
}

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

.header__title {
  font-family: var(--accent-font);
  font-size: clamp(3.063rem, 2.71rem + 1.502vw, 4.063rem);
}

.header__subtitle {
  font-family: var(--accent-font);
  font-size: clamp(0.875rem, 0.677rem + 0.845vw, 1.438rem);
  text-transform: uppercase;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 50px;
  width: var(--content-width);
}

.section {
  border: var(--border);
  background-color: var(--bg-color);
}

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

.section__image-wrapper {
  position: relative;
  overflow: hidden;
  outline: var(--border);
}

.label {
  position: absolute;
  top: 25px;
  right: 25px;
  mix-blend-mode: hard-light;
  font-family: var(--accent-font);
  font-size: 14px;
  opacity: 50%;
  text-shadow: -1px -1px 0 var(--stroke-color), 1px -1px 0 var(--stroke-color),
    -1px 1px 0 var(--stroke-color), 1px 1px 0 var(--stroke-color),
    0px -1px 0 var(--stroke-color), 0px 1px 0 var(--stroke-color),
    -1px 0px 0 var(--stroke-color), 1px 0px 0 var(--stroke-color);
}

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

.section__image {
  display: flex;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.card {
  display: grid;
  gap: 25px;
  padding: 27px 25px 25px 25px;
}

.card__text {
  font-size: 18px;
}

.card__buttons {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 7px;
}

.button {
  background-color: var(--bg-color);
  border: var(--border);
  cursor: pointer;
  outline: none;
  overflow: hidden;
  position: relative;
  line-height: 90%;
  transition: box-shadow 0.3s ease;
}

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

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

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

.card__icon-button {
  background-color: var(--bg-color);
  display: flex;
  transition: outline-width 0.3s ease;
  outline-offset: -1px;
  outline: 0 solid var(--accent-color);
  border: none;
  padding: 0;
}

.card__icon-button:focus-visible {
  outline-width: 2px;
}

.heart {
  transform-origin: center;
}

.sparks {
  opacity: 0;
}

.card__like-button {
  width: 130px;
  height: 38px;
}

.button__text {
  font-family: var(--accent-font);
  font-size: 14px;
  position: relative;
  z-index: 1;
  color: var(--stroke-color);
  mix-blend-mode: difference;
}

.actions {
  display: flex;
  justify-content: center;
  padding: 50px 34px 100px 34px;
  width: var(--content-width);
}

.save-button {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 17px 20px;
  min-width: 310px;
}

.floppy-icon {
  width: clamp(
    21px,
    calc(28px + (21 - 28) * ((100vw - 375px) / (1440 - 375))),
    28px
  );
  position: relative;
  z-index: 1;
  fill: var(--bg-color);
  mix-blend-mode: difference;
}

dialog[open] {
  width: 341px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 30px;
  position: fixed;
  inset: 0;
}

.dialog__wrapper .floppy-icon {
  width: 39px;
  height: 39px;
  flex-shrink: 0;
}

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

.dialog__text {
  font-family: var(--accent-font);
  font-size: 14px;
  text-transform: uppercase;
  line-height: 150%;
}

.dialog__button {
  padding: 12.5px 116.5px;
}

.dialog__button .button__text {
  text-transform: uppercase;
}

dialog[open]::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
}

.sepia-image {
  filter: sepia(70%);
}

.invert-image {
  filter: invert(0.9);
}

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

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

.blur-image {
  filter: blur(8px);
}

.brightness-image {
  filter: brightness(220%);
}

.multiple-image {
  filter: sepia(60%) saturate(150%) brightness(1.1) blur(2px);
}
