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

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

*/

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

.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  width: var(--block-width);
  border: var(--border);
  padding: var(--header-padding-vertical) var(--header-padding-sides);
  line-height: 0.95;
  background-color: #fff;
}

.header__logo {
  font-family: var(--accent-font), sans-serif;
  font-weight: 400;
  font-size: var(--header-logo-size);
}

.header__title {
  font-family: var(--accent-font), sans-serif;
  font-size: var(--header-title-size);
  text-transform: uppercase;
}

.main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 51.5px;
  margin-top: 100px;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: var(--block-width);
  border: var(--border);
  overflow: hidden;
  font-family: var(--main-font);
  background-color: #fff;
}

.card__title {
  align-self: start;
  margin: 3.5px 10px;
  font-size: var(--main-font-size);
  font-variation-settings: "wght" var(--title-weight);
}

.container {
  position: relative;
  height: auto;
  border: var(--border);
}

.card__image {
  display: block;
  width: var(--block-width);
  height: auto;
  font-size: var(--main-font-size);
}

.image__label {
  position: absolute;
  top: 25px;
  right: 25px;
  opacity: 50%;
  font-family: var(--accent-font);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.3;
  text-shadow: -1px 0 #fff, 0 1px #fff, 1px 0 #fff, 0 -1px #fff;
  mix-blend-mode: hard-light;
}

@supports ((text-stroke: 1px #fff) or (-webkit-text-stroke: 1px #fff)) {
  .image__label {
    text-shadow: none;
    -webkit-text-stroke: 1px #fff;
    text-stroke: 1px #fff;
  }
}

.card__description {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 25px;
  font-size: var(--main-font-size);
  line-height: 1.16;
}

.card__buttons {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 6px;
}

.card__icon-button {
  display: flex;
  align-items: center;
  height: 38px;
  border: 2px solid #fff;
  padding: 0;
  background-color: transparent;
  transition: 0.3s ease;
}

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

.card__like-button {
  padding: 10px 35px;
  font-family: var(--accent-font);
  font-weight: 400;
  font-size: 14px;
}

.save-button {
  display: flex;
  justify-items: center;
  align-items: center;
  gap: 8px;
  padding: 15px 18px;
}

.save__image {
  width: var(--diskette-size);
  height: var(--diskette-size);
}

.save__text {
  font-family: var(--accent-font);
  font-size: 14px;
  text-wrap: nowrap;
}

.dialog {
  display: flex;
  flex-direction: column;
  border: var(--border);
  padding: 30px 30px;
  font-family: var(--accent-font);
  font-weight: 400;
  font-size: 14px;
}

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

.dialog__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 0;
  margin-bottom: 30px;
  line-height: 1.5;
  text-transform: uppercase;
}

.dialog__image {
  --diskette-size: 39px;
  width: var(--diskette-size);
  height: var(--diskette-size);
}

.dialog__text {
  width: clamp(12.563rem, 11.836rem + 3.099vw, 14.625rem);
}

.dialog-button {
  display: flex;
  justify-content: center;
  padding: 10px clamp(7.281rem, 6.929rem + 1.502vw, 8.281rem);
  line-height: 0.9;
  text-transform: uppercase;
}

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

.main-buttons {
  position: relative;
  border: var(--border);
  overflow: hidden;
  background-color: #fff;
  transition: 0.3s ease;
  cursor: pointer;
}

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

.main-buttons::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--accent-color);
  transition: 0.5s ease-in-out;
  transform: translateX(-100%);
  transform-origin: left;
}

.main-buttons:hover::before {
  transform: translateX(0);
}

button span,
.save__image {
  position: relative;
  z-index: 1;
  color: white;
  mix-blend-mode: difference;
}

.sparks {
  opacity: 0;
}

.contour {
  transition: fill 0.1s linear;
}

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

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

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

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

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

.like-icon:active .core {
  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;
}

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

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

.like-icon.is-liked .heart {
  transform-origin: center;
  animation: scaling 0.3s ease-in 0.1s 1;
}

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

.filter-bright-gray {
  filter: brightness(120%) grayscale(0.6);
}

.filter-bright-hue {
  filter: brightness(120%) hue-rotate(330deg);
}

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

.filter-hue-blue {
  filter: hue-rotate(200deg);
}

.filter-invert-saturate {
  filter: invert(1) saturate(120%);
}

.filter-sepia-strong {
  filter: sepia(80%);
}

.filter-muted-gray {
  filter: saturate(50%) grayscale(0.5);
}

.filter-bright-soft {
  filter: saturate(150%) opacity(0.8);
}

@media (width <= 375px) {
  .main {
    gap: 52.5px;
  }

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

  .save__image {
    --diskette-size: 28px;
  }

  .dialog {
    padding: 30px 40px;
  }
}
