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

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

*/

.page {
  display: grid;
  min-inline-size: 320px;
  min-block-size: 100dvb;
  color: var(--text-color);
  font-family: var(--font-base), sans-serif;
  font-variation-settings: "wght" var(--font-weight-normal);
  font-size: var(--font-size-base);
  background-image: var(--background-pattern);
  background-attachment: fixed;
  background-size: auto;
  background-color: var(--page-bg-color);
  padding-block-start: 100px;
}

.header {
  display: grid;
  width: 100%;
}

.welcome {
  border: 2px solid var(--contour-color);
  background-color: var(--page-bg-color);
  max-inline-size: 696px;
  margin: 0 auto;
}

.title__decor {
  display: block;
  font-family: var(--font-accent), fantasy;
  font-size: var(--hero-title-size);
  margin-block-start: clamp(122px, calc(0.00751 * 100vw + 119.18px), 130px);
  align-items: center;
  justify-content: center;
  margin-block-end: 20px;
  text-align: center;
  text-transform: uppercase;
}

.hero__title {
  display: grid;
  max-inline-size: 696px;
  width: 100%;
  font-size: var(--hero-subtitle-size);
  text-align: center;
  align-content: center;
  font-family: var(--font-accent), fantasy;
  text-transform: uppercase;
  margin-block-end: clamp(122px, calc(0.00751 * 100vw + 119.18px), 130px);
}

main {
  display: grid;
  margin-block-start: 98px;
  margin-block-end: 105px;
  gap: 50px;
}

.card {
  display: grid;
  max-inline-size: 696px;
  background-color: var(--page-bg-color);
  border: 2px solid var(--border-color);
  margin-inline: auto;
}

.card__cover-image {
  display: block;
  width: 100%;
  object-fit: cover;
  object-position: center;
  aspect-ratio: 1/1;
}

.filter-sepia {
  filter: sepia(1);
}
.filter-grayscale {
  filter: grayscale(1);
}
.filter-contrast {
  filter: contrast(1.5);
}
.filter-blur {
  filter: blur(3px);
}
.filter-brightness {
  filter: brightness(1.3);
}
.filter-saturate {
  filter: saturate(2);
}
.filter-hue-rotate {
  filter: hue-rotate(90deg) saturate(1.5);
}

.card__cover {
  position: relative;
}

.card__title {
  font-variation-settings: "wght" var(--font-weight-bold);
  padding: 5px 10px;
  font-family: var(--font-base), sans-serif;
  font-size: var(--font-size-base);
  border-block-end: 2px solid var(--border-color);
}

.card__watermark {
  position: absolute;
  top: 25px;
  right: 25px;
  font-family: var(--font-accent), fantasy;
  text-shadow: -1px 0 var(--page-bg-color), 1px 0 var(--page-bg-color),
    0 -1px var(--page-bg-color), 0 1px var(--page-bg-color);
  font-size: 14px;
  color: var(--text-color);
  opacity: 0.5;
}

.card__details {
  display: grid;
  font-family: var(--font-base), sans-serif;
  border-block-start: 2px solid var(--border-color);
  padding: 25px;
  gap: 25px;
  font-size: var(--font-size-base);
  line-height: 21px;
}

.card__paragraph {
  font-size: var(--font-size-base);
  line-height: 21px;
}

.like-icon {
  transition: transform 0.3s ease-in-out;
}



.card__icon-button {
  display: flex;
  border: 2px solid transparent;
  background-color: transparent;
  color: var(--text-color);
  cursor: pointer;
  margin: 0;
  transition: border-color 0.3s ease;
}

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

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

.button:focus {
  outline: none;
}

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

.card__button {
  display: flex;
  justify-content: end;
  gap: 8px;
}

.button {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--border-color);
  background: var(--button-text-color);
  transition: box-shadow 0.3s ease;
}

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

.button .button__text {
  /* Убираем анимацию с текста - только псевдоэлемент должен анимироваться */
}

.button:hover::before {
  width: 100%;
}

.card__like-button {
  width: 130px;
  min-height: 38px;
  padding: 9px 17px;
}

.button__text {
  font-size: var(--button-font-size);
  color: var(--button-text-color);
  font-family: var(--font-accent), fantasy;
  mix-blend-mode: difference;
}

.button:hover .button__text {
  /* Убираем анимацию с текста - только псевдоэлемент должен анимироваться */
}

.button svg {
  stroke: white;
  mix-blend-mode: difference;
}

.button:hover svg {
  /* Убираем анимацию с иконки - только псевдоэлемент должен анимироваться */
}

.save {
  display: flex;
  justify-content: center;
}

.save__button {
  min-height: 58px;
  gap: 8px;
  padding: 9px 17px;
}

.dialog[open] {
  display: grid;
  justify-content: center;
  align-items: center;
  width: 353px;
  padding: 30px;
  position: fixed;
  background-color: var(--page-bg-color);
  border: 2px solid var(--text-color);
}

.dialog::backdrop {
  opacity: 0.75;
  background: var(--text-color);
}

.dialog__title {
  display: flex;
  font-family: var(--font-accent), fantasy;
  font-size: 14px;
  line-height: 150%;
  text-transform: uppercase;
  inline-size: 234px;
}

.dialog__container {
  display: grid;
  gap: 30px;
}

.dialog__button {
  width: 100%;
  min-height: 38px;
  padding: 9px 17px;
  text-transform: uppercase;
}

.dialog__message {
  display: flex;
  font-family: var(--font-accent), fantasy;
  font-size: 14px;
  line-height: 150%;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

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

@supports (mix-blend-mode: difference) {
  .button .button__text {
    /* Убираем анимацию с текста - только псевдоэлемент должен анимироваться */
  }
}

@media (max-width: 768px) {
  .save__button {
    flex-direction: column;
  }

  .dialog[open] {
    width: 90%;
    max-width: 353px;
    padding: 20px;
  }

  .dialog__icon {
    width: 28px;
    height: 28px;
  }

  .dialog__message svg {
    width: 39px;
    height: 39px;
  }
}