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

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

*/

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-inline-size: 320px;
  min-block-size: 100dvb;
  font-family: var(--font-main), sans-serif;
  font-size: 18px;
  font-variation-settings: 'wght' var(--font-weight-text);
  background-attachment: fixed;
  background-image: var(--background-gradient);
  background-size: cover;
  padding-top: 100px;
  padding-bottom: 100px;
  color: var(--accent-color);
}

/* header */

.header {
  display: flex;
  justify-content: center;
  align-items: center;
  inline-size: var(--block-width);
  height: var(--header-height);
  background-color: var(--bg-color);
  font-family: var(--font-accent), fantasy;
  border: var(--border);
  margin-bottom: 100px;
}

.header__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  font-size: var(--font-size-logo);
}

.header__logo span {
  font-size: var(--font-size-logo_span);
  text-transform: uppercase;
}

/* main */

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

.cards {
  display: flex;
  flex-direction: column;
  gap: 50px;
  inline-size: var(--block-width);
}

.card {
  inline-size: 100%;
  background-color: var(--bg-color);
  border: var(--border);
}

.card__heading {
  font-size: 18px;
  font-variation-settings: "wght" var(--font-weight-heading);
  padding: 4px 10px;
  line-height: 1.222;
  letter-spacing: 0;
}

.card__image-wrapper {
  position: relative;
  inline-size: 100%;
  border-top: var(--border);
  border-bottom: var(--border);
}

.card__image {
  display: block;
  aspect-ratio: 1 / 1;
  inline-size: 100%;
  object-fit: cover;
}

.card__label {
  position: absolute;
  top: 25px;
  right: 25px;
  font-family: var(--font-accent), fantasy;
  font-size: 14px;
  font-weight: 400;
  text-shadow: 
    1px 0 var(--text-stroke-color),
    0 1px var(--text-stroke-color),
    -1px 0 var(--text-stroke-color),
    0 -1px var(--text-stroke-color);
  opacity: 0.5;
  mix-blend-mode: hard-light;
  line-height: 1;
}

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

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

.card__text {
  display: flex;
  flex-direction: column;
  gap: 25px;
  line-height: 1.166;
}

.card__buttons {
  display: flex;
  gap: 7px;
  justify-content: end;
  align-items: center;
}

.text-button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border: var(--border);
  font-family: var(--font-accent), fantasy;
  background: none;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 0.9;
  transition: box-shadow 0.3s ease;
  overflow: hidden;
}

.card__icon-button {
  position: relative;
  /* display: flex;
  justify-content: center;
  align-items: center; */
  /* inline-size: 27px;
  block-size: 24px; */
  width: 38px;
  height: 38px;
  background: none;
  padding: 0;
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
  flex-shrink: 0;
  overflow: visible;
}

.like-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
}

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

.save-button {
  gap: 8px;
  /* padding: 15px 18px; */
  inline-size: 335px;
  block-size: 55px;
  background-color: var(--bg-color);
}

.dialog[open] {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 30px;
  border: var(--border);
  width: var(--dialog-width);
  max-width: none;
}

.dialog__content {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: var(--font-accent), fantasy;
  font-size: 14px;
}

.dialog__text {
  text-transform: uppercase;
  line-height: 1.5;
  letter-spacing: 0;
}

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

.dialog__button {
  width: 100%;
  height: 38px;
}

.floppy {
  flex-shrink: 0;
  color: var(--bg-color);
  z-index: 1;
  mix-blend-mode: difference;
}

/* media */

@media (width <= 375px) {
  .save-button .floppy {
    width: 28px;
    height: 28px;
  }

  .save-button {
    flex-direction: column;
    inline-size: 306px;
    block-size: 84px;
  }

  .dialog[open] {
    padding: 30px 40px;
  }
}

/* filters */

.card__image_faded {
  filter: saturate(30%);
}

.card__image_neon {
  filter: hue-rotate(360deg) saturate(300%);
}

.card__image_contrast {
  filter: contrast(30%);
}

.card__image_invert {
  filter: invert(80%);
}

.card__image_sepia {
  filter: sepia(90%);
}

.card__image_bright {
  filter: brightness(500%);
}

.card__image_calm {
  filter: contrast(60%) hue-rotate(300deg) sepia(20%);
}

/* button effects */

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

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

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

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

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

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