/* ── Страница одного поста ─────────────────────────────── */
.post-main {
  margin: 0 5%;
  padding: 28px 0 80px;
}

.post-loading,
.post-error {
  text-align: center;
  color: #888;
  padding: 80px 24px;
  font-size: 1rem;
}

/* ── Двухколоночный макет: текст 5 / слайдшоу 6 ───────── */
.post-article {
  display: grid;
  grid-template-columns: 6fr 5fr;
  gap: 60px;
  align-items: start;
}

/* ── Левая колонка: текст ──────────────────────────────── */
.post-left {
  min-width: 0;
}

.post-back {
  display: inline-block;
  color: #2d5016;
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 24px;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.post-back:hover { opacity: 1; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.post-date {
  font-size: 0.8125rem;
  color: #999;
}

.post-dept {
  font-size: 0.8125rem;
  color: #2d5016;
  font-weight: 500;
}


.post-title {
  font-size: 1.625rem;
  font-weight: 700;
  color: #0e350e;
  line-height: 1.3;
  margin: 0 0 28px;
}

.post-body {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: #222;
}

.post-body p { margin: 0 0 1em; }
.post-body h2, .post-body h3 { color: #0e350e; margin: 1.5em 0 0.5em; }
.post-body img { max-width: 100%; border-radius: 8px; margin: 16px 0; display: block; }
.post-body a { color: #2d5016; }
.post-body ul, .post-body ol { padding-left: 24px; margin: 0 0 1em; }
.post-body ul { list-style-type: disc; }
.post-body ol { list-style-type: decimal; }
.post-body ul ul { list-style-type: circle; }

/* ── Правая колонка: слайдшоу + миниатюры ─────────────── */
.post-right {
  min-width: 0;
  position: sticky;
  top: 80px;
  padding-top: 52px;
}

/* ── Основное слайдшоу ─────────────────────────────────── */
.post-slideshow {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  user-select: none;
}

.pss-track {
  display: flex;
  transition: transform 0.35s ease;
  will-change: transform;
}

.pss-slide {
  min-width: 100%;
  height: 500px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pss-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* стрелки */
.pss-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #0e350e;
  color: #e8dda0;
  border: 2px solid rgba(232, 221, 160, 0.4);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.625rem;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  padding: 0;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.pss-btn:hover {
  background: #1a5c1a;
  border-color: #e8dda0;
  color: #fff;
}
.pss-prev { left: 10px; }
.pss-next { right: 10px; }
.pss-btn.pss-hidden { display: none; }

/* ── Видео-слайды ──────────────────────────────────────── */
.pss-slide-video iframe,
.pss-slide-video video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  object-fit: contain;
}

/* ── Стрип миниатюр ────────────────────────────────────── */
.pss-thumbs {
  position: relative;
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.pss-thumb {
  flex: 1;
  min-width: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.60;
  transition: opacity 0.25s;
  flex-shrink: 0;
}

.pss-thumb:hover { opacity: 0.85; }

.pss-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.pss-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
}

.pss-thumb { position: relative; }

/* Скользящий резиновый оверлей-индикатор */
.pss-thumb-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  pointer-events: none;
  /* сначала без анимации — js добавит класс .ready */
  transition: none;
}

.pss-thumb-overlay.ready {
  /* мультяшная резинка */
  transition: left  0.52s cubic-bezier(0.68, -0.55, 0.265, 1.55),
              width 0.52s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ── Адаптив: планшет ───────────────────────────────── */
@media (max-width: 1279px) {
  .post-article {
    grid-template-columns: 1fr;
    grid-template-areas: "right" "left";
    gap: 32px;
  }
  .post-left  { order: 2; }
  .post-right {
    order: 1;
    position: static;
    padding-top: 0;
  }
  .pss-slide { height: 360px; }
}

/* ── Адаптив: мобильный ─────────────────────────────── */
@media (max-width: 767px) {
  .post-main {
    margin: 0 3%;
    padding: 16px 0 60px;
  }
  .post-title { font-size: 1.25rem; }
  .pss-slide  { height: 260px; }
  .pss-btn    { width: 36px; height: 36px; font-size: 1.25rem; }
}

/* ── Лайтбокс (полноэкранный просмотр фото) ─────────────── */
.pss-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.pss-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.pss-lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pss-lb-img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 3px;
  display: block;
  user-select: none;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
  transition: opacity 0.14s ease;
}

.pss-lb-img.fading { opacity: 0; }

.pss-lb-close {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
  z-index: 1001;
}
.pss-lb-close:hover { background: rgba(255, 255, 255, 0.28); }

.pss-lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.10);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 2.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background 0.2s;
  z-index: 1001;
}
.pss-lb-nav:hover { background: rgba(255, 255, 255, 0.26); }
.pss-lb-prev { left: 20px; }
.pss-lb-next { right: 20px; }
.pss-lb-nav.lb-hidden { display: none; }

.pss-lb-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.60);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  z-index: 1001;
  pointer-events: none;
  white-space: nowrap;
}

/* canvas-превью видеофайла в стрипе миниатюр */
.pss-thumb canvas.pss-vc {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* курсор zoom-in на слайде-изображении */
.pss-slide-img { cursor: zoom-in; }

@media (max-width: 767px) {
  .pss-lb-nav { width: 40px; height: 40px; font-size: 1.75rem; }
  .pss-lb-prev { left: 8px; }
  .pss-lb-next { right: 8px; }
  .pss-lb-close { top: 10px; right: 10px; }
}
