
/* ==========================================================================
   Responsive Mobile Overrides (v1.0)
   Purpose: Make a desktop-oriented site usable on phones (320px–768px).
   Strategy: Collapse multi-column layouts, stack nav, simplify spacing,
   ensure images/forms/tables adapt. Safe to load after desktop CSS.
   ========================================================================== */

/* Base viewport adjustments */
@media (max-width: 768px) {

  html, body {
    font-size: 15px; /* Slightly smaller base for narrow screens */
    overflow-x: hidden;
  }

  /* Containers */
  .container, .wrapper, .content, main, section {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Headings & text spacing */
  h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin: 0.5em 0;
    word-break: break-word;
  }
  p {
    margin: 0.5em 0;
  }

  /* Navigation */

  .navigation {
    flex-direction: column;
  }
  
  .backg {
    flex-direction: row;
  }

  .nav {
    flex-direction: column !important;
    align-items: flex-start;
    gap: 0.5rem !important;
  }
  .nav a {
    display: block;
    padding: 0.5rem 0;
  }

  /* Grid / row / col collapse */
  .row, .grid {
    display: flex;
    flex-direction: column !important;
    gap: 1rem;
  }
  .col, [class*="col-"] {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }

  /* Hero or banner blocks */
  .hero {
    grid-template-columns: 1fr !important;
    text-align: center;
  }

  /* Cards stack neatly */
  .card {
    padding: 1rem;
    gap: 0.75rem;
  }

  /* Tables: make scrollable */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
  }
  th, td {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  /* Forms: stack labels/fields */
  form, .form-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
  input, select, textarea, button {
    width: 100% !important;
    font-size: 1rem;
  }

  /* Images & media */
  img, video, iframe {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Utility overrides */
  .hide-mobile { display: none !important; }
  .text-center { text-align: center !important; }
  .mt-0 { margin-top: 0 !important; }
  .mb-0 { margin-bottom: 0 !important; }
  .p-0 { padding: 0 !important; }
}

/* Extra small devices (phones <480px) */
@media (max-width: 480px) {
  body { font-size: 14px; }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.2rem; }

  .nav a {
    padding: 0.25rem 0;
    font-size: 0.95rem;
  }

  button, input, select, textarea {
    font-size: 0.95rem;
    padding: 0.5rem;
  }
}
