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

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

*/



.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-inline-size: 320px;
  min-block-size: 100dvb;
  margin: 0;
  font-family: var(--font-family-base) sans-serif;
  font-variation-settings: 'wght' var(--font-weight-normal);
  font-size: var(--font-size-base);
  background-color: var(--color-background);
  background-image: var(--grid-gradient);
  background-attachment: fixed;
  background-size: cover;
}

.stretch-container {
  width: var(--page-width);
}

.header {
  padding: 97px 0;

}

.header__content {
  display: flex;
  flex-direction: column;
  padding: 130px 0;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  border: var(--border);
}

@media (width <=375px) {
  .header__content {
    padding: 120px 0;
  }
  .header {
    padding: 100px 0;
  }
}



/* Заголовок страницы*/
.title {
  font-family: var(--font-family-heading), fantasy;
  font-size: var(--font-size-h1-adaptive);
  color: var(--color-text);
  text-align: center;
  text-transform: uppercase;
  font-weight: 400;
}

/* Крупный элемент заголовка*/
.title-accent-size {
  display: inline-block;
  margin-bottom: 20px;
  font-size: clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem);
}



.main {
  padding-bottom: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}


/*======================= CARD ==========================*/

.card {
  border: var(--border);
  background-color: var(--color-background);
}

.card__header {
  margin: 4px 10px;
  font-family: var(--font-family-base), monospace;
  font-size: inherit;
  color: var(--color-text);
  font-variation-settings: 'wght' var(--font-weight-bold);
}

.card__image-wrapper {
  position: relative;
  overflow: hidden;
  border-top: 2px solid var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
}

.card__label {
  position: absolute;
  right: 25px;
  top: 25px;
  font-family: var(--font-family-heading), fantasy;
  font-size: 14px;
  mix-blend-mode: hard-light;
  opacity: 0.5;
  z-index: 10;
  -webkit-text-stroke: 1px var(--color-text-stroke, #fff);
}

@supports not (-webkit-text-stroke: 1px var(--color-text-stroke, #fff)) {
  .card__label {
    text-shadow:
      -2px -2px 0 var(--color-text-stroke, #fff),
      2px -2px 0 var(--color-text-stroke, #fff),
      -2px 2px 0 var(--color-text-stroke, #fff),
      2px 2px 0 var(--color-text-stroke, #fff);
  }
}

.card__image {
  width: 100%;
  aspect-ratio: 1/1;
}

.card__content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-base);
  padding: 20px 25px;
  font-family: var(--font-family-base), sans-serif;
  line-height: 1.1667;
}

.card__actions {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: 6px;
}

.decorated__text {
  font-family: var(--font-family-heading), fantasy;
  font-size: var(--font-size-small);
  line-height: 0.9;
  mix-blend-mode: difference;
  z-index: 10;
  position: relative;
  color: var(--text-blend-color);
}

.card__like-button {
  min-width: 130px;
  padding: 7px 17px;
}

.card__icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background-color: transparent;
  border: 2px solid transparent;
  transition: border 0.3s ease;
}

.main-footer__save-button {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
}



/*======================= MODAL ==========================*/

.modal[open] {
  padding: 26px;
  max-width: 100%;
  width: clamp(341px, 90%, 353px);
  display: flex;
  flex-direction: column;
  gap: 30px;
  border: var(--border);
}

@media (width <=375px) {
  .modal[open] {
    padding: 26px 36px;
  }

  .main-footer__save-button {
    flex-direction: column;
  }
}

.modal::backdrop {
  background-color: var(--color-backdrop, rgba(0, 0, 0, 0.7));
}

.modal__content {
  display: flex;
  flex-direction: row;
  gap: 20px;
}

.modal__text {
  line-height: 1.5;
  text-transform: uppercase;
}

.modal__button-close {
  padding: 9px 17px;
}


.modal__floppy-icon {
  width: 82px;
  height: 60px;
}

.floppy-icon {
  mix-blend-mode: difference;
  z-index: 10;
}

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

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


/*=============Heart=============*/
.sparks {
  opacity: 0;
}

.contour {
  transition: fill 0.1s linear;
}

.core {
  transition: fill 0.3s linear;
  transition-delay: 0.03s;
}

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

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

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


/*active*/

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

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


/*clicked*/
.like-icon.is-liked .core {
  fill: var(--animation-fill-color);
  transition: fill 0.3s linear;
  transition-delay: 0s;
  animation: like-heart-animation 0.3s ease-in 0.1s;
  transform-origin: center;
}

.like-icon.is-liked .main-body {
  fill: var(--animation-fill-color);
  transition: fill 0.3s linear;
  transition-delay: 0.05s;
  animation: like-heart-animation 0.3s ease-in 0.1s;
  transform-origin: center;
}

.like-icon.is-liked .contour {
  fill: var(--animation-fill-color);
  transition: fill 0.3s linear;
  transition-delay: 0.06s;
  animation: like-heart-animation 0.3s ease-in 0.1s;
  transform-origin: center;
}

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


/* =============Фильтры================*/

.image-blur-l {
  filter: blur(5px);
  transform: scale(1.02);
}

.image-brightness-contrast {
  filter: brightness(900%) contrast(100%);
}

.image-sepia-saturate {
  filter: sepia(100%) saturate(110%);
}

.image-saturate {
  filter: saturate(250%);
}

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

.image-blur-s {
  filter: blur(1px);
}

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


/* Button Styles */

.button {
  position: relative;
  background-color: var(--color-secondary);
  transition: box-shadow 0.3s ease;
  border: var(--border);
  overflow: hidden;
}

.button::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: -100%;
  transition: left 0.5s ease-in-out;
  background-color: var(--color-accent);
}

.button:hover::after {
  left: 0;
}

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