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

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

*/

.page {
  min-inline-size: 320px;
  margin: auto;
  max-width: 700px;
  background-image:
   repeating-linear-gradient(
    to right, 
    #d3d3d3 0 2px,
    transparent 2px 4px
   ),
   repeating-linear-gradient(
    to bottom,
    #d3d3d3 0 2px,
    transparent 2px 4px
   ),
   linear-gradient(
    #e7e7e7 0.01%,
    #1a1a1a
   )
  ;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  font-variation-settings: 'wght' var(--font-weight-regular, 410);
  font-family: var(--font-family-main, sans-serif);
}

.header {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: var(--bg-color, #fff);
  inline-size: var(--inline-size, clamp(375px, 100%, 700px));
  margin: 100px 0;
  border: #000 solid 2px;
  align-items: center;
  justify-content: center;
  padding: 130px 122.5px;
}

.logo {
  font-family: var(--font-family-accent, sans-serif);
  text-transform: uppercase;
  font-weight: 400;
  font-size: clamp(3.0625rem, 1.9087rem + 4.9231vw, 4.0625rem);
  line-height: 100%;
  letter-spacing: 0;
  color: var(--text-color, #000);
}

.name {
  font-family: var(--font-family-accent, sans-serif);
  text-transform: uppercase;
  font-weight: 400;
  font-size: clamp(0.875rem, 0.226rem + 2.7692vw, 1.4375rem);
  line-height: 100%;
  letter-spacing: 0;
  color: var(--text-color, #000);
  inline-size: var(--inline-size, clamp(375px, 100%, 700px));
  text-align: center;
}

.content {
  display: grid;
  inline-size: var(--inline-size, clamp(375px, 100%, 700px));
  height: min-content;
}

.card {
  display: grid;
  inline-size: var(--inline-size, clamp(375px, 100%, 700px));
  height: min-content;
  border: 2px solid #000;
  margin-bottom: 50px;
  background-color: var(--bg-color, #fff);
}

.card-text__title {
  font-family: var(--font-family-main, sans-serif);
  font-variation-settings: 'wght' var(--font-weight-bold, 715);
  font-size: 18px;
  color: var(--text-color, #000);
  margin: 5px 10px;
}

.picture-zone {
  position: relative;
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
}

.card__picture {
  display: block;
  max-width: 100%;
  height: auto;
}

.lable-text {
  position: absolute;
  top: 25px;
  right: 25px;
  font-family: var(--font-family-accent, sans-serif);
  text-transform: uppercase;
  font-weight: 400;
  font-size: 14px;
  line-height: 100%;
  letter-spacing: 0;
  color: var(--text-color, #000);
  opacity: 50%;
  mix-blend-mode: hard-light;
  text-shadow: -1px 0 var(--text-shadow-color, rgba(255, 255, 255, 0.5)), 0 1px var(--text-shadow-color, rgba(255, 255, 255, 0.5)), 1px 0 var(--text-shadow-color, rgba(255, 255, 255, 0.5)), 0 -1px var(--text-shadow-color, rgba(255, 255, 255, 0.5));
}

@supports ((text-stroke: 1px var(--text-shadow-color, rgba(255, 255, 255, 0.5))) or (-webkit-text-stroke:1px var(--text-shadow-color, rgba(255, 255, 255, 0.5)))) {
  .lable-text {
    -webkit-text-stroke:1px var(--text-shadow-color, rgba(255, 255, 255, 0.5))
  }
}

.content__text {
  font-family: var(--font-family-main, sans-serif);
  font-weight: var(--font-weight-regular, 410);
  font-size: 18px;
  line-height: 21px;
  color: var(--text-color, #000);
}

.content-story {
  display: grid;
  gap: 25px;
  padding: 24px 25px;
}

.content__text:last-of-type {
  margin-top: 0;
}

.button-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  margin: 0 25px 25px auto;
  gap: 7px;
}

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

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

.card__icon-button:focus-visible {
  border-color: #000;
  transition: border-color 0.3s ease;
}

.button {
  font-family: var(--font-family-accent, sans-serif);
  font-weight: 400;
  font-size: 14px;
  line-height: 90%;
  letter-spacing: 0;
  cursor: pointer;
  padding: 0;
  color: var(--button-text-color, #fff);
  background-color: var(--bg-color, #fff);
}

.button .save-icon {
  mix-blend-mode: difference;
}

.button:focus {
  outline: none;
}

.card__like-button {
  border: 2px solid #000;
  background-color: inherit;
  height: 38px;
  width: 130px;
}

.save-icon:hover {
  fill: #fff;
  mix-blend-mode: difference;
}

.button__transform {
  position: relative;
  overflow: hidden;
  transition: background-color 0.3s, box-shadow 0.3s ease;
}

.button__transform:hover {
  background-color: white;
}

.button__transform::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background-color: black;
  transition: left 0.5s ease-in-out;
}

.button__transform:hover::before {
  left: 0%;
}

.button__text {
  color: white;
  mix-blend-mode: difference;
}

.button__transform:focus {
  box-shadow: none;
}

.button__transform:focus-visible {
  box-shadow: 2px 2px 0 var(--text-color, #000);
  color: white;
  transition: box-shadow 0.3s ease;
}

.save {
  display: flex;
  justify-content: center;
}

.button__save {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 17px 20px;
  background-color: var(--bg-color, #fff);
  margin-bottom: 100px;
  border: 2px solid #000;
}

.save-icon {
  width: 21px;
  height: 21px;
  z-index: 1;
}

.dialog {
  display: none;
  grid-template-columns: min-content 1fr;
  outline: 2px solid #000;
  padding: 27px 30px;
  max-width: 353px;
  row-gap: 30px;
  column-gap: 20px;
  border: none;
  align-items: center;
}

.dialog[open] {
  display: grid;
}

.dialog::backdrop {
  background-color: rgba(0, 0, 0, 1);
  opacity: 75%;
  z-index: 1;
}

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

.dialog-text {
  font-family: var(--font-family-accent, sans-serif);
  font-weight: 400;
  font-size: 14px;
  line-height: 150%;
  letter-spacing: 0;
  text-transform: uppercase;
  
}

.button__card-dialog {
  background-color: inherit;
  grid-column: span 2;
  padding-top: 10.5px;
  padding-bottom: 10.5px;
}

.dialog__save-icon {
  width: 39px;
  height: 39px;
}

.sparks {
  opacity: 0;
}

.contour {
  transition: fill 0.1s linear;
}

.like-icon {
  height: 38px;
  width: 38px;
}

.like-icon.is-liked .contour {
  fill: var(--animation-fill-color-finish, rgba(255, 0, 0, 1));
  transition: fill 0.3s linear 0.06s;
}

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

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

.like-icon:active .main-body {
  fill: var(--animation-fill-color-finish,  rgba(255, 0, 0, 1));
  transition: fill 0.3s linear 0.05s;
}

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

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

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

.like-icon:active .core {
  fill: var(--animation-fill-color-finish,  rgba(255, 0, 0, 1));
  transition: fill 0.3s linear;
}

.like-icon.is-liked .core {
  fill: var(--animation-fill-color-finish,  rgba(255, 0, 0, 1));
  transition: fill 0.3s linear;
}

@media (width <= 375px) {
  .header {
    padding: 122px 16px;
  }

  .button__save {
    flex-direction: column;
  }

  .save-icon {
    width: 28px;
    height: 28px;
  }

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

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

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

.heart {
  transform-origin: center;
}

.filter-brightness {
  filter: brightness(50%);
}

.filter-contrast {
  filter: contrast(150%);
}

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

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

.filter-saturate {
  filter: saturate(200%);
}

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

.filter-many {
  filter: sepia(50%) invert(0.2) contrast(120%);
}