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

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

*/

.page {
  font-family: var(--font-main);

  background-image: var(--background-gradient);
  background-size: cover;
  background-attachment: fixed;
  min-inline-size: 320px;
  min-block-size: 100dvb;
  font-variation-settings: "wght" var(--font-weight-text);
}

.block {
  width: var(--block-width);
  margin: 0 auto;
}

.header {
  margin: 100px auto;
  border: 2px solid var(--dark-color);
  background-color: var(--light-color);
}

.logo-group {
  display: grid;
  place-content: center;
  gap: 18px;

  padding-inline: clamp(1rem, -1.07rem + 9.66vw, 7.625rem);
  padding-block: clamp(7.625rem, 7.47rem + 0.73vw, 8.125rem);

  font-family: var(--font-accent);
  text-align: center;
  text-transform: uppercase;
}

.main-title {
  font-size: var(--title-size);
}

.subtitle {
  font-size: var(--subtitle-size);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(375px, 1fr));
  gap: 50px;
}

.card {
  border: 2px solid var(--dark-color);
  background-color: var(--light-color);
}

.heading {
  padding: 4px 10px;
  font-size: var(--heading-size);
  font-variation-settings: "wght" var(--font-weight-title);
}

.image__wrapper {
  position: relative;
  display: inline-block;
  outline: 2px solid var(--dark-color);
  overflow: hidden;
}

.card__image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
}

.img-bright {
  filter: brightness(4.3);
}

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

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

.img-sepia {
  filter: sepia(100%);
}

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

.img-blur {
  filter: blur(5px);
}

.img-multi {
  filter: saturate(200%) contrast(120%) hue-rotate(120deg);
}

.card-label {
  position: absolute;
  top: 27px;
  right: 25px;
  z-index: 1;
  opacity: 0.5;
  color: var(--dark-color);
  font-family: var(--font-accent);
  font-size: var(--label-text-size);

  text-shadow: 
    2px 0 var(--label-stroke-color),
    -2px 0 var(--label-stroke-color),
    0 2px var(--label-stroke-color),
    0 -2px var(--label-stroke-color);
  pointer-events: none;
  mix-blend-mode: hard-light;
}

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

.card__content {
  display: grid;
  gap: 22px;

  padding: 20px 25px 23px;
}

.text {
  font-size: var(--text-size);
  line-height: var(--text-line-height);
}

.buttons {
  display: grid;
  grid-template-columns: auto 1fr;
  justify-self: end;
  align-items: stretch;
  gap: 5px;
}

.card__icon-button {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border: 2px solid transparent;
  padding: 0;
  outline: none;
  background: none;

  transition: border-color 0.3s ease;
  cursor: pointer;
}

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

.button {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;

  width: max-content;
  margin: 0 auto;
  border: 2px solid var(--dark-color);
  outline: none;
  overflow: hidden;

  font-family: var(--font-accent);
  font-size: var(--button-text-size);
  background: var(--light-color);
  transition: box-shadow 0.3s ease;
  cursor: pointer;
}

.card__like-button {
  width: 129px;
  padding: 12px 0;
}

.button__text {
  position: relative;
  z-index: 1;
  color: var(--light-color);
  mix-blend-mode: difference;
}

.floppy {
  position: relative;
  z-index: 1;
  color: var(--light-color);
  fill: currentColor;
  mix-blend-mode: difference;
}

.save-button {
  margin-block-end: 100px;
  padding: 17px 20px;
}

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

.button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  background: var(--dark-color);
  transition: transform 0.5s ease-in-out;
  transform: scaleX(0);
  transform-origin: left;
}

.button:hover::before {
  transform: scaleX(1);
}

.save-window {
  display: none;
  max-width: 353px;
  padding: 30px;
  outline: 2px solid var(--dark-color);
  background: var(--light-color);
}

.save-window[open] {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.save-window::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
}

.dialog__content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.dialog__content svg {
  flex-shrink: 0;
}

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

.save-window .save-button {
  width: 100%;
  margin: 0;
  text-transform: uppercase;
}

@media (width <= 375px) {
  .header {
    margin: 99px 0;
  }

  .cards {
    gap: 51px;
  }

  .card__content {
    gap: 24px;
    padding: 23px 25px;
  }

  .button.save-button {
    flex-direction: column;
    padding: 14px 17px;
  }

  .save-button svg {
    width: 28px;
    height: 28px;
  }
}