/* ========================================
   ARTICLEBOARD.CSS - MOBILE RESPONSIVE STYLES
   ======================================== */

/* Large tablets (1024px and down) */
@media only screen and (max-width: 1024px) {
  .ab-container {
    gap: 30px;
    padding: 1rem;
  }

  .ab-all-articles {
    width: 100%;
  }

  .ab-sidebar {
    width: 250px;
  }
}

/* Tablets and smaller (768px and down) */
@media only screen and (max-width: 768px) {
  .ab-container {
    flex-direction: column;
    gap: 20px;
    padding: 1rem;
    align-items: center;
  }

  .ab-all-articles {
    width: 100%;
    max-width: 600px;
  }

  .ab-article {
    width: 100%;
    height: 350px;
    margin-bottom: 1.5rem;
  }

  .ab-article-content {
    padding: 1.5rem;
  }

  .ab-article-content h2 {
    font-size: 1.3rem;
  }

  .ab-preview {
    font-size: 0.95rem;
  }

  .ab-like-btn {
    right: 15px;
    bottom: 70px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .ab-sidebar {
    width: 100%;
    max-width: 600px;
    margin: 0;
  }

  /* Make article sections consistent in tablet view */
  .article-article-section-side > div {
    margin-bottom: 2rem;
  }

  .article-popular-articles-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
}

/* Mobile phones (600px and down) */
@media only screen and (max-width: 600px) {
  * {
    box-sizing: border-box;
  }

  .ab-container {
    gap: 15px;
    padding: 1rem;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
  }

  .ab-article {
    height: 250px;
    margin-bottom: 1rem;
  }

  /* Search bar fixed size */
  .article-search {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem;
    margin: 0 auto 1rem auto;
    font-size: 16px;
    box-sizing: border-box;
    display: block;
  }

  /* Form controls fixed size */
  .ab-all-articles form {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
  }

  .ab-all-articles form label {
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
  }

  .ab-all-articles form select,
  .ab-all-articles form button {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    flex: 1;
    min-width: 110px;
  }

  .ab-all-articles form button {
    flex: 0 0 auto;
    min-width: 90px;
  }

  .ab-all-articles {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .ab-all-articles h2 {
    text-align: center;
    width: 100%;
  }

  /* Article cards fixed dimensions */
  .ab-article {
    width: 100%;
    max-width: 500px;
    height: 300px;
    min-height: 300px;
    margin-bottom: 1.5rem;
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
    box-sizing: border-box;
  }

  .ab-article-content {
    padding: 1rem;
  }

  .ab-article-content h2 {
    font-size: 1rem;
    line-height: 1.2;
  }

  .ab-article-content small {
    font-size: 0.7rem;
  }

  .ab-preview {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .ab-like-btn {
    right: 10px;
    bottom: 50px;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }

  .ab-all-articles form {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .ab-all-articles form select,
  .ab-all-articles form button {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  .read-more {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  /* Make Most Popular Articles match Most Liked layout in mobile */
  .article-article-section-side > div {
    margin-bottom: 2rem;
  }

  .article-popular-articles-grid {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .article-popular-articles-grid .article {
    width: 100%;
    max-width: 500px;
    height: 200px;
    min-height: 200px;
    margin: 0;
  }

  .article-article-section-like,
  .article-article-section-comment {
    margin-bottom: 2rem;
  }

  .article-article-section-like .article,
  .article-article-section-comment .article {
    width: 100%;
    max-width: 500px;
    height: 200px;
    min-height: 200px;
    margin-bottom: 1rem;
  }
}
