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

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

*/

.page {
  padding-block-start: 98px;
  min-block-size: 100dvb;
  font-family: var(--font-main);
  font-variation-settings: "wght" var(--font-weight-text);
  background: var(--page-bg) center / cover no-repeat fixed;
}

.header {
  display: flex;
  margin: 0 auto 100px;
  align-items: center;
  justify-content: center;
}

.header__contents {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 21px;
  inline-size: var(--container-width, 100%);
  padding-block: var(--container-block-padding, 122px);
  border: 2px solid #000;
  background: #fff;
  text-align: center;
  font-family: var(--font-accent, fantasy);
  font-weight: var(--font-weight-accent);
}

.header__title {
  font-size: var(--font-header-title, 49px);
  line-height: 100%;
  text-transform: uppercase;
}

.header__subtitle {
  font-size: var(--font-header-subtitle, 14px);
  line-height: 100%;
  text-transform: uppercase;
}

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

.card {
  width: var(--container-width, 100%);
  margin: 0 auto;
  border: 2px solid #000;
  background: #fff;
}

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

.card__text {
  font-size: 18px;
  line-height: 1.17;
  padding: 25px 28px 0 25px;
}

/*картинки карточек и фильтры к ним*/

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

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

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

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

.card__image-sepia {
  filter: saturate(20%);
}
.card__image-neon {
  filter: brightness(110%) contrast(110%) hue-rotate(5deg) saturate(300%);
}
.card__image-purple {
  filter: hue-rotate(37deg);
}
.card__image-negative {
  filter: invert(77%);
}
.card__image-monochrome {
  filter: sepia(90%);
}
.card__image-blur {
  filter: blur(8px);
}
.card__image-faded {
  filter: blur(1px) brightness(110%) contrast(40%) hue-rotate(95deg)
    saturate(145%);
}

/*общие стили кнопок*/

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

.button {
  position: relative;
  overflow: hidden;
  padding: 9px 17px;
  border: 2px solid #000;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}

.button:focus {
  outline: none;
}

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

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-color, #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;
  font-family: var(--font-accent, fantasy);
  font-size: 14px;
  font-weight: var(--font-weight-accent, 400);
  color: #fff;
  mix-blend-mode: difference;
  transition: color 0.5s ease-in-out;
}

/*стили для оборачивающей сердце кнопки*/

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

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

.card__icon-button:focus-visible {
  border-color: var(--accent-color, #000);
}

/*стили для иконки сердца*/

.like-icon {
  block-size: 35px;
  inline-size: 38px;
}

.contour {
  transition: fill 0.1s linear;
}

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

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

.sparks {
  opacity: 0;
}

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

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

.card__icon-button:active .core {
  fill: var(--animation-fill-color, red);
  transition-delay: 0s;
}

.card__icon-button:active .main-body {
  fill: var(--animation-fill-color, red);
  transition-delay: 0.05s;
}

.like-icon.is-liked .core {
  fill: var(--animation-fill-color, red);
  transition-delay: 0s;
}

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

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

/*доп стили для кнопки like*/

.card__like-button {
  min-inline-size: 130px;
  padding: 8px 17px;
  text-align: center;
}

/*стили для секции с dialog*/
.section__save {
  margin: 0 auto;
  padding-bottom: 100px;
}

.save-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 18px;
  /*min-inline-size: 308px;*/
}

.save-button svg {
  position: relative;
  z-index: 1;
  color: #fff;
  mix-blend-mode: difference;
  transition: color 0.5s ease-in-out;
}

.dialog {
  display: none;
  padding: 31px 38px;
  border: 2px solid #000;
  background: #fff;
  font-family: var(--font-accent, fantasy);
  font-size: 14px;
  font-weight: var(--font-weight-text, 400);
  text-transform: uppercase;
  line-height: 1.5;
}

.dialog[open] {
  display: block;
  margin: auto;
}

.dialog__content {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 19px;
  margin-bottom: 27px;
  max-inline-size: 260px;
}

.ok-button {
  inline-size: 100%;
  min-block-size: 38px;
}

.dialog__text {
  text-transform: uppercase;
}

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

/*адаптив*/

@media (width >= 700px) {
  .card__image-wrapper {
    max-block-size: 696px;
  }

  .save-button {
    flex-direction: row;
  }

  .save-button svg {
    inline-size: 21px;
    block-size: 21px;
  }

  .dialog {
    padding: 28px;
  }

  .dialog__content {
    margin-bottom: 30px;
    max-inline-size: 293px;
  }
}
