/* ==========================================================================
   Страница темы (/imena-dlya-detey) — телефон по композиции шаблона «33 · Streaming Hero»
   в светлом стиле сайта: постер с «логотипом» темы и парой кнопок, ряд вертикальных карточек
   подборок. Компьютер не меняется: стили темы — в topics.css (CSS_DEPS). Шапка — общая для сайта.
   Элементы только для телефона — .hub-m.
   ========================================================================== */
.hub-m {
  display: none;
}

@media (max-width: 639px) {
  .hub {
    --hub-gold: #f2d35b;       /* метки и флажок поверх фото */
    --hub-gold-deep: #c9962c;
    --hub-gray-btn: rgba(109, 109, 110, 0.72);

    padding-top: 52px; /* под фиксированной шапкой */
    color: var(--main-bg-color);
    /* мягкое золотое свечение сверху, к низу — обычный фон сайта */
    background:
      radial-gradient(140% 50% at 50% 0, #fff3c4, #f7f5ec 45%, var(--ligth-bg-color) 80%) no-repeat,
      var(--ligth-bg-color);
  }

  .hub svg {
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* ---------- Постер: фото, затемнения, метки, «логотип» темы, кнопки ---------- */
  .hub section.tp-hero {
    display: block;
    min-height: 0;
    aspect-ratio: 358 / 404;
    max-height: 62svh;
    margin: 8px 16px 0 !important;
    padding: 0 !important;
    border-radius: 12px;
    overflow: hidden;
    background: #2a1a0e;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 18px 40px rgba(120, 90, 20, 0.22);
  }
  .hub .tp-hero-bg {
    object-position: 50% 0;
  }
  .hub .tp-hero-overlay {
    background: linear-gradient(rgba(0, 0, 0, 0.5), transparent 16% 34%, rgba(0, 0, 0, 0.55) 58%, rgba(0, 0, 0, 0.94));
  }
  .hub .tp-hero .breadcrumbs,
  .hub .tp-hero-desc {
    display: none;
  }

  .hub .hub-label {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    font: 800 11px/1 "Montserrat", sans-serif;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  }
  .hub .hub-label svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
    color: var(--hub-gold);
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.6));
  }

  .hub .hub-flag {
    position: absolute;
    top: 0;
    right: 12px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 7px 6px;
    border-radius: 0 0 4px 4px;
    background: var(--hub-gold);
    color: #1a1208;
  }
  .hub-flag b {
    font: 900 16px/1 "Montserrat", sans-serif;
  }
  .hub-flag small {
    margin-top: 2px;
    font: 800 7.5px/1 "Montserrat", sans-serif;
    letter-spacing: 0.4px;
    text-transform: uppercase;
  }

  .hub .tp-hero #container.tp-hero-inner {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    max-width: none;
    margin: 0;
    padding: 0 14px 14px !important;
    text-align: center;
  }

  /* «логотип» темы: КАТАЛОГ — ИМЕНА — ДЛЯ ДЕТЕЙ; H1 остаётся «Имена для детей» */
  .hub .hub-kicker {
    display: block;
    margin-right: -9px;
    font: 700 13px/1 "Montserrat", sans-serif;
    letter-spacing: 9px;
    text-transform: uppercase;
    color: #f6e3a8;
  }
  .hub .tp-hero h1 {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 4px 0 0 !important;
    font-family: "Montserrat", sans-serif;
    font-size: inherit !important;
    line-height: 1 !important;
    text-transform: uppercase;
  }
  .hub .hub-name {
    font-size: 64px;
    font-weight: 900;
    line-height: 0.86;
    letter-spacing: -1px;
    color: #fff3df;
    background: linear-gradient(180deg, #fffaf0 20%, #f6dc6e 72%, var(--hub-gold-deep));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
  }
  .hub .hub-sub {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px -11px 0 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 11px;
    color: #fff3df;
  }
  .hub .hub-sub::before,
  .hub .hub-sub::after {
    content: "";
    width: 30px;
    height: 2px;
    background: var(--hub-gold);
  }
  .hub .hub-sub::after {
    margin-left: -11px;
  }

  .hub .hub-rank {
    display: block;
    margin: 10px 0 0 !important;
    font: 600 13px/1.35 "Nunito", sans-serif;
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.92);
  }
  .hub-rank b {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 18px;
    margin-right: 4px;
    padding: 1px 5px 0;
    border-radius: 3px;
    background: var(--hub-gold);
    font: 800 12px/1 "Montserrat", sans-serif;
    color: #1a1208;
  }
  .hub .hub-genres {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 6px 0 0 !important;
    font: 500 13px/1.3 "Nunito", sans-serif;
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.72);
  }
  .hub-genres i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
  }

  .hub .hub-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
  }
  .hub-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 48px;
    border-radius: 6px;
    font: 700 16px/1 "Nunito", sans-serif;
    text-decoration: none;
    white-space: nowrap;
  }
  .hub-btn svg {
    width: 20px;
    height: 20px;
  }
  .hub-btn--play {
    background-color: #fff;
    color: #000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }
  .hub .hub-btn--play svg {
    fill: currentColor;
    stroke: none;
  }
  .hub-btn--list {
    background: var(--hub-gray-btn);
    color: #fff;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  .hub-btn:focus-visible,
  .hub-tile:focus-visible {
    outline: 2px solid var(--gold-color);
    outline-offset: 2px;
  }

  .hub .hub-micro {
    display: block;
    margin: 10px 16px 0 !important;
    font: 400 12px/1.4 "Nunito", sans-serif;
    font-size: 12px !important;
    text-align: center;
    color: var(--dark-text-color);
  }

  /* ---------- Ряд вертикальных карточек ---------- */
  .hub section.hub-row {
    display: block;
    margin: 0 !important;
    padding: 20px 0 28px !important;
  }
  .hub-row-title {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0 0 10px;
    padding: 0 16px;
    font: 700 20px/1 "Montserrat", sans-serif;
    letter-spacing: -0.2px;
    color: var(--main-bg-color);
    text-decoration: none;
  }
  .hub-row-title svg {
    width: 18px;
    height: 18px;
    color: var(--dark-text-color);
  }
  .hub-strip {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .hub-strip::-webkit-scrollbar {
    display: none;
  }
  .hub-tile {
    position: relative;
    flex: 0 0 112px;
    aspect-ratio: 2 / 3;
    border-radius: 6px;
    overflow: hidden;
    background: #d9d4c4;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(17, 17, 17, 0.12);
  }
  .hub-tile img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 50% 30%;
  }
  .hub-tile::after {
    content: "";
    position: absolute;
    inset: 40% 0 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  }
  .hub-tile-badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    padding: 4px 6px 3px;
    border-radius: 0 0 0 5px;
    background: var(--hub-gold);
    font: 800 9px/1 "Montserrat", sans-serif;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #1a1208;
  }
  .hub-tile-name {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 8px;
    z-index: 1;
    font: 800 14px/0.98 "Montserrat", sans-serif;
    letter-spacing: -0.2px;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    overflow-wrap: anywhere;
  }

  /* ---------- Ниже первого экрана: разделы компактными белыми карточками, старый блок «Свежие» скрыт ---------- */
  .hub .tp-latest {
    display: none;
  }
  .hub section.tp-subtopics {
    margin: 0 !important;
    padding: 8px 0 40px !important;
    scroll-margin-top: 60px;
  }
  .hub .tp-subtopics #container {
    padding: 0 16px;
  }
  .hub .tp-section-title {
    margin: 0 0 12px !important;
    padding: 0;
    border: 0;
    font: 700 20px/1 "Montserrat", sans-serif !important;
    letter-spacing: -0.2px;
    text-transform: none !important;
    color: var(--main-bg-color);
  }
  .hub .tp-subtopics-grid {
    gap: 10px;
  }
  .hub .tp-subtopic-card {
    gap: 6px;
    padding: 16px;
    border-radius: 12px;
  }
  .hub .tp-subtopic-top h3 {
    font-size: 17px !important;
  }
  .hub .tp-subtopic-card p {
    font-size: 14px !important;
  }
  .hub .tp-subtopic-count {
    font-size: 12px;
  }
}

/* самые узкие экраны: «логотип» и кнопки чуть плотнее */
@media (max-width: 374px) {
  .hub .hub-name {
    font-size: 56px;
  }
  .hub .hub-sub {
    gap: 8px;
    margin-right: -8px;
    letter-spacing: 8px;
  }
  .hub .hub-sub::after {
    margin-left: -8px;
  }
  .hub .hub-sub::before,
  .hub .hub-sub::after {
    width: 22px;
  }
  .hub-btn {
    gap: 5px;
    font-size: 14px;
  }
  .hub-btn svg {
    width: 18px;
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub * {
    transition: none !important;
  }
}
