/* ══════════════════════════════════════════════════════════════
   Музей добрых дел
   ══════════════════════════════════════════════════════════════ */

/* ── Hero ───────────────────────────────────────────────────── */
.museum-hero {
  min-height: 40svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(60px + 34px) 24px 38px;
}

.museum-title-img {
  width: min(480px, 84vw);
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* ══ Счётчик ═══════════════════════════════════════════════════
   Плоские панели с тонкими жёсткими тенями (без блюра — крисп-край).
   Тиффани — полная пилюля; остальные углы в согласии с ней.
   outer 40px → inner 30px → teal ∞ (pill) → btn 13px
   ══════════════════════════════════════════════════════════════ */
.museum-counter-wrap {
  padding: 0 20px 46px;
  display: flex;
  justify-content: center;
}

/* Плашка 1 — большая внешняя. Невысокая, очень сильно скруглённая. */
.museum-counter {
  width: min(600px, 100%);
  background: #6C3EFA;
  border-radius: 64px;
  padding: 13px 13px 15px;
  display: flex;
  flex-direction: column;
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,0.22),
    inset 0 -3px 6px rgba(0,0,0,0.16),
    0 2px 5px rgba(0,0,0,0.24),
    0 10px 22px rgba(0,0,0,0.30);
}

/* Плашка 2 — в цвет большой панели; читается за счёт 3D-теней.
   Отступы до тиффани равны сверху/снизу/справа (14px). */
.museum-counter__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #6C3EFA;
  /* концентрично: тиффани-пилюля (≈r37) + отступ 14 = 51 */
  border-radius: 51px;
  padding: 14px 14px 14px 24px;
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.28),
    inset 0 -3px 6px rgba(0,0,0,0.18),
    0 2px 4px rgba(0,0,0,0.22),
    0 6px 13px rgba(0,0,0,0.26);
}

.museum-counter__label {
  flex-shrink: 1;
  min-width: 0;
  font-family: "Actay Wide", sans-serif;
  font-size: clamp(12px, 3.2vw, 21px);
  font-weight: 700;
  color: #fff;
  line-height: 1.05;
  white-space: nowrap;                        /* строго одна строка */
}

/* Плашка 3 — тиффани-пилюля, длинная */
.museum-counter__teal {
  flex-shrink: 0;
  min-width: clamp(120px, 40%, 250px);
  background: #3DE8C4;
  border-radius: 9999px;                      /* полное скругление — пилюля */
  padding: 15px 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.60),
    inset 0 -3px 6px rgba(0,0,0,0.14),
    0 6px 16px rgba(0,0,0,0.30);
}

.museum-counter__num {
  font-family: "Actay Wide", sans-serif;
  font-size: clamp(26px, 6.4vw, 44px);
  font-weight: 700;
  font-style: italic;
  color: #0A2A22;
  line-height: 1;
  transform: translateY(2px);                 /* число чуть ниже центра */
}

/* Текст-подсказка — на главной плашке, одна строка, по центру, мелкая */
.museum-counter__hint {
  font-family: "Actay", sans-serif;
  font-size: clamp(10px, 2.6vw, 13px);
  font-style: italic;
  color: rgba(255,255,255,0.70);
  text-align: center;
  line-height: 1.4;
  white-space: nowrap;                        /* строго одна строка */
  margin: 14px auto 11px;
}

/* Плашка 4 — кнопка «Заявка»: небольшая пилюля в цвет большой панели */
.museum-counter__btn {
  display: block;
  width: fit-content;
  margin: 0 auto;
  padding: 7px 30px;
  background: #6C3EFA;
  border: none;
  border-radius: 9999px;                      /* пилюля */
  font-family: "Actay Wide", sans-serif;
  font-size: 13px; font-weight: 700;
  font-style: italic;
  color: #fff;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.22),
    0 4px 10px rgba(0,0,0,0.30);
  transition: filter 0.2s;
}
.museum-counter__btn:hover { filter: brightness(1.08); }

/* ══ Лента новостей ════════════════════════════════════════════ */
.museum-cards {
  padding: 30px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 54px;                 /* место под «летающую» вкладку и фото-тени */
}

.deed-entry {
  position: relative;
  width: min(600px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ══ Карточка ══════════════════════════════════════════════════ */
.deed-card {
  position: relative;
  width: 100%;
  /* Фон вынесен в слой .deed-card__bg: карточке нужна вогнутая выемка
     в правом верхнем углу (clip-path), а фото должны выходить за её края. */
}

/* Слой фона: несёт тень по форме выемки (drop-shadow повторяет альфу потомка) */
.deed-card__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  filter: drop-shadow(0 16px 34px rgba(0,0,0,0.52));
  pointer-events: none;
}
/* Заливка: фиолетовый градиент + фаска; форма задаётся clip-path (ставит JS).
   Выемка в правом верхнем — граница вгибается внутрь (это не угол). */
.deed-card__bg i {
  position: absolute;
  inset: 0;
  display: block;
  background: linear-gradient(180deg, #7A45FF 0%, #6C3EFA 55%, #5E34F0 100%);
  box-shadow:
    inset 0 2px 5px rgba(255,255,255,0.26),
    inset 0 -8px 18px rgba(0,0,0,0.38);
  /* базовый путь до расчёта JS (прямоугольник со скруглениями) */
  clip-path: path('M 28,0 L 200,0 L 380,0 Q 400,0 400,20 L 400,380 Q 400,400 380,400 L 28,400 Q 0,400 0,380 L 0,28 Q 0,0 28,0 Z');
}

/* Контент — поверх слоя фона */
.deed-card__title, .deed-carousel, .deed-card__body {
  position: relative;
  z-index: 1;
}

.deed-card__title {
  padding: 18px 22px 12px;
  max-width: calc(100% - 150px);   /* не заезжать в выемку/под вкладку */
  font-family: "Actay Wide", sans-serif;
  font-size: 15px; font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

/* Категория — «летает» над правым верхним углом, оторвана от карточки,
   но вписана в мнимые границы этого угла */
/* Вкладка садится в вогнутую выемку карточки (правый верхний угол) */
.deed-card__tab {
  position: absolute;
  top: 0; right: 12px; z-index: 6;     /* зазор справа как на скрине */
  padding: 11px 24px 13px;
  line-height: 1.15;
  background: linear-gradient(180deg, #5CEFD9 0%, #3DE8C4 44%, #24C0A0 100%);
  /* Углы (TL TR BR BL) — умеренные и близкие, как на скрине.
     BL(15) в вогнутый угол выемки → Ri = 15 + зазор 5 = 20. */
  border-radius: 14px 16px 18px 15px;
  font-family: "Actay Wide", sans-serif;
  font-size: 13px; font-weight: 700;
  color: #0A2A22;
  white-space: nowrap;
  /* объёмная «чанки»-кнопка */
  box-shadow:
    inset 0 3px 3px rgba(255,255,255,0.78),
    inset 0 -6px 10px rgba(0,0,0,0.20),
    0 10px 22px rgba(0,0,0,0.42);
}

/* ══ Карусель — шире карточки, «летает» над ней ════════════════ */
.deed-carousel {
  position: relative;
  margin: 0 -18px 4px;        /* выходит за края карточки */
  overflow-x: clip;           /* клип горизонтального скролла */
  overflow-y: visible;        /* тени фото видны сверху/снизу */
  cursor: grab;
  user-select: none; -webkit-user-select: none;
}
.deed-carousel.is-grab { cursor: grabbing; }

.deed-carousel__track {
  display: flex;
  gap: 12px;
  padding: 4px 8px 14px;
  will-change: transform;
}

/* Высота фиксированная, ширина по соотношению сторон; скруглены + тень */
.deed-carousel__slide {
  flex-shrink: 0;
  height: 200px;
  border-radius: 18px;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 12px 30px rgba(0,0,0,0.42);
}
.deed-carousel__slide img {
  height: 100%; width: auto; display: block; object-fit: cover;
  -webkit-user-drag: none;
  pointer-events: none; /* клик ловит слайд (drag-guard) */
}
.deed-carousel__slide--ph { width: 200px; cursor: default; }

/* ══ Тело: текст со сворачиванием + встроенная «Показать ещё…» ══ */
.deed-card__body { position: relative; padding: 8px 22px 18px; }
.deed-card__text {
  font-size: 14px; color: rgba(255,255,255,0.85); line-height: 1.6;
  max-height: 8em;            /* ~5 строк в свёрнутом виде */
  overflow: hidden;
}
.deed-card__body.is-expanded .deed-card__text { max-height: none; }

/* «Показать ещё…» встроена в последнюю строку; перед ней текст плавно тает */
.deed-card__toggle {
  position: absolute;
  right: 22px; bottom: 28px;              /* поднято на строку */
  padding-left: 90px;
  line-height: 1.6;                       /* совпадает со строкой текста */
  background: linear-gradient(to right, rgba(94,52,240,0) 0%, #5E34F0 52%);
  font-family: "Actay", sans-serif; font-size: 13px;
  color: rgba(255,255,255,0.78);
  border: none; cursor: pointer;
  transition: color 0.2s;
}
.deed-card__toggle:hover { color: #fff; }
/* Развёрнуто — просто ссылка под текстом, без затухания */
.deed-card__body.is-expanded .deed-card__toggle {
  position: static; display: block; margin: 8px 0 0 auto;
  width: max-content; padding-left: 0; background: none;
}

/* ── Кнопка CTA — отдельно от карточки ──────────────────────── */
.deed-entry__cta { margin-top: 26px; }

/* ══ Скелетон ══════════════════════════════════════════════════ */
.deed-card--skeleton { width: min(600px, 100%); animation: sk 1.5s ease-in-out infinite; }
@keyframes sk { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
.skeleton-line {
  background: rgba(255,255,255,0.14);
  border-radius: 6px;
  height: 14px; margin-bottom: 8px;
}
.skeleton-line--short { width: 45%; }
.skeleton-line--med   { width: 70%; }
.skeleton-img { width: 100%; height: 210px; background: rgba(255,255,255,0.08); }

/* ══ Лайтбокс ══════════════════════════════════════════════════ */
.museum-lb {
  position: fixed; inset: 0;
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.88);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.museum-lb.open { opacity: 1; pointer-events: auto; }
.museum-lb__img {
  max-width: 92vw; max-height: 88vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.65);
}
.museum-lb__close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none;
  color: rgba(255,255,255,0.75);
  font-size: 38px; line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}
.museum-lb__close:hover { color: #fff; }

/* ── Подвал: бренд музея всегда в одну строку ───────────────── */
.footer-brand--museum {
  white-space: nowrap;
  font-size: clamp(12px, 3.4vw, 16px);   /* ужимается, но не переносится */
}

/* ══ Мобильная адаптация ═══════════════════════════════════════ */
@media (max-width: 480px) {
  .museum-hero { padding-top: calc(60px + 18px); }

  .museum-counter-wrap { padding: 0 14px 38px; }
  .museum-counter        { border-radius: 44px; padding: 9px 9px 11px; }   /* 35 + 9 */
  .museum-counter__inner { border-radius: 35px; padding: 11px 11px 11px 16px; gap: 8px; }   /* тиффани ≈24 + 11 */
  .museum-counter__label { font-size: clamp(12px, 3.6vw, 18px); }
  .museum-counter__teal  { padding: 11px 18px; min-width: 86px; }
  .museum-counter__num   { font-size: clamp(24px, 6vw, 34px); }
  .museum-counter__btn   { padding: 7px 28px; font-size: 12px; }

  .museum-cards { padding: 12px 16px 48px; gap: 40px; }
  .deed-card__title { font-size: 13px; }
  .deed-carousel__slide { height: 170px; }
  .deed-carousel__slide--ph { width: 170px; }
  .skeleton-img { height: 170px; }
}
