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

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

.header {
  margin: var(--header-margin);
  display: flex;
  justify-content: center;
}

.header__container {
  width: var(--container-width);
  border: 2px solid var(--black);
  padding: var(--header-padding);
  background-color: var(--white);
}

.header__title {
  display: flex;
  align-items: center;
  flex-direction: column;
  font-family: var(--PressStart2P), monospace;
  gap: var(--header-gap-between-logo-and-text);
  text-transform: uppercase;
  font-weight: var(--main-font-weight);
}

.header__title-logo {
  font-size: var(--header__title-logo-size);
}

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

/* MAIN */

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

.main__container {
  width: var(--container-width);
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.container__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--white);
}

.card__title-container {
  padding: var(--card__title-container-padding);
  inline-size: 100%;
  border-style: solid solid none solid;
  border-width: 2px 2px 0px 2px;
  border-color: var(--black);
}

.card__title {
  font-size: var(--card__font-main-size);
  font-variation-settings: 'wght' var(--card-heading-font-weight);
}

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

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

.card__image-container {
  inline-size: 100%;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--black); /* Края контейнера  */
}

.card__image {
  inline-size: 100%;
  block-size: 100%;
  display: block;
}

.card__label {
  position: absolute;
  top: 25px;
  right: clamp(13px, 8.77px + 1.13vw, 25px);
  font-size: var(--card__font-button-size);
  font-family: var(--PressStart2P), monospace;
  mix-blend-mode: hard-light;
  color: var(--black);
  text-shadow:
    -1px 0 var(--white),
    0 1px var(--white),
    1px 0 var(--white),
    0  -1px var(--white);
  opacity: 0.5;
  text-transform: uppercase;
  line-height: 100%;
}

@supports (-webkit-text-stroke: 2px var(--white)) {
  .card__label {
    text-shadow: none;
    paint-order: stroke fill;
    -webkit-text-stroke: 2px var(--white);
  }
}

.card__bottom-container {
  border-style: none solid solid solid;
  border-width: 0px 2px 2px 2px;
  border-color: var(--black);
  inline-size: 100%; /* на всякий */
  display: flex;
  flex-direction: column;
  padding: var(--card-padding-texts);
  gap: 25px;
}

.card__text-container {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap-between-texts);
}

.card__button-container {
  align-self: end;
  display: flex;
  gap: 5px;
}

.card__icon-button {
  background: none;
  border: 2px solid transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 41px;
  padding: 0;
  
  transition: border-color 0.3s ease;
}

.like-icon {
  width: 37px;
  height: 34px;
  
}

.card__like-button {
  background-color: var(--white);
  border: 2px solid var(--black);
  width: 130px;
  height: 38px;

  position: relative;
  transition: box-shadow 0.3s ease;
}

.button__text {
  font-family: var(--PressStart2P), monospace;
  font-size: var(--card__font-button-size);
  color: var(--white);
  mix-blend-mode: difference;
  position: relative;
}

.dialog__button-container {
  display: flex;
  justify-content: center;
  margin-bottom: 103px;
  container-type: inline-size;
}

.dialog__button {
  width: var(--dialog-button-width);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--white);
  gap: 8px;
  white-space: nowrap;
  border: 2px solid var(--black);
  padding: 15px 0px 15px 0px;
  position: relative;
  transition: box-shadow 0.3s ease;
}

@container (width <= 400px) {
  .dialog__button {
    flex-direction: column;
  }
}

.floppy-icon {
  width: var(--floppy-icon-width);
  height: var(--floppy-icon-height);
  fill: var(--white);
  mix-blend-mode: difference;
  position: relative;
}

/* Диалог ниже */

.dialog[open] {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 30px clamp(30px, 43.52px + -0.94vw, 40px) 30px clamp(30px, 43.52px + -0.94vw, 40px);
  width: clamp(341px, 335.37px + 1.50vw, 357px);
  max-width: 100%;
  height: clamp(193px, 195.70px + -0.19vw, 195px);
}

.dialog[open]::backdrop {
  opacity: 0.75;
  background-color: var(--black);
}

.dialog__container-first-row {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: center;
}

.dialog__svg {
  width: 39px;
  height: 39px;
  flex-shrink: 0;
}

.dialog__text {
  font-family: var(--PressStart2P), monospace;
  line-height: 140%;
  font-size: 14px;
  text-transform: uppercase;
}

.dialog__close-button {
  border: 2px solid var(--black);
  background-color: transparent;
  padding: 6px 112px; /* было 10px */
  
  text-transform: uppercase;

  position: relative;
  transition: box-shadow 0.3s ease;
  
}




/* Адаптивность  */

@media (width < 375px) {
  .header__container {
    width: 100%;
  }
  .main__container {
    width: 100%;
  }
  .header__title-logo {
    font-size: var(--less-than-375-header-logo-size);
  }
  .dialog__button {
    width: 100%;
  }
}

@media (width > 375px) {
  .text-break {
    display: none;
  }
}

/* Фильтры */

.filter-one {
 /* Тут не буду */
}

.filter-two {
  filter:
  saturate(55%)
  brightness(92%)
  contrast(105%)
  grayscale(0.5)
  hue-rotate(4deg);
  
}

.filter-three {
  filter:
  saturate(190%)
  contrast(120%)
  hue-rotate(20deg)
  brightness(125%);
  
}

.filter-four {
  filter: hue-rotate(45deg)
}

.filter-five {
  filter:
  invert(85%)
  saturate(70%)
  brightness(95%)
  contrast(90%);

}

.filter-six {
  filter: sepia(90%);
}

.filter-seven {
  filter: blur(17px);
  
}

.filter-eight {
  filter:
  brightness(0.97)
  contrast(0.55)
  hue-rotate(90deg)
  grayscale(0.25)
  blur(1px)
  saturate(1.85);
}

/* Эффекты кнопок */

.card__like-button:focus,
.dialog__button:focus,
.dialog__close-button:focus {
  outline: none;
  box-shadow: 2px 2px 0 var(--black);
}

.card__like-button::before,
.dialog__button::before,
.dialog__close-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--black);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease-in-out;
}

.card__like-button:hover::before,
.dialog__button:hover::before,
.dialog__close-button:hover::before {
  transform: scaleX(1);
}

/* Фокус сердца */

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

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

