/* =========================================================
   Responsive rules — tested against 320 / 375 / 576 / 768 / 992 / 1200 / 1440
   ========================================================= */

/* Prevent any horizontal scroll site-wide */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; }

/* ---- >= 1440px : roomier container ---- */
@media (min-width: 1440px) {
  .container { max-width: 1260px; }
}

/* ---- <= 1199.98px : tablet landscape / small desktop ---- */
@media (max-width: 1199.98px) {
  .nav-search-form .input-group { width: 200px; }
  .related-guide-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- <= 991.98px : navbar collapses, sidebar stacks below content ---- */
@media (max-width: 991.98px) {
  .site-navbar { padding: 0.5rem 0; }
  .navbar-collapse { padding-top: 1rem; }
  .nav-search-form { width: 100%; margin-top: 0.75rem; }
  .nav-search-form .input-group { width: 100%; }
  .navbar-nav { margin-bottom: 0.5rem; }
  .navbar-nav .nav-link { padding: 0.6rem 0.5rem !important; }

  .hero { padding: 2.75rem 0 2.5rem; }
  .article-card--horizontal { flex-direction: column; }
  .article-card--horizontal .article-card-img-wrap { width: 100%; aspect-ratio: 5/3; }

  .sidebar { margin-top: 2.5rem; }
}

/* ---- <= 767.98px : mobile ---- */
@media (max-width: 767.98px) {
  .section { padding: 2.5rem 0; }
  .hero-title { font-size: 1.85rem; }
  .hero-subtitle { font-size: 1rem; }
  .search-box-inner { padding: 0.3rem 0.3rem 0.3rem 1rem; flex-wrap: nowrap; }
  .search-box .form-control { font-size: 0.92rem; }
  .search-box-btn span { display: none !important; }
  .search-box-btn { padding: 0.6rem 0.9rem; }

  .related-guide-grid { grid-template-columns: 1fr; }
  .table-of-contents ol { columns: 1; }

  .article-title { font-size: 1.5rem; }
  .article-meta-row { gap: 0.85rem; font-size: 0.82rem; }

  .footer-brand { justify-content: flex-start; }
  .site-footer { text-align: left; }

  .problem-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---- <= 575.98px : small phones ---- */
@media (max-width: 575.98px) {
  .brand-tagline { display: none; }
  .brand-name { font-size: 0.95rem; }
  .brand-mark { width: 36px; height: 36px; font-size: 1rem; }

  .hero { padding: 2.25rem 0 2rem; }
  .hero-title { font-size: 1.6rem; }
  .hero-examples { gap: 0.4rem; }
  .hero-example-chip { font-size: 0.78rem; padding: 0.35rem 0.75rem; }

  .section-title { font-size: 1.35rem; }

  .question-card, .category-tile { padding: 1rem; }
  .article-card-body { padding: 1rem; }

  .solution-box { flex-direction: column; gap: 0.65rem; padding: 1rem; }
  .step-number { width: 32px; height: 32px; font-size: 0.9rem; }

  .content-page-card { padding: 1.5rem; }
  .error-code { font-size: 4rem; }
}

/* ---- <= 374.98px : very small phones (320px target) ---- */
@media (max-width: 374.98px) {
  .container { padding-left: 12px; padding-right: 12px; }
  .hero-title { font-size: 1.4rem; }
  .btn { padding: 0.55rem 1rem; font-size: 0.9rem; }
  .navbar-brand .brand-name { font-size: 0.88rem; }
}
