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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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;
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  background-image: var(--bg-gradient);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-color);
  border: solid 2px var(--border-color);
  margin: 100px 0px;
}

.header__title {
  font-size: var(--header-font-size);
  font-family: var(--font-header), fantasy;
  font-weight: var(--header-font-weight);
  color: var(--header-color);
  margin: 120px 14px 0px 14px;
}

.header__content {
  font-size: var(--header-content-font-size);
  font-family: var(--font-header), fantasy;
  font-weight: var(--header-font-weight);
  color: var(--header-color);
  margin-top: 20px;
  margin-bottom: 120px;
  text-transform: uppercase;
}

.main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card {
  display: flex;
  flex-direction: column;
  margin-bottom: 51px;
}

.content__title {
  font-size: var(--title-font-size);
  font-family: var(--font-content), sans-serif;
  font-weight: var(--title-font-weight);
  font-variation-settings: "wght" var(--title-font-weight);
  background: var(--content-bg-color);
  color: var(--content-color);
  border-top: solid 2px var(--border-color);
  border-right: solid 2px var(--border-color);
  border-left: solid 2px var(--border-color);
  padding: 6px 10px 4px 10px;
}

.bus__container {
  position: relative;
}

.label {
  position: absolute;
  font-family: var(--font-lable), fantasy;
  font-size: var(--lable-font-size);
  font-weight: var(--lable-font-weight);
  color: var(--content-color);
  text-shadow: 1px 1px 0 var(--lable-shadow-color),
    1px -1px 0 var(--lable-shadow-color), -1px 1px 0 var(--lable-shadow-color),
    -1px -1px 0 var(--lable-shadow-color);
  mix-blend-mode: hard-light;
  right: 12px;
  top: 24px;
  opacity: 0.5;
  z-index: 1;
}

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

.bus__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

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

.bus__img-brightness {
  filter: brightness(1.5);
}

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

.bus__img-grayscale {
  filter: grayscale(100%);
}

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

.bus__img-invert {
  filter: invert(0.2);
}

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

.bus__img-multiple {
  filter: saturate(150%) contrast(120%) hue-rotate(15deg);
}

.description {
  background: var(--content-bg-color);
  border-left: solid 2px var(--border-color);
  border-right: solid 2px var(--border-color);
  border-bottom: solid 2px var(--border-color);
}

.description__text {
  font-size: var(--content-font-size);
  font-family: var(--font-content), sans-serif;
  font-weight: var(--content-font-weight);
  font-variation-settings: "wght" var(--content-font-weight);
  padding: 25px 25px 3px 25px;
}

.sparks {
  fill: transparent;
}

.like-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

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

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

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

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

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

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

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

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

.like-icon .heart {
  transform-origin: center;
}

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

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

.like__buttons {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  margin: 20px 25px 23px 0px;
  gap: 5px;
}

.card__icon-button {
  background-color: transparent;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border 0.3s ease;
  padding: 0;
}

.card__icon-button:focus-visible {
  outline: none;
  border: solid 2px var(--border-color);
}

.button {
  font-family: var(--font-button), fantasy;
  font-size: var(--button-font-size);
  font-weight: var(--button-font-weight);
  background-color: var(--button-bg-color);
  border: solid 2px var(--border-color);
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}

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

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

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

.card__like-button {
  padding-left: 15px;
  padding-right: 15px;
  padding-top: 1px;
  margin-bottom: 0px;
  position: relative;
  overflow: hidden;
  min-width: 130px;
}

.button__text {
  position: relative;
  z-index: 2;
  color: var(--button-text-color);
  mix-blend-mode: difference;
  font-family: var(--font-button), fantasy;
  font-size: var(--button-font-size);
  font-weight: var(--button-font-weight);
}

.memory__button {
  display: flex;
  flex-direction: column;
  margin-bottom: 102px;
}

.dialog__button {
  display: flex;
  border: 2px solid var(--border-color);
  flex-direction: column;
  padding: 15px 20px;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.floppy {
  width: 28px;
  height: 28px;
  mix-blend-mode: difference;
  fill: #fff;
  position: relative;
  z-index: 2;
}

.dialog {
  border: solid 2px var(--border-color);
  padding: 30px 0px;
  max-width: 341px;
  margin: auto;
}

.dialog[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dialog::backdrop {
  background-color: #000000;
  opacity: 0.75;
}

.dialog__block {
  display: flex;
  align-items: center;
  flex-direction: row;
  padding-left: 16px;
}

.dialog__floppy {
  width: 167px;
  height: 40px;
}

.dialog__text {
  font-family: var(--font-dialog), fantasy;
  font-size: var(--dialog-font-size);
  font-weight: var(--dialog-font-weight);
  line-height: 150%;
  text-transform: uppercase;
}

.button__text-transform {
  text-transform: uppercase;
}

.agreement__button {
  padding: 10px 113px;
  margin-top: 30px;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
  overflow: hidden;
  position: relative;
}

@media (width > 375px) {
  .header {
    inline-size: clamp(375px, 90%, 700px);
  }

  .header__title {
    margin-top: 128px;
  }

  .header__content {
    margin-bottom: 128px;
  }

  .card {
    inline-size: clamp(375px, 90%, 700px);
  }

  .dialog {
    max-width: 353px;
    padding: 30px 0px;
  }

  .agreement__button {
    padding: 10px 131px;
  }

  .dialog__block {
    padding-left: 6px;
    padding-right: 30px;
  }

  .dialog__button {
    flex-direction: row;
    padding: 15px 19px;
  }

  .floppy {
    width: 21px;
    height: 21px;
  }

  .label {
    right: 28px;
    top: 26px;
  }
}
