/*
 * Final responsive fixes.
 * Loaded after styles.css, hero.css and globe3d.css so these rules win the cascade
 * without rewriting the older layout layers.
 */

/* Small mono labels were below comfortable contrast on the dark background. */
.breadcrumb {
  color: var(--muted);
}

.sidebar-label,
.sidebar-footer,
.source-label {
  color: var(--muted);
}

.search-box input::placeholder {
  color: var(--muted);
}

.login-button {
  flex: none;
  white-space: nowrap;
}

/* Keep the fixed player bar from covering the sidebar footer. */
@media (min-width: 761px) {
  .sidebar {
    padding-bottom: calc(86px + 30px);
  }

  .player-status .player-live {
    display: flex;
  }

  .player-status .player-wave {
    opacity: .75;
  }
}

/* Mobile: reduce chrome, stop the top-bar labels from wrapping, and keep the
   globe above the selected-station card as in the original composition. */
@media (max-width: 760px) {
  .sidebar {
    height: 58px;
  }

  .topbar {
    height: 56px;
  }

  .breadcrumb {
    min-width: 0;
    overflow: hidden;
    font-size: 9px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .breadcrumb > span:first-child,
  .breadcrumb > b {
    display: none;
  }

  .breadcrumb span:last-child {
    font-size: 9px;
    letter-spacing: .8px;
  }

  .top-actions {
    flex: none;
    gap: 8px;
    min-width: 0;
  }

  .live-status {
    display: none;
  }

  .language-toggle {
    font-size: 10.5px;
    font-weight: 600;
  }

  .login-button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
  }

  .install-button {
    width: auto;
    min-width: 0;
    height: 34px;
    min-height: 34px;
    padding: 0 9px;
    font-size: 11px;
    line-height: 1.1;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .hero-section {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 0;
    padding: 16px 0 8px;
  }

  .hero-copy {
    display: contents;
  }

  .hero-copy > .eyebrow {
    grid-row: 1;
  }

  .hero-copy > h1 {
    grid-row: 2;
    margin: 10px 0 7px;
  }

  .hero-copy > .hero-description {
    grid-row: 3;
    margin-bottom: 2px;
  }

  .hero-location {
    grid-row: 4;
    width: 100%;
    margin-top: 8px;
    justify-items: center;
    row-gap: 6px;
  }

  .hero-copy > #hero-location-copy {
    grid-row: 5;
    width: 100%;
    max-width: none;
    margin-top: 10px;
    padding: 0;
    text-align: left;
  }

  .hero-copy > .hero-play-actions {
    grid-row: 6;
    width: 100%;
    margin-top: 8px;
    justify-content: flex-start;
  }

  .hero-copy > .hero-play-actions .hero-play-button {
    min-height: 46px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 700;
  }

  .hero-play-icon {
    font-size: 13px;
  }

  .hero-globe-stage {
    width: clamp(220px, 56vw, 230px);
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    justify-self: center;
  }

  .hero-location-label {
    font-size: 9px;
    letter-spacing: .9px;
  }

  .hero-player-state {
    font-size: 9.5px;
    letter-spacing: .4px;
  }

  .hero-song-viewport {
    min-height: 16px;
  }

  .hero-song-title {
    color: var(--text);
    font: 500 11px/1.4 var(--sans);
    letter-spacing: 0;
  }

  .hero-globe-toggle {
    padding: 7px 10px;
    font-size: 10.5px;
  }

  .filter-select {
    font-size: 12px;
  }

  .genre-chip {
    font-size: 12px;
  }

  .mobile-bottom-nav .mobile-nav-link {
    color: var(--text-soft);
    font-size: clamp(10px, 2.7vw, 10.5px);
    font-weight: 500;
    line-height: 1.15;
  }

  .mobile-bottom-nav .mobile-nav-link.active {
    font-weight: 600;
  }

  /* The two station actions were 34px; bring them closer to a touch target. */
  .station-row {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    gap: 6px;
  }

  .station-row .row-favorite,
  .station-row .row-play {
    width: 42px;
    height: 42px;
  }

  .player-previous,
  .player-next-popular {
    width: 36px;
    height: 36px;
  }
}

/* 761-899px used to stack the hero, making it 751px tall on a 800x670 screen.
   Keep a compact side-by-side hero instead. */
@media (min-width: 761px) and (max-width: 899px) {
  .live-status {
    display: none;
  }

  .hero-section {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(160px, 38%);
    align-items: center;
    column-gap: 16px;
    padding: 18px 0;
  }

  .hero-copy {
    width: auto;
    max-width: none;
    min-width: 0;
    padding: 0;
  }

  .hero-copy h1 {
    margin: 12px 0 8px;
    font-size: clamp(32px, 4.6vw, 38px);
    line-height: 1.06;
    letter-spacing: -1.4px;
  }

  .hero-description {
    max-width: none;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
  }

  .hero-copy > #hero-location-copy {
    width: 100%;
    max-width: none;
    margin-top: 8px;
    padding: 0;
    text-align: left;
  }

  .hero-copy > .hero-play-actions {
    margin-top: 8px;
  }

  .hero-location {
    position: relative;
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 6px;
    transform: none;
  }

  .hero-globe-stage {
    width: min(190px, 100%);
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .hero-location-copy {
    text-align: left;
  }
}

/* Desktop: tighten the hero and discovery controls enough that the first
   station row sits above the fixed player bar at 1440x900. */
@media (min-width: 900px) {
  .hero-section {
    min-height: 0;
    padding: 6px 0;
  }

  .discovery-section {
    padding-top: 10px;
  }

  .section-kicker {
    margin-bottom: 6px;
  }

  .search-filter-bar {
    margin-top: 16px;
  }

  .genre-row {
    padding: 12px 0 14px;
  }

  .results-meta {
    padding-bottom: 12px;
  }
}

/* globe3d.css grows the sphere to 384px from 1101px, although the compact
   900-1199px hero has no room for that size. Keep the compact sphere there;
   the full desktop grid starts at 1200px. */
@media (min-width: 900px) and (max-width: 1199px) {
  .hero-location {
    display: grid;
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "globe";
    justify-items: center;
  }

  .hero-globe-stage {
    grid-area: globe;
    width: min(320px, 100%) !important;
    height: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 1;
  }

  .hero-globe-stage > .hero-globe,
  .hero-globe-stage .hero-globe-canvas,
  .hero-globe-stage .hero-globe svg {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
  }
}

/* At 1200px the full desktop grid starts. The legacy two-column
   .hero-location grid needs more width than the 1200-1300px column has;
   use a single globe cell so the sphere stays inside the content. */
@media (min-width: 1200px) {
  .hero-location {
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "globe";
    justify-items: end;
  }

  .hero-globe-stage {
    grid-area: globe;
    width: 384px !important;
    height: 384px !important;
    max-width: 100% !important;
  }
}
