/* =====================================================
   PALOMA — БЛОК «ФОРМАТЫ» (флип-карточки)
   Реплика блока serafimafadeeva.ru: тёмно-винная секция,
   крупный сериф-заголовок слева + заметка с рукописным
   подчёркиванием справа, сетка 3×2 карточек. При наведении
   (или тапе на мобильном) карточка аккуратно переворачивается
   по оси Y — сзади розовая «изнанка» с описанием и «подробнее».
   ===================================================== */

.fmt {
  background: #FFFFFF;
  color: #1B1A18;
  padding: clamp(56px, 7vw, 120px) 0 clamp(64px, 8vw, 130px);
  overflow: hidden;
}

.fmt__inner {
  max-width: none;
  margin: 0 auto;
  padding: 0 var(--gutter, clamp(20px, 4vw, 64px));
}

/* ── Шапка: заголовок + заметка ───────────────────────── */
.fmt__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(28px, 5vw, 80px);
  margin: 0 0 clamp(40px, 5vw, 64px);
}

.fmt__title {
  margin: 0;
  font-family: var(--serif, "Classica One", cursive);
  font-weight: 400;
  font-size: clamp(32px, 4.4vw, 66px);
  line-height: 1;
  letter-spacing: 0.005em;
  text-transform: none;
  white-space: nowrap;
  color: #1B1A18;
}

.fmt__note {
  flex: 0 1 clamp(280px, 30vw, 400px);
  margin: clamp(6px, 1vw, 14px) 0 0;
  font-family: var(--sans, "Montserrat", sans-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.4;
  color: rgba(27, 26, 24, 0.78);
}
.fmt__note-wave {
  display: block;
  width: 100%;
  max-width: 240px;
  height: 14px;
  margin-top: 10px;
  color: var(--burgundy, #E7385A);
}

/* ── Сетка карточек ───────────────────────────────────── */
.fmt__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 1.7vw, 28px);
}

.fmt__card {
  position: relative;
  aspect-ratio: 5 / 6;
  perspective: 2000px;
  outline: none;
}

.fmt__flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 1.15s cubic-bezier(0.65, 0, 0.18, 1);
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .fmt__card:hover .fmt__flip { transform: rotateY(180deg); }
}
/* тап / клавиатура (мобильные и доступность) */
.fmt__card:focus-within .fmt__flip { transform: rotateY(180deg); }

.fmt__face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow: hidden;
  border-radius: clamp(18px, 1.6vw, 30px);
}

/* ── Лицевая сторона: фото + название ─────────────────── */
.fmt__front {
  transform: translateZ(1px); /* пара к .fmt__back — см. комментарий там */
  background-size: cover;
  background-position: center;
  background-color: #2C0A12;
}
.fmt__front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 5, 9, 0) 38%, rgba(20, 5, 9, 0.62) 100%);
}
/* ── Подсказка «наведите, чтобы перевернуть» ──────────── */
.fmt__hint {
  position: absolute;
  top: clamp(12px, 1.2vw, 16px);
  right: clamp(12px, 1.2vw, 16px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(27, 26, 24, 0.78);
  font-family: var(--sans, "Montserrat", sans-serif);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(20, 5, 9, 0.12);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0.9;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.fmt__hint svg {
  width: 12px;
  height: 12px;
  flex: none;
  color: rgba(27, 26, 24, 0.55);
  animation: fmtHintSpin 4.5s ease-in-out infinite;
}
/* при наведении/перевороте — плавно убрать, чтобы не мелькала на изнанке */
@media (hover: hover) and (pointer: fine) {
  .fmt__card:hover .fmt__hint {
    opacity: 0;
    transform: translateY(-6px) scale(0.9);
    animation: none;
  }
}
.fmt__card:focus-within .fmt__hint {
  opacity: 0;
  transform: translateY(-6px) scale(0.9);
  animation: none;
}
@keyframes fmtHintSpin {
  0%, 70%, 100% { transform: rotate(0deg); }
  85% { transform: rotate(180deg); }
}
@media (prefers-reduced-motion: reduce) {
  .fmt__hint, .fmt__hint svg { animation: none; }
}

.fmt__front-title {
  position: absolute;
  left: clamp(18px, 2vw, 28px);
  right: clamp(18px, 2vw, 28px);
  bottom: clamp(18px, 2vw, 26px);
  z-index: 2;
  margin: 0;
  font-family: var(--serif, "Classica One", cursive);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-transform: none;
  color: #FFFFFF;
}

/* ── Изнанка: розовая, с описанием ────────────────────── */
.fmt__back {
  /* translateZ разводит грани по глубине: без него обе стороны лежат в одной
     плоскости, и часть GPU-драйверов не может решить, какая сверху — текст
     изнанки проступает сквозь лицевую во время переворота. Каждая грань
     смещена на 1px «к себе», т.к. у изнанки локальная ось Z развёрнута. */
  transform: rotateY(180deg) translateZ(1px);
  background: var(--burgundy, #E7385A);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  /* отступы и расположение как в референс-карточке .ea-serv__card */
  padding: clamp(30px, 2.8vw, 46px) clamp(26px, 2.4vw, 40px);
}
.fmt__back-title {
  margin: clamp(4px, 0.6vw, 8px) 0 clamp(12px, 1.4vw, 18px);
  font-family: var(--serif, "Classica One", cursive);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-transform: none;
}
.fmt__back-text {
  /* как .ea-serv__slash — текст занимает свободное место по центру,
     оффер уходит к низу карточки */
  margin: auto 0;
  font-family: var(--sans, "Montserrat", sans-serif);
  font-weight: 400;
  font-size: clamp(13px, 1.05vw, 15px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.94);
}
.fmt__more {
  margin-top: auto;
  padding-top: clamp(18px, 2vw, 26px);
  align-self: flex-start;
  font-family: var(--sans, "Montserrat", sans-serif);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FFFFFF;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.85);
  padding-bottom: 2px;
  transition: opacity 0.25s ease;
}
.fmt__more:hover { opacity: 0.72; }

/* строка-оффер на изнанке (прижата к низу, с разделителем) */
.fmt__offer {
  margin: clamp(14px, 1.8vw, 22px) 0 0;
  padding-top: clamp(13px, 1.5vw, 17px);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  font-family: var(--sans, "Montserrat", sans-serif);
  font-style: italic;
  font-size: clamp(12px, 0.95vw, 13.5px);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}
.fmt__offer::before {
  content: "→";
  font-style: normal;
  font-weight: 600;
  margin-right: 7px;
}

/* светлый вариант изнанки — белый фон + розовый текст и кнопка */
.fmt__card--light .fmt__back {
  background: #FFFFFF;
  color: var(--burgundy, #E7385A);
  border: 1px solid rgba(231, 56, 90, 0.22);
}
.fmt__card--light .fmt__back-text { color: rgba(231, 56, 90, 0.85); }
.fmt__card--light .fmt__more {
  color: var(--burgundy, #E7385A);
  border-bottom-color: rgba(231, 56, 90, 0.6);
}
.fmt__card--light .fmt__offer {
  color: rgba(231, 56, 90, 0.9);
  border-top-color: rgba(231, 56, 90, 0.22);
}

/* ── Адаптив ──────────────────────────────────────────── */
@media (max-width: 899px) {
  .fmt__head {
    flex-direction: column;
    gap: 20px;
  }
  .fmt__note { flex: none; }
  .fmt__title { white-space: normal; }
  .fmt__grid { grid-template-columns: repeat(2, 1fr); }
  .fmt__card { aspect-ratio: 4 / 5; }
}

@media (max-width: 560px) {
  .fmt__grid { grid-template-columns: 1fr; }
  .fmt__card { aspect-ratio: 4 / 5; }
}

@media (prefers-reduced-motion: reduce) {
  .fmt__flip { transition: none; }
}

/* убираем «шторочную» тень панелей оформления на главной — затемнение между блоками */
#ea-home .ea-panel { box-shadow: none; }

/* hero на главной — одна статичная фотография слева (как медиа в блоке «философия») */
#ea-home .ea-hero__static { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* Главная: текст блока «Оформляем» шире */
#ea-home .ea-hero__lead{max-width:720px;font-size:clamp(14px,1.05vw,17px)}
