/* ============================================================
   CommunityAds — Responsive (responsive.css)
   Mobile-first adjustments layered on top of style.css
   ============================================================ */

/* ---------- Tablet ≤ 1024px ---------- */
@media (max-width: 1024px) {
  :root { --header-h: 64px; }

  .container { padding: 0 var(--s-5); }
  .section { padding: var(--s-16) 0; }
  .section-sm { padding: var(--s-12) 0; }

  .nav-links { display: none; }
  .nav-actions .btn-secondary { display: none; }
  .nav-toggle { display: inline-flex; }

  .hero { padding: var(--s-12) 0 var(--s-16); }
  .hero-trust { gap: var(--s-4); }

  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .community-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonial-grid { grid-template-columns: repeat(2, 1fr); }
  .benefits-grid { grid-template-columns: 1fr; }
  .stats-band-inner { grid-template-columns: repeat(2, 1fr); gap: var(--s-8); }

  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }

  .preview-body { grid-template-columns: 160px 1fr; min-height: 400px; }
  .preview-side { padding: var(--s-3); }
  .preview-stats { grid-template-columns: repeat(3, 1fr); }
  .floating-card.fc-1, .floating-card.fc-2 { display: none; }

  /* Dashboard */
  .dash-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0;
    width: 280px; height: 100vh;
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-collapse { display: none; }
  .sidebar-scrim { display: block; }
  .topbar-menu-btn { display: inline-flex; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .topbar-search { max-width: none; }
  .topbar-avatar .name { display: none; }
}

/* ---------- Small tablet / large phone ≤ 768px ---------- */
@media (max-width: 768px) {
  .section-title { font-size: 32px; }
  .section-sub { font-size: var(--fs-base); margin-bottom: var(--s-8); }
  h1 { font-size: 36px; }

  .features-grid,
  .steps-grid,
  .community-grid,
  .testimonial-grid { grid-template-columns: 1fr; }

  .stats-band-inner { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
  .stats-band { padding: var(--s-10) var(--s-5); }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
  .footer-col h5 { font-size: 12px; }

  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-legal { justify-content: center; }

  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; }

  .preview-body { grid-template-columns: 1fr; }
  .preview-side { display: none; }

  .benefit-block { padding: var(--s-6); }

  /* Dashboard */
  .page { padding: var(--s-4); }
  .kpi-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-actions { justify-content: flex-start; }
  .table-head { flex-direction: column; align-items: stretch; }
  .table-tools { width: 100%; }
  .table-search { flex: 1; }

  /* Responsive table → cards on mobile via data-label */
  .data-table.responsive-table { min-width: 0; }
  .data-table.responsive-table thead { display: none; }
  .data-table.responsive-table tbody tr {
    display: block; border: 1px solid var(--border);
    border-radius: var(--r-md); margin-bottom: var(--s-3); padding: var(--s-3);
  }
  .data-table.responsive-table tbody td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px var(--s-2); border-bottom: 1px dashed var(--border);
    font-size: var(--fs-sm);
  }
  .data-table.responsive-table tbody td:last-child { border-bottom: none; }
  .data-table.responsive-table tbody td::before {
    content: attr(data-label);
    font-weight: 600; color: var(--muted); font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.03em;
    margin-right: var(--s-3);
  }
}

/* ---------- Mobile ≤ 480px ---------- */
@media (max-width: 480px) {
  .container { padding: 0 var(--s-4); }
  h1 { font-size: 30px; }
  .hero-badge { font-size: 12px; }
  .hero-trust { flex-direction: column; gap: var(--s-2); }

  .btn-lg { height: 46px; padding: 0 var(--s-5); font-size: var(--fs-base); }

  .testimonial-quote { font-size: var(--fs-sm); }

  .stats-band-inner { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-legal { flex-wrap: wrap; justify-content: center; gap: var(--s-3); }

  .topbar-search { display: none; }
  .page-title { font-size: var(--fs-xl); }
  .kpi-value { font-size: 22px; }

  .toast-container { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: 100%; min-width: 0; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .sidebar, .dash-topbar, .btn, .toast-container { display: none !important; }
  .dash-shell { grid-template-columns: 1fr; }
  body { background: #fff; }
}