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

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

*/

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: 100px;
  font-family: var(--main-font, "Inter-Variable"), sans-serif;
  background-image: var(--background-image);
  background-repeat: no-repeat; 
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  font-variation-settings: "wght" var(--main-font-weight, 410);
}

.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 98px;
  padding-block: var(--rubber-block-padding, clamp(122px, 119.18px + 0.7512vw, 130px));
  box-shadow: 0 0 0 2px var( --stroke-color, #000);
  color: var(--text-color, #000);
  font-family: var(--accent-font, "PressStart2P"), sans-serif;
  text-transform: uppercase;
  background-color: #fff;
}

.rubber-block {
  inline-size: var(--rubber-width, clamp(375px, 260.55px + 30.52vw, 700px));
}

.header__title {
  font-weight: 400;
  font-size: var(--header-title-font-size, clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem));
}

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

.content {
  display: flex;
  flex-direction: column;
  gap: 50px;
  align-self: center;
}

.card {
  display: flex;
  flex-direction: column;
  border: 2px solid #000;
  background-color: #fff;
}

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


.card__title {
  padding: 7px 10px 5px;
  vertical-align: middle;
  font-size: 18px;
  line-height: var(--title-line-height, normal);
  font-variation-settings: "wght" var( --title-font-weight, 715);
}

.card__text {
  font-size: 18px;
  line-height: var(--main-text-line-height, 1.1666666667);
  font-variation-settings: "wght" var(--main-font-weight, 410);
}

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

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

.card__icon-button {
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  box-shadow: inset 0 0 0 2px transparent;
  outline: none;
  background-color: transparent;
  transition: box-shadow 0.3s ease;
  cursor: pointer;
}

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

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

.button {
  position: relative;
  border: none;
  box-shadow: inset 0 0 0 2px var( --stroke-color, #000);
  overflow: hidden ;
  background-color: var(--button-color, #fff);
  transition: box-shadow 0.3s ease;
  cursor: pointer;
}

.card__action-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.5px;
}

.button__text {
  position: relative;
  z-index: 1;
  color: var(--button-text-color, #fff);
  font-family: var(--accent-font, "PressStart2P"), sans-serif;
  font-size: 14px;
  line-height: 0.9;
  mix-blend-mode: difference;
}


.card__like-button {
  min-width: 130px;
  padding-block-start: 12px;
  padding-block-end: 8px;
}

.floppy-svg {
  width: 21px;
  height: 21px;
  fill: #fff;
  mix-blend-mode: difference;
}

.save-button__text {
  vertical-align: middle;
}

.save-button {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  width: fit-content;
  padding: 17px 20px;

}

.card__image-container {
  position: relative;
  border-block: 2px solid var(--stroke-color, #000); 
  inline-size: 100%;
}

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


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

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

.button:focus {
  outline: none;
}

.button:before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--button-hover-color, #000);
  transition: transform 0.5s ease-in-out;
  transform: translate(-100%, 0);
}

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

.button-ok {
  padding: 10px 132.5px;
  text-transform: uppercase;
  inline-size: 100%;
  
}

.save-dialog {
  display: none;
  max-width: none;   
  max-height: none;
  border: none;
  border-radius: 0;
  padding: 0;
}

.save-dialog {
  display: none;
  flex-direction: column;
  gap: 30px;
  padding: 30px;
  box-shadow: inset 0 0 0 2px var( --stroke-color, #000);
  background-color: #fff;
  inline-size: clamp(341px, calc(341px + 12 * ((100vw - 375px) / 1065)), 353px);
  }

.save-dialog[open] {
  display: flex;
}

.save-dialog .dialog__content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  align-self: flex-start;
}

.save-dialog .floppy-svg {
  flex-shrink: 0;
  width: 39px;
  height: 39px;
}

.dialog-text {
  font-family: var(--accent-font, "PressStart2P"), sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  text-transform: uppercase;
}

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

.filter-brightness {
  filter: brightness(145%);
}

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

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

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

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

.filter-grayscale-blur-contrast {
  filter: grayscale(100%) blur(3px) contrast(120%);
}

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

.page:has(.save-dialog[open]) {
  overflow: hidden ;
}

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

@media (width <= 375px) {
  .save-button {
    flex-direction: column;
    align-items: center;
  }

  .header {
    margin-bottom: 100px;
    box-shadow: inset 0 0 0 2px var( --stroke-color, #000);
  }

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

.sparks {
  opacity: 0;
}

.contour {
  transition: fill  0.1s linear;
}

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

.main-body {
  transition: fill  0.3s linear;
}

.like-icon:hover .core {
  fill: var(--contour-color, #000);
  transition: fill  0.3s linear;
}

.like-icon:hover .main-body {
  fill: var(--contour-color, #000);
  transition: fill  0.3s linear 0.05s;
}

.like-icon:active .core {
  fill: var(--animation-fill-color, #ff0000);
  transition: fill  0.3s linear;
}

.like-icon:active .main-body {
  fill: var(--animation-fill-color, #ff0000);
  transition: fill  0.3s linear 0.05s;
}

.like-icon.is-liked .contour {
  fill: var(--animation-fill-color, #ff0000);
  transition: fill  0.3s linear 0.06s;
}

.like-icon.is-liked .core {
  fill: var(--animation-fill-color, #ff0000);
  transition: fill  0.3s linear;
}

.like-icon.is-liked .main-body {
  fill: var(--animation-fill-color, #ff0000);
  transition: fill  0.3s linear 0.05s;
}

.like-icon.is-liked .heart {
  animation: clicking 0.3s 1 ease-in 0.1s;
}

.like-icon.is-liked .sparks {
  animation: sparkling 0.3s 1 ease-in 0.3s;
}


  /* animation: myAnimation 2s infinite alternate ease-in-out 0.5s forwards; */
