/* =========================================================
   FM RADIO — player.css
   Единый файл стилей дочерней темы Astra
   ========================================================= */

/* =========================================================
   1. КОНТЕЙНЕР
   ========================================================= */
.fm-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* =========================================================
   2. HEADER — стилизация шапки Astra
   ========================================================= */

.site-header,
#masthead,
.ast-primary-header-bar,
.ast-above-header-bar,
.ast-below-header-bar,
.main-header-bar {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  background-color: #ffffff !important;
  background-image: none !important;
}

.ast-primary-header-bar {
  min-height: 72px !important;
  padding: 12px 0 !important;
  border-bottom: 1px solid #eef0f3 !important;
  box-shadow: 0 2px 8px rgba(16,24,40,.04) !important;
}

/* Контейнер шапки — выровнен по ширине контента */
.ast-primary-header-bar .ast-builder-grid-row,
.site-primary-header-wrap,
.ast-builder-grid-row-container-inner {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  align-items: center !important;
}

/* Логотип — фиксированная высота */
.site-branding {
  display: flex !important;
  align-items: center !important;
  padding: 4px 0 !important;
}

.site-branding .custom-logo-link,
.site-branding .custom-logo-link img,
.site-branding img.custom-logo,
.site-logo-img img {
  max-height: 44px !important;
  height: auto !important;
  width: auto !important;
  display: block !important;
}

/* Убираем прозрачную шапку жёстко */
.ast-theme-transparent-header .site-header,
.ast-theme-transparent-header .ast-primary-header-bar,
.ast-theme-transparent-header .main-header-bar,
.ast-theme-transparent-header #masthead {
  position: relative !important;
  background-color: #ffffff !important;
  background-image: none !important;
}

/* Меню в шапке */
.site-header .main-header-menu > .menu-item > .menu-link {
  color: #1a1a1a !important;
  font-weight: 500;
  padding: 0 14px !important;
}
.site-header .main-header-menu > .menu-item.current-menu-item > .menu-link,
.site-header .main-header-menu > .menu-item:hover > .menu-link {
  color: #e63946 !important;
}

/* Отступ контента от шапки */
.site-content,
#content { padding-top: 0 !important; }

/* =========================================================
   3. HERO
   ========================================================= */
.fm-hero {
  padding: 60px 16px 36px !important;
  text-align: center;
  background: linear-gradient(180deg, #f4f5fb 0%, #ffffff 100%);
}
.fm-hero h1 {
  font-size: clamp(22px, 3vw, 34px);
  margin: 0 0 12px;
  line-height: 1.25;
}
.fm-hero p {
  color: #555;
  max-width: 720px;
  margin: 0 auto 24px;
  line-height: 1.55;
}

.fm-hero__buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.fm-hero__play,
.fm-hero__catalog {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .15s ease, border-color .15s ease;
}

.fm-hero__play {
  background: #e63946;
  color: #fff;
  border: 2px solid #e63946;
}
.fm-hero__play:hover {
  background: #d32f3e;
  border-color: #d32f3e;
  color: #fff;
  transform: translateY(-1px);
}

.fm-hero__catalog {
  background: #fff;
  color: #e63946;
  border: 2px solid #e63946;
}
.fm-hero__catalog:hover {
  background: #e63946;
  color: #fff;
  transform: translateY(-1px);
}

.fm-hero__play svg,
.fm-hero__catalog svg {
  display: block;
  flex: 0 0 auto;
}

/* =========================================================
   4. СЕКЦИИ И СЕТКИ
   ========================================================= */
.fm-section { padding: 32px 0; }
.fm-section h2 { font-size: 22px; margin: 0 0 18px; }

.fm-grid { display: grid; gap: 14px; }
.fm-grid--genres   { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.fm-grid--stations { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.fm-section--other {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid #eee;
}

/* =========================================================
   5. КАРТОЧКА ЖАНРА / ГОРОДА / ДЕСЯТИЛЕТИЯ / НАСТРОЕНИЯ
   ========================================================= */
.fm-genre-card {
  display: block;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fm-genre-card:hover {
  border-color: #e63946;
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
}
.fm-genre-card h3 { margin: 0 0 4px; font-size: 16px; }
.fm-genre-card span { font-size: 13px; color: #888; }

/* =========================================================
   6. КАРТОЧКА СТАНЦИИ
   ========================================================= */
.fm-station-card {
  display: grid;
  grid-template-columns: 56px 1fr 24px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.fm-station-card:hover {
  border-color: #e63946;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
  transform: translateY(-1px);
}
.fm-station-card:hover .fm-station-card__arrow {
  color: #e63946;
  transform: translateX(3px);
}

.fm-station-card__logo-wrap { display: block; }
.fm-station-card__logo {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  padding: 3px;
}

.fm-station-card__info { min-width: 0; display: block; }

.fm-station-card__title {
  display: block;
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fm-station-card__desc {
  display: -webkit-box;
  margin: 0;
  font-size: 13px;
  color: #777;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fm-station-card__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  transition: color .15s ease, transform .15s ease;
}
.fm-station-card__arrow svg { display: block; }

/* =========================================================
   7. SEO-БЛОК
   ========================================================= */
.fm-seo-text { background: #fafafa; }
.fm-seo-text p {
  max-width: 900px;
  color: #444;
  line-height: 1.65;
  margin: 0;
}

/* =========================================================
   8. РЕКЛАМНЫЕ БЛОКИ
   ========================================================= */
.fm-ad-wrap {
  margin: 24px auto;
  max-width: 1200px;
  padding: 0 16px;
}
.fm-ad {
  min-height: 90px;
  width: 100%;
  background: #f4f5f7;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.fm-ad:empty { display: none; }
.fm-ad > div,
.fm-ad iframe { display: block; width: 100%; max-width: 100%; }

/* =========================================================
   9. ПЛАВАЮЩИЙ ПЛЕЕР
   ========================================================= */
.fm-player {
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  left: auto !important;
  top: auto !important;
  z-index: 9999 !important;

  width: 340px !important;
  max-width: calc(100vw - 24px) !important;

  background: #111 !important;
  color: #fff !important;
  border-radius: 14px !important;
  padding: 12px !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.35) !important;

  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.fm-player.fm-player--collapsed { width: 60px !important; padding: 8px !important; }
.fm-player.fm-player--collapsed .fm-player__head,
.fm-player.fm-player--collapsed .fm-player__controls,
.fm-player.fm-player--collapsed .fm-player__ad { display: none !important; }
.fm-player.fm-player--collapsed .fm-player__min {
  position: static !important;
  transform: rotate(180deg) !important;
  margin: 0 auto !important;
}

/* Кнопка сворачивания */
.fm-player .fm-player__min,
button.fm-player__min {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #888 !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  font-size: 0 !important;
  line-height: 0 !important;
}
.fm-player__min svg { display: block !important; width: 16px !important; height: 16px !important; }
.fm-player__min:hover { background: rgba(255,255,255,.08) !important; color: #fff !important; }

/* Шапка плеера */
.fm-player__head {
  display: grid !important;
  grid-template-columns: 48px 1fr 48px !important;
  gap: 10px !important;
  align-items: center !important;
}
.fm-player__logo {
  width: 48px !important;
  height: 48px !important;
  border-radius: 10px !important;
  object-fit: contain !important;
  background: #222 !important;
  padding: 3px !important;
  display: block !important;
}
.fm-player__meta { min-width: 0 !important; }
.fm-player__title {
  font-weight: 600 !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: #fff !important;
}
.fm-player__status {
  font-size: 11px !important;
  opacity: .65 !important;
  margin-top: 3px !important;
  color: #fff !important;
}

/* Кнопка Play/Pause */
.fm-player .fm-player__btn,
button.fm-player__btn {
  appearance: none !important;
  -webkit-appearance: none !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  border-radius: 50% !important;
  background: #e63946 !important;
  color: #fff !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0 !important;
  line-height: 0 !important;
  flex: 0 0 48px !important;
}
.fm-player__btn svg {
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
}
.fm-player__btn:hover { background: #d32f3e !important; }

/* Громкость */
.fm-player__controls {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.fm-player__volume {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 1 1 auto !important;
}
.fm-player__volume-icon { font-size: 13px !important; opacity: .7 !important; }
.fm-player__volume input[type="range"] {
  width: 100% !important;
  accent-color: #e63946 !important;
  cursor: pointer !important;
}

/* Реклама внутри плеера */
.fm-player__ad {
  margin: 4px -4px -4px !important;
  min-height: 60px !important;
  background: #1a1a1a !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* =========================================================
   10. ТАКСОНОМИИ И АРХИВ
   ========================================================= */
.fm-tax-genre,
.fm-tax-city,
.fm-tax-decade,
.fm-tax-mood,
.fm-archive-stations { padding: 20px 0 40px; }

.fm-breadcrumbs { font-size: 13px; color: #888; margin: 0 0 16px; }
.fm-breadcrumbs a { color: #666; text-decoration: none; }
.fm-breadcrumbs a:hover { color: #e63946; }

.fm-tax-header { margin: 0 0 20px; }
.fm-tax-header__title {
  font-size: clamp(22px, 2.6vw, 30px);
  margin: 0 0 14px;
  line-height: 1.25;
}
.fm-tax-header__desc { max-width: 900px; color: #444; line-height: 1.65; }

.fm-tax-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px 0 !important;
  margin: 0 0 20px !important;
  border-top: 1px solid #eee !important;
  border-bottom: 1px solid #eee !important;
  flex-wrap: wrap !important;
}
.fm-tax-toolbar__count { font-size: 14px; color: #555; }
.fm-tax-toolbar__random {
  appearance: none;
  border: 1px solid #e63946;
  background: #fff;
  color: #e63946;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.fm-tax-toolbar__random:hover { background: #e63946; color: #fff; }

/* Алфавитный указатель */
.fm-alphabet {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  padding: 14px 0 20px !important;
  border-bottom: 1px solid #eee !important;
  margin: 0 0 24px !important;
}
.fm-alphabet__item {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 32px !important;
  height: 32px !important;
  padding: 0 8px !important;
  border-radius: 6px !important;
  background: #f5f5f5 !important;
  color: #333 !important;
  text-decoration: none !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}
.fm-alphabet__item:hover { background: #e63946 !important; color: #fff !important; }

.fm-letter-section { margin: 0 0 36px; }
.fm-letter-section__title {
  font-size: 26px !important;
  margin: 0 0 14px !important;
  color: #e63946 !important;
  font-weight: 700 !important;
  scroll-margin-top: 80px !important;
}

/* Пагинация */
.fm-pagination {
  margin: 28px 0 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}
.fm-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: #f5f5f5;
  color: #333;
  text-decoration: none;
  font-size: 14px;
}
.fm-pagination .page-numbers.current { background: #e63946; color: #fff; }
.fm-pagination .page-numbers:hover:not(.current) { background: #eaeaea; }

/* Пустое состояние и кнопка */
.fm-empty { padding: 40px 0; text-align: center; color: #666; }
.fm-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 22px;
  background: #e63946;
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}
.fm-btn:hover { background: #d32f3e; color: #fff; }

/* =========================================================
   11. ОДИНОЧНАЯ СТРАНИЦА СТАНЦИИ
   ========================================================= */
.fm-single-station { padding: 24px 0 60px; }
.fm-single-station__title {
  font-size: clamp(22px, 2.8vw, 32px);
  line-height: 1.25;
  margin: 8px 0 20px;
}

.fm-single-station__player-card {
  display: grid !important;
  grid-template-columns: 96px 1fr !important;
  gap: 20px !important;
  align-items: center !important;
  padding: 20px !important;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%) !important;
  color: #fff !important;
  border-radius: 16px !important;
  margin: 0 0 28px !important;
  cursor: pointer;
}
.fm-single-station__logo {
  width: 96px !important;
  height: 96px !important;
  border-radius: 14px !important;
  object-fit: contain !important;
  background: #fff !important;
  padding: 6px !important;
  display: block !important;
}
.fm-single-station__station-name {
  font-size: 20px !important;
  font-weight: 700 !important;
  margin: 0 0 4px !important;
  color: #fff !important;
}
.fm-single-station__hint {
  font-size: 13px !important;
  color: #bbb !important;
  margin: 0 0 12px !important;
}
.fm-single-station__buttons {
  display: flex !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

.fm-btn--play {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 12px 22px !important;
  background: #e63946 !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}
.fm-btn--play:hover:not(:disabled) { background: #d32f3e !important; }
.fm-btn--play:disabled { opacity: .5 !important; cursor: not-allowed !important; }
.fm-btn--play svg { display: block !important; }

.fm-btn--ghost {
  display: inline-flex !important;
  align-items: center !important;
  padding: 12px 20px !important;
  color: #fff !important;
  background: transparent !important;
  border: 1px solid rgba(255,255,255,.3) !important;
  border-radius: 999px !important;
  font-size: 14px !important;
  text-decoration: none !important;
}
.fm-btn--ghost:hover {
  border-color: #fff !important;
  background: rgba(255,255,255,.08) !important;
}

.fm-single-station__content {
  margin: 0 0 28px;
  line-height: 1.7;
  color: #333;
  max-width: 900px;
}
.fm-single-station__content h2 { margin: 24px 0 12px; font-size: 22px; }
.fm-single-station__content p  { margin: 0 0 14px; }

.fm-single-station__freqs { margin: 0 0 32px; }
.fm-single-station__freqs h2 { font-size: 22px; margin: 0 0 16px; }

.fm-single-station__related { margin: 0 0 32px; }
.fm-single-station__related h2 { font-size: 22px; margin: 0 0 16px; }

/* =========================================================
   12. ТАБЛИЦА ЧАСТОТ
   ========================================================= */
.fm-freq-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
}
.fm-freq-table th,
.fm-freq-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
}
.fm-freq-table th {
  background: #fafafa;
  font-weight: 600;
  color: #333;
}
.fm-freq-table tr:last-child td { border-bottom: 0; }
.fm-freq-table a { color: #1a1a1a; text-decoration: none; font-weight: 500; }
.fm-freq-table a:hover { color: #e63946; }

/* =========================================================
   13. СТРАНИЦА ГОРОДА
   ========================================================= */
.fm-city-freqs { margin: 36px 0 32px; }
.fm-city-freqs h2 { font-size: 22px; margin: 0 0 12px; }
.fm-city-freqs__intro {
  color: #555;
  max-width: 900px;
  margin: 0 0 16px;
  line-height: 1.6;
}

/* =========================================================
   14. МОБИЛЬНАЯ АДАПТАЦИЯ
   ========================================================= */
@media (max-width: 921px) {
  .ast-primary-header-bar {
    min-height: 64px !important;
    padding: 10px 0 !important;
  }
  .site-branding .custom-logo-link img,
  .site-branding img.custom-logo,
  .site-logo-img img {
    max-height: 36px !important;
  }
  .fm-hero { padding-top: 40px !important; }
}

@media (max-width: 768px) {
  .fm-ad-wrap { display: none; }
  .fm-hero__play,
  .fm-hero__catalog {
    padding: 12px 20px;
    font-size: 14px;
  }
}

@media (max-width: 600px) {
  .fm-hero { padding: 40px 12px 22px !important; }
  .fm-section { padding: 22px 0; }
  .fm-grid--genres { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  .fm-player {
    right: 8px !important;
    left: 8px !important;
    bottom: 8px !important;
    width: auto !important;
    max-width: none !important;
  }
  .fm-player__head { grid-template-columns: 42px 1fr 48px !important; }
  .fm-player__logo { width: 42px !important; height: 42px !important; }

  .fm-single-station__player-card {
    grid-template-columns: 72px 1fr !important;
    gap: 14px !important;
    padding: 16px !important;
  }
  .fm-single-station__logo { width: 72px !important; height: 72px !important; }
}

@media (max-width: 380px) {
  .fm-player__volume { display: none !important; }
  /* =========================================================
   INLINE RATING — компактный рейтинг в тёмной карточке
   ========================================================= */
.fm-inline-rating {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 6px 12px !important;
  background: rgba(255,255,255,.06) !important;
  border-radius: 999px !important;
  position: relative !important;
  vertical-align: middle;
  flex: 0 0 auto;
}

.fm-inline-rating__stars {
  display: inline-flex !important;
  gap: 2px !important;
  line-height: 0 !important;
}

/* Кнопка-звезда — сбрасываем все стили Astra */
.fm-inline-rating__star {
  all: unset;
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  color: rgba(255,255,255,.25) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  line-height: 0 !important;
  transition: color .15s ease, transform .1s ease;
}
.fm-inline-rating__star:hover:not(:disabled),
.fm-inline-rating__star.is-active {
  color: #f5b301 !important;
}
.fm-inline-rating__star:hover:not(:disabled) {
  transform: scale(1.15);
}
.fm-inline-rating__star:disabled {
  cursor: default;
}
.fm-inline-rating__star svg {
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  margin: 0 !important;
}

.fm-inline-rating__meta {
  display: inline-flex !important;
  align-items: baseline !important;
  gap: 3px !important;
  font-size: 12px !important;
  color: rgba(255,255,255,.6) !important;
  line-height: 1 !important;
  margin-left: 4px;
}
.fm-inline-rating__meta strong {
  font-size: 14px !important;
  color: #fff !important;
  font-weight: 700 !important;
}

.fm-inline-rating__msg {
  position: absolute !important;
  top: -30px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: #111 !important;
  color: #fff !important;
  font-size: 11px !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.fm-inline-rating__msg.is-visible { opacity: 1; }
.fm-inline-rating__msg.is-success { color: #52c47a !important; }
.fm-inline-rating__msg.is-error   { color: #ff8b8b !important; }

/* Стили для некликабельного домена сайта станции */
.fm-btn--site {
  cursor: default !important;
  user-select: text !important;
  color: #fff !important;
  border-style: dashed !important;
  border-color: rgba(255,255,255,.25) !important;
}
.fm-btn--site:hover {
  border-color: rgba(255,255,255,.45) !important;
  background: transparent !important;
  color: #fff !important;
}

/* Мобильная адаптация */
@media (max-width: 600px) {
  .fm-single-station__buttons {
    flex-wrap: wrap !important;
  }
  .fm-inline-rating {
    flex-basis: 100% !important;
    justify-content: center !important;
    margin-top: 6px;
  }
}
}