/* ==========================================================================
   Guides Slider — отдельный файл стилей
   Подключается только на главной странице (front-page)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Секция
   -------------------------------------------------------------------------- */
.guides-slider-section {
  padding: 0;
}

.guides-slider-section .container {
  /* наследует .container из main.css */
}

/* --------------------------------------------------------------------------
   Обёртка (glass-карточка, как .games и .news на главной)
   -------------------------------------------------------------------------- */
.guides-slider-wrap {
  margin-top: 40px;
}

/* --------------------------------------------------------------------------
   Шапка блока
   -------------------------------------------------------------------------- */
.guides-slider__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.guides-slider__title {
  /* использует .heading-yy-2 + .gradient-text из main.css */
  margin: 0;
}

.guides-slider-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Swiper — переопределение темы под сайт
   -------------------------------------------------------------------------- */
.guides-swiper {
  --swiper-theme-color: var(--primary-clr, #ea3c46);
  --swiper-navigation-color: var(--primary-clr, #ea3c46);
  --swiper-pagination-color: var(--primary-clr, #ea3c46);
  --swiper-pagination-bullet-inactive-color: #323248;
  --swiper-pagination-bullet-inactive-opacity: 1;

  overflow: visible;           /* чтобы тень карточек не обрезалась */
  padding-bottom: 44px !important; /* место под пагинацию */
}

/* --------------------------------------------------------------------------
   Pre-init: предотвращаем прыжок верстки до инициализации JS.
   Swiper добавляет класс .swiper-initialized сразу после init —
   до этого момента задаём слайдам те же ширины, что будет ставить JS.
   spaceBetween = 16px, breakpoints совпадают с guides-slider.js
   -------------------------------------------------------------------------- */
.guides-swiper:not(.swiper-initialized) .swiper-wrapper {
  flex-wrap: nowrap;
  gap: 16px;
}

/* mobile: 1 слайд — 100% */
.guides-swiper:not(.swiper-initialized) .swiper-slide {
  min-width: 100%;
  width: 100%;
}

/* >= 480px: 2 слайда */
@media (min-width: 480px) {
  .guides-swiper:not(.swiper-initialized) .swiper-slide {
    min-width: calc(50% - 8px);
    width: calc(50% - 8px);
  }
}

/* >= 768px: 3 слайда */
@media (min-width: 768px) {
  .guides-swiper:not(.swiper-initialized) .swiper-slide {
    min-width: calc(33.333% - 10.667px);
    width: calc(33.333% - 10.667px);
  }
}

/* >= 1024px: 4 слайда */
@media (min-width: 1024px) {
  .guides-swiper:not(.swiper-initialized) .swiper-slide {
    min-width: calc(25% - 12px);
    width: calc(25% - 12px);
  }
}

/* Скрываем overflow у родителя, чтобы слайдер не выезжал за пределы секции */
.guides-slider-wrap {
  overflow: hidden;
  border-radius: 40px;
  padding: 40px;
}

/* --------------------------------------------------------------------------
   Карточка гайда
   -------------------------------------------------------------------------- */
.guide-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--border-medium, 12px);
  overflow: hidden;
  background: var(--background-card-gradient);
  border: 1px solid var(--field-border-clr);
  transition: all .3s ease;
  height: 100%;
}

@media (hover: hover) {
  .guide-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .5);
    border-color: #6c6c8e;
  }
}

/* Ссылка-обёртка */
.guide-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Превью */
.guide-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--tertiary-clr, #1a1a27);
  flex-shrink: 0;
}

.guide-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease, opacity .3s ease-in-out;
}

@media (hover: hover) {
  .guide-card:hover .guide-card__media img {
    transform: scale(1.05);
  }
}

/* Тег категории поверх картинки */
.guide-card__tag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 6px;
  color: var(--text-clr, #efecff);
  background: rgba(17, 18, 27, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Тело карточки */
.guide-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 16px 16px;
  gap: 8px;
}

/* Заголовок */
.guide-card__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-clr, #efecff);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-fast, 0.2s ease);
}

.guide-card:hover .guide-card__title {
  color: var(--primary-clr, #ea3c46);
}

/* Описание / excerpt */
.guide-card__desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--content-text-clr, #c3c1d2);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Мета (дата + игра) */
.guide-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.guide-card__date {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted, #a5adcf);
  white-space: nowrap;
}

.guide-card__date svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.guide-card__game {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-clr, #ea3c46);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* --------------------------------------------------------------------------
   Навигация — кастомные кнопки
   -------------------------------------------------------------------------- */
.guides-swiper-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.guides-swiper-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-clr, #efecff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast, 0.2s ease),
              border-color var(--transition-fast, 0.2s ease),
              color var(--transition-fast, 0.2s ease);
  -webkit-user-select: none;
  user-select: none;
  position: static !important; /* переопределяем absolute из swiper */
  margin: 0 !important;
}

.guides-swiper-btn:hover {
  background: rgba(234, 60, 70, 0.15);
  border-color: rgba(234, 60, 70, 0.4);
  color: var(--primary-clr, #ea3c46);
}

.guides-swiper-btn.swiper-button-disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* Скрываем дефолтные псевдоэлементы Swiper у кастомных кнопок */
.guides-swiper-btn::after {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Пагинация — кастомные bullets
   -------------------------------------------------------------------------- */
.guides-swiper-pagination {
  position: static !important;
  transform: none !important;
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.guides-swiper-pagination .swiper-pagination-bullet {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: #323248;
  opacity: 1;
  transition: width 0.2s ease, background 0.2s ease;
  margin: 0 !important;
}

.guides-swiper-pagination .swiper-pagination-bullet-active {
  width: 22px;
  background: var(--primary-clr, #ea3c46);
}

/* --------------------------------------------------------------------------
   Swiper-контейнер — убираем лишние отступы
   -------------------------------------------------------------------------- */
.guides-swiper .swiper-wrapper {
  align-items: stretch;
}

.guides-swiper .swiper-slide {
  height: auto;
}

/* --------------------------------------------------------------------------
   Адаптив
   -------------------------------------------------------------------------- */

/* Планшет (2 слайда) */
@media (max-width: 1024px) {
  .guides-slider-wrap {
    padding: 24px 20px;
  }
}

/* Мобилка */
@media (max-width: 640px) {
  .guides-slider-wrap {
    padding: 20px 16px;
    border-radius: 20px;
  }

  .guides-slider__head {
    margin-bottom: 20px;
  }

  .guides-swiper {
    padding-bottom: 36px !important;
  }

  /* На мобилке навигацию скрываем — свайп удобнее */
  .guides-swiper-nav {
    display: none;
  }
}
