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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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-base), Arial, sans-serif;
  font-variation-settings: 'wght' var(--font-weight-base);
  font-size: var(--font-size-base);
  margin: 0 auto;
}

.header,
.main {
  width: var(--page-width);
  margin: 0 auto;
}

.header {
  font-family: var(--font-accent), fantasy;
  font-weight: var(--font-weight-text);
  text-transform: uppercase;
}

.header-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: var(--page-width);
  outline: var(--border-style);
  background-color: var(--bg-color);
  padding: var(--header-padding);
  margin-block: 103px;
  gap: 20px;
}

.header-title {
  font-size: var(--header-title-font-size);
  font-weight: var(--font-weight-text);
}

.header-subtitle {
  font-size: var(--header-subtitle-font-size);
  font-weight: var(--font-weight-text);
}

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

.article {
  width: var(--page-width);
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.article:not(:last-child) {
  gap: 52px;
}

.article-card {
  width: var(--page-width);
  outline: var(--border-style);
  background-color: var(--bg-color);
}

.article-title {
  padding: 5px 10px;
  font-variation-settings: 'wght' var(--font-weight-title, 715);
  color: var(--color);
  background-color: var(--bg-color);
  font-size: var(--font-size-base);
}

.article-image-box {
  outline: var(--border-style);
  position: relative;
  margin: 0 0 5px;
}

.card-label {
  position: absolute;
  top: 25px;
  right: 25px;
  font-family: var(--font-accent), fantasy;
  font-weight: var(--font-weight-text);
  font-size: var(--font-button-text);
  color: var(--color);
  text-shadow: 0 0 1px var(--shadow-color);
  mix-blend-mode: hard-light;
  opacity: 0.5;
  z-index: 1;
}

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

.article-image {
  display: block;
  object-fit: cover;
  object-position: center;
  inline-size: 100%;
  max-block-size: 100%;
  position: relative;
}

.blur-filter {
  filter: blur(3px);
}

.brightness-filter {
  filter: brightness(130%);
}

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

.grayscale-filter {
  filter: grayscale(45%);
}

.hue-rotate_filter {
  filter: hue-rotate(0.7turn);
}

.invert-filter {
  filter: invert(35%);
}

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

.multiple-filter {
  filter: brightness(130%) contrast(110%) saturate(120%);
}

.article-info {
  padding: 24px 24px 25px 26px;
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.article-text {
  font-family: var(--font-base), sans-serif;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-base);
}

.button-article-block {
  display: flex;
  align-self: end;
  gap: 7px;
}

.card__icon-button {
  height: 34px;
  display: flex;
  background-color: transparent;
  border: none;
  outline: 2px solid transparent;
  transition: outline 0.3s ease;
  align-self: center;
  padding-inline: 0;
}

.card__like-button {
  padding-block: 8px;
  align-self: end;
  width: 130px;
  background-color: transparent;
  min-block-size: 38px;
}

.button {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-color);
  border: var(--border-style);
  color: var(--color);
  cursor: pointer;
  font-family: var(--font-accent), fantasy;
  justify-content: center;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.button::before {
  content: '';
  position: absolute;
  z-index: 0;
  transition: translate 0.5s ease-in-out;
  translate: -100% 0;
  background-color: var(--color);
  inset: 0;
}

.button:hover::before {
  translate: 0;
}

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

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

.button__text {
  font-family: var(--font-accent), sans-serif;
  font-size: var(--font-button-text);
  font-weight: var(--font-weight-text);
  line-height: 90%;
  position: relative;
  z-index: 1;
  color: var(--bg-color);
  mix-blend-mode: difference;
}

.button-save-box {
  background-color: transparent;
}

.button-save {
  flex-direction: row;
  height: 55px;
  gap: 8px;
  padding: 0 20px;
  margin-bottom: 100px;
}

.floppy {
  width: 21px;
  height: 21px;
  background-color: var(--bg-color);
  position: relative;
  z-index: 1;
}

.dialog-svg {
  display: flex;
  align-items: center;
  font-family: var(--font-accent), fantasy;
  font-weight: var(--font-weight-text);
  font-size: var(--font-button-text);
  line-height: 150%;
  text-transform: uppercase;
  gap: 20px;
}

.dialog-svg svg {
  flex-shrink: 0;
}

.ok-button {
  width: 100%;
  max-width: 293px;
  height: 38px;
  flex-shrink: 1;
  text-transform: uppercase;
  padding: 0;
}

.modal {
  display: none;
  width: clamp(341px, calc(336.775px + 1.127vw), 353px);
  border: var(--border-style);
  box-sizing: border-box;
  padding: 0;
}

.modal[open]::backdrop {
  background-color: rgb(0 0 0 / 75%);
}

.modal[open] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
  padding: 30px 40px;
}

body:has(.modal[open]) {
  overflow: hidden;
}

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

  .button-save {
    display: flex;
    flex-direction: column;
    height: 84px;
    padding: 15px 20px;
  }

  .ok-button {
    width: 100%;
  }

  .header {
    margin-block: 100px 97px;
  }
}

/* для неудачных комитов */
