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

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

.header {
  inline-size: clamp(23.438rem, 16.285rem + 30.52vw, 43.75rem);
  display: flex;
  align-items: center;
  flex-direction: column;
  font-family: var(--accent-font);
  background: var(--background-color);
  border: 2px solid var(--border-color);
  font-weight: var(--header-text-weight);
  margin: 100px auto;
  padding: clamp(120px, 0.75vw + 117.2px, 128px) 0;
}

.header-title {
  color: var(--text-color);
  font-size: clamp(3.063rem, 2.71rem + 1.502vw, 4.063rem);
  font-weight: var(--text-weight);
  text-transform: uppercase;
  margin-block-end: 20px;
}

.header-text {
  color: var(--text-color);
  font-size: clamp(0.875rem, 0.677rem + 0.845vw, 1.438rem);
  font-weight: var(--header-text-weight);
  text-transform: uppercase;
}

.cards {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
}

.card {
  inline-size: clamp(23.438rem, 16.285rem + 30.52vw, 43.75rem);
  background: var(--background-color);
  border: 2px solid var(--border-color);
}

.card-title {
  font-size: 18px;
  color: var(--text-color);
  margin: 4px 10px;
  font-variation-settings: "wght" var(--title-weight);
  line-height: 22px;
}

.card-image-container {
  position: relative;
  inline-size: 100%;
}

.card-image-label {
  position: absolute;
  font-size: 14px;
  font-weight: var(--text-weight);
  font-family: var(--accent-font);
  color: var(--text-color);
  opacity: 0.5;
  mix-blend-mode: hard-light;
  text-shadow: -1px 0 var(--background-color),
    0 1px var(--background-color), 1px 0 var(--background-color),
    0 -1px var(--background-color);
  inset-block-start: 28px;
  inset-inline-end: 25px;
  z-index: 1;
}

.card-image {
  box-sizing: content-box;
  block-size: auto;
  max-block-size: clamp(371px, calc(371px + (100vw - 375px) * 0.30516), 696px);
  display: block;
  inline-size: 100%;
  border-block-start: 2px solid var(--border-color);
  border-block-end: 2px solid var(--border-color);
  aspect-ratio: 1/1;
  object-fit: cover;
  object-position: center;
}

.filter-blur {
  filter: blur(3px);
}

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

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

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

.filter-brightness {
  filter: brightness(0.4);
}

.filter-contrast {
  filter: contrast(0.6);
}

.filter {
  filter: 
          blur(4px)
          grayscale(60%) 
          hue-rotate(180deg) 
          saturate(3);
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 25px;
}

.card-text-content {
  display: flex;
  flex-direction: column;
  gap: 25px;
  color: var(--text-color);
  font-size: 18px;
  font-weight: var(--text-weight);
  line-height: 21px;
}

.card-buttons {
  display: flex;
  justify-content: end;
  gap: 4px;
}

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

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

.card__icon-button:focus-visible {
  border-color: var(--border-color);
}

.button {
  background-color: var(--background-color);
  border: 2px solid var(--border-color);
  color: var(--border-color);
  cursor: pointer;
  font-family: var(--accent-font);
  font-size: 14px;
  font-weight: var(--button-text-weight);
  line-height: 90%;
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.3s ease;
  z-index: 1;
}

.button:focus {
  outline: none;
}

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

.button::before {
  content: "";
  position: absolute;
  background-color: var(--border-color);
  inset: 0;
  transform: translateX(-100%);
  transition: transform 0.5s ease-in-out;
  z-index: -1;
}

.button:hover::before {
  transform: translateX(0);
}

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

.button__text {
  position: relative;
  font-family: var(--accent-font);
  font-size: 14px;
  font-weight: var(--button-text-weight);
  line-height: 90%;
  color: var(--background-color);
  mix-blend-mode: difference;
  z-index: 1;
  white-space: nowrap;
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page__button {
  max-block-size: 306px;
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 52px clamp(2.156rem, -1.101rem + 13.897vw, 11.406rem) 100px;
  padding: 15px 18px;
  text-align: center;
}

.floppy-icon {
  position: relative;
  block-size: 28px;
  inline-size: 28px;
  color: var(--background-color);
  mix-blend-mode: difference;
  z-index: 1;
}

.modal-window {
  flex-direction: column;
  gap: 30px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 14px;
  font-weight: var(--button-text-weight);
  font-variation-settings: "wght" var(--button-text-weight);
  text-transform: uppercase;
  max-inline-size: clamp(341px, 335.4px + 1.5vw, 357px);
  padding: 30px clamp(30px, -0.94vw + 43.52px, 40px);
}

.modal-window[open] {
  display: flex;
}

.modal-window::backdrop {
  background-color: var(--modal-background-color);
}

.modal-window__content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.modal-window__icon {
  block-size: 39px;
  inline-size: 39px;
  flex-shrink: 0;
}

.modal-window__text {
  font-family: var(--accent-font);
  line-height: 150%;
}

.modal-window__button {
  inline-size: 100%;
  padding: 11px 0;
  text-transform: uppercase;
}

@media (width > 375px) {
  .page__button {
    flex-direction: row;
  }

  .floppy-icon {
  block-size: 21px;
  inline-size: 21px;
  }
}

@supports (-webkit-text-stroke: 1px var(--background-color)) {
  .card__image-label {
    -webkit-text-stroke: 1px var(--background-color);
    text-shadow: none;
  }
}
