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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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;
  color: rgba(0, 0, 0, 1);
  background-image:
    var(--right-gradient),
    var(--bottom-gradient),
    var(--color-gradient);
  background-size: cover;
  background-attachment: fixed;
}

@supports (font-variation-settings: normal) {
  .page {
    font-family: var(--main-font), sans-serif;
  }
}

.header {
  padding: 100px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.header__logo {
  padding: 122px 0;
  border: 2px solid black;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  inline-size: clamp(23.4375rem, 16.2852rem + 30.5164vw, 43.75rem);
  gap: 20px;
}

@media (width>768px) {
  .header__logo {
    padding: 130px 0;
  }
}

.header__decore {
  font-size: clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem);
  font-family: var(--accent-font);
}

.header__title {
  font-size: clamp(0.875rem, 0.6769rem + 0.8451vw, 1.4375rem);
  font-family: var(--accent-font);
  font-weight: 410;
  text-transform: uppercase;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.main__article {
  margin: 0 auto;
  border: 2px solid var(--main-color, #000);
  background-color: var(--background-color, #fff);
  inline-size: clamp(23.4375rem, 16.2852rem + 30.5164vw, 43.75rem);
}

.article__title {
  padding: 3px 10px;
  font-weight: 715;
  font-size: 18px;
  line-height: 1.21;
}

@supports (font-variation-settings: normal) {
  .article__title {
    font-variation-settings: 'wght' var(--title-weight, 715);
  }
}

.label__wrapper {
  position: relative;
  border-block: 2px solid var(--main-color, #000);
}

.label {
  position: absolute;
  top: 25px;
  right: 25px;
  opacity: 0.5;
  font-family: var(--accent-font, 'PressStart2P'), 'fantasy';
  font-size: 14px;
  text-shadow: -1px 0 var(--label-color, #fff), 
  0 1px var(--label-color, #fff),      
  1px 0 var(--label-color, #fff), 
  0 -1px var(--label-color, #fff);
  mix-blend-mode: hard-light;
}

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

.image {
  display: block;
  object-fit: cover;
  object-position: center;
  inline-size: 100%;
}

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

.saturate {
  filter: saturate(228%);
}

.sepia {
  filter: sepia(0.77);
}

.blur {
  filter: blur(4px);
}

.grayscale {
  filter: grayscale(83%);
}

.invert {
  filter: invert(92%);
}

.contrast-unique {
  filter: contrast(22%) sepia(0.44);
}

.wrapper__text {
  display: flex;
  flex-direction: column;
  gap: 27px;
  padding-inline: 24px;
  padding-block: 27px;
}

.article__text {
  font-size: 18px;
  line-height: 1.16;
}

@supports (font-variation-settings: normal) {
  .article__text {
    font-variation-settings: 'wght' var(--main-weight, 410);
  }
}

.wrapper__button {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 4px;
}

.card__icon-button {
  display: flex;
  align-items: center;
  border: 2px solid transparent; 
  padding: 0;
  background-color: inherit;
  cursor: pointer;
  block-size: 38px;
  fill: transparent;
  transition: border-color 0.3s ease;
}

.contour {
  transition: 0.1s linear;
}

.main-body {
   fill: transparent;
}

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

@media (hover:hover) {
  .card__icon-button:hover .main-body {
    fill: var(--contour-color, #000);
    transition: 0.3s linear;
  }
  .card__icon-button:hover .main-body {
    fill: var(--contour-color, #000);
    transition: fill 0.3s linear 0.05s;
  }
}

.card__icon-button:active .main-body {
  fill: var(--accent-color-heart, #FF0000);
  transition: fill 0.3s linear 0.05s;
}
.card__icon-button:active .core {
  fill: var(--accent-color-heart, #FF0000);
  transition: fill 0.3s linear;
}

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

.card__icon-button:focus-visible {
  border: 2px solid var(--main-color, #000);
}

.sparks {
  opacity: 0;
}

.card__like-button {
  padding: 11px 0;
  min-inline-size: 130px;
  min-block-size: 38px;
}

.button {
  position: relative;
  border: 2px solid var(--main-color, #000);
  font-family: var(--accent-font, 'PressStart2P'), 'fantasy';
  font-size: 14px;
  line-height: 0.9;
  background-color: var(--background-color, #fff);
  cursor: pointer;
  transition: 0.3s ease;
}

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

.button:focus {
  outline: none;
}

.button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  background-color: var(--main-color, #000);
  transform:  scaleX(0);
  transform-origin: left;
  inline-size: 100%;
  block-size: 100%;
  transition: 0.5s ease-in-out;
}

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

@media (hover: none) {
   .button:active {
    background-color: var(--main-color, #000);
   }
}

.button__text {
  z-index: 10;
  color: var(--button-span, #fff);
  mix-blend-mode: difference;
}

.save__button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 auto 100px;
  padding: 17px 20px;
  white-space: pre;
  inline-size: clamp(19.125rem, 18.4868rem + 2.723vw, 20.9375rem);
}

.floppy-image {
  z-index: 10;
  flex-shrink: 0;
  color: var(--button-span, #fff);
  inline-size: 28px;
  block-size: 28px;
  mix-blend-mode: difference;
}

@media (width >= 768px) {
  .save__button {
    flex-direction: row;
    gap: 8px;
    padding: 15px 20px;
  }
  .save__button .button__text {
    margin-block-start: 4px;
  }
  .save__button .floppy-image {
    inline-size: 21px;
    block-size: 21px;
  }
}

.dialog {
  position: fixed;
  inset: 0;
  border: 2px solid var(--main-color, #000);
  padding: 30px;
  background-color: var(--background-color, #fff);
  inline-size: clamp(21.3125rem, 20.9604rem + 1.5023vw, 22.3125rem);
}

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

.dialog .floppy-image {
  flex-shrink: 0;
  inline-size: 39px;
  block-size: 39px;
}

.dialog__wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-block-end: 30px;
}

.dialog__text {
  color: var(--main-color, #000);
  font-family: var(--accent-font, 'PressStart2P'), 'fantasy';
  font-size: 14px;
  line-height: 1.5;
  text-transform: uppercase;
  inline-size: clamp(12.25rem, 11.3477rem + 3.8498vw, 14.8125rem);
}

.dialog__button {
  padding: 10px 114.5px;
  text-transform: uppercase;
  inline-size: 100%;
}