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

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

*/

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

.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: clamp(6.25rem, 6.294rem + -0.1878vw, 6.125rem);
  border: 2px solid black;
  background-color: #fff;
  inline-size: var(--content-inline-size);
  block-size: clamp(20.4375rem, 19.5352rem + 3.8498vw, 23rem);
}

.header__title {
  color: #000;
  font-family: var(--accent-font-family);
  font-weight: 400;
  font-size: var(--header-title-size);
  text-transform: uppercase;
}
.header__subtitle {
  color: #000;
  font-family: var(--accent-font-family);
  font-weight: 400;
  font-size: var(--header-subtitle-size);
  text-transform: uppercase;
}

.content__section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block-end: 100px;
  max-inline-size: 1440px;
}

.card__list {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 50px;
  margin-block-end: 50px;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 2px solid #000;
  background-color: #fff;
  inline-size: var(--content-inline-size);
}

.card__title {
  align-self: flex-start;
  padding-inline: 10px;
  padding-block: 5px;
  color: #000;
  font-size: 18px;
  text-align: start;
  font-variation-settings: "wght" var(--font-weight-title);
}

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

.card__image {
  display: block;
  width: 100%;
  margin: 0;
}

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

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

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

.card__text p {
  color: #000;
  font-size: 18px;
  line-height: 1.16667;
}

.card__buttons {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  padding: 0 25px 25px 0;
}

.button {
  position: relative;
  border: 2px solid #000;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 0 transparent;
  transition: box-shadow 0.3s ease;
}

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

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

.button:focus {
  outline: none;
}

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

.floppy__icon {
  z-index: 1;
  color: #fff;
  inline-size: 21px;
  mix-blend-mode: difference;
}

.button__text {
  z-index: 1;
  color: var(--button-text-color);
  font-family: var(--accent-font-family);
  font-weight: 400;
  font-size: 14px;
  line-height: 0.9;
  mix-blend-mode: difference;
}

.save__button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 55px;
  padding: 15px 20px;
}

@media (width <= 375px) {
  .save__button {
    flex-direction: column;
    max-height: 84px;
  }

  .floppy__icon {
    inline-size: 28px;
  }
}

/* для сердечка */
.like-icon {
  cursor: pointer;
  block-size: 36px;
  inline-size: 39px;
}

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

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

.like-icon .contour {
  fill: var(--contour-color);
  transition: fill 0.1s linear;
}

.like-icon .sparks {
  opacity: 0;
  fill: var(--animation-fill-color);
}
.like-icon .heart {
  transform-origin: center;
}

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

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

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

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

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

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

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

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

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

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

.card__icon-button {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid transparent;
  padding: 0;
  outline: none;
  background-color: transparent;
  transition: border-color 0.3s ease;
  cursor: pointer;
  block-size: 38px;
  inline-size: 38px;
  appearance: none;
}

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

.card__icon-button:focus-visible {
  border-color: var(--contour-color);
}

/* диалоговое окно */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  padding: 30px;
  transition: opacity 0.3s ease-in-out;
}

.modal[open] {
  display: flex;
}

.modal::backdrop {
  opacity: 0.75;
  background: #000;
}

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

.modal__content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.modal__icon {
  display: block;
  min-width: 39px;
}

.modal__title {
  max-width: 234px;
  color: #000;
  font-family: var(--accent-font-family);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  text-transform: uppercase;
}

.modal__button {
  height: 38px;
  width: var(--modal-button-width);
}

/* фильтры дял картинок */

.sepia {
  filter: sepia(60%);
}

.light-sepia {
  filter: sepia(50%) contrast(80%) saturate(150%);
}

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

.invert-green {
  filter: invert(80%);
}

.grayscale {
  filter: grayscale(70%) sepia(70%);
}

.red-invert {
  filter: hue-rotate(90deg) blur(1px);
}

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