body { margin: 0; }

.sto-root {
  --sto-accent: #FE5D26;
  --sto-accent-hover: #D95427;
  --sto-black: #312D2B;
  --sto-text: #272F3D;
  --sto-bg: #F6F6F6;
  --sto-white: #FFFFFF;
  --sto-border: rgba(49, 45, 43, 0.1);
  --sto-card-shadow: 0 1px 4px 0 rgba(49, 45, 43, 0.08);
  --sto-transition: .25s ease;
  --sto-radius-md: 12px;
  --sto-radius-lg: 24px;

  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--sto-text);
  background-color: var(--sto-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sto-root *,
.sto-root *::before,
.sto-root *::after {
  box-sizing: border-box;
}

.sto-root :where(h1, h2, h3, p) { margin: 0; }

.sto-root a {
  text-decoration: none;
  color: inherit;
}

.sto-root img {
  max-width: 100%;
  height: auto;
  display: block;
}

.sto-root button {
  font-family: inherit;
}

/* --- Контейнер --- */
.sto-container {
  max-width: 1327px; /* контент 1297px (1327 − 2×15) */
  margin: 0 auto;
  padding: 24px 15px 0;
}

/* --- Heading --- */
.sto-heading {
  padding: 24px 0 28px;
}

.sto-heading-title {
  font-size: 32px;
  font-weight: 500;
  line-height: 40px;
  color: var(--sto-black);
}

.sto-heading-subtitle {
  margin-top: 8px;
  font-size: 15px;
  line-height: 22px;
  color: var(--sto-text);
  opacity: 0.5;
}

/* --- Сетка --- */
.sto-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

/* --- Карточка (вся карточка = кадр видео; превью играет по наведению) --- */
.sto-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: var(--sto-black);
  border-radius: var(--sto-radius-md);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 9 / 16;
  box-shadow: var(--sto-card-shadow);
  transition: transform var(--sto-transition), box-shadow var(--sto-transition);
}

.sto-card[hidden] { display: none; }

.sto-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 26px rgba(49, 45, 43, 0.18);
}

/* Видео заполняет карточку целиком (кадр-постер до наведения) */
.sto-card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Центральная кнопка play */
.sto-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%) scale(1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sto-accent);
  transition: transform var(--sto-transition), opacity var(--sto-transition);
  pointer-events: none;
}

.sto-card-play svg { margin-left: 2px; }

.sto-card:hover .sto-card-play {
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0;
}

/* Бейдж длительности (текст ставит JS из метаданных видео) */
.sto-card-duration {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(49, 45, 43, 0.6);
  backdrop-filter: blur(4px);
  color: var(--sto-white);
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
}

.sto-card-duration[hidden] { display: none; }

/* --- Навигация: «Показать ещё» + пагинация (порт листинга новостей) --- */
.sto-navigation-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 0;
  padding-bottom: 64px;
}

.sto-navigation-block[hidden] { display: none; }

.sto-root .sto-show-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: var(--sto-white);
  box-shadow: var(--sto-card-shadow);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--sto-text);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sto-root .sto-show-more[hidden] { display: none; }

.sto-root .sto-show-more:hover {
  background-color: var(--sto-accent);
  color: var(--sto-white);
}

.sto-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.sto-pagination[hidden] { display: none; }

.sto-root .sto-pagination-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: var(--sto-white);
  box-shadow: var(--sto-card-shadow);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--sto-text);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sto-root .sto-pagination-link:hover {
  background-color: var(--sto-accent);
  color: var(--sto-white);
}

.sto-root .sto-pagination-link--active {
  background-color: var(--sto-accent);
  color: var(--sto-white);
  pointer-events: none;
}

.sto-pagination-arrow svg { display: block; }

/* --- Попап (лайтбокс) --- */
.sto-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 18, 17, 0.78);
  backdrop-filter: blur(6px);
  animation: sto-fade 0.2s ease;
}

.sto-popup[hidden] { display: none; }

@keyframes sto-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sto-popup-dialog {
  position: relative;
  width: min(420px, 92vw);
  max-height: 88vh;
  aspect-ratio: 9 / 16;
  border-radius: var(--sto-radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.sto-popup-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.sto-popup-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--sto-white);
  color: var(--sto-black);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform var(--sto-transition), background var(--sto-transition), color var(--sto-transition);
}

.sto-popup-close:hover {
  background: var(--sto-accent);
  color: var(--sto-white);
  transform: rotate(90deg);
}

/* ========== Responsive ========== */
@media screen and (max-width: 1100px) {
  .sto-grid { grid-template-columns: repeat(5, 1fr); }
}

@media screen and (max-width: 900px) {
  .sto-grid { grid-template-columns: repeat(4, 1fr); }
}

@media screen and (max-width: 768px) {
  .sto-navigation-block {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-bottom: 40px;
  }
  .sto-pagination { margin-left: 0; justify-content: center; }
}

@media screen and (max-width: 680px) {
  .sto-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .sto-heading { padding: 16px 0 20px; }
  .sto-heading-title { font-size: 24px; line-height: 32px; }
  .sto-card-play { width: 40px; height: 40px; }
}

@media screen and (max-width: 480px) {
  .sto-grid { grid-template-columns: repeat(2, 1fr); }
  .sto-popup-close { top: 10px; right: 10px; }
}
