/* mobile.css — responsive overrides for screens < 720px */

/* ─── Base / Container ──────────────────────────────────────── */
@media (max-width: 719px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* ─── Typography ─────────────────────────────────────────── */
  h1 { font-size: 1.6rem !important; }
  h2 { font-size: 1.25rem !important; }
  h3 { font-size: 1.1rem !important; }

  /* ─── Buttons ────────────────────────────────────────────── */
  .btn-lg {
    padding: 0.8rem 1.25rem;
    font-size: 0.95rem;
  }
  .start-btn {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 1rem;
  }

  /* ─── Grid helpers ───────────────────────────────────────── */
  .grid-4 {
    grid-template-columns: 1fr 1fr !important;
  }

  /* ─── Header / Nav ───────────────────────────────────────── */
  .header-inner {
    height: 56px;
  }

  /* ─── Footer ─────────────────────────────────────────────── */
  .site-footer {
    padding: 2rem 0 1.25rem;
    margin-top: 2.5rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-brand p {
    font-size: 0.85rem;
  }
  .footer-col h4 {
    margin-bottom: 0.6rem;
  }
  .footer-col li {
    margin-bottom: 0.4rem;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.75rem;
  }

  /* ─── Homepage hero ──────────────────────────────────────── */
  .speedtest-hero {
    padding: 2rem 0 1.5rem;
  }
  .speedtest-card {
    padding: 1.5rem 1rem;
  }
  .gauge-wrap {
    width: 180px !important;
    height: 180px !important;
  }
  .gauge-value {
    font-size: 2.25rem;
  }

  /* ─── Speedtest result metrics ───────────────────────────── */
  .result-metrics {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem;
  }
  .result-metric {
    padding: 0.65rem 0.5rem;
  }
  .result-metric-value {
    font-size: 1.1rem;
  }

  /* ─── Article layout ─────────────────────────────────────── */
  .article-layout {
    padding: 1.25rem 0;
    gap: 1.25rem;
  }
  .article-body h2 {
    margin-top: 1.5rem;
  }
  .article-meta {
    gap: 0.6rem;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
  }
  .author-box {
    padding: 1rem;
    gap: 0.75rem;
  }
  .author-avatar {
    width: 40px;
    height: 40px;
  }
  .toc-mobile {
    margin-bottom: 1rem;
  }
  .answer-box {
    padding: 1rem;
  }

  /* ─── Cards ──────────────────────────────────────────────── */
  .card-lg {
    padding: 1.25rem 1rem;
  }
  .card {
    padding: 1rem;
  }

  /* ─── Tables ─────────────────────────────────────────────── */
  .data-table th,
  .data-table td {
    padding: 0.55rem 0.6rem;
    font-size: 0.8rem;
  }

  /* ─── FAQ ────────────────────────────────────────────────── */
  .faq-question {
    font-size: 0.9rem;
    padding: 0.875rem 0;
  }
  .faq-answer {
    font-size: 0.875rem;
  }

  /* ─── Download time calculator ───────────────────────────── */
  .dtc-inputs {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* ─── Bandwidth calculator rows ──────────────────────────── */
  .bw-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }
  .bw-row-controls {
    width: 100%;
    justify-content: space-between;
  }

  /* ─── Tool pages — specific overflow grids ──────────────── */

  /* Speed Result Explainer: 3-col inputs → 1-col */
  .sre-inputs {
    grid-template-columns: 1fr !important;
    gap: 0.875rem !important;
  }

  /* Internet Speed Plan Calculator: 3-col result → 1-col */
  .ispc-result-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* Compare Connection Types: pros/cons 2-col → 1-col */
  .cct-pros-cons {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* Router Placement: diagram side-by-side → stacked */
  .rpg-diagram {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Speed Grade: grade result 2-col — keep 2-col but tighten */
  #sgGradeGrid {
    gap: 0.5rem !important;
  }
  #sgGradeGrid > div {
    padding: 0.75rem 0.5rem !important;
  }

  /* Related tools auto-fill grid */
  [style*="auto-fill"] {
    grid-template-columns: 1fr !important;
  }

  /* CTA boxes */
  [style*="padding:1.75rem 2rem"] {
    padding: 1.25rem 1rem !important;
  }

  /* Hero section padding */
  [style*="padding:3.5rem 0"] {
    padding: 2rem 0 !important;
  }
  [style*="padding:3rem 0"] {
    padding: 1.75rem 0 !important;
  }

  /* Reduce large gaps in flex/grid layouts */
  [style*="gap:3rem"] {
    gap: 1.5rem !important;
  }
  [style*="gap:2.5rem"] {
    gap: 1.25rem !important;
  }
}

/* ─── Extra-small (< 400px) ──────────────────────────────────── */
@media (max-width: 399px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .gauge-wrap {
    width: 160px !important;
    height: 160px !important;
  }
  .gauge-value {
    font-size: 1.9rem;
  }
  .speedtest-card {
    padding: 1.25rem 0.75rem;
  }
  .grid-4 {
    grid-template-columns: 1fr !important;
  }
  .result-metrics {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
  .data-table th,
  .data-table td {
    padding: 0.45rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* ─── Tablet (720–959px) — article sidebars ──────────────────── */
@media (min-width: 720px) and (max-width: 959px) {
  .article-layout {
    grid-template-columns: 1fr !important;
  }
  .article-toc,
  .article-rail {
    display: none !important;
  }
  .toc-mobile {
    display: block !important;
  }
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr !important;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
