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

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

*/

.page {
  min-height: 100vh;
  font-family: var(--main-font);
  background-image: var(--background-gradient);
  background-size: cover;
  background-attachment: fixed;
  min-inline-size: 320px;
  min-block-size: 100dvb;
  font-variation-settings: 'wght' var(--paragraph-font-weight);
}

.card {
  margin-inline: auto;
  border: var(--border--style);
  background-color: rgb(255 255 255);
  inline-size: var(--main-block-size);
}

.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-block-start: 100px;
  margin-block-end: 98px;
}

.header__title {
  font-family: var(--accent-font);
  font-size: 23px;
  text-transform: uppercase;
}

.html-title {
  margin-block-start: 130px;
  font-size: clamp(3.0625rem, 2.7104rem + 1.5023vw, 4.0625rem);
}

.closed-title {
  margin-block-end: 130px;
  font-size: clamp(0.875rem, 0.6769rem + 0.8451vw, 1.4375rem);
}

.section {
  margin-block-end: 50px;
}

.card__header {
  margin-inline: 10px;
  margin-block: 4px;
  font-size: 18px;
  font-variation-settings: 'wght' var(--header-font-weight);
}

.picture-wrapper {
  position: relative;
}

.picture-label {
  position: absolute;
  top: 25px;
  right: 25px;
  z-index: 1;
  opacity: 0.5;
  font-family: var(--accent-font);
  font-size: 14px;
  text-shadow: var(--picture-label-shadow);
  mix-blend-mode: hard-light;
}

@supports (
  (text-stroke: 1px rgb(255 255 255)) or
    (-webkit-text-stroke: 1px rgb(255 255 255))
) {

  .picture-label {
    text-shadow: none;
    -webkit-text-stroke: 1px rgb(255 255 255);
    text-stroke: 1px rgb(255 255 255);
  }
}

.card__picture {
  display: block;
  margin-block-end: 27px;
  object-fit: cover;
  object-position: center;
  inline-size: 100%;
  block-size: 100%;
  max-block-size: 100%;
  aspect-ratio: 1/1;
}

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

.saturate {
  filter: saturate(200%);
}

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

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

.grayscale {
  filter: grayscale(1);
}

.vintage {
  filter: saturate(0.85) sepia(0.25) contrast(0.95) brightness(1.02) blur(0.2px);
}

.blur {
  filter: blur(0.1rem);
}

.card__paragraph {
  margin-inline: 25px;
  margin-block-end: 25px;
  font-size: 18px;
}

.card__button-wrapper {
  display: flex;
  justify-self: end;
  justify-content: flex-end;
  gap: 7px;
  margin-inline-end: 25px;
  margin-block-end: 25px;
}

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

.card__icon-button:focus-visible {
  border: var(--border--style);
  outline: none;
}

.like-icon {
  display: block;
  cursor: pointer;
}

.card__like-button {
  border: var(--border--style);
  padding-block: 12.5px;
  background-color: transparent;
  cursor: pointer;
  inline-size: 130px;
}

.button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.button:focus-visible {
  box-shadow: 2px 2px 0 0 rgb(0 0 0);
  outline: none;
}

.button::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: rgb(0 0 0);
  transition: transform 0.5s ease-in-out;
  transform: scaleX(0);
  transform-origin: left top;
}

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

.button__text {
  color: rgb(255 255 255);
  font-family: var(--accent-font);
  font-size: 14px;
  mix-blend-mode: difference;

}

.save-button {
  gap: 8px;
  margin-inline: auto;
  margin-block-end: 50px;
  border: var(--border--style);
  padding-inline: 20px;
  cursor: pointer;
  min-block-size: 55px;
}

.floppy-icon {
  display: block;
  color: rgb(255 255 255);
  mix-blend-mode: difference;
  inline-size: 21px;
  block-size: 21px;
}

.dialog {
  margin: auto;
  border: none;
  padding: 30px;
  outline: var(--border--style);
  max-inline-size: 341px;
}

.dialog[open] .dialog-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
  max-inline-size: 261px;
}

.dialog[open]  .floppy-icon{
  flex-shrink: 0;
  inline-size: 39px;
  block-size: 39px;
}

.dialog__text-button {
  line-height: 150%;
  text-transform: uppercase;
}

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

.dialog-button {
  margin-block-start: 30px;
  border: var(--border--style);
  padding-block: 12px;
  background-color: transparent;
  cursor: pointer;
  min-inline-size: 293px;
}

@media (width <= 375px) {

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

  .dialog {
    padding-inline: 40px;
    max-inline-size: 341px;
  }

  .dialog-button {
    min-inline-size: 261px;
  }
}
