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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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-image: var(--bg-image);
  background-position: center;
  background-attachment: fixed;
  background-size: cover;
  background-repeat: no-repeat;
  font-family: var(--main-font);
  font-size: var(--font-size);
  font-variation-settings: 'wght' var(--weight-regular), 'wdth' var(--wdth);
}

.header {
  background-color: var(--bg-color);
  margin-block-start: 100px;
  margin-block-end: 98px;
  font-family: var(--accent-font);
  text-align: center;
  padding: 130px 0;
  border: var(--main-border);
}

.header__title {
  margin-bottom: 20px;
  font-size: var(--title-size);
  line-height: 100%;
}

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

.card {
  background-color: var(--bg-color);
  border: var(--main-border);
  margin-block-end: 50px;
}

.card:last-child {
  margin-block-end: 0;
}

.card__title {
  padding: 4px 10px;
  font-variation-settings: 'wght' var(--text-weight-bold), 'wdth' var(--wdth);
  line-height: 1.2;
  font-size: var(--font-size);
}

.card__image {
  position: relative;
  border-top: var(--main-border);
}

.article__image {
  width: 100%;
  aspect-ratio: 1/1;
  margin: 0 0 5px 0;
}

.image__logo {
  position: absolute;
  top: 25px;
  right: 25px;
  z-index: 1;
  opacity: 0.5;
  font-family: var(--accent-font);
  font-size: var(--font-size-card-label);
  text-shadow: 0 0 1px var(--black-color);
  mix-blend-mode: hard-light;
}

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

.card__text {
  padding: 18px 25px 25px 25px;
  line-height: 117%;
}

.card__paragraph:not(:last-child) {
  margin-bottom: 25px;
}

.card__button {
  display: flex;
  align-items: center;
  justify-content: end;
  padding: 0 25px 25px;
  gap: 8px;
}

.button {
  background-color: var(--bg-color);
  font-family: var(--accent-font);
  font-size: var(--font-size-card-label);
  line-height: 90%;
  border: none;
  transition: box-shadow 0.3s ease;
}

.button:hover {
  cursor: pointer;
}

.button:not(.card__icon-button) {
  position: relative;
  overflow: hidden;
  border: var(--main-border);
  color: var(--black-color);
}

.button:not(.card__icon-button)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--black-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease-in-out;
}

.button:not(.card__icon-button):hover::before {
  transform: scaleX(1);
}

.button:not(.card__icon-button):focus {
  outline: none;
  box-shadow: 2px 2px 0 var(--black-color);
}

.button:not(.card__icon-button) .button__text {
  z-index: 1;
  color: var(--bg-color);
  mix-blend-mode: difference;
}

.button:not(.card__icon-button) svg {
  z-index: 1;
  color: var(--bg-color);
  position: relative;
  mix-blend-mode: difference;
}

.card__icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  outline: 2px solid transparent;
  height: 34px;
  transition: outline 0.3s ease;
}

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

}

.like-icon {
  transform-origin: center;
  width: 39px;
  height: 36px;
}

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

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

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

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

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

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

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

.heart {
  transform-origin: center;
}

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

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

.contour {
  transition: fill 0.1s linear;
}

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

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

.sparks {
  opacity: 0;
}

.card__like-button {
  display: flex;
  width: 130px;
  height: 38px;
  justify-content: center;
  align-items: center;
}

.filter__brightness {
  filter: brightness(110%);
}

.filter__opacity {
  filter: opacity(0.9);
}

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

.filter__sepia {
  filter: sepia(60%);
}

.filter__invert {
  filter: invert(0.1);
}

.filter__grayscale {
  filter: grayscale(1);
}

.filter__blur {
  filter: blur(0.2rem);
}

.filter__mix {
  filter: sepia(1) hue-rotate(264deg) saturate(289%);
}

.footer {
  padding: 50px 0 100px 0;
}

.footer-button svg {
  width: 28px;
  aspect-ratio: 1/1;
}

.footer-button {
  min-inline-size: 306px;
  min-block-size: 84px;
  margin: 0 auto;
  gap: 8px;
}

.button__text {
  position: relative;
}

.flex-button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.dialog {
  font-family: var(--accent-font);
  padding: 30px 40px;
  max-width: 353px;
}

.dialog-top {
  display: flex;
  align-items: center;
  gap: 20px;
}

.dialog-text {
  max-width: 260px;
  font-size: var(--font-size-card-label);
  line-height: 150%;
  text-transform: uppercase;
}

.dialog svg {
  height: 39px;
  min-width: 39px;
}

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

body:has(dialog[open]) {
  overflow: hidden;
}

.dialog-button {
  width: 100%;
  min-height: 38px;
  margin-top: 30px;
}

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

@media (width >=768px) {
  .footer-button {
    min-width: 335px;
    min-height: 55px;
    flex-direction: row;
  }

  .footer-button svg {
    width: 21px;
  }
}

@media (width <= 375px) {

  .header {
    margin-top: 27vw;
    margin-bottom: 27vw;
    padding: 120px 16px;
  }

  .card__text {
    padding: 18px 25px 26px 25px;
  }

  /* .main,
  .header,
  .footer {
    width: 100%;
  } */
}