/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    width: 90%;
    font-size: 20px;
    padding: 15px;
    border-left: 20px solid yellow;
    border-right: 20px solid yellow;
  }

  .math-papers-quiz-container,
  .english-quiz-grid,
  .env-quiz-grid,
  .science-quiz-grid,
  .ict-quiz-grid,
  .ol-science-quiz-container,
  .ict-quiz-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .math-papers-quiz-container button,
  .english-quiz-grid button,
  .env-quiz-grid button,
  .science-quiz-grid button,
  .ict-quiz-grid button,
  .ol-science-quiz-container button {
    font-size: 16px;
    padding: 12px;
  }

  .pdf-card {
    margin: 10px;
    padding: 10px;
    font-size: 16px;
  }
}

/* Responsive Design for header*/
/* Responsive Tweaks */
@media (max-width: 1024px) {
  .header-content {
    flex-direction: column;
  }

  .home-button {
    width: 80%;
    font-size: 16px;
    text-align: center;
  }

  .logo1 {
    width: 250px;
  }

  .logo2 {
    width: 120px;
  }

  .sign {
    display: none;
  }

  .sign p {
    font-size: 16px;
  }
}

@media (max-width: 600px) {
  .logo1 {
    width: 200px;
  }

  .logo2 {
    width: 100px;
  }

  .header1 h2 {
    font-size: 1.2rem;
  }

  .home-button {
    width: 90%;
    font-size: 14px;
    padding: 8px 16px;
  }

  .sign {
    width: 120px;
    padding: 0.2em 0.8em 0.5em;
  }

  .sign img {
    width: 80px;
    margin-left: auto;
    margin-right: auto;
  }

  .sign:before,
  .sign:after {
    display: none; /* Hide string and nail on small screens */
  }
}

/* Responsive text sizes */
@media (max-width: 768px) {
  .banner{
    max-width: 100%;
    max-height: 100px;
  }
  .banner h2 {
    display: none;
  }

  .banner h4 {
    display: none;
  }
  .container6{
    display: none;
  }
  .border h5{
      display: flex;
    }
  .border img{
    display: flex;
    width: 100% !important;  /* fill grid cell width */
    height: 130px !important; /* fixed height */
    box-sizing: border-box;
  }

}

@media (max-width: 480px) {

  .find-tutor-btn {
    font-size: 1rem;
    padding: 8px 16px;
    border-left: 30px solid yellow;
    border-right: 30px solid yellow;
  }
    .container6{
    display: none;
  }
  .news{
    width: 60px;
  }
  #news-head{
    width: 50px;
  }
    .border img{
    display: flex;
    width: 100% !important;  /* fill grid cell width */
    height: 130px !important; /* fixed height */
    box-sizing: border-box;
    border-radius: 50%;
  }
}

/* For desktop or larger screens: 5 tabs in a row (or as you want) */
@media (min-width: 601px) {
  .articlecontainer {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

/* MOBILE VIEW */
@media (max-width: 600px) {
  .articlecontainer {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr); /* 3 columns */
    grid-auto-rows: 130px; /* fixed height rows */
    gap: 15px;
    padding: 10px;
  }
  
  .articlecontainer article {
    width: 100% !important;  /* fill grid cell width */
    height: 130px !important; /* fixed height */
    box-sizing: border-box;
  }

  /* Adjust heading font size and margin on mobile */
  .articlecontainer article h2 {
    font-size: 16px !important;
    margin-top: 20px !important;
  }
  
  /* Adjust button width and height on mobile */
  .articlecontainer article > div {
    width: 70px !important;
    height: 25px !important;
    margin-top: 10px !important;
  }
}

/* Optional: Prevent page from overflowing */
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Grade 1 */
/* MEDIA QUERIES */
@media screen and (max-width: 768px) {
  header img {
    width: 80% !important;
    margin: 0 auto !important;
    position: relative !important;
    margin-top: 10px !important;
  }

  .home-button {
    display: block;
    margin: 20px auto !important;
    width: 90% !important;
  }

  .sign.three {
    margin-top: 10px !important;
  }

  .subject-box {
    flex: 1 1 40%;
    min-width: 120px;
  }

  h1 {
    font-size: 1.2rem;
    padding: 10px;
  }

  button {
    width: 100%;
    max-width: 200px;
  }
}

@media screen and (max-width: 480px) {
  .subject-box {
    flex: 1 1 80%;
  }

  h1 {
    font-size: 1rem;
    padding: 8px;
  }

  .sign p {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  .quiz-grid button,
  .english-quiz-grid button,
  .science-quiz-grid button,
  .env-quiz-grid button,
  .ict-quiz-grid button {
    width: 100%;
    max-width: 100%;
    font-size: 16px;
    box-sizing: border-box;
    margin: 6px 0; /* space between buttons */
  }
}