/* ================== GRID VARIANTS ==================
 - mah-grid--2-cols         → fixed 2-col grid, collapses on mobile
 - mah-grid--3-cols         → responsive min 280px grid
 - mah-grid--3-fixed        → always 3 columns, collapses on mobile
 - mah-grid--auto-fit       → small tile grid, min 150px
 - mah-grid--scrollable     → horizontal scroll of fixed-width cards
======================================================= */

/* ================================================================

                                                      Grid Utility 

=================================================================================== */

.mah-grid {
  display: grid;
  gap: var(--mah-spacing-md);
  list-style: none;
  margin: 0;
  padding: 0;
}

ul.mah-grid > li {
  display: grid;
}

.mah-grid--cta {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.mah-grid--exam {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* ========== Responsive Grid Columns Utility ========== */

/* Mobile-first (default) */
.mah-grid--1-cols { grid-template-columns: 1fr; }
.mah-grid--2-cols { grid-template-columns: repeat(2, 1fr); }
.mah-grid--3-cols { grid-template-columns: repeat(2, 1fr); } /* Mobile fallback */
.mah-grid--4-cols { grid-template-columns: repeat(2, 1fr); } /* Mobile fallback */

/* Tablet and up (≥768px) */
@media (min-width: 768px) {
  .mah-grid--2-cols { grid-template-columns: repeat(2, 1fr); }
  .mah-grid--3-cols { grid-template-columns: repeat(3, 1fr); }
  .mah-grid--4-cols { grid-template-columns: repeat(4, 1fr); }
}

.mah-grid--2-cols-equal {
  grid-template-columns: 1fr;
}
.mah-grid--3-cols-equal {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .mah-grid--2-cols-equal {
    grid-template-columns: 1fr 1fr;
  }
  .mah-grid--3-cols-equal {
    grid-template-columns: 1fr 1fr 1fr;
  }
}


.mah-grid--3-cols-fixed {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--mah-spacing-lg);
}


/* ==================== Grid Auto-Fit Utility ==================== */
.mah-grid--auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* change 1fr to max-content - to set a max content width*/
  gap: var(--mah-spacing-md);
}

.mah-grid--auto-fill {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* ==================== Collapse Grid Utility ==================== */


@media (max-width: 768px) {
  .mah-grid--collapse-md {
    grid-template-columns: 1fr;
  }
}

/* ==================== Related Grid With Divider ==================== */
@media (min-width: 768px) {
  .mah-related-grid-with-divider {
    position: relative;
  }

  .mah-related-grid-with-divider > div:first-child {
    border-right: 1px solid var(--mah-border-color, #e2e8f0);
    padding-right: var(--mah-spacing-md);
  }

  .mah-related-grid-with-divider > div:last-child {
    padding-left: var(--mah-spacing-md);
  }
}



/* =============================== scroll wrapper ======================*/
.mah-scroll-x-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  
  margin-inline: 0;
  max-width: 100%;
  box-sizing: border-box;
  scroll-padding-left: 1rem;
}



/* =============================== Scrollable Row ======================*/
.mah-grid--scrollable {
  display: flex;
  flex-wrap: nowrap;
  /*overflow-x: auto;*/
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 1rem;
  justify-content: flex-start;
}
/* Uncomment the following media query to center the scrollable grid on larger screens
@media (min-width: 768px) {
  .mah-grid--scrollable {
   justify-content: center;
  }
  
}*/


.mah-grid--scrollable .mah-card {
  flex: 0 0 auto;
  min-width: 200px;
  max-width: 240px;
}


.mah-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: var(--mah-spacing-lg) 0;
}

/*@media (min-width: 1024px) {
  .mah-grid--scrollable:has(:not(:nth-child(n+5))) {
    justify-content: center;
  }
}*/

@media (max-width: 768px) {
  #upsc-roadmap .mah-grid--3-cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  #school-class-pill-grid.mah-grid--3-cols {
    grid-template-columns: 1fr;
  }
}



/* ========================== Table of Contents use in Archive Featured post ========================== */
.mah-toc-wrapper {
  
  border-radius: 8px;
  padding: var(--mah-spacing-md);
  margin-bottom: var(--mah-spacing-lg);
  max-width: 720px;
  margin: 0 auto;
}

.mah-toc-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--mah-spacing-md);
}

.mah-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mah-toc-list li {
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.mah-toc-list a {
  text-decoration: none;
  color: var(--mah-text-muted, #4b5563);
}

.mah-toc-list a:hover {
  text-decoration: underline;
  color: var(--mah-text-default, #1f2937);
}



/* ========================== Breadcrumb css ========================== */

/* ================== BreadcrumbGenerator ================== */
.mah-breadcrumb {
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    column-gap: 6px;
    row-gap: 4px;
    list-style: none;
    padding-right: 8px;
    margin-left: 0;
    margin-right: 0;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
  }
  
  .mah-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    flex-shrink: 0;
    color: #666;
    font-weight: 400;
  }
  
  .mah-breadcrumb li:not(:last-child)::after {
    content: "";
    margin-left: 4px;
    color: #aaa;
  }
  
  .mah-breadcrumb li:last-child {
    color: #999;
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
  }
  
  .mah-breadcrumb a {
    color: #219EBC;
    text-decoration: none;
  }
  
  .mah-breadcrumb span {
    color: #888;
  }



  /* ================== Post meta css ================== */
  /* ================== PostMeta ================== */
.mah-post-meta {
    font-size: 13.6px;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .mah-post-reading-time::before {
    content: " ";
  }


  /* ================== TermChips ================== */
.mah-term-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .mah-chip {
    background-color: #edf2f7;
    color: #2d3748;
    padding: 4px 10px;
    font-size: 13.6px;
    border-radius: 999px;
  }


  