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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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, sans-serif), Arial, sans-serif;
  color: #000;
  font-variation-settings: "wght" var(--main-weight);
  background-image:
    repeating-linear-gradient(to right, var(--background-image) 0px 2px, transparent 2px 4px),
    repeating-linear-gradient(var(--background-image) 0px 2px, transparent 2px 4px),
    repeating-linear-gradient(180deg, #e7e7e7 0.01%, #1a1a1a 100%);
  background-attachment: fixed;
  background-size: cover;
}

.block {
  inline-size: var(--block-width);
  background-color: #fff;
  border: var(--border);
}

/*Шапка*/

.header {
  margin: 98px auto;
  padding: clamp(7.625rem, 7.4489rem + 0.7512vw, 8.125rem) clamp(1rem, -1.3437rem + 9.9996vw, 7.656rem);
  font-family: var(--accent-font, sans-serif ), sans-serif;
  text-transform: uppercase;
  text-align: center;
}

.header__title {
  margin-block-end: 20px;
  font-size: clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem);
}

.header__subtitle {
  font-size: clamp(0.875rem, 0.6769rem + 0.8451vw, 1.4375rem);
}

/*Основное содержимое*/

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-block-end: 100px;
}

.content__list {
  margin-block-end: 52px;
}

.content__list-item:not(:last-of-type) {
  margin-block-end: 50px;
}

.card__title {
  padding: 4px 10px;
  font-variation-settings: "wght" var(--title-main-weight), 'slnt' 0;
  font-size: 18px;
  line-height: 22px;
}

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

.card__text-paragraph:not(:last-of-type) {
  margin-block-end: 25px;
}

/*картинка с карточки + фильтры на карточках*/

.card__image {
  position: relative;
}

.image {
  display: block;
  inline-size: 100%;
  block-size: clamp(23.438rem, 16.2859rem + 30.5157vw, 43.75rem);
  object-fit: cover;
  border-block-start: var(--border);
  border-block-end: var(--border);
}

.grayscale {
  filter: grayscale(79%) brightness(70%);
}

.hue-rotate {
  filter: hue-rotate(-20deg) brightness(60%);
}

.sepia {
  filter: sepia(40%) brightness(60%);
}

.contrast {
  filter: contrast(150%) brightness(60%);
}

.saturate {
  filter: saturate(200%) brightness(71%);
}

.invert {
  filter: invert(20%) contrast(120%);
}

.opacity {
  filter: opacity(80%) brightness(71%);
}

.blur {
  filter: blur(1px) brightness(71%);
}

/*лейбел*/

.label {
  position: absolute;
  inset-block-start: 25px;
  inset-inline-end: 25px;
  font-family: var(--accent-font, sans-serif ), sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  mix-blend-mode: hard-light;
  filter: opacity(0.5);
  text-shadow:
  -1px 0 #fff,
  0 1px #fff,
  1px 0 #fff,
  0 -1px #fff;
}

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

/*кнопка с сердцем*/

.card__icon-button {
  inline-size: 38px;
  block-size: 38px;
  border: 2px solid transparent;
  background-color: transparent;
  transition: border 0.3s ease;
  cursor: pointer;
}

.like-icon {
  margin-left: -8px;
}

.contour {
  transition: fill 0.1s linear 0s;
}

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

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

.sparks {
  opacity: 0;
}

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

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

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

.card__icon-button:focus-visible {
  border: 2px solid currentColor;
  transition: border 0.3s ease;
}

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

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

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

.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: heart-animation 0.3s ease-in 1 0.1s;
  transform-origin: center;
}

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

/*остальные кнопки*/

.card__buttons {
  display: flex;
  justify-content: end;
  gap: 7px;
  padding: 0 25.2px 25.3px;
}

.button {
  position: relative;
  overflow: hidden;
  z-index: 1;
  border: var(--border);
  cursor: pointer;
  background-color: #fff;
  transition: box-shadow 0.3s ease;
}

.card__like-button {
  inline-size: 130px;
  block-size: 38px;
}

.button__text {
  display: block;
  font-family: var(--accent-font, sans-serif ), sans-serif;
  font-size: 14px;
  line-height: 90%;
  color: #fff;
  mix-blend-mode: difference;
}

.content__button {
  padding: 15px 0;
  inline-size: clamp(19.125rem, 18.4870rem + 2.7223vw, 20.937rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.icon {
  inline-size: 21px;
}

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

.button:before {
  content: "";
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0%;
  left: -100%;
  background-color: #000;
  transition: 0.5s ease-in-out;
  z-index: -1;
}

.button:hover:before {
  top: 0;
  left: 0;
  transform: scale(1);
  transition: 0.5s ease-in-out;
}

.button:focus {
  outline: none;
  box-shadow: 2px 2px 0 0 #000;
  transition: box-shadow 0.3s ease;
}

/*диалог*/

.content__dialog[open] {
  max-inline-size: 353px;
  inline-size: 80%;
  min-inline-size: 341px;
  padding: 27px;
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: min-content 1fr;
  grid-template-rows: auto;
  column-gap: 20px;
  row-gap: 28px;
  align-items: center;
}

.content__dialog[open]::backdrop {
  background-color: rgb(0 0 0 / 0.75);
}

.content__dialog[open] .icon {
  inline-size: 41px;
}

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

.dialog-close {
  inline-size: clamp(16.312rem, 15.6078rem + 3.0047vw, 18.312rem);
  block-size: 38px;
  grid-column: span 2;
  grid-row: span 2;
}

.content__dialog[open] .button__text {
  text-transform: uppercase;
  line-height: 150%;
}

/*Медиа
p.s. у меня в контрольной точке @media (width <= 375px)  не меняет отображение в ширине 375px.
Если ставлю ширину (в devtools) 374px  все срабатывает.
Также если ставлю контрольную точку @media (width <= 375.5px) тоже все работает.  
наставник сказал, что возможная причина может быть зум, погрешность браузера при округлении пикселей*/

@media (width <= 375px) {
  .content__button {
    flex-direction: column;
  }

  .icon {
   inline-size: 28px;
  }

  .content__dialog[open] {
    padding: 25px 37px 30px;
  }
}








