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

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в 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-main);
  font-variation-settings: 'wght' var(--font-weight-text);
  background-color: var(--color-bg);
  background-image: var(--bg-image);
  background-attachment: fixed;
  color: var(--color-accent);
}

.svg-symbols {
  display: none;
}

/* ─── HEADER ─────────────────────────────────────────────── */

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: min(100%, 700px);
  margin: 100px auto;
  padding: clamp(120px, 15vw, 136px) 0 25px;
  border: 2px solid var(--color-accent);
  background-color: var(--color-bg);
  font-family: var(--font-accent);
  text-transform: uppercase;
}

.header__logo {
  font-size: clamp(49px, 9.3vw, 65px);
  text-decoration: none;
  color: var(--color-accent);
}

.header__title {
  font-size: clamp(14px, 3.3vw, 23px);
  font-weight: 400;
}

/* ─── THEME MENU ─────────────────────────────────────────── */

.theme-menu__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-inline-start: 18px;
}

.theme-menu__button {
  position: relative;
  display: block;
  border: none;
  background: transparent;
  font-family: var(--font-accent);
  font-size: 14px;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.3s ease;
}

.theme-menu__button:hover {
  opacity: 0.6;
}

.theme-menu__button:focus {
  outline: none;
}

.theme-menu__button:focus-visible {
  opacity: 0.6;
}

.theme-menu__button::after {
  content: '';
  display: block;
  height: 2px;
  background-color: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.theme-menu__button:focus-visible::after {
  transform: scaleX(1);
}

.theme-menu__button:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.theme-menu__button:disabled::before {
  content: '▶';
  position: absolute;
  left: -18px;
  animation: arrow-bounce 0.5s ease-in-out infinite alternate;
}

@keyframes arrow-bounce {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(4px);
  }
}

/* ─── CARDS SECTION ──────────────────────────────────────── */

.cards {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
  width: min(100%, 700px);
  margin: 0 auto;
}

/* ─── CARD ───────────────────────────────────────────────── */

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

.card__title {
  padding: 5px 10px;
  border-bottom: 2px solid var(--color-accent);
  font-size: 18px;
  font-variation-settings: 'wght' var(--font-weight-title);
  line-height: 1.21;
}

.card__image-wrapper {
  position: relative;
  overflow: hidden;
}

.card__image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
}

/* image filters */
.card__image--filter-1 {
  filter: grayscale(0.6);
}

.card__image--filter-2 {
  filter: saturate(3);
}

.card__image--filter-3 {
  filter: hue-rotate(30deg);
}

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

.card__image--filter-5 {
  filter: sepia(0.9);
}

.card__image--filter-6 {
  filter: blur(2px);
}

.card__image--filter-7 {
  filter: opacity(0.7);
}

.card__image--filter-8 {
  filter: saturate(2) hue-rotate(90deg) contrast(1.2) brightness(1.1) blur(0.5px);
}

/* ─── LABEL (watermark) ──────────────────────────────────── */

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

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

/* ─── CARD CONTENT ───────────────────────────────────────── */

.card__content {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 25px;
  border-top: 2px solid var(--color-accent);
}

.card__text {
  font-size: 18px;
  line-height: 1.17;
}

/* ─── BUTTONS ROW ────────────────────────────────────────── */

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

/* ─── ICON BUTTON (heart wrapper) ───────────────────────── */

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

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

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

/* ─── SHARED BUTTON STYLES ───────────────────────────────── */

.button {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--color-accent);
  background-color: var(--color-bg);
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}

.button:focus {
  outline: none;
}

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

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

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

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

/* ─── LIKE BUTTON ────────────────────────────────────────── */

.card__like-button {
  min-width: 130px;
  padding: 9px 17px;
}

/* ─── FOOTER SAVE BUTTON ─────────────────────────────────── */

.footer {
  display: flex;
  justify-content: center;
  padding: 50px 0 100px;
}

.footer__save-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 20px;
}

.footer__save-button .floppy-icon {
  position: relative;
  z-index: 1;
  width: 21px;
  height: 21px;
  color: var(--color-bg);
  mix-blend-mode: difference;
}

/* ─── DIALOG ─────────────────────────────────────────────── */

.dialog {
  width: min(357px, calc(100vw - 34px));
  padding: 30px;
  border: 2px solid var(--color-accent);
  background-color: var(--color-bg);
}

.dialog[open] {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

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

.dialog__content {
  display: flex;
  align-items: center;
  gap: 30px;
}

.dialog__floppy {
  flex-shrink: 0;
  width: 39px;
  height: 39px;
  color: var(--color-accent);
}

.dialog__text {
  font-family: var(--font-accent);
  font-size: 14px;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--color-accent);
}

.dialog__form {
  margin: 0;
}

.dialog__button {
  width: 100%;
  padding: 9px 17px;
  text-transform: uppercase;
}

/* ─── HEART SVG ──────────────────────────────────────────── */

.like-icon {
  width: 39px;
  height: 36px;
  cursor: pointer;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */

@media (width <= 375px) {
  .header {
    width: 100%;
    margin: 0 auto 50px;
  }

  .cards {
    width: 100%;
  }

  .card__label {
    right: 11px;
  }

  .footer__save-button {
    flex-direction: column;
  }

  .footer__save-button .floppy-icon {
    width: 28px;
    height: 28px;
  }

  .dialog {
    padding: 30px 40px;
  }
}
