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

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

*/

.page {
  font-family: var(--main-font);
  min-inline-size: 320px;
  min-block-size: 100dvb;
  font-variation-settings: "wght" 410;
  background-attachment: fixed;
  background-image: var(--linear-gradient);
  background-size: cover;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.main {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.header {
  background-color: var(--bg-color);
  width: var(--container-width);
  grid-template-rows: repeat(2, 1fr);
  padding-top: var(--header-padding-block);
  padding-bottom: var(--header-padding-block);
  border: 2px solid var(--main-color);
  margin-top: var(--header-margin);
  margin-bottom: var(--header-margin);
}
.header_container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.main-heading {
  font-family: var(--accent-font);
  font-size: var(--logo-size);
  line-height: 100%;
  display: block;
  text-transform: uppercase;
  justify-self: center;
  padding-bottom: 19px;
}
.title-text {
  font-family: var(--accent-font);
  font-size: var(--title-size);
  line-height: 100%;
  text-transform: uppercase;
  display: inline;
}
.cards {
  width: var(--container-width);
  display: grid;
  gap: 50px;
}
.card {
  border: 2px solid var(--main-color);
  background-color: var(--bg-color);
}
.subtitle {
  font-variation-settings: "wght" 715;
  font-family: var(--main-font);
  font-weight: var(--font-w-card-title);
  font-size: 18px;
  max-inline-size: 676px;
  line-height: 22px;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 10px;
  padding-right: 10px;
  display: flex;
  align-items: center;
}
.image-container {
  width: 100%;
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-style: solid;
  border-color: var(--main-color);
  border-width: 2px 0px 2px 0px;
}
.label {
  position: absolute;
  top: 25px;
  right: 25px;
  font-family: var(--accent-font);
  font-size: 14px;
  line-height: 100%;
  text-shadow:
    -1px 0 var(--bg-color),
     1px 0 var(--bg-color),
     0 -1px var(--bg-color),
     0  1px var(--bg-color);
  text-transform: uppercase;
  color: var(--main-color);
  mix-blend-mode: hard-light;
  opacity: 0.5;
}
@supports (-webkit-text-stroke: 1px var(--bg-color)) {
  .label {
    text-shadow: none;
    -webkit-text-stroke: 1px var(--bg-color);
  }
}
.bus {
  width: 100%;
  height: auto;
  max-height: 696px;
  display: block;
  object-fit: cover;
}
.bus_grayscale {
  filter: grayscale(0.7) opacity(0.9) contrast(105%);
}
.bus_saturate {
  filter: saturate(320%);
}
.bus_hue-rotate {
  filter: hue-rotate(30deg) saturate(110%);
}
.bus_invert {
  filter: invert(0.8);
}
.bus_sepia {
  filter: sepia(90%);
}
.bus_blur {
  filter: blur(0.6rem);
}
.bus_contrast {
  filter: hue-rotate(105deg) contrast(60%) blur(0.09rem);
}
.main_text {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding-top: 22px;
  padding-left: 25px;
  padding-right: 25px;
  padding-bottom: 25px;
}
.subtext {
  font-variation-settings: "wght" 410;
  font-family: var(--main-font);
  font-weight: var(--font-w-card-text);
  font-size: 18px;
  line-height: 21px;
}
.card_button-container {
  padding-right: 25px;
  padding-bottom: 25px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 1px;
}
.card__icon-button:focus {
  outline: none;
}
.card__icon-button:focus-visible {
  border: 2px solid var(--main-color);
}
.card__icon-button {
  max-block-size: 38px;
  border: 2px solid transparent;
  transition: border 0.3s ease;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
}
.button {
  overflow: hidden;
  position: relative;
  transition: 0.3s ease;
}
.button:focus {
  outline: none;
}
.button:focus-visible {
  box-shadow: 2px 2px 0 0 var(--main-color);
}
.button::before {
  position: absolute;
  inset: 0;
  content:"";
  background-color: var(--main-color);
  transform: translateX(-100%);
  transition: transform 0.5s ease-in-out;
}
.button:hover::before {
  transform: translateX(0);
}
.card__like-button {
  width: 130px;
  height: 38px;
  border: 2px solid var(--main-color);
  background-color: transparent;
  overflow: hidden;
  position: relative;
}
.like-icon {
  transform-origin: center;
  height: 36px;
  cursor: pointer;
  transform-origin: center;
}
.like-icon.is-liked {
  animation: change-scale 0.3s 0.1s ease-in;
}
.like-icon .sparks {
  opacity: 0;
}
.like-icon.is-liked .sparks {
  animation: change-opacity 0.3s ease-in 0.3s 1;
}
.like-icon .contour {
  fill: var(--color-contour);
  transition: fill 0.1s linear;
}
.like-icon.is-liked .contour {
  fill: var(--color-animation-main);
  transition: fill 0.3s linear 0.06s;
}
.like-icon .core {
  fill: transparent;
  transition: fill 0.3s linear 0.03s;
}
.like-icon:hover .core {
  fill: var(--main-color);
  transition: fill 0.3s linear;
}
.like-icon:active .core {
  fill: var(--color-animation-main);
  transition: fill 0.3s linear;
}
.like-icon.is-liked .core {
  fill: var(--color-animation-main);
  transition: fill 0.3s linear;
}
.like-icon .main-body {
  fill: transparent;
  transition: fill 0.3s linear;
}
.like-icon:hover .main-body {
  fill: var(--main-color);
  transition: fill 0.3s linear 0.05s;
}
.like-icon:active .main-body {
  fill: var(--color-animation-main);
  transition: fill 0.3s linear 0.05s;
}
.like-icon.is-liked .main-body {
  fill: var(--color-animation-main);
  transition: fill 0.3s linear 0.05s;
}
.button__text {
  max-width: 266x;
  font-size: 14px;
  line-height: 90%;
  font-family: var(--accent-font);
  position: relative;
  z-index: 2;
  mix-blend-mode: difference;
  color: var(--bg-color);
}
.save__disk {
  color: var(--bg-color);
  max-width: 21px;
  height: auto;
  fill: currentColor;
  mix-blend-mode: difference;
  z-index: 2;
  position: relative;
}
.button__save {
  background-color: var(--bg-color);
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding-top: 17px;
  padding-bottom: 17px;
  padding-left: 20px;
  padding-right: 20px;
  margin-top: 50px;
  margin-bottom: 100px;
}
.dialog[open] {
  width: 353px;
  padding: 30px;
  border: 2px solid var(--color-contour);
  font-size: 14px;
  line-height: 90%;
  font-family: var(--accent-font);
  display: grid;
  grid-template-columns: 0.2fr 1fr;
  column-gap: 25px;
  row-gap: 30px;
  z-index: 2;
}
.big-save__disk {
  max-width: 39px;
  height: auto;
  justify-self: start;
  align-self: center;
}
.dialog_title {
  text-transform: uppercase;
  line-height: 150%;
  max-width: 234px;
  font-size: 14px;
}
.dialog__button {
  grid-column: span 2;
  max-width: 293px;
  min-height: 38px;
  background-color: var(--bg-color);
  border: 2px solid var(--color-contour);
}
.dialog .button__text {
line-height: 90%;
text-transform: uppercase;
}
.dialog::backdrop {
  opacity: 75%;
  background-color: var(--main-color);
}
@media (width <= 375px) {
  .header {
    width: clamp(320px, calc(0px+100vw), 375px);
  }
  .cards {
    width: clamp(320px, calc(0px+100vw), 375px);
  }
  .subtitle {
    max-width: 351px;
  }
  .main_text {
    padding-top: 19px;
  }
  .button__save {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }
  .save__disk {
    max-width: 28px;
  }
  .dialog[open] {
    width: 341px;
  }
  .dialog__button {
  max-width: 261px;
  }
}