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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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;
  font-family: var(--main-font-family);
  background-image: repeating-linear-gradient(
      270deg,
      #d3d3d3 0px 2px,
      transparent 2px 4px
    ),
    repeating-linear-gradient(0deg, #d3d3d3 0px 2px, transparent 2px 4px),
    linear-gradient(#e7e7e7 0 0.01%, #1a1a1a);
  background-size: cover;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 100px;
  font-variation-settings: "wght" 410;
}

.header {
  background-color: #fff;
  border: 2px solid #000;
  width: var(--main-width);
  /* block-size: 368px; */
  margin-block-start: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header_text {
  padding: 130px 0;
}

.header_main-text {
  font-family: var(--accent-font-family);
  font-weight: 400;
  font-size: clamp(3.0625rem, 1.9087rem + 4.9231vw, 4.0625rem);
  line-height: clamp(3.0625rem, 1.9087rem + 4.9231vw, 4.0625rem);
  letter-spacing: 0;
  text-transform: uppercase;
}

.header_description-text {
  font-family: var(--accent-font-family);
  font-size: clamp(0.875rem, 0.226rem + 2.7692vw, 1.4375rem);
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: center;
  padding-top: 20px;
}

/*--------------------------*/

.cards {
  width: var(--main-width);
  display: flex;
  flex-direction: column;
  gap: 50px;
  padding-bottom: 100px;
}

.cards_card-list {
  display: flex;
  flex-direction: column;
  gap: 52px;
}

.card {
  background-color: #fff;
  border: 2px solid #000;

  /* position: relative; */
}

.card_title {
  font-variation-settings: "wght" var(--accent-font-weight);
  font-size: 18px;
  padding: 6px 10px;
  line-height: 18px;
  letter-spacing: 0;
}

.card_wrapper {
  position: relative;
}

/*----------------------------*/

.card_image {
  object-fit: contain;
  max-width: 100%;
}

.filter-brigtness {
  filter: brightness(0.5);
}

.filter-blur {
  filter: blur(1rem);
}

.filter-contrast-invert {
  filter: contrast(3) invert(1);
}

.filter-opacity {
  filter: opacity(0.3);
}

.filter-grayscale {
  filter: grayscale(0.666);
}

.filter-sepia {
  filter: sepia(0.99);
}

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

.card_label {
  position: absolute;
  top: 25px;
  right: 25px;
  font-family: var(--accent-font-family);
  text-transform: uppercase;
  letter-spacing: 0;
  mix-blend-mode: hard-light;
  text-shadow: 1px #fff;
  opacity: 0.5;
}

/*---------------------------*/

.card_text-wrapper {
  padding: 21px 25px 24px;
  font-size: 18px;
  line-height: 21px;
  letter-spacing: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-style: normal;
  font-weight: 410;
}

.button-change-background {
  transition: box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.button-change-background:focus {
  outline: none;
  box-shadow: 2px 2px 0 #000;
}

.button-change-background::before {
  transform: translateX(-100%);
  transition: transform 0.5s 0.2s, background-color 0.3s ease;
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  /* transition: background-color 0.3s ease; */
  z-index: 1;
}

.button-change-background:hover::before {
  transform: translateX(0);
  /* mix-blend-mode: difference; */
}

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

.card_buttons {
  justify-self: flex-end;
  align-self: flex-end;
  padding-right: 25px;
  padding-bottom: 25px;
  display: flex;
  gap: 7px;
}

.card_buttons button {
  background-color: transparent;
  height: 38px;
  line-height: 38px;
  vertical-align: middle;
}

.card__icon-button {
  border: 2px solid transparent;
  transition: border 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  block-size: 38px;
  inline-size: 38px;
  padding: 0;
}

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

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

.card__like-button {
  width: 130px;
  padding: 0;
  border: 2px solid #000;
}

/*--------------SVG HEART----------*/

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

.sparks {
  opacity: 0;
}

.contour {
  transition: fill 0.1s linear;
}

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

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

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

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

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

.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;
}

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

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

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

/*------------------------------------*/

.button__text {
  /* padding: 12px 37px; */
  text-align: center;
  font-family: var(--accent-font-family);
  font-size: 14px;
  line-height: 12.6px;
  letter-spacing: 0;
  position: relative;
  z-index: 5;
  mix-blend-mode: difference;
  color: #fff;
}

dialog {
  width: 353px;
  /* font-size: 14px; */
  letter-spacing: 0;
  text-transform: uppercase;
  padding: 30px;
}

.dialog-text {
  font-size: 14px;
  line-height: 21px;
  font-family: var(--accent-font-family);
  text-transform: uppercase;
}

dialog button {
  font-size: 14px;
  line-height: 21px;
  font-family: var(--accent-font-family);
  text-transform: uppercase;
  width: 293px;
  text-align: center;
  /* display: block; */
  margin: 30px auto 0;
  padding: 6.5px;
  border: 2px solid #000;
  background-color: transparent;
}

dialog[open] .dialog_block {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 100%;
}

dialog[open] .dialog_block svg {
  flex-shrink: 0;
  width: 39px;
  height: 39px;
}

dialog::backdrop {
  background-color: rgb(0 0 0 / 0.75);
}

.button-save {
  width: 335px;
  margin: auto;
  border: 2px solid#000;
  padding: 17px;
}

.button-small-padding {
  padding: 0;
}

.button-small-padding img {
  margin: 0;
}

.button_save-span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button-icon {
  max-width: 21px;
  height: auto;
}

.button-icon use {
  fill: #fff;
}

/*-----------------------------------*/

@supports (font-variation-settings: normal) {
  .page {
    font-weight: var(--main-font-weight);
  }
  .card_text {
    font-weight: 410;
  }
}

@media (width <= 375px) {
  .card-title {
    font-weight: bold;
  }

  .button_save-span {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }
}
