/* ═══ Mobile Design System — AudioHub ═══ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }

/* ── Touch devices ── */
@media (hover: none) and (pointer: coarse) {
  * { -webkit-tap-highlight-color: transparent; }
  .sc:hover, .story-card:hover, .btn:hover { transform: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   BOTTOM NAV — 64px, horizontal, safe area
   ═══════════════════════════════════════════════════════════ */
.bnav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 64px;
  background: rgba(9, 9, 15, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bnav__inner {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  height: 100%;
  width: 100%;
}

.bnav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  color: #64748b;
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  transition: color .2s;
  flex: 1;
  min-width: 0;
  max-width: 72px;
  -webkit-tap-highlight-color: transparent;
}

.bnav__item span {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

.bnav__item i {
  font-size: 20px;
  transition: transform .2s;
  line-height: 1;
}

.bnav__item.active,
.bnav__item:hover {
  color: #f59e0b;
}

.bnav__item.active i { transform: scale(1.1); }

/* FAB center button (for hall-of-fame link) */
.bnav__fab-wrap { position: relative; top: 0; }
.bnav__fab-wrap .bnav__fab {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary, #f59e0b), #f97316);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #000;
  box-shadow: 0 4px 16px rgba(245,158,11,.3);
}
.bnav__fab-wrap span { display: none; }

/* ═══════════════════════════════════════════════════════════
   HEADER — compact 48px on mobile
   ═══════════════════════════════════════════════════════════ */
.site-header {
  height: 48px;
  padding: 0 14px;
  background: rgba(9, 9, 15, 0.95) !important;
  backdrop-filter: blur(18px) !important;
}

.header__inner {
  min-height: 48px;
}

.logo {
  font-size: 1rem !important;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: #f1f5f9;
  font-size: 20px;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

.hamburger:active { background: rgba(255,255,255,.06); }

/* Nav drawer */
.nav-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 7, 18, 0.97);
  backdrop-filter: blur(20px);
  flex-direction: column;
  padding: 60px 20px 80px;
  overflow-y: auto;
  animation: slideIn .25s ease;
}

.nav-drawer.is-open { display: flex; }

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.nav-drawer__close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,.06);
  border: none;
  color: #f1f5f9;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.nav-drawer__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #94a3b8;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all .2s;
}

.nav-drawer__link:active { background: rgba(255,255,255,.06); }
.nav-drawer__link.active { background: rgba(245,158,11,.1); color: #f59e0b; }

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(0,0,0,.5);
}

.nav-overlay.is-open { display: block; }

/* ═══════════════════════════════════════════════════════════
   BREAKPOINT: ≤ 1024px — Tablet
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .site-nav { display: none !important; }
  .hamburger { display: flex; }
  .header__actions .btn { display: none !important; }
  .bnav { display: flex; }
  .bnav__inner { display: flex; }
  body { padding-bottom: 64px; }

  /* Buttons — bigger touch targets */
  .btn { min-height: 42px; font-size: .88rem; padding: 0 16px; }

  /* Cards */
  .cgrid { grid-template-columns: repeat(3, 1fr) !important; gap: 12px; }

  /* Panels */
  .panel { padding: 16px; border-radius: 14px; }

  /* Section spacing */
  .sec { padding: 16px 0 !important; }
}

/* ═══════════════════════════════════════════════════════════
   BREAKPOINT: ≤ 768px — Mobile
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .container { padding: 0 16px; }

  /* Cards — 2 columns */
  .cgrid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }

  /* Story cards — compact */
  .sc__nm { font-size: clamp(.82rem, 3.5vw, .95rem); }
  .sc__author { font-size: .72rem; }

  /* Section titles */
  .sec__ttl { font-size: 1.05rem; }

  /* Footer */
  .footer__inner { grid-template-columns: 1fr 1fr; gap: 16px; }
  .footer__bottom { flex-direction: column; text-align: center; gap: 8px; }

  /* Hero */
  .hero-cover__title { font-size: clamp(1.4rem, 5vw, 2rem) !important; }

  /* Genre grid */
  .ggrid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .gi { padding: 10px 6px; font-size: .72rem; }
  .gi i { font-size: 16px; }

  /* Auth forms */
  .auth-form { padding: 16px; }

  /* Detail layout */
  .detail-layout { grid-template-columns: 1fr !important; }

  /* Story detail */
  .detail-title { font-size: 1.2rem !important; }
  .detail-meta { font-size: .75rem; gap: 6px; }

  /* Breadcrumb */
  .breadcrumb { font-size: .72rem; margin-bottom: 10px; }

  /* Filter card — compact */
  .filter-card { padding: 12px; border-radius: 12px; }
  .filter-card input,
  .filter-card select { height: 42px; font-size: .85rem; }
  .filter-card .btn { height: 42px; }
  .filter-card .filter-row { gap: 10px; }
}

/* ═══════════════════════════════════════════════════════════
   BREAKPOINT: ≤ 480px — Small phone
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .container { padding: 0 14px; }

  /* Cards — 2 columns (keep 2 for content density) */
  .cgrid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }

  /* Genre grid */
  .ggrid { grid-template-columns: repeat(3, 1fr); gap: 6px; }

  /* Buttons */
  .btn { width: 100%; justify-content: center; }
  .btn--outline { width: auto; }

  /* Footer */
  .footer__inner { grid-template-columns: 1fr; }

  /* Header */
  .site-header { height: 44px; }
  .logo { font-size: .92rem !important; }

  /* Tabs */
  .site-nav a { font-size: .8rem; padding: 6px 8px; }

  /* Bottom nav icon size */
  .bnav__item i { font-size: 18px; }
  .bnav__item span { font-size: 9px; }
}

/* ═══════════════════════════════════════════════════════════
   BREAKPOINT: ≤ 360px — Very small
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .cgrid { gap: 6px; }
  .ggrid { grid-template-columns: repeat(2, 1fr); }
  .bnav__item { padding: 4px 2px; }
  .bnav__item i { font-size: 17px; }
}

/* ═══════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
