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

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

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  width: var(--container-width);
  margin-inline: auto;
  margin-top: 100px;
  margin-bottom: 100px;
  font-family: var(--font-accent);
  background-color: var(--bg-color);
  border: 2px solid currentColor;
}


.header__logo {
  font-size: clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem);
  text-transform: uppercase;
  padding: 128px 0 20px 0;
}

.header__title {
  font-size: clamp(0.875rem, 0.6769rem + 0.8451vw, 1.4375rem);
  text-transform: uppercase;
  padding-bottom: 128px;
}

.main {
  display: flex;
  flex-direction: column;

  gap: 48px;
}

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

.card {
  /* Размер и выравнивание */
  width: var(--container-width);
  margin-inline: auto;

  /* Визуал */
  background-color: var(--bg-color);
  border: 2px solid currentColor;
  overflow: hidden;
}

.card__title {
  /* Шрифт */
  font-size: 18px;
  font-variation-settings: 'wght' var(--font-weight-title);

  /* Отступы */
  padding: 3px 10px 5px;

  /* Нижняя граница */
  border-bottom: 2px solid currentColor;
}

.card__content {
  position: relative;
  border-bottom: 2px solid currentColor;
}

.card__image {
  display: block;
  object-fit: cover;

  width: 100%;
}

.card__text {
  font-weight: var(--font-weight-main);
  font-size: 18px;
  line-height: 21px;

  margin: 25px 25px 0 25px;
}

.card__text p {
  margin-bottom: 25px;
}

.card__label {
  position: absolute;
  right: 1.5rem;
  top: 1.5625rem;

  font: 14px var(--font-accent);
  color: #000;
  opacity: 0.5;
  z-index: 1;

  mix-blend-mode: hard-light;

  text-shadow:
    -1px 0 var(--stroke-color),
     0 1px var(--stroke-color),
     1px 0 var(--stroke-color),
     0 -1px var(--stroke-color);
}

.card__actions {
  display: flex;
  justify-content: end;

  margin-bottom: 25px;
  margin-right: 25px;
}

.card__icon-button {
  /* Сброс стилей */
  appearance: none;
  background-color: transparent;
  padding: 0;
  border: 2px solid transparent;
  cursor: pointer;

  /* Раскладка */
  display: grid;
  margin: 4px 4px 0 0; 

  /* Переходы */
  transition: border-color 0.3s ease;
}

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

.card__icon-button:focus-visible {
  border: 2px solid currentColor;
}

.card__like-button {
  height: 40px;
  width: 130px;
  margin-top: 4px;
}

.save-button {
  display: flex;
  align-items: center;
  width: 335px;
  height: 55px;
  box-sizing: border-box;
}

.submit-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 50px;
  margin-bottom: 100px;
}

.button {
  position: relative;
  overflow: hidden;
  
  /* Базовые стили кнопки */
  background-color: var(--bg-color);
  border: 2px solid currentColor;
  cursor: pointer;
  outline: none;
  
  /* Шрифт */
  font-family: var(--font-accent);
  font-size: 14px;
  font-weight: var(--font-weight-main);
  
  transition: box-shadow 0.3s ease;
}

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

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

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

.button__text {
  position: relative;
  z-index: 1;
  font-family: var(--font-accent);
  font-size: 14px;
  color: var(--bg-color);
  mix-blend-mode: difference;
}


.modal[open] {
  max-inline-size: 353px;
  padding: 0 30px;
  background: var(--bg-color);
  border: 2px solid currentColor;
  box-sizing: border-box;
  font-family: var(--font-accent);
  color: #000;
}

.modal[open]::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
}

.modal__content {
  margin: 30px 0;
}

.modal__icon {
  margin: 12px 20px 12px 0;
}

.modal__columns {
  display: flex;
  align-items: flex-start;
  margin-bottom: 30px;
}

.modal__text {
  margin-bottom: 0;
  font-family: var(--font-accent);
  font-size: 14px;
  font-weight: var(--font-weight-main);
  line-height: 1.5;
  text-transform: uppercase;
}

.modal-button__icon {
  z-index: 1;
  fill: var(--bg-color);
  mix-blend-mode: difference;
  width: 21px;
  height: 21px;
  margin-top: 10px;
  margin-right: 9px;
  margin-left: 11px;
  margin-bottom: 11px;
}

.modal__button {
  width: 100%;
  padding: 9px 0 7px;
  box-sizing: border-box;
}

.filter-grayscale   { filter: grayscale(0.8); }
.filter-sepia       { filter: sepia(0.85); }
.filter-saturate    { filter: saturate(3); }
.filter-blur        { filter: blur(10px); }
.filter-hue-rotate  { filter: hue-rotate(30deg); }
.filter-invert      { filter: invert(80%); }
.filter-multiple    { filter: hue-rotate(90deg) contrast(0.4) saturate(1.5) blur(2px); }


@supports ((text-stroke: 0.5px var(--stroke-color)) or (-webkit-text-stroke: 0.5px var(--stroke-color))) {
  .card__label {
    -webkit-text-stroke: 0.5px var(--stroke-color);
    text-stroke: 0.5px var(--stroke-color);
    text-shadow: none;
  }
}


@media (width <= 375px) {
  .header {
    width: 100%;
  }

  .header__logo {
    padding: 120px 14px 20px;
  }

  .header__title {
    padding-bottom: 120px;
  }

  .card__label {
    right: 0.6rem;
  }

  .save-button {
    width: 306px;
    height: 84px;
    margin-inline: 34px;
    flex-direction: column;
  }

  .modal-button__icon {
    width: 28px;
    height: 28px;
    margin: 14px 0 10px 10px;
  }

  .modal__content {
    margin: 30px 10px;
  }

  .modal__button {
    padding-block: 9px 10px;
  }

  .modal {
    padding-inline: 42px;
    margin-inline: 17px;
  }
}