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

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

.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: var(--font-accent);
  font-weight: var(--font-accent-weight);
  color: var(--text-color);
  min-block-size: 327px;
  text-transform: uppercase;
  margin: 100px auto;
  border: 2px solid var(--text-color);
}

.variable-calc {
  width: var(--variable-width);
  background-color: #fff;
}

.header__title {
  font-size: clamp(49px, 43.37px + 1.5vw, 65px);
}

.header__text {
  font-size: clamp(14px, 10.83px + 0.85vw, 23px);
  padding-top: 20px;
}

/*фильтры на картинки*/
.filter-first {
  filter: grayscale(100%);
}

.filter-second {
  filter: hue-rotate(280deg) saturate(250%) contrast(120%);
}

.filter-third {
  filter: hue-rotate(240deg) saturate(180%) drop-shadow(0 0 5px rgba(255, 0, 255, 0.3));
}

.filter-fourth {
  filter: sepia(100%) hue-rotate(60deg) saturate(120%) brightness(0.9) contrast(0.8);
}

.filter-fifth {
  filter: sepia(100%) contrast(1.1) brightness(0.9);
}

.filter-sixth {
  filter: blur(8px) saturate(1.2) brightness(0.9);
}

.filter-seventh {
  filter: sepia(100%) hue-rotate(-50deg) brightness(0.9) contrast(0.85);
}

.card-list {
  margin: auto;
}

.card {
  margin-bottom: 50px;
  border: 2px solid var(--text-color);
}

.card__title {
  font-weight: var(--font-title-weight);
  color: var(--text-color);
  font-size: var(--title-font-size);
  margin: 4px 10px;
}

.card__text {
  margin: 25px;
}

.card__like-button {
  min-width: 130px;
  min-height: 38px;
}

.card__icon-button {
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
}
.card__icon-button:focus-visible {
  border-color: var(--btn-bg-color);
  outline: none;
}

.like-icon {
  width: 27px;
  height: 24px;
  border: none;
}

.like-container {
  display: flex;
  align-items: center;
  justify-content: end;
  margin: 0 25px 25px 0;
}

.card__image-container {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  width: 100%;
  border-top: 2px solid var(--text-color);
  border-bottom: 2px solid var(--text-color);
}

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

.card__lable {
  position: absolute;
  inset: 25px 25px auto auto;
  mix-blend-mode: hard-light;
  font-family: var(--font-accent);
  font-weight: var(--font-accent-weight);
  font-size: var(--main-font-size);
  text-transform: uppercase;
  text-shadow:
    -1px -1px 0 var(--stroke-color),
    1px -1px 0 var(--stroke-color),
    -1px 1px 0 var(--stroke-color),
    1px 1px 0 var(--stroke-color);
  opacity: 0.5;
}

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

.button__text {
  font-family: var(--font-accent);
  font-weight: var(--font-accent-weight);
  font-size: var(--main-font-size);
}

.footer {
  display: flex;
  justify-content: center;
  padding-bottom: 100px;
}

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



.floppy-disk__container {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 341px;
}

.footer__button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--text-color);
  min-width: 261px;
  gap: 8px;
  padding: 17px 20px;
}

.floppy-disk__text {
  line-height: 150%;
  text-transform: uppercase;
}

dialog:not([open]) {
  display: none;
}

dialog {
  display: flex;
  flex-direction: column;
  padding: 30px 40px;
  gap: 20px;
  border: 2px solid var(--text-color);
}

dialog::backdrop {
  background-color: rgb(0 0 0 / 0.75);
}

.card__like-button, 
.footer__button {
  transition: box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  background-color: #fff; 
  cursor: pointer;
  border-style: solid;
}

.button__text,
.floppy-disk {
  color: var(--btn-text-color);
  fill: var(--btn-text-color);
  position: relative;
  z-index: 1;
  mix-blend-mode: difference;
}

.card__like-button:focus, 
.footer__button:focus {
  outline: none;
  box-shadow: 2px 2px 0 #000;
}

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


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


@media (width >=768px) {
  .footer__button {
    flex-direction: row;
    min-width: 291px;
  }

  dialog {
    padding: 30px 30px;
    gap: 30px;
  }

  .floppy-disk__container {
    max-width: 353px;
  }

  .floppy-disk {
    width: 21px;
    height: 21px;
  }
}