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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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;
  gap: 98px;
  padding: 100px 0;
  font-family: var(--font-main);
  background-image: var(--background-page);
  background-size: cover;
  background-attachment: fixed; /*неподвижно даже с прокруткой*/
  min-inline-size: 320px;
  min-block-size: 100dvh;
  font-variation-settings: 'wght' var(--font-weight-main);
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  border: 2px solid var(--accent-color-black);
  padding: clamp(120px, 80px + 5vb, 128px) 0;
  font-family: var(--font-accent);
  background-color: var(--bg-color);
}

.content-wrapper {
  inline-size: clamp(320px, 100%, 700px);
}

.logo_page {
  font-size: clamp(3.07rem, 6vi, 4.05rem);/**/
}

.title_page {
  font-size: clamp(0.87rem, 2vi, 1.45rem);
  text-transform: uppercase;/**/
}

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

.card {
  border: 2px solid var(--accent-color-black);
  background: var(--bg-color);
}

.card_title {
  font-size: 18px;
  padding: 6px 10px;
  font-variation-settings: 'wght' var(--font-weight-subtitle);
}

.card_container {
  position: relative;
  overflow: hidden; /*края не будут вылезать за пределы*/
}

.card_image {
  object-fit: cover;
  inline-size: 100%;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  object-position: top;
}

.image-label {
  position: absolute;
  z-index: 2;
  opacity: 0.5;
  font-family: var(--font-accent);
  font-size: 0.778rem;
  text-shadow: 
    1px 1px 0 var(--text-stroke-color),
    -1px -1px 0 var(--text-stroke-color),
    1px -1px 0 var(--text-stroke-color),
    -1px 1px 0 var(--text-stroke-color);
  inset-inline-end: 25px;
  inset-block-start: 25px;
  mix-blend-mode: hard-light;
  max-inline-size: calc(100% - 50px);
  white-space: normal;
}

.card-content {
  display: flex;
  flex-direction: column;
  font-size: 18px;
  gap: 25px;
  padding: 25px 25px 0;
  font-variation-settings: 'wght' var(--font-weight-card-text);
}

.post {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 6px;
  margin-block-start: 25px;
  padding: 0 25px 25px;/**/
}

.card__icon-button {
  display: flex;
  align-items: center;
  border: none;
  padding: 0;
  outline: 2px solid transparent;
  background-color: transparent;
  transition: outline 0.3s ease;
  cursor: pointer;
}

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

.card__icon-button:focus-visible {
  outline: 2px solid var(--accent-color-black);
}

.like-icon.is-liked .heart {
  animation: scaling 0.3s 0.1s ease-in;
}

.heart {
  transform-origin: center;
}

.contour {
  transition: fill 0.1s linear;
}

.main-body {
  transition: fill 0.3s linear;
}

.core {
  transition: fill 0.3s 0.03s linear;
}

.sparks {
  opacity: 0;
  fill: var(--contour-color,red);
}

.card__icon-button:hover .core {
  fill: var(--accent-color-black);
  transition: fill 0.3s linear;
}

.card__icon-button:hover .main-body {
  fill: var(--accent-color-black);
  transition: fill 0.3s 0.05s linear;
}

.card__icon-button:active .core {
  fill: var(--animation-fill-color);
  transition: fill 0.3s linear;
}

.card__icon-button:active .main-body {
  fill: var(--animation-fill-color);
  transition: fill 0.3s 0.05s linear;
}

.like-icon.is-liked .core {
  fill: var(--animation-fill-color);
  transition: fill 0.3s linear;
}

.like-icon.is-liked .main-body {
  fill: var(--animation-fill-color);
  transition: fill 0.3s 0.05s linear;
}

.like-icon.is-liked .contour {
  fill: var(--animation-fill-color);
  transition: fill 0.3s 0.06s linear;
}

.like-icon.is-liked .sparks {
  animation: sparks-appearance 0.3s 0.3s ease-in;
}

.button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--accent-color-black);
  overflow: hidden;
  font-family: var(--font-accent);
  background-color: var(--bg-color);
  transition: box-shadow 0.3s ease;
  cursor: pointer;
  block-size: 97%;
}

.button:focus {
  outline: none;
}

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

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

.button:hover::before {
  transform: translateX(0);
}

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

.button__text {
  position: relative;
  z-index: 2;
  color: var(--accent-color-white);
  font-size: 14px;
  mix-blend-mode: difference;
}

.filter-static-noise {
  filter:  hue-rotate(80deg) contrast(0.4) saturate(2) blur(2px);
}

.filter-vibrant {
  filter: saturate(3);
}

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

.filter-invert {
  filter: invert(0.8);
}

.filter-dimmed {
  filter: saturate(0.2);
}

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

.filter-noir {
  filter: grayscale(0.85) brightness(1.2) contrast(0.8) sepia(0.6);
}

.save-button {
  position: relative;
  z-index: 2;
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 15px 18px;
}

.icon-save {
  z-index: 2;
  display: block;
  flex-shrink: 0;
  color: var(--accent-color-white);
  min-inline-size: clamp(21px, 41.06px - 2.612vw, 28px);
  min-block-size: clamp(21px, 41.06px - 2.612vw, 28px);
  mix-blend-mode: difference;
}

.button-save-text {
  padding: 0 1.325px;
}

#disk-dialog {
  padding: 27px clamp(27px, 44.577px - 1.221vw, 40px);
  min-inline-size: 341px;
}

#disk-dialog[open] {
  display: grid;
  grid-template-columns: min-content fit-content(234px);
  justify-content: center;
  align-items: center;
  gap: 30px 20px;
}

.page:has(#disk-dialog[open]) {
  overflow: hidden;
}

#disk-dialog .icon-save {
  max-inline-size: 39px;
  max-block-size: 39px;
}

#disk-dialog
.dialog-description {
  grid-column: 2 / 3;
  font-family: var(--font-accent);
  font-size: 14px;
  line-height: 1.5;
  text-transform: uppercase;
}

.dialog-button-close {
  grid-column: 1 / 3;
  padding: 10.5px;
  text-transform: uppercase;
}

#disk-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
}

@media (width <= 375px) {
  .save-button {
    flex-direction: column;
  }
}

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