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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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: 100vh;
  background-image: var(--complex-gradient);
  background-attachment: fixed;
  background-size: cover;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 100px;
  font-family: var(--main-font), Arial, sans-serif;
  font-variation-settings: "wdth" var(--wdth), "wght" var(--wght);
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-m);
  padding: var(--padding-clamp);
  inline-size: var(--width);
  border: 2px solid var(--border-color);
  background-color: var(--header-bg-color);
  font-weight: var(--header-weight);
  font-family: var(--accent-font);
  width: var(--width-clamp);
}

.logo-group {
  font-size: var(--font-size-logo);
}

.logo-group-subtitle {
  font-size: var(--font-size-logo-subtitle);
  text-transform: uppercase;
}

.header-title {
  text-align: center;
  gap: var(--gap-m);
  display: grid;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap--xxl);
  inline-size: var(--width);
  margin-top: 98px;
  margin-bottom: 100px;
  width: var(--width-clamp);
}

.card {
  border: 2px solid var(--border-color);
  background-color: var(--card-bg-color);
  display: flex;
  flex-direction: column;
}

h2 {
  padding: 4px 10px;
  font-size: var(--font-size-heading);
  border-bottom: 2px solid var(--border-color);
  --wght: 715;
  font-variation-settings: "wdth" var(--wdth), "wght" var(--wght);
}

.image-label-container {
  position: relative;
  display: block;
  overflow: hidden;
  line-height: 0;
  max-width: 696px;
  aspect-ratio: 1/1;
  box-sizing: border-box;
}

.label {
  position: absolute;
  top: 32px;
  right: 25px;
  color: var(--label-color-text);
  font-weight: var(--label-weight);
  font-size: 14px;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 1);
  font-family: var(--accent-font);
  opacity: 0.7;
  mix-blend-mode: hard-light;
  vertical-align: middle;
  text-transform: uppercase;
}

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

.image-main {
  width: 100%;
  height: 100%;
}

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

.filter-hue-rotate {
  filter: var(--filter-hue-rotate);
}

.img-filter-blur {
  z-index: 1;
  position: relative;
}

.bg-filter-blur {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  filter: var(--filter-blur);
  animation: softPinkFilter 6s ease-in-out infinite;
}

.filter-opacity {
  transition: transform 10s linear;
}

.filter-opacity:hover {
  transform: scale(1.3) rotate(-3deg);
  filter: var(--filter-opacity);
}

.filter-drop-shadow {
  width: 100%;
  height: 100%;
  z-index: 1;
  filter: var(--filter-drop-shadow);
  background-color: var(--filter-drop-shadow);
}

.background-drop-shadow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  filter: var(--filter-blur);
  animation: softPinkFilter 6s ease-in-out infinite;
}

.filter-saturate {
  width: 100%;
  height: 100%;
  filter: var(--filter-saturate);
  animation: rotateSun 15s linear infinite;
  z-index: 1;
}

.background-filter-saturate {
  filter: var(--filter-saturate);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.filter-sepia {
  z-index: 1;
  position: relative;
}

.filter-sepia-bg {
  filter: var(--filter-sepia);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.filter-brightness {
  filter: var(--filter-brightness);
}

.text {
  display: flex;
  flex-direction: column;
  gap: var(--gap-l);
  padding: 25px;
  font-size: var(--font-size-text);
  color: var(--color-main);
  line-height: 21px;
  letter-spacing: 0%;
  --wght: 410;
  font-variation-settings: "wdth" var(--wdth), "wght" var(--wght);
  border-top: 2px solid var(--border-color);
}

.card-button {
  display: flex;
  block-size: 38px;
  margin-left: auto;
  margin-bottom: 25px;
  margin-right: 25px;
  box-sizing: border-box;
}

.item {
  margin-right: 7px;
}

.card__icon-button {
  background: none;
  cursor: pointer;
  border: none;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 0;
  transition: border 0.3s ease;
}

.like-icon {
  flex-shrink: 0;
}

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

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

.button_main {
  cursor: pointer;
  border: 2px solid var(--border-color);
  background-color: var(--card-bg-color);
  font-weight: var(--button-weight);
  font-size: var(--font-size-button);
  font-family: var(--accent-font);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.card__like-button {
  inline-size: 130px;
  block-size: 38px;
}

.button_main:focus {
  outline: none;
  box-shadow: 2px 2px 0 var(--accent-color);
}

.button_main::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.5s ease-in-out;
  transform: scaleX(0);
  transform-origin: left;
  z-index: 0;
  background-color: var(--animation-button);
  mix-blend-mode: difference;
}

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

/* Стили для анимации сердечка */

.contour {
  transition: fill 0.1s linear;
}

.main-body {
  opacity: 0;
  transition: 0.3s linear;
}
.core {
  opacity: 0;
  transition: 0.3s linear 0.03s;
}

.sparks {
  opacity: 0;
}

.like-icon:hover .main-body,
.like-icon:hover .core {
  opacity: 1;
  fill: var(--hover-animation-color);
}

.like-icon:hover .main-body {
  transition: 0.3s linear 0.05s;
}

.like-icon:hover .core {
  transition: 0.3s linear;
}

.like-icon:active .main-body,
.like-icon:active .core {
  opacity: 1;
  fill: var(--animation-fill-color);
}

.like-icon:active .main-body {
  transition: 0.3s linear 0.05s;
}

.like-icon:active .core {
  transition: 0.3s linear;
}

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

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

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

.like-icon.is-liked .heart {
  animation-delay: 0.1s;
  animation-name: heart;
  animation-duration: 0.3s;
  animation-timing-function: ease-in;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}

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

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

/* Стили для кнопки сохранения на дискете */

.save-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-xs);
  inline-size: 335px;
  block-size: 55px;
  line-height: 90%;
}

.save-button svg {
  flex-shrink: 0;
}

.save-icon {
  display: inline-block;
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}

.save-icon .save-icon-dialog use {
  fill: currentColor;
}

/* всплывающее окно*/

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.75);/* у меня почему-то нет информации про прозрачность в макете:( надеюсь угадала*/
}

.content-dialog {
  inline-size: 353px;
  background-color: var(--card-bg-color);
  border: 2px solid var(--border-color);
  padding: 30px 0;
}

.dialog__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-xl);
  inline-size: 100%;
  block-size: 100%;
}

.dialog-context {
  display: flex;
  align-items: center;
  gap: var(--gap-xl);
  text-transform: uppercase;
  inline-size: 293px;
}

.text-dialog {
  font-weight: 400;
  font-size: var(--font0-size-dialog-text);
  color: var(--color-main);
  line-height: 150%;
  font-family: var(--accent-font);
}

.dialog-button__ok {
  inline-size: 293px;
  block-size: 38px;
  text-transform: uppercase;
}

.save-icon-dialog-container {
  width: 39px;
  height: 39px;
  display: flex;
}

@media (width <= 375px) {
  .header,
  main {
    inline-size: 375px;
  }

  .logo-group {
    font-size: 49px;
  }

  .logo-group-subtitle {
    font-size: 14px;
  }

  .image-bus {
    width: 371px;
    height: 371px;
  }

  img {
    width: 100%;
    max-width: none;
    height: auto;
  }

  .save-button {
    inline-size: 306px;
    block-size: 84px;
    display: flex;
    flex-direction: column;
  }

  .save-button svg {
    width: 28px;
    height: 28px;
  }
}
