/* Основной фон страницы */
.page {
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Шапка сайта */
.page-header {
  width: var(--container-width);
  max-width: 700px;
  min-height: clamp(327px, calc(327px + 43 * (100vw - 375px) / 325), 368px);
  margin: clamp(50px, 90px, 90px) auto clamp(25px, 95px, 95px);
  border: 2px solid var(--accent-color);
  background-color: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  padding-block: clamp(122px, calc(122px + 8 * (100vw - 375px) / 325), 130px);
}

/* Контейнер для текста в шапке */
.header-block {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Текстовая часть шапки */
.header-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Основной заголовок */
.main-heading {
  font-family: var(--font-accent);
  font-size: clamp(3rem, 2.5rem + 2.5vw, 4.0625rem);
  color: var(--accent-color);
  text-transform: uppercase;
  margin: 0 0 20px 0;
}

/* Подзаголовок */
.sub-heading {
  font-family: var(--font-accent);
  font-size: clamp(0.875rem, 0.226rem + 2.77vw, 1.4375rem);
  color: var(--accent-color);
  text-transform: uppercase;
  margin: 0;
}

/* Основной контент */
.content {
  width: var(--container-width);
  max-width: 700px;
  margin: 0 auto;
}

/* Контейнер для постов */
.posts-container {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* Карточка поста */
.memory-post {
  background-color: var(--bg-color);
  border: 2px solid var(--accent-color);
}

/* Заголовок поста */
.post-heading {
  font-family: var(--font-main);
  font-variation-settings: 'wght' var(--font-weight-card-title);
  font-size: 18px;
  margin: 0;
  padding: 4px 10px;
  text-align: left;
  display: block;
  box-sizing: border-box;
}

/* Блок с изображением */
.image-block {
  position: relative;
  border-top: 2px solid var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
}

/* Изображение в посте */
.post-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: cover;
}

/* Водяной знак на изображении */
.image-watermark {
  position: absolute;
  top: 25px;
  right: 25px;
  font-family: var(--font-accent);
  font-size: 14px;
  color: #000000; /* ЧЕРНЫЙ текст внутри */
  opacity: 0.5;
  mix-blend-mode: hard-light;
  text-transform: uppercase;
  
  /* Белая обводка 1px */
  text-shadow: 
    -1px -1px 0 #fff,  
    -1px  0   0 #fff,  
    -1px  1px 0 #fff,  
     0   -1px 0 #fff,  
     0    1px 0 #fff,  
     1px -1px 0 #fff,  
     1px  0   0 #fff,
     1px  1px 0 #fff;  
}

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

/* Тело поста */
.post-body {
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* Основной текст поста */
.post-text {
  font-family: var(--font-main);
  font-variation-settings: 'wght' var(--font-weight-card-text);
  font-size: 18px;
  line-height: 21px;
  margin: 0;
}

/* Контейнер для кнопок лайков */
.post-buttons {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
  align-self: flex-end;
}

/* Кнопка с иконкой сердца */
.card__icon-button {
  width: 40px;
  height: 38px;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease;
}

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

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

/* ОБЩИЙ КЛАСС ДЛЯ ВСЕХ КНОПОК (Like, Сохранить, ОК) */
.button {
  /* Основные стили */
  font-family: var(--font-accent);
  font-size: 14px;
  line-height: 0.9;
  color: var(--accent-color);
  background-color: var(--bg-color);
  border: 2px solid var(--accent-color);
    /* Позиционирование и отображение */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
    /* Для анимации псевдоэлемента */
  position: relative;
  overflow: hidden;
    /* Transition для focus эффекта */
  transition: box-shadow 0.3s ease;
}

/* Для всех кнопок с классом button */
.button:focus {
  outline: none;
}

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

/* Псевдоэлемент для hover анимации */
.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--accent-color);
  transform: translateX(-100%);
  transition: transform 0.5s ease-in-out;
  z-index: 1;
}

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

/* Текст внутри кнопок */
.button__text {
  font-size: 14px;
  line-height: 0.9;
  position: relative;
  z-index: 2;
  color: #FFFFFF; /* Белый цвет для текста */
  mix-blend-mode: difference; /* Режим смешивания для контрастного эффекта */
}

/* ОДИН селектор для всех иконок внутри кнопок */
.button__icon {
  position: relative;
  z-index: 2;
  color: #FFFFFF;
  mix-blend-mode: difference;
}

/* Размер для иконки в модальном на декстопе */
#save-modal .header-icon {
  width: 39px;
  height: 39px;
  flex-shrink: 0;
  fill: var(--accent-color);
}

/* Размер для иконки в кнопке сохранить */
.save-btn .button__icon {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}

/* Кнопка Like */
.card__like-button {
  width: 130px;
  height: 38px;
  padding: 9px 17px;
}

/* Иконка сердца */
.like-icon {
  width: 27px;
  height: 24px;
  transform: scale(1.5);
  transform-origin: center;
}

/* Модальное окно декстоп*/
.modal {
  border: 2px solid var(--accent-color);
  padding: 0;
  background-color: var(--bg-color);
  width: 353px; /* размер по макету */
  height: 191px; /* размер по макету */
  margin: 0;
  position: fixed;
    /* Центрирование вместо фиксированных отступов: */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.modal::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
}

.modal-content {
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.modal-row {
  display: flex;
  flex-direction: row; /* иконка и текст в ряд */
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.modal-text {
  font-family: var(--font-accent);
  font-size: 14px;
  margin: 0;
  text-transform: uppercase;
  line-height: 150%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  white-space: normal; /* перенос если не помещается */
}

.modal-btn {
  width: 293px;
  height: 38px;
  padding: 9px 17px;
  gap: 10px;
}

/* Фильтры для изображений */
.vintage-effect {
  filter: sepia(0.7) contrast(1.2) brightness(0.9);
}

.dreamy-effect {
  filter: blur(1px) brightness(1.1) saturate(1.3);
}

.dramatic-effect {
  filter: grayscale(0.6) contrast(1.4) brightness(0.8);
}

.warm-effect {
  filter: sepia(0.3) saturate(1.4) hue-rotate(-10deg);
}

.cold-effect {
  filter: brightness(1.1) saturate(0.8) hue-rotate(180deg);
}

.mystic-effect {
  filter: blur(0.5px) hue-rotate(90deg) saturate(1.5);
}

.multiple-effect {
  filter: sepia(0.5) saturate(1.8) contrast(1.3) brightness(1.1);
}

/* Секция кнопки сохранения */
.save-section {
  display: flex;
  justify-content: center;
  margin: 50px 0 100px;
}

.save-btn {
  padding: 15px 20px;
  gap: 8px;
}

/* Мобильная версия */
@media (max-width: 375px) {
  .page-header {
    margin: 50px auto 102px;
    padding-block: 122px;
  }
  
  .main-heading {
    font-size: clamp(49px, 3rem, 65px); /* 49px по макету */
  }
  
  .sub-heading {
    font-size: clamp(14px, 0.875rem, 16px); /* 14px по макету */
  }

   /* Кнопка Сохранить - только уникальные стили для мобильной */
  .save-btn {
    width: 306px;
    height: 84px;
    font-size: 13px;
    flex-direction: column;
  }

    /* Размер иконки в save-btn на мобильной */
  .save-btn .button__icon {
    width: 28px;
    height: 28px;
  }

  /* Для запрета переноса в мобилке кнопки Сохранить */
.save-btn .button__text {
    white-space: nowrap;
 }

  .modal {
    max-width: 341px;
  }
  
  .modal-content {
    padding: 30px 40px;
  }
  
  .modal-btn {
    width: 261px;
  }
}