/* ===================================================== */
/* == GENERAL MOBILE STYLES (Apply <= 1024px) == */
/* ===================================================== */
@media (max-width: 1024px) {

    /* --- Base Layout & Typography --- */
  
    body {
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      overflow-x: hidden;
    }
  
    body.page-api-layout {
        padding-top: 8rem; /* h-16 (header) + h-16 (nav) = 8rem */
    }
  
    section > .absolute.font-mono {
        display: none;
    }
  
    h1 { font-size: 2.25rem; line-height: 1.3; }
    h2 { font-size: 1.875rem; line-height: 1.3; }
    h3 { font-size: 1.5rem; line-height: 1.3; }
  
    main {
      overflow-x: hidden;
    }
  
    /* --- Header --- */
  
    header nav ul.hidden.md:flex {
      display: none;
    }
  
    header nav .md\:hidden {
      display: block;
    }
  
    header nav.container {
      padding-left: 1rem;
      padding-right: 1rem;
      height: 5rem; /* 80px height */
      display: flex;
      align-items: center;
    }
  
    /* --- ADJUSTED LOGO RULE --- */
    /* Target the logo image more directly within its container */
    header nav .flex-shrink-0 img[alt='Mpalo Logo'] {
        height: 8rem !important; /* 48px logo height */
        width: auto !important; /* Maintain aspect ratio */
        max-height: none !important; /* Remove any potential max-height limit */
        /* Ensure visibility if other styles conflict */
        display: inline-block !important;
        opacity: 1 !important;
    }
    /* --- END ADJUSTED LOGO RULE --- */
  
  
    /* --- Mobile Menu (#mobile-menu hidden md:hidden) --- */
    #mobile-menu {
       background-color: rgba(16, 16, 23, 0.98);
       border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    #mobile-menu ul {
      padding: 1rem;
    }
    #mobile-menu li a {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        display: block;
        border-radius: 4px;
    }
     #mobile-menu li a:hover {
         background-color: rgba(255, 255, 255, 0.1);
         color: #FFE5D9;
     }
  
  
    /* --- Hero Sections --- */
  
    section.hero-bg {
      padding-top: 6.5rem;
      padding-bottom: 3rem;
      min-height: 80vh;
      height: auto;
      flex-direction: column;
      background-position: center center;
      width: 100%;
      overflow: hidden;
    }

    .hero-overlay {
      background-color: #0D1B2A;
    }

  
    section.hero-bg .relative.z-10.container {
      flex-direction: column;
      justify-content: center;
      align-items: center;
      width: 100%;
    }
  
    section.hero-bg div.md\:w-1\/2:nth-child(1) { /* Text container */
      width: 100%;
      max-width: 600px;
      text-align: center;
      margin-bottom: 2.5rem;
    }
  
    section.hero-bg div.md\:w-1\/2:nth-child(1) .flex { /* Button container */
      justify-content: center;
      flex-direction: column;
      align-items: center;
      gap: 1rem;
    }
     section.hero-bg div.md\:w-1\/2:nth-child(1) .flex a {
        width: 80%;
        max-width: 300px;
        text-align: center;
     }
  
    section.hero-bg div.md\:w-1\/2:nth-child(2) { /* Desktop GIF container */
      display: none;
    }
  
    #second-hero, #final-hero {
        height: 60vh;
        min-height: 400px;
        width: 100%;
        overflow: hidden;
    }
     #second-hero img[alt="Loading Scribble"] {
          max-width: 60%;
          max-height: 60%;
     }
  
  
    /* --- "Who We Are" Section --- */
    #who-we-are {
      padding-top: 3rem;
      padding-bottom: 3rem;
    }
     #who-we-are .container {
        flex-direction: column;
        gap: 2rem;
     }
     #who-we-are img {
        max-height: 150px;
        max-width: 150px;
     }
     #who-we-are p {
        font-size: 0.95rem;
        line-height: 1.6;
     }
  
    /* --- Third Hero / Cards Section --- */
    #third-hero {
      padding-top: 3rem;
      padding-bottom: 3rem;
      min-height: auto;
    }
    #third-hero img.h-\[40vh\] { height: 30vh; }
    #third-hero img.h-\[25vh\] { height: 20vh; }
  
    /* --- Blog Section --- */
    #filler-hero {
      padding-top: 3rem;
      padding-bottom: 3rem;
    }
    #filler-hero h2 {
       font-size: 1.75rem;
       margin-bottom: 1.5rem;
    }
    #filler-hero .grid {
      gap: 0.5rem;
    }
    #filler-hero .flex.items-center {
       flex-direction: row;
       align-items: flex-start;
    }
    #filler-hero .blog-bg-image {
      width: 6rem;
      height: 6rem;
      flex-shrink: 0;
    }
     #filler-hero .flex-1 {
         margin-left: 1rem;
     }
    #filler-hero h3 { font-size: 1rem; }
    #filler-hero p { font-size: 0.875rem; }
    #filler-hero span.text-xs { font-size: 0.75rem; }
  
  
    /* --- Footer --- */
    footer {
      padding-top: 4rem;
      padding-bottom: 2rem;
      text-align: center;
    }
    footer .grid {
       gap: 2.5rem;
    }
     footer .flex.justify-center.md\:justify-start,
     footer .flex.justify-center.md\:justify-end {
        justify-content: center !important;
     }
     footer img.h-60 { /* Footer logo */
        height: 8rem;
     }
      footer img.h-48 { /* Palo mascot */
         height: 7rem;
      }
     footer h3 {
         margin-bottom: 0.75rem;
         font-size: 1.25rem;
     }
     footer ul {
         space-y: 0.5rem;
     }
     footer li a {
         font-size: 0.95rem;
         padding: 0.25rem 0;
         display: inline-block;
     }
     footer .mt-12.text-center {
         margin-top: 3rem;
     }
  
    /* --- Chat Popup Trigger --- */
    #chat-container {
       max-width: 90%;
       bottom: 1rem;
       left: 5%;
       right: 5%;
       transform: translateX(0) translateY(150%);
       width: auto;
    }
     #chat-container.opacity-100 {
        transform: translateX(0) translateY(0);
     }
     #chat-container input {
         padding: 0.8rem 1rem;
         font-size: 0.95rem;
     }
  
  
    /* --- Cookie Consent --- */
    #cookie-consent-popup {
       max-width: 90%;
       bottom: 1rem;
       left: 5%;
       right: 5%;
       width: auto;
    }
     #cookie-consent-popup p {
         font-size: 0.875rem;
         line-height: 1.5;
     }
  
  
  } /* End of @media (max-width: 1024px) block */
  
  
  /* ===================================================== */
  /* == SPECIFIC SMALL MOBILE STYLES (Apply <= 767px) == */
  /* ===================================================== */
  @media (max-width: 767px) {
  
    /* --- Finer Grained Typography Adjustments --- */
  
    section.hero-bg h1 {
      font-size: 1.875rem;
      line-height: 1.3;
    }
  
    section.hero-bg p {
      font-size: 1rem;
      line-height: 1.5;
    }
  
     #filler-hero .blog-bg-image {
       width: 5rem;
       height: 5rem;
     }
     #filler-hero .flex-1 {
         margin-left: 0.75rem;
     }
  
    section.hero-bg div.md\:w-1\/2:nth-child(1) .flex {
      flex-direction: column;
      gap: 0.75rem;
    }
     section.hero-bg div.md\:w-1\/2:nth-child(1) .flex a {
        width: 90%;
     }
  
  } /* End of @media (max-width: 767px) block */